---
title: PhysicsBodyComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/physicsbodycomponent
---

# PhysicsBodyComponent

A component that defines an entity’s behavior in physics body simulations.

## Declaration

```swift
struct PhysicsBodyComponent
```

## Overview

Overview Only entities with a PhysicsBodyComponent and a CollisionComponent can participate in a scene’s physics simulation. If you need to move an entity that participates in the physics system, it also needs a PhysicsMotionComponent. Add a physics body component to an entity by adopting the HasPhysicsBody protocol, which allows RealityKit’s physics simulation to compute behavior in response to forces acting upon the body, following basic rules of Newtonian mechanics. Note the following when considering applying a non-uniform scale to an entity: Non-uniform scaling is applicable only to box, convex mesh and triangle mesh collision shapes. Non-uniform scaling is not supported for all other types of collision shapes. In this case the scale.x value is duplicated to the scale’s y and z components as well to force scale uniformity based on the x component. If the entity has a non-uniform scale assigned to its transform then that entity should not have any descendants assigned that contain rotations in their transforms. A good rule of thumb is to assign the non-uniform scale to the entity that has the collision shape, and avoid adding children below that entity. note: Model entities have a physics body component by default.

## Topics

### Creating a physics body component

- [init()](realitykit/physicsbodycomponent/init().md)
- [init(massProperties:material:mode:)](realitykit/physicsbodycomponent/init(massproperties:material:mode:).md)
- [init(shapes:density:material:mode:)](realitykit/physicsbodycomponent/init(shapes:density:material:mode:).md)
- [init(shapes:mass:material:mode:)](realitykit/physicsbodycomponent/init(shapes:mass:material:mode:).md)

### Detecting collisions

- [isContinuousCollisionDetectionEnabled](realitykit/physicsbodycomponent/iscontinuouscollisiondetectionenabled.md)

### Locking movement

- [isRotationLocked](realitykit/physicsbodycomponent/isrotationlocked.md)
- [isTranslationLocked](realitykit/physicsbodycomponent/istranslationlocked.md)

### Setting the mode

- [mode](realitykit/physicsbodycomponent/mode.md)

### Setting material properties

- [material](realitykit/physicsbodycomponent/material.md)

### Setting mass properties

- [massProperties](realitykit/physicsbodycomponent/massproperties.md)

### Operators

- [==(_:_:)](realitykit/physicsbodycomponent/==(_:_:).md)

### Instance Properties

- [angularDamping](realitykit/physicsbodycomponent/angulardamping.md)
- [isAffectedByGravity](realitykit/physicsbodycomponent/isaffectedbygravity.md)
- [linearDamping](realitykit/physicsbodycomponent/lineardamping.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)
- [Equatable](swift/equatable.md)

## See Also

### Physical properties

- [PhysicsMaterialResource](realitykit/physicsmaterialresource.md)
- [PhysicsBodyMode](realitykit/physicsbodymode.md)
- [PhysicsMassProperties](realitykit/physicsmassproperties.md)
