physenv
physenv
This module fixes https://github.com/Facepunch/garrysmod-issues/issues/642 and adds a few small things.
Supports: Linux32| Windows32
Will soon have support for Windows & Linux64 Windows currently likes to crash :(
Methods
IPhysicsEnvironment physenv.CreateEnvironment( )
Creates a new physics environment.
It will apply all settings from the main environment on the newly created on to match.
If you notice Physics objects that have a invalid entity, report this. But this should normally never happen.
In this case, this means that something is failing to remove physics objects and it will cause random crashes.
physenv.DestroyAllCollisionSets()
Destroys all collision sets.
physenv.DestroyEnvironment( IPhysicsEnvironment environment )
Destroys the given physics environment.
physenv.EnablePhysHook( boolean shouldCall )
Enables/Disables the HolyLib:OnPhysFrame hook.
Returns the collision set by the given index.
Only 32 collision sets can exist at the same time!
Returns the collision set by the given index or creates it if needed.
Only 32 collision sets can exist at the same time!
Returns the physics environment by the given index.
table physenv.GetAllEnvironments( )
Returns a table containing all currently active physics environments.
IPhysicsEnvironment physenv.GetCurrentEnvironment( )
Returns the currently simulating environment.
number physenv.GetLagThreshold( )
Returns the lag threshold.
Only works on Linux32
number physenv.GetPhysSkipType( )
Returns the currently set skip type, see physenv.SetPhysSkipType.
This is reset to physenv.IVP_None (-1) at the start of every simulation step. Only works on Linux32
This is reset to physenv.IVP_None (-1) at the start of every simulation step. Only works on Linux32
physenv.IVP_NoSkip()
Let the simulation run normally.
physenv.IVP_SkipImpact()
Skip all impact calls.
physenv.IVP_SkipSimulation()
Skip the entire simulation.
Players that collide with props will be randomly teleported!
physenv.SetLagThreshold( number ms )
The lag threshold which, if exceeded, triggers the HolyLib:PhysicsLag hook.
Only works on Linux32
physenv.SetPhysSkipType( type IVP_SkipType )
Sets the skiptype for the current simulation.
This is reset after the simulation ended.
Only works on Linux32
boolean physenv.ShouldSkip( )
Returns whether the current skip type (see physenv.GetPhysSkipType) tells the engine to skip the current impact/simulation step.
Only works on Linux32