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 a material surface property type to the game's physics environment.
See util.GetSurfaceData for the opposite function.
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.
Does nothing on x86-64 beta.Issue Tracker: 2604
number physenv.GetAirDensity()
Returns the air density used to calculate drag on physics objects.
Validate: The unit is in kg/m³.
Vector physenv.GetGravity()
Gets the gravitational acceleration used for physics objects in source_unit/s^2.
number physenv.GetLastSimulationTime()
Returns the last simulation duration of the in-game physics.
table physenv.GetPerformanceSettings()
Gets the current performance settings in table form.
boolean physenv.GetPhysicsPaused()
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.