Physics Guide
OpenReality includes a full rigid body physics engine with impulse-based constraint solving, GJK+EPA collision detection, and spatial hash broadphase.
# Adding Physics
Add physics to any entity with a ColliderComponent and a RigidBodyComponent. The physics system runs automatically each frame.
# Collision Shapes
Seven collision shape types for different use cases. Simple shapes (AABB, Sphere) are fastest; ConvexHull and Compound are more accurate but more expensive.
# Body Types
Three body types control how the physics engine treats an entity.
# Solver Pipeline
The physics engine runs a 7-phase pipeline each step:
# Joint Constraints
Connect entities with joints to create mechanical systems. Joints constrain the relative motion between two bodies.
# Trigger Volumes
Triggers detect overlap without applying physical forces. Useful for checkpoints, damage zones, and event areas.
# Raycasting
Cast rays into the physics world for hit detection, line-of-sight checks, and picking.
# Continuous Collision Detection
Fast-moving objects can tunnel through thin geometry. CCD performs swept tests between frames to prevent this.