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

Phys thruster: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Please format)
 
(-added class hierarchy)
 
(16 intermediate revisions by 10 users not shown)
Line 1: Line 1:
phys_thruster
{{CD|CPhysThruster|file1=1}}
{{This is a|point entity|name=phys_thruster}} It is used to apply constant acceleration to a physics object. The force and torque is calculated using the position and direction of the thruster as an impulse. So moving those off the object's center will cause torque as well. Torque can be removed by unchecking the ''Apply Torque'' flag. The position of the thruster can be forced to be at the object's center by checking the ''Ignore Pos'' flag.


An entity used to apply constant acceleration to a physics object. The force and torque is calculated using the position and direction of the thruster as an impulse. So moving those off the object's center will cause torque as well. Torque can be removed by unchecking the 'apply torque' flag. The position of the thruster can be forced to be at the object's center by checking to 'ignore pos' flag.
== Keyvalues ==
{{KV Targetname}}
{{KV|Force|intn=force|string|Force (will be integrated, units are force kg*in/s^2)}}
{{KV Angles}}
{{KV ForceController}}


KEYS
== Flags ==
{{fl|32|Ignore Pos}}
{{Fl ForceController}}


Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
== Inputs ==
{{I ForceController}}


Name targetname <target_source> The name that other entities refer to this entity by.
== See also ==
* {{ent|trigger_gravity}}


spawnflags spawnflags <flags>
[[Category:Forces]]
 
Attached Object attach1 <target_destination> Object to apply the force to.
 
Time of Force (0=inf) forcetime <string> Automatic shut-off after this time has passed (0 = stay on forever or until deactivated)
 
Force force <string> Force (will be integrated, units are force kg*in/s^2)
 
 
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.
 
Activate Turn the force on
 
Deactivate Turn the force off
 
Scale <string> Set Force Scale
 
 
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 16:57, 9 April 2025

C++ Class hierarchy
CPhysThruster
CPhysForce
CPointEntity
CBaseEntity
C++ phys_controller.cpp

phys_thruster is a point entity available in all Source Source games. It is used to apply constant acceleration to a physics object. The force and torque is calculated using the position and direction of the thruster as an impulse. So moving those off the object's center will cause torque as well. Torque can be removed by unchecking the Apply Torque flag. The position of the thruster can be forced to be at the object's center by checking the Ignore Pos flag.

Keyvalues

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

Force (force) <string>
Force (will be integrated, units are force kg*in/s^2)
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

ForceController:

Attached Object (attach1) <targetname>
Object to apply the force to.
Time of Force (0=inf) (forcetime) <float>
Automatic shut-off after this time has passed. A value of 0 means to stay on forever or until deactivated.


Flags

Ignore Pos : [32]

ForceController:

Start On : [1]
Thrust is on by default (will turn off in forcetime)
Apply Force : [2]
Apply linear force (if off, torque only)
Apply Torque : [4]
Apply rotational force (torque - if off, linear only)
Orient Locally : [8]
Maintain local relationship with the attached object
Ignore Mass : [16]
Impulse is independent of object's mass (impulse is acceleration NOT force)


Inputs

ForceController:

Activate
Turn the force on
Deactivate
Turn the force off
Scale <floatRedirectInput/float>
Set Force Scale


See also