Various functions to make dealing with the HL2 physics engine a little easier.
Physics Helpers | Various functions to make dealing with the HL2 physics engine a little easier. |
Functions | |
applyAccel | |
applyForce | |
applyAccelInCurDirection | Applies an acceleration in the entities current velocity direction ( not the entity’s heading ). |
applyForceInCurDirection | Applies a force in the entities current velocity direction ( not the entity’s heading ). |
function ULib.applyAccel( ent, magnitude, direction, dTime )
ent | The entity to apply the acceleration to |
magnitude | The amount of acceleration ( Use nil if the magnitude is specified in the direction ) |
direction | The direction to apply the acceleration in ( if the magnitude is part of the direction, specify nil for the magnitude ) |
dTime | (Optional, defaults to 1) The time passed since the last update in seconds ( IE: 0.5 for dTime would only apply half the acceleration ) |
function ULib.applyForce( ent, magnitude, direction, dTime )
ent | The entity to apply the force to |
magnitude | The amount of force ( Use nil if the magnitude is specified in the direction ) |
direction | The direction to apply the force in ( if the magnitude is part of the direction, specify nil for the magnitude ) |
dTime | (Optional, defaults to 1) The time passed since the last update in seconds ( IE: 0.5 for dTime would only apply half the force ) |
function ULib.applyAccelInCurDirection( ent, magnitude, dTime )
Applies an acceleration in the entities current velocity direction ( not the entity’s heading ). See applyAccel. Basically makes the entity go faster or slower ( if a negative magnitude is passed ).
ent | The entity to apply the force to |
magnitude | The amount of acceleration |
dTime | (Optional, defaults to 1) The time passed since the last update in seconds ( IE: 0.5 for dTime would only apply half the acceleration ) |
function ULib.applyForceInCurDirection( ent, magnitude, dTime )
Applies a force in the entities current velocity direction ( not the entity’s heading ). See applyForce. Basically makes the entity go faster or slower ( if a negative magnitude is passed ).
ent | The entity to apply the force to |
magnitude | The amount of force |
dTime | (Optional, defaults to 1) The time passed since the last update in seconds ( IE: 0.5 for dTime would only apply half the force ) |
function ULib.applyAccel( ent, magnitude, direction, dTime )
function ULib.applyForce( ent, magnitude, direction, dTime )
Applies an acceleration in the entities current velocity direction ( not the entity’s heading ).
function ULib.applyAccelInCurDirection( ent, magnitude, dTime )
Applies a force in the entities current velocity direction ( not the entity’s heading ).
function ULib.applyForceInCurDirection( ent, magnitude, dTime )