This article's documentation is for anything that uses the Source engine. Click here for more information.

Phys motor: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Please format)
 
m (→‎Inputs: Substituted IO templates)
 
(22 intermediate revisions by 16 users not shown)
Line 1: Line 1:
phys_motor
{{CD|CPhysMotor|file1=phys_controller.cpp}}
{{this is a|point entity|name=phys_motor|engine=Source}} It tries to spin a target entity at a particular speed.


An entity that tries to spin a target entity at a particular speed.
== Keyvalues ==
{{KV|Rotation Speed|intn=speed|string|Angular speed (units are degrees/second)}}
{{KV|Spin up time|intn=spinup|string|spin up time in seconds (also affects the rate at which speed changes happen)}}
{{KV|System Interia Scale|intn=inertiafactor|float|Make this larger if the object being driven is constrained to a set of heavier objects.}}
{{KV|Rotation Axis|intn=axis|vecline|The point to the Origin of the entity whose line the rotation axis.}}
{{KV|Attached Object|intn=attach1|target_destination|Object to apply the force to}}
{{KV Targetname}}


KEYS
== Flags ==
{{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")}}


Name targetname <target_source> The name that other entities refer to this entity by.
== Inputs ==
{{I|SetSpeed|Sets target speed|param=float}}
{{I|TurnOn|Turns motor on}}
{{I|TurnOff|Turns motor off}}


Rotation Speed speed <string> Angular speed (units are degress/second)
[[Category:Forces]]
 
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 <vecline>
 
spawnflags spawnflags <flags>
 
Attached Object attach1 <target_destination> Object to apply the force to
 
 
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetSpeed <float> Sets target speed
 
TurnOn Turns motor on
 
TurnOff Turns motor off
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.

Latest revision as of 11:10, 21 April 2025

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

phys_motor is a point entity available in all Source Source games. 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 <floatRedirectInput/float>
Sets target speed
TurnOn
Turns motor on
TurnOff
Turns motor off