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.
physenv.SetAirDensity( number airDensity )
Sets the air density.
physenv.SetGravity( Vector gravAccel )
Sets the gravitational acceleration used for physics objects. Does not work on players.
physenv.SetPerformanceSettings( table performanceSettings )
Sets the performance settings.