VERGELua API

PhysicsEnvironment

A physics simulation you can step and query.

env:IsNull():boolean

Whether the environment wrapper is null.

env:SetGravity(v:Vector3)

Set the gravity vector.

env:GetGravity():Vector3

Current gravity vector.

env:SetAirDensity(density:number)

Set the air density.

env:GetAirDensity():number

Current air density.

env:Simulate(dt:number)

Advance the simulation by a time step.

env:GetSimulationTime():number

Current simulation time.

env:GetSimulationTimestep():number

Current simulation time step.

env:SetSimulationTimestep(step:number)

Set the simulation time step.

env:GetActiveObjects():table

Active physics objects as an array table.

env:ResetSimulationClock()

Reset the simulation clock.

env:CreatePolyObject(model:PhysicsCollisionModel, material:number|string, params:PhysicsObjectParameters):PhysicsObject

Create a physics object from a collision model, material and parameters.

env:DestroyObject(obj:PhysicsObject)

Destroy a physics object.