class PhysicsWorld

book_4_sparkGenerated
code_blocksInput

Description

The PhysicsWorld class represents a world in which physics objects exist. It is part of the Sandbox namespace and provides functionality for managing and simulating physics interactions. While you can create your own physics world, a default world is automatically created for the map on both client and server sides.

Members

Instance Members

Member NameSummary
SetupPhysicsFromModelInitializes physics from a model with specified motion type.
SetupPhysicsFromModelInitializes physics from a model with a transform and specified motion type.
DeleteDelete this world and all objects inside. Throws an exception if the world wasn't manually created.
StepAdvances the physics simulation by a given time step.
StepAdvances the physics simulation by a given time step with substeps.
StepAdvances the physics simulation by a given world time, delta, and substeps.
DebugDrawUpdates all the SceneObjects in the DebugSceneWorld, call once per tick or frame.
SetCollisionRulesSets collision rules. (Obsolete: Use CollisionRules Property)
GetCollisionRuleRetrieves the collision rule between two specified entities.
RunTracePerforms a physics trace using the specified trace builder.
RunTraceAllPerforms a physics trace and returns all results using the specified trace builder.
BodiesAll bodies in the world.
CollisionRulesSet or retrieve the collision rules for this PhysicsWorld.
DebugSceneWorldA SceneWorld where debug SceneObjects exist.
GravityAccess the world's current gravity.
AirDensityAir density of this physics world, for things like air drag.
BodyThe body of this physics world.
GroupThe physics group of this physics world. A physics world will contain only 1 body.
SleepingEnabledIf true, bodies will be able to sleep after a period of inactivity.
SimulationModePhysics simulation mode. See PhysicsSimulationMode for explanation of each mode.
PositionIterationsUsed for constraints (joints). Higher values should result in more accurate simulation.
VelocityIterationsUsed for constraints (joints). Higher values should result in more accurate simulation.
SubStepsIncreases the number of physics substeps to prevent objects from passing through each other.
TimeScalePhysics time scale. 0.5 is half speed, 1 is full speed, etc.
TraceRaytrace against this world.