# Sandbox.Rigidbody

Adds physics properties to an object. Requires a collider to be attached to the same object.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Component](/api/Sandbox.Component)
- Modifiers: sealed

## Constructors

- [`Rigidbody`](/api/Sandbox.Rigidbody/.ctor)

## Properties

- [`AngularDamping`](/api/Sandbox.Rigidbody/AngularDamping)
- [`AngularVelocity`](/api/Sandbox.Rigidbody/AngularVelocity)
- [`CollisionEventsEnabled`](/api/Sandbox.Rigidbody/CollisionEventsEnabled): 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`](/api/Sandbox.Rigidbody/CollisionUpdateEventsEnabled): Like CollisionEventsEnabled but means the OnCollisionUpdate gets called when the collision persists. Updates are only sent while the collision is awake, sleeping contacts don't emit them.
- [`EnableImpactDamage`](/api/Sandbox.Rigidbody/EnableImpactDamage): Whether this rigidbody can deal damage to damageable objects on high-speed impacts.
- [`EnhancedCcd`](/api/Sandbox.Rigidbody/EnhancedCcd): 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`](/api/Sandbox.Rigidbody/Gravity): Is gravity enabled or not.
- [`GravityScale`](/api/Sandbox.Rigidbody/GravityScale): Scale the gravity relative to [Sandbox.PhysicsWorld.Gravity](/api/Sandbox.PhysicsWorld/Gravity). 2 is double the gravity, etc.
- [`ImpactDamage`](/api/Sandbox.Rigidbody/ImpactDamage): 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`](/api/Sandbox.Rigidbody/InertiaTensor): 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](/api/Sandbox.Rigidbody/ResetInertiaTensor) is called.
- [`InertiaTensorRotation`](/api/Sandbox.Rigidbody/InertiaTensorRotation): Gets or sets the rotation applied to the inertia tensor. Like [Sandbox.Rigidbody.InertiaTensor](/api/Sandbox.Rigidbody/InertiaTensor), this acts as an override to the automatically calculated inertia tensor rotation and remains in effect until [Sandbox.Rigidbody.ResetInertiaTensor](/api/Sandbox.Rigidbody/ResetInertiaTensor) is called.
- [`Joints`](/api/Sandbox.Rigidbody/Joints): A list of joints that we're connected to, if any.
- [`LinearDamping`](/api/Sandbox.Rigidbody/LinearDamping)
- [`Locking`](/api/Sandbox.Rigidbody/Locking)
- [`Mass`](/api/Sandbox.Rigidbody/Mass)
- [`MassCenter`](/api/Sandbox.Rigidbody/MassCenter): Center of mass for this rigidbody in local space coordinates.
- [`MassCenterOverride`](/api/Sandbox.Rigidbody/MassCenterOverride)
- [`MassOverride`](/api/Sandbox.Rigidbody/MassOverride): Override mass for this body, only when value is more than zero
- [`MinImpactDamageSpeed`](/api/Sandbox.Rigidbody/MinImpactDamageSpeed): The minimum speed required for an impact to cause damage.
- [`MotionEnabled`](/api/Sandbox.Rigidbody/MotionEnabled)
- [`OverrideMassCenter`](/api/Sandbox.Rigidbody/OverrideMassCenter)
- [`PhysicsBody`](/api/Sandbox.Rigidbody/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`](/api/Sandbox.Rigidbody/RigidbodyFlags)
- [`Sleeping`](/api/Sandbox.Rigidbody/Sleeping)
- [`SleepThreshold`](/api/Sandbox.Rigidbody/SleepThreshold): 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`](/api/Sandbox.Rigidbody/StartAsleep)
- [`Touching`](/api/Sandbox.Rigidbody/Touching): This is a list of all of the triggers that we are touching.
- [`Velocity`](/api/Sandbox.Rigidbody/Velocity)

## Methods

- [`ApplyBuoyancy`](/api/Sandbox.Rigidbody/ApplyBuoyancy): Applies buoyancy and drag to the rigidbody relative to a plane to simulate things floating in water.
- [`ApplyForce`](/api/Sandbox.Rigidbody/ApplyForce): Applies linear force to this body
- [`ApplyForceAt`](/api/Sandbox.Rigidbody/ApplyForceAt): Applies force to this body at given position.
- [`ApplyImpulse`](/api/Sandbox.Rigidbody/ApplyImpulse): Applies instant linear impulse (i.e. a bullet impact) to this body
- [`ApplyImpulseAt`](/api/Sandbox.Rigidbody/ApplyImpulseAt): Applies instant linear impulse (i.e. a bullet impact) to this body at given position
- [`ApplyTorque`](/api/Sandbox.Rigidbody/ApplyTorque): Applies angular velocity to this body.
- [`ClearForces`](/api/Sandbox.Rigidbody/ClearForces): Clear accumulated linear forces ([Sandbox.Rigidbody.ApplyForce](/api/Sandbox.Rigidbody/ApplyForce) and [Sandbox.Rigidbody.ApplyForceAt](/api/Sandbox.Rigidbody/ApplyForceAt)) during this physics frame that were not yet applied to the physics body.
- [`FindClosestPoint`](/api/Sandbox.Rigidbody/FindClosestPoint): Returns the closest point to the given one between all convex shapes of this body.
- [`GetVelocityAtPoint`](/api/Sandbox.Rigidbody/GetVelocityAtPoint): Returns the world space velocity of a point of the object. This is useful for objects rotating around their own axis/origin.
- [`GetWorldBounds`](/api/Sandbox.Rigidbody/GetWorldBounds): Get the world bounds of this object
- [`ResetInertiaTensor`](/api/Sandbox.Rigidbody/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](/api/Sandbox.Rigidbody/InertiaTensor) or [Sandbox.Rigidbody.InertiaTensorRotation](/api/Sandbox.Rigidbody/InertiaTensorRotation).
- [`SetTargetTransform`](/api/Sandbox.SceneExtensions/SetTargetTransform)
- [`SmoothMove`](/api/Sandbox.Rigidbody/SmoothMove): 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`](/api/Sandbox.Rigidbody/SmoothRotate): Rotate the body to this position in a way that cooperates with the physics system.
