Physics & Collision
Overview
The physics system integrates Jolt Physics for rigid body simulation with automatic Transform synchronization. It supports a unified Collider component with box, sphere, and capsule shapes, plus optional debug wireframe outlines.
Adding Physics in the Editor
To make an entity physically simulated:
- Select the entity in the Scene Hierarchy
- In the Inspector, click Add Component > RigidBody
- Choose a body type: Static, Dynamic, or Kinematic
- Add a collider: Add Component > Collider
- Choose a shape: Box, Sphere, or Capsule
- Configure the physics properties in the Inspector
Components
RigidBody
Collider
A single Collider component supports three shapes, selected via a dropdown:
The Show Outline checkbox renders a green wireframe matching the collider shape, useful for debugging collision bounds.
Body Types
Integration Notes
- Physics runs with a fixed timestep of 1/60s using an accumulator pattern
- Transform is automatically synced from physics for Dynamic/Kinematic bodies
- Bodies are created lazily when entities with RigidBody + Transform are detected
- If no collider is attached, a default unit box is used
- All physics components are editable in the Inspector and serializable
- Physics steps in
Engine::BeginFrame(), before rendering - Old scenes with separate BoxCollider/SphereCollider/CapsuleCollider components are automatically migrated to the unified Collider on load