Summary

A world in which physics objects exist. You can create your own world but you really don't need to. A world for the map is created clientside and serverside automatically.

Properties

AirDensity Air density of this physics world, for things like air drag.
Bodies All bodies in the world
Body The body of this physics world.
CollisionRules Set or retrieve the collision rules for this Sandbox.PhysicsWorld.
DebugSceneWorld A SceneWorld where debug SceneObjects exist.
Gravity Access the world's current gravity.
Group The physics group of this physics world. A physics world will contain only 1 body.
PositionIterations Used for constraints (joints). Higher values should result in more accurate simulation (TODO: Confirm this)
SimulationMode Physics simulation mode. See Sandbox.PhysicsSimulationMode for explanation of each mode.
SleepingEnabled If true then bodies will be able to sleep after a period of inactivity
SubSteps If you're seeing objects go through other objects or you have a low tickrate, you might want to increase the number of physics substeps. This breaks physics steps down into this many substeps. The default is 1 and works pretty good. Be aware that the number of physics ticks per second is going to be tickrate * substeps. So if you're ticking at 90 and you have SubSteps set to 1000 then you're going to do 90,000 steps per second. So be careful here.
TimeScale
Trace Raytrace against this world
VelocityIterations Used for constraints (joints). Higher values should result in more accurate simulation (TODO: Confirm this)

Methods

DebugDraw Updates all the SceneObjects in the Sandbox.PhysicsWorld.DebugSceneWorld, call once per tick or frame.
Delete Delete this world and all objects inside. Will throw an exception if you try to delete a world that you didn't manually create.
GetCollisionRule
RunTrace
RunTraceAll
SetCollisionRules
SetupPhysicsFromModel
Step
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.