ENT.PhysicsSimulate

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePhysicsSimulate
SyntaxENT:PhysicsSimulate( Physobj phys, Number deltatime )
DescriptionControls/simulates the physics on the entity.
ReturnsVector angular_force, Vector linear_force, SimulateConst sim
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.PhysicsSimulate]ENT.PhysicsSimulate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionENT:PhysicsSimulate from gmod_thruster
Used onNewerServer.png
Code
 
function ENT:PhysicsSimulate( phys, deltatime )
 
	if (!self:IsOn()) then return SIM_NOTHING end
 
	local ForceAngle, ForceLinear = self.ForceAngle, self.ForceLinear
 
	return ForceAngle, ForceLinear, SIM_LOCAL_ACCELERATION
 
end
 
OutputN/A


Additional Notes

  1. A Vector representing the angular acceleration/force
  2. A Vector representing the linear acceleration/force
  3. A SIM_ enum
SHARED | 0000000000000000 | 00000000000000000 | SIM_NOTHING
SHARED | 0000000000000001 | 00000000000000001 | SIM_LOCAL_ACCELERATION
SHARED | 0000000000000002 | 00000000000000010 | SIM_LOCAL_FORCE
SHARED | 0000000000000003 | 00000000000000011 | SIM_GLOBAL_ACCELERATION
SHARED | 0000000000000004 | 00000000000000100 | SIM_GLOBAL_FORCE

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox