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
Components
Rigidbody
chevron_left
Components
class
Rigidbody
search
Constructors
functions
Rigidbody
Properties
data_object
AngularDamping
data_object
AngularVelocity
data_object
CollisionEventsEnabled
data_object
CollisionUpdateEventsEnabled
data_object
EnableImpactDamage
data_object
EnhancedCcd
data_object
Gravity
data_object
GravityScale
data_object
ImpactDamage
data_object
InertiaTensor
data_object
InertiaTensorRotation
data_object
Joints
data_object
LinearDamping
data_object
Locking
data_object
Mass
data_object
MassCenter
data_object
MassCenterOverride
data_object
MassOverride
data_object
MinImpactDamageSpeed
data_object
MotionEnabled
data_object
OverrideMassCenter
data_object
PhysicsBody
data_object
RigidbodyFlags
data_object
Sleeping
data_object
SleepThreshold
data_object
StartAsleep
data_object
Touching
data_object
Velocity
Methods
functions
ApplyBuoyancy
functions
ApplyForce
functions
ApplyForceAt
functions
ApplyImpulse
functions
ApplyImpulseAt
functions
ApplyTorque
functions
ClearForces
functions
FindClosestPoint
functions
GetVelocityAtPoint
functions
GetWorldBounds
functions
ResetInertiaTensor
functions
SmoothMove
functions
SmoothRotate
Static Methods
functions
SetTargetTransform
menu
Rigidbody
Adds physics properties to an object. Requires a collider to be attached to the same object.
class
Sandbox
.
account_tree
extends
Component
sealed
Sandbox.Engine
build
Constructors
1
Rigidbody
(
)
data_object
Properties
28
AngularDamping
float
AngularVelocity
Vector3
CollisionEventsEnabled
bool
Enable or disable touch events. If you disable the events then ICollisionListener won't get any touch events and you won't get things like collision sounds.
CollisionUpdateEventsEnabled
bool
Like CollisionEventsEnabled but means the OnCollisionUpdate gets called when the collision persists
EnableImpactDamage
bool
Whether this rigidbody can deal damage to damageable objects on high-speed impacts.
EnhancedCcd
bool
Enable enhanced continuous collision detection (CCD) for this body. When enabled, the body performs CCD against dynamic bodies (but not against other bodies with enhanced CCD enabled). This is useful for fast-moving objects like bullets or rockets that need reliable collision detection.
Gravity
bool
Is gravity enabled or not.
GravityScale
float
Scale the gravity relative to Sandbox.PhysicsWorld.Gravity. 2 is double the gravity, etc.
ImpactDamage
float
The amount of damage this rigidbody deals to other objects when it collides at high speed. If set to 0 or less, this will be calculated from the mass of the rigidbody.
InertiaTensor
Vector3
Gets or sets the inertia tensor for this body. By default, the inertia tensor is automatically calculated from the shapes attached to the body. Setting this property overrides the automatically calculated inertia tensor until Sandbox.Rigidbody.ResetInertiaTensor is called.
InertiaTensorRotation
Rotation
Gets or sets the rotation applied to the inertia tensor. Like Sandbox.Rigidbody.InertiaTensor, this acts as an override to the automatically calculated inertia tensor rotation and remains in effect until Sandbox.Rigidbody.ResetInertiaTensor is called.
Joints
IReadOnlySet`1
A list of joints that we're connected to, if any.
LinearDamping
float
Locking
PhysicsLock
Mass
float
MassCenter
Vector3
Center of mass for this rigidbody in local space coordinates.
MassCenterOverride
Vector3
MassOverride
float
Override mass for this body, only when value is more than zero
MinImpactDamageSpeed
float
The minimum speed required for an impact to cause damage.
MotionEnabled
bool
OverrideMassCenter
bool
PhysicsBody
PhysicsBody
Get the actual physics body that was created by this component. You should be careful, this can of course be null when the object is not enabled or the physics world is not available. It might also get deleted and re-created, so best use this to access, but don't store it.
RigidbodyFlags
RigidbodyFlags
Sleeping
bool
SleepThreshold
float
The speed threshold below which this body will be put to sleep. Units per second. Increase this to make the body sleep sooner, which is useful for stacking stability.
StartAsleep
bool
Touching
IEnumerable`1
This is a list of all of the triggers that we are touching.
Velocity
Vector3
functions
Methods
13
ApplyBuoyancy
(
plane
,
dt
)
Applies buoyancy and drag to the rigidbody relative to a plane to simulate things floating in water.
ApplyForce
(
force
)
Applies linear force to this body
ApplyForceAt
(
position
,
force
)
Applies force to this body at given position.
ApplyImpulse
(
force
)
Applies instant linear impulse (i.e. a bullet impact) to this body
ApplyImpulseAt
(
position
,
force
)
Applies instant linear impulse (i.e. a bullet impact) to this body at given position
ApplyTorque
(
force
)
Applies angular velocity to this body.
ClearForces
(
)
Clear accumulated linear forces (Sandbox.Rigidbody.ApplyForce(Vector3@) and Sandbox.Rigidbody.ApplyForceAt(Vector3@,Vector3@)) during this physics frame that were not yet applied to the physics body.
FindClosestPoint
(
position
)
Vector3
Returns the closest point to the given one between all convex shapes of this body.
GetVelocityAtPoint
(
position
)
Vector3
Returns the world space velocity of a point of the object. This is useful for objects rotating around their own axis/origin.
GetWorldBounds
(
)
BBox
Get the world bounds of this object
ResetInertiaTensor
(
)
Resets the inertia tensor and its rotation to the values automatically calculated from the attached colliders. This removes any custom overrides set via Sandbox.Rigidbody.InertiaTensor or Sandbox.Rigidbody.InertiaTensorRotation.
SmoothMove
(
transform
,
timeToArrive
,
timeDelta
)
Move body to this position in a way that cooperates with the physics system. This is quite good for things like grabbing and moving objects.
SmoothRotate
(
rotation
,
timeToArrive
,
timeDelta
)
Rotate the body to this position in a way that cooperates with the physics system.
functions
Static Methods
1
SetTargetTransform
(
body
,
tx
)
Inheritance
Component
Rigidbody
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.