Garry's Mod Wiki

physenv

The physenv library allows you to control the physics environment created by the engine, and lets you modify constants such as gravity and maximum velocity.

Methods

physenv.AddSurfaceData( string properties )
Adds surface properties to the game's physics environment. The game has a limit of 128 surface properties - this includes properties loaded automatically from surfaceproperties. txt. Due to this, there's only a small amount of open slots that can be registered with GMod's provided surfaceproperties. txt. Issue Tracker: 2604
Returns the air density used to calculate drag on physics objects. The unit is in kg/m³.
Vector physenv.GetGravity()
Gets the gravitational acceleration used for physics objects in source_unit/s^2.
Returns the last simulation duration of the in-game physics.
Gets the current performance settings in table form.
Returns the pause status of global physics simulation. See physenv. SetPhysicsPaused for the setter.
physenv.SetAirDensity( number airDensity )
Sets the air density.
physenv.SetGravity( Vector gravAccel )
Sets the gravitational acceleration used for physics objects. Does not affect players.
physenv.SetPerformanceSettings( table performanceSettings )
Sets the performance settings.
physenv.SetPhysicsPaused( boolean pause )
Pauses or unpauses the physics simulation globally. See physenv. GetPhysicsPaused for the getter.