# Sandbox.PhysicsBody

Represents a physics object. An entity can have multiple physics objects. See [PhysicsGroup](/api/Sandbox.PhysicsBody/PhysicsGroup).
A physics objects consists of one or more [PhysicsShape](/api/Sandbox.PhysicsShape)s.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Constructors

- [`PhysicsBody`](/api/Sandbox.PhysicsBody/.ctor)

## Properties

- [`AngularDamping`](/api/Sandbox.PhysicsBody/AngularDamping): Generic angular damping, i.e. how much the physics body will slow down on its own.
- [`AngularDrag`](/api/Sandbox.PhysicsBody/AngularDrag)
- [`AngularVelocity`](/api/Sandbox.PhysicsBody/AngularVelocity): Angular velocity of this body in world space.
- [`AutoSleep`](/api/Sandbox.PhysicsBody/AutoSleep): Whether this body is allowed to automatically go into "sleep" after a certain amount of time of inactivity. [Sandbox.PhysicsBody.Sleeping](/api/Sandbox.PhysicsBody/Sleeping) for more info on the sleep mechanic.
- [`BodyType`](/api/Sandbox.PhysicsBody/BodyType): Movement type of physics body, either Static, Keyframed, Dynamic Note: If this body is networked and dynamic, it will return Keyframed on the client
- [`Component`](/api/Sandbox.PhysicsBody/Component): The component that created this body
- [`Density`](/api/Sandbox.PhysicsBody/Density): Returns average of densities for all physics shapes of this body. This is based on [Sandbox.PhysicsShape.SurfaceMaterial](/api/Sandbox.PhysicsShape/SurfaceMaterial) of each shape.
- [`DragEnabled`](/api/Sandbox.PhysicsBody/DragEnabled)
- [`EnableCollisionSounds`](/api/Sandbox.PhysicsBody/EnableCollisionSounds): Whether to play collision sounds
- [`Enabled`](/api/Sandbox.PhysicsBody/Enabled): Whether this body is enabled or not. Disables collisions, physics simulation, touch events, trace queries, etc.
- [`EnableSolidCollisions`](/api/Sandbox.PhysicsBody/EnableSolidCollisions): Sets [Sandbox.PhysicsShape.EnableSolidCollisions](/api/Sandbox.PhysicsShape/EnableSolidCollisions) on all shapes of this body. Returns true if ANY of the physics shapes have solid collisions enabled.
- [`EnableTouch`](/api/Sandbox.PhysicsBody/EnableTouch): Enables Touch callbacks on all [PhysicsShapes](/api/Sandbox.PhysicsShape) of this body. Returns true if ANY of the physics shapes have touch events enabled.
- [`EnableTouchPersists`](/api/Sandbox.PhysicsBody/EnableTouchPersists): Sets [Sandbox.PhysicsShape.EnableTouchPersists](/api/Sandbox.PhysicsShape/EnableTouchPersists) on all shapes of this body. Returns true if ANY of the physics shapes have persistent touch events enabled.
- [`EnhancedCcd`](/api/Sandbox.PhysicsBody/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.
- [`GameObject`](/api/Sandbox.PhysicsBody/GameObject): The GameObject that created this body
- [`GravityEnabled`](/api/Sandbox.PhysicsBody/GravityEnabled): Whether gravity is enabled for this body or not.
- [`GravityScale`](/api/Sandbox.PhysicsBody/GravityScale): Scale the gravity relative to [Sandbox.PhysicsWorld.Gravity](/api/Sandbox.PhysicsWorld/Gravity). 2 is double the gravity, etc.
- [`GroupIndex`](/api/Sandbox.PhysicsBody/GroupIndex): Return the index of this body in its PhysicsGroup
- [`GroupName`](/api/Sandbox.PhysicsBody/GroupName): What is this body called in the group?
- [`Inertia`](/api/Sandbox.PhysicsBody/Inertia): The diagonal elements of the local inertia tensor matrix.
- [`InertiaRotation`](/api/Sandbox.PhysicsBody/InertiaRotation): The orientation of the principal axes of local inertia tensor matrix.
- [`LastWaterEffect`](/api/Sandbox.PhysicsBody/LastWaterEffect): Time since last water splash effect. Used internally.
- [`LinearDamping`](/api/Sandbox.PhysicsBody/LinearDamping): Generic linear damping, i.e. how much the physics body will slow down on its own.
- [`LinearDrag`](/api/Sandbox.PhysicsBody/LinearDrag)
- [`LocalMassCenter`](/api/Sandbox.PhysicsBody/LocalMassCenter): Center of mass for this physics body relative to its [origin](/api/Sandbox.PhysicsBody/Position).
- [`Locking`](/api/Sandbox.PhysicsBody/Locking)
- [`Mass`](/api/Sandbox.PhysicsBody/Mass): Mass of this physics body.
- [`MassCenter`](/api/Sandbox.PhysicsBody/MassCenter): Center of mass for this physics body in world space coordinates.
- [`MotionEnabled`](/api/Sandbox.PhysicsBody/MotionEnabled): Controls physics simulation on this body.
- [`OnIntersectionEnd`](/api/Sandbox.PhysicsBody/OnIntersectionEnd)
- [`OnIntersectionStart`](/api/Sandbox.PhysicsBody/OnIntersectionStart)
- [`OnIntersectionUpdate`](/api/Sandbox.PhysicsBody/OnIntersectionUpdate)
- [`OverrideMassCenter`](/api/Sandbox.PhysicsBody/OverrideMassCenter): Is this physics body mass calculated or set directly.
- [`Parent`](/api/Sandbox.PhysicsBody/Parent): The physics body we are attached to, if any
- [`PhysicsGroup`](/api/Sandbox.PhysicsBody/PhysicsGroup): The physics group we belong to.
- [`Position`](/api/Sandbox.PhysicsBody/Position): Position of this body in world coordinates.
- [`Rotation`](/api/Sandbox.PhysicsBody/Rotation): Rotation of the physics body in world space.
- [`Scale`](/api/Sandbox.PhysicsBody/Scale)
- [`SelfOrParent`](/api/Sandbox.PhysicsBody/SelfOrParent): A convenience property, returns [Parent](/api/Sandbox.PhysicsBody/Parent), or if there is no parent, returns itself.
- [`ShapeCount`](/api/Sandbox.PhysicsBody/ShapeCount): How many shapes belong to this body.
- [`Shapes`](/api/Sandbox.PhysicsBody/Shapes): All shapes that belong to this body.
- [`Sleeping`](/api/Sandbox.PhysicsBody/Sleeping): Physics bodies automatically go to sleep after a certain amount of time of inactivity to save on performance. You can use this to wake the body up, or prematurely send it to sleep.
- [`SleepThreshold`](/api/Sandbox.PhysicsBody/SleepThreshold): The speed threshold below which this body will be put to sleep. Units per second. The default is about 2 units/sec. Increase this to make bodies sleep sooner, which is useful for stacking stability.
- [`SpeculativeContactEnabled`](/api/Sandbox.PhysicsBody/SpeculativeContactEnabled): If enabled, this physics body will move slightly ahead each frame based on its velocities.
- [`Surface`](/api/Sandbox.PhysicsBody/Surface)
- [`SurfaceMaterial`](/api/Sandbox.PhysicsBody/SurfaceMaterial): Sets [Sandbox.PhysicsShape.SurfaceMaterial](/api/Sandbox.PhysicsShape/SurfaceMaterial) on all child [PhysicsShape](/api/Sandbox.PhysicsShape)s.
- [`Transform`](/api/Sandbox.PhysicsBody/Transform): Transform of this physics body.
- [`UseController`](/api/Sandbox.PhysicsBody/UseController): If true we'll create a controller for this physics body. This is useful for keyframed physics objects that need to push things. The controller will sweep as the entity moves, rather than teleporting the object.. which works better when pushing dynamic objects etc.
- [`Velocity`](/api/Sandbox.PhysicsBody/Velocity): Linear velocity of this body in world space.
- [`World`](/api/Sandbox.PhysicsBody/World): The physics world this body belongs to.

## Methods

- [`AddBoxShape`](/api/Sandbox.PhysicsBody/AddBoxShape): Add a box shape to this body.
- [`AddCapsuleShape`](/api/Sandbox.PhysicsBody/AddCapsuleShape): Add a capsule shape to this body.
- [`AddCloneShape`](/api/Sandbox.PhysicsBody/AddCloneShape)
- [`AddConeShape`](/api/Sandbox.PhysicsBody/AddConeShape): Add a cone shape to this body.
- [`AddCylinderShape`](/api/Sandbox.PhysicsBody/AddCylinderShape): Add a cylinder shape to this body.
- [`AddHeightFieldShape`](/api/Sandbox.PhysicsBody/AddHeightFieldShape)
- [`AddHullShape`](/api/Sandbox.PhysicsBody/AddHullShape)
- [`AddMeshShape`](/api/Sandbox.PhysicsBody/AddMeshShape)
- [`AddShape`](/api/Sandbox.PhysicsBody/AddShape): Add a shape from a physics hull
- [`AddSphereShape`](/api/Sandbox.PhysicsBody/AddSphereShape): Add a sphere shape to this body.
- [`ApplyAngularImpulse`](/api/Sandbox.PhysicsBody/ApplyAngularImpulse): Applies instant angular impulse (i.e. a bullet impact) to this body. For continuous force (i.e. a moving car), use [Sandbox.PhysicsBody.ApplyTorque](/api/Sandbox.PhysicsBody/ApplyTorque)
- [`ApplyForce`](/api/Sandbox.PhysicsBody/ApplyForce): Applies force to this body at the center of mass. This force will only be applied on the next physics frame and is scaled with physics timestep.
- [`ApplyForceAt`](/api/Sandbox.PhysicsBody/ApplyForceAt): Applies force to this body at given position. This force will only be applied on the next physics frame and is scaled with physics timestep.
- [`ApplyImpulse`](/api/Sandbox.PhysicsBody/ApplyImpulse): Applies instant linear impulse (i.e. a bullet impact) to this body at its center of mass. For continuous force (i.e. a moving car), use [Sandbox.PhysicsBody.ApplyForce](/api/Sandbox.PhysicsBody/ApplyForce)
- [`ApplyImpulseAt`](/api/Sandbox.PhysicsBody/ApplyImpulseAt): Applies instant linear impulse (i.e. a bullet impact) to this body at given position. For continuous force (i.e. a moving car), use [Sandbox.PhysicsBody.ApplyForceAt](/api/Sandbox.PhysicsBody/ApplyForceAt)
- [`ApplyTorque`](/api/Sandbox.PhysicsBody/ApplyTorque): Applies angular velocity to this body. This force will only be applied on the next physics frame and is scaled with physics timestep.
- [`CheckOverlap`](/api/Sandbox.PhysicsBody/CheckOverlap): Checks if another body overlaps us, ignoring all collision rules
- [`ClearForces`](/api/Sandbox.PhysicsBody/ClearForces): Clear accumulated linear forces ([Sandbox.PhysicsBody.ApplyForce](/api/Sandbox.PhysicsBody/ApplyForce) and [Sandbox.PhysicsBody.ApplyForceAt](/api/Sandbox.PhysicsBody/ApplyForceAt)) during this physics frame that were not yet applied to the physics body.
- [`ClearShapes`](/api/Sandbox.PhysicsBody/ClearShapes): Remove all physics shapes, but not the physics body itself.
- [`ClearTorque`](/api/Sandbox.PhysicsBody/ClearTorque): Clear accumulated torque (angular force, [Sandbox.PhysicsBody.ApplyTorque](/api/Sandbox.PhysicsBody/ApplyTorque)) during this physics frame that were not yet applied to the physics body.
- [`ComputePenetration`](/api/Sandbox.PhysicsBody/ComputePenetration): Finds the smallest move needed to separate us from another body, ignoring all collision rules. Returns true if we're overlapping; moving us by `direction` * `distance` pushes us clear.
- [`FindClosestPoint`](/api/Sandbox.PhysicsBody/FindClosestPoint): Returns the closest point to the given one between all shapes of this body.
- [`GetBounds`](/api/Sandbox.PhysicsBody/GetBounds): Returns Axis-Aligned Bounding Box (AABB) of this physics body.
- [`GetGameObject`](/api/Sandbox.PhysicsBody/GetGameObject)
- [`GetLerpedTransform`](/api/Sandbox.PhysicsBody/GetLerpedTransform): When the physics world is run at a fixed timestep, getting the positions of bodies will not be smooth. You can use this function to get the lerped position between steps, to make things super awesome.
- [`GetVelocityAtPoint`](/api/Sandbox.PhysicsBody/GetVelocityAtPoint): Returns the world space velocity of a point of the object. This is useful for objects rotating around their own axis/origin.
- [`LocalPoint`](/api/Sandbox.PhysicsBody/LocalPoint): Convenience function that returns a [Sandbox.Physics.PhysicsPoint](/api/Sandbox.Physics.PhysicsPoint) from a position relative to this body.
- [`MassCenterPoint`](/api/Sandbox.PhysicsBody/MassCenterPoint): Returns a [Sandbox.Physics.PhysicsPoint](/api/Sandbox.Physics.PhysicsPoint) at the center of mass of this body.
- [`Move`](/api/Sandbox.PhysicsBody/Move): Move to a new position. Unlike Transform, if you have `UseController` enabled, this will sweep the shadow to the new position, rather than teleporting there.
- [`RebuildMass`](/api/Sandbox.PhysicsBody/RebuildMass): Meant to be only used on dynamic bodies, rebuilds mass from all shapes of this body based on their volume and [physics properties](/api/Sandbox.PhysicsBody/Surface), for cases where they may have changed.
- [`Remove`](/api/Sandbox.PhysicsBody/Remove): Completely removes this physics body.
- [`ResetInertiaTensor`](/api/Sandbox.PhysicsBody/ResetInertiaTensor): Resets the inertia tensor to its calculated values.
- [`SetComponentSource`](/api/Sandbox.PhysicsBody/SetComponentSource)
- [`SetInertiaTensor`](/api/Sandbox.PhysicsBody/SetInertiaTensor): Sets the inertia tensor using the given moments and rotation.
- [`SmoothMove`](/api/Sandbox.PhysicsBody/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.PhysicsBody/SmoothRotate): Rotate the body to this position in a way that cooperates with the physics system.
- [`WorldPoint`](/api/Sandbox.PhysicsBody/WorldPoint): Convenience function that returns a [Sandbox.Physics.PhysicsPoint](/api/Sandbox.Physics.PhysicsPoint) for this body from a world space position.
