ENT.PhysicsSimulate
From GMod Wiki
Revision as of 11:33, 14 October 2010 by Unrealomega (Talk | contribs)
Event Hook | |
Hook Name | PhysicsSimulate |
Syntax | ENT:PhysicsSimulate( Physobj phys, Number deltatime ) |
Description | Controls/simulates the physics on the entity. |
Returns | Vector angular_force, Vector linear_force, SimulateConst sim |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=ENT.PhysicsSimulate]ENT.PhysicsSimulate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- Officially the most complicated callback in the whole mod.
- Returns 3 variables.
- A Vector representing the angular acceleration/force
- A Vector representing the linear acceleration/force
- 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
- If you're doing nothing you can return SIM_NOTHING
- You need to call Entity.StartMotionController to tell the entity to start calling this function..
- Another example of this function can be found in the Melonracer fretta gamemode, which is here.
- This function does not run when the entity is asleep. Make sure you wake the physics object of the entity before using this function with PhysObj.Wake.