s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
PhysicsWorld
chevron_left
Classes
class
PhysicsWorld
search
Constructors
functions
PhysicsWorld
Properties
data_object
AirDensity
data_object
Bodies
data_object
Body
data_object
CollisionRules
data_object
DebugSceneWorld
data_object
Gravity
data_object
Group
remove_circle
PositionIterations
data_object
SimulationMode
data_object
SleepingEnabled
data_object
SubSteps
remove_circle
TimeScale
data_object
Trace
remove_circle
VelocityIterations
Methods
functions
DebugDraw
functions
Delete
functions
GetCollisionRule
functions
RunTrace
functions
RunTraceAll
remove_circle
SetCollisionRules
functions
SetupPhysicsFromModel
functions
Step
menu
PhysicsWorld
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.
class
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
PhysicsWorld
(
)
Create a new physics world. You should only do this if you want to simulate an extra world for some reason.
data_object
Properties
14
AirDensity
float
Air density of this physics world, for things like air drag.
Bodies
IEnumerable`1
All bodies in the world
Body
PhysicsBody
The body of this physics world.
CollisionRules
CollisionRules
Set or retrieve the collision rules for this Sandbox.PhysicsWorld.
DebugSceneWorld
SceneWorld
A SceneWorld where debug SceneObjects exist.
Gravity
Vector3
Access the world's current gravity.
Group
PhysicsGroup
The physics group of this physics world. A physics world will contain only 1 body.
PositionIterations
obsolete
int
SimulationMode
PhysicsSimulationMode
Physics simulation mode. See Sandbox.PhysicsSimulationMode for explanation of each mode.
SleepingEnabled
bool
If true then bodies will be able to sleep after a period of inactivity
SubSteps
int
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
obsolete
float
Trace
PhysicsTraceBuilder
Raytrace against this world
VelocityIterations
obsolete
int
functions
Methods
8
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
(
left
,
right
)
Result
Gets the specific collision rule for a pair of tags.
RunTrace
(
trace
)
PhysicsTraceResult
Like calling PhysicsTraceBuilder.Run, except will re-target this world if it's not already the target
RunTraceAll
(
trace
)
PhysicsTraceResult[]
Like calling PhysicsTraceBuilder.RunAll, except will re-target this world if it's not already the target
SetCollisionRules
(
rules
)
obsolete
Used internally to set collision rules from gamemode's project settings. You shouldn't need to call this yourself.
SetupPhysicsFromModel
(
model
,
motionType
)
PhysicsGroup
Temp function for creating model physics until entity system handles it
Step
(
delta
)
Step simulation of this physics world. You can only do this on physics worlds that you manually create.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.