User:CodingAintFun/pagetest00: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Updated to use "this is a" template)
Line 1: Line 1:
{{this is a|e0|name=phys_spring|engine=2}} It is a physically simulated spring. '''length''' is what's known as the "natural spring length". This is how long the spring would be if it was at rest (nothing hanging on it or attached). When you attach something to the spring, it will stretch longer than its natural length. The amount of stretch is determined by the spring constant '''constant'''. The larger the spring constant the less stretch in the spring.
{{CD|CPhysMotor|file1=phys_controller.cpp}}
{{this is a|e0|name=phys_motor|engine=2}} It tries to spin a target entity at a particular speed.


== Keyvalues ==
== Keyvalues ==
{{KV|Entity 1|intn=attach1|target_destination|First entity to attach.}}
{{KV|Rotation Speed|intn=speed|string|Angular speed (units are degrees/second)}}
{{KV|Entity 2|intn=attach2|target_destination|Second entity to attach.}}
{{KV|Spin up time|intn=spinup|string|spin up time in seconds (also affects the rate at which speed changes happen)}}
{{KV|Spring Axis|intn=springaxis|vecline|Use the helper. Drag it out to match the virtual spring.}}
{{KV|System Interia Scale|intn=inertiafactor|float|Make this larger if the object being driven is constrained to a set of heavier objects.}}
{{KV|Spring Length|intn=length|string|How long the spring would be if it was at rest (nothing hanging on it or attached). 0 means the length of the brush.}}
{{KV|Rotation Axis|intn=axis|vecline|The point to the Origin of the entity whose line the rotation axis.}}
{{KV|Spring Constant|intn=constant|string|Stiffness of the spring.  The larger the number the less the spring will stretch.}}
{{KV|Attached Object|intn=attach1|target_destination|Object to apply the force to}}
{{KV|Damping Constant|intn=damping|string|How much energy the spring loses.  The larger the number, the less bouncy the spring.}}
{{KV|Relative Damping Constant|intn=relativedamping|string|The amount of energy the spring loses proportional to the relative velocity of the two objects the spring is attached to.}}
{{KV|Break on Length|intn=breaklength|string|If the spring's length ever exceeds this length, the spring breaks.}}
{{KV Targetname}}
{{KV Targetname}}


== Flags ==
== Flags ==
* 1 : Force only on stretch
{{fl|1|Start On}}
{{fl|2|No world collision|Disable world collisions on hinges}}
{{fl|4|Hinge Object|Motor also acts as a hinge constraining the object to this axis}}
{{fl|8|Orient Locally|Maintain local relationship with the attached object ([[FGD]] comment: "NOT WORKING YET")}}


== Inputs ==
== Inputs ==
{{IO|SetSpringConstant|Set the Spring Constant.|param=float}}
{{IO|SetSpeed|Sets target speed|param=float}}
{{IO|SetSpringLength|Set the Spring Length.|param=float}}
{{IO|TurnOn|Turns motor on}}
{{IO|SetSpringDamping|Set the Spring Damping.|param=float}}
{{IO|TurnOff|Turns motor off}}
{{I Targetname}}


== Outputs ==
[[Category:Forces]]
{{O Targetname}}
 
[[Category:Constraints|C]]

Revision as of 07:35, 16 December 2023

C++ Class hierarchy
CPhysMotor
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ phys_controller.cpp

phys_motor is an e0 available in all Template:2 games.Template:2 topicon

Warning.pngWarning:
  • The {{{engine}}} parameter is inconsistent with the name defined by the {{2}} template.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

It tries to spin a target entity at a particular speed.

Keyvalues

Rotation Speed (speed) <string>
Angular speed (units are degrees/second)
Spin up time (spinup) <string>
spin up time in seconds (also affects the rate at which speed changes happen)
System Interia Scale (inertiafactor) <float>
Make this larger if the object being driven is constrained to a set of heavier objects.
Rotation Axis (axis) <vector>
The point to the Origin of the entity whose line the rotation axis.
Attached Object (attach1) <targetname>
Object to apply the force to
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Flags

Start On : [1]
No world collision : [2]
Disable world collisions on hinges
Hinge Object : [4]
Motor also acts as a hinge constraining the object to this axis
Orient Locally : [8]
Maintain local relationship with the attached object (FGD comment: "NOT WORKING YET")

Inputs

SetSpeed <float>
Sets target speed
TurnOn
Turns motor on
TurnOff
Turns motor off