A physics pipeline is the deterministic sequence of algorithmic stages a physics engine executes each time step to compute the motion and interactions of simulated bodies. This pipeline typically includes broadphase collision detection to cull distant objects, narrowphase collision detection to compute precise contacts, a constraint solver to resolve forces preventing interpenetration, and time integration to update positions and velocities. Its modular design allows for optimization and specialization for different simulation needs, such as real-time robotics or high-fidelity engineering analysis.
Glossary
Physics Pipeline

What is Physics Pipeline?
The physics pipeline is the core computational sequence executed by a physics engine each simulation step to model physical interactions.
The efficiency and stability of the entire sim-to-real transfer learning workflow depend on this pipeline's robustness. Key considerations include the choice of time integration method (e.g., explicit vs. implicit Euler) for numerical stability, the constraint solver's iterative convergence for handling complex contacts and joints, and the use of spatial data structures like a Bounding Volume Hierarchy (BVH) for scalable performance. A well-engineered pipeline is foundational for generating the high-volume, physically plausible experience needed to train robust robotic policies before hardware-in-the-loop testing and real-world deployment.
Key Stages of the Physics Pipeline
The physics pipeline is the deterministic sequence of computational stages executed by a physics engine each time step to advance the state of a simulated world. This pipeline transforms applied forces into new positions and velocities for all objects.
1. Broadphase Collision Detection
The broadphase is the initial, coarse culling stage of the collision detection pipeline. Its purpose is to efficiently eliminate pairs of objects that are obviously too far apart to collide, drastically reducing the number of expensive precise tests required.
- Key Data Structures: Uses spatial partitioning systems like Bounding Volume Hierarchies (BVH), grids, or sweep-and-prune algorithms.
- Performance Impact: Operates in O(n log n) or near O(n) time, where n is the number of objects. It is the primary bottleneck for scenes with thousands of dynamic bodies.
- Output: A reduced list of potentially colliding pairs passed to the narrowphase.
2. Narrowphase Collision Detection
The narrowphase performs precise geometric intersection tests on the candidate pairs provided by the broadphase. It calculates the exact contact data required for resolving collisions.
- Core Algorithms: Employs shape-specific tests (sphere-sphere, box-box) and general algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm for convex shapes and the Expanding Polytope Algorithm (EPA) for penetration depth.
- Output: For each colliding pair, it generates contact manifolds containing:
- Contact Points: World-space points of intersection.
- Contact Normal: The direction to separate the objects.
- Penetration Depth: How far the objects are intersecting.
3. Constraint Solving & Contact Generation
This stage formulates the physical laws and interactions as mathematical constraints and solves for the forces and impulses needed to satisfy them. Contacts from the narrowphase are converted into velocity-level or position-level constraints.
- Constraint Types: Includes contact constraints (prevent inter-penetration), friction constraints, and joint constraints (e.g., hinges, sliders).
- Solver Methods: Typically solved as a Linear Complementarity Problem (LCP) or using iterative solvers like Projected Gauss-Seidel (PGS). The solver finds impulses that satisfy
J*v >= 0, where J is the Jacobian matrix and v is velocity. - Objective: To compute the final velocity delta for each body that respects all constraints simultaneously.
4. Time Integration
Time integration is the final stage where the computed forces, torques, and constraint impulses are applied to update the kinematic state (position, orientation, velocity) of every body forward by the simulation time step (dt).
- Core Equation: Solves Newton's second law,
F = m*a, by integrating acceleration to update velocity and position. - Common Integrators:
- Semi-Implicit Euler (Symplectic Euler):
v_new = v + (F/m)*dt; p_new = p + v_new*dt. Most common for real-time engines due to stability. - Runge-Kutta Methods (RK4): Higher accuracy for predictive simulations, at greater computational cost.
- Semi-Implicit Euler (Symplectic Euler):
- Result: Produces the new world state for rendering or the next simulation tick.
5. Continuous Collision Detection (CCD)
Continuous Collision Detection (CCD) is a safeguard stage, often integrated with broad/narrowphase, that prevents tunneling—where fast-moving or small objects pass through thin geometry in a single time step.
- Mechanism: Instead of testing static shapes, it tests the swept volume (the path of motion) between time steps for intersection.
- Algorithms: Uses conservative advancement, ray casting, or continuous versions of GJK.
- Use Case: Critical for simulating bullets, fast-moving robots, or objects in low-framerate simulations. It is computationally expensive and often applied selectively.
6. Island Management & Sleep
An optimization stage that groups interacting bodies into islands (connected graphs via constraints/contacts) and puts inactive islands to sleep. This dramatically reduces per-frame computation.
- Island Creation: After constraint solving, a graph traversal identifies isolated groups of bodies that can be solved independently.
- Sleep Criteria: An island is put to sleep when its kinetic energy falls below a threshold for several frames, indicating it is at rest.
- Wake-up: Sleeping islands are reactivated when a collision or external force is applied to any member. This is a key performance optimization for large, static environments.
How the Physics Pipeline Works
The physics pipeline is the core computational sequence within a physics engine that advances a virtual world's state from one discrete time step to the next.
The physics pipeline is the deterministic sequence of computational stages a physics engine executes each time step to simulate motion and interactions. It begins with a broadphase stage, which uses spatial data structures like a Bounding Volume Hierarchy (BVH) to quickly cull objects that are too far apart to collide. The surviving potential collision pairs are passed to the narrowphase, where precise algorithms like Gilbert–Johnson–Keerthi (GJK) compute exact contact points, normals, and penetration depths.
Following collision detection, the pipeline's constraint solver—often a Projected Gauss-Seidel (PGS) method—resolves all contact forces and joint constraints to prevent interpenetration. Finally, the time integration stage (e.g., using symplectic Euler or Runge-Kutta methods) applies the net forces and torques to update each body's position, orientation, and velocity. This closed loop enables the simulation of rigid body dynamics and complex multibody systems for robotic training.
Pipeline Stage Comparison
A comparison of the computational stages within a modern physics engine's pipeline, detailing their purpose, algorithmic complexity, and typical outputs.
| Pipeline Stage | Primary Function | Algorithmic Complexity | Key Output | Parallelization Potential |
|---|---|---|---|---|
Broadphase | Culls obviously non-colliding object pairs | O(n log n) to O(n²) | Set of potentially colliding pairs (PCPs) | High |
Narrowphase | Precise collision detection for PCPs | O(m) where m = |PCPs| | Contact manifolds (points, normals, depth) | High |
Contact Generation | Resolves manifolds into solver constraints | O(c) where c = contacts | Constraint Jacobians & limits | Medium |
Constraint Solver | Solves for impulses to satisfy constraints | O(i * j) iterative | Corrective impulses/forces | Low-Medium |
Time Integration | Updates body positions & velocities | O(b) where b = bodies | New kinematic state (pos, vel) | High |
Island Management | Groups interacting bodies for solving | O(b) union-find | Independent simulation islands | Medium |
Continuous Collision Detection (CCD) | Prevents tunneling for fast objects | O(p) where p = CCD pairs | TOI (Time of Impact) & safe velocities | Medium |
Sleep Management | Deactivates bodies at rest | O(b) energy threshold | Awake/asleep state flags | Low |
Physics Pipeline
The physics pipeline is the sequential stages of computation within a physics engine, typically involving broadphase collision detection, narrowphase collision detection, constraint solving, and time integration.
Broadphase Collision Detection
The broadphase is the first, high-efficiency stage of the collision detection pipeline. Its primary function is to cull obviously non-interacting object pairs to reduce the computational load for the more expensive narrowphase. It uses spatial data structures to organize the simulation world.
- Key Data Structures: Bounding Volume Hierarchies (BVH), spatial hashing, sweep and prune, and uniform grids.
- Purpose: Generates a potential collision pair list of objects whose bounding volumes overlap.
- Performance Impact: Critical for scaling simulations with thousands of objects, as it reduces O(n²) pairwise checks to near O(n log n).
Narrowphase & Contact Generation
The narrowphase receives the potential collision pairs from the broadphase and performs precise geometric tests to determine if and how the objects intersect. This stage outputs detailed contact manifolds.
- Precise Algorithms: Uses algorithms like GJK (Gilbert–Johnson–Keerthi) for distance/computation and EPA (Expanding Polytope Algorithm) for penetration depth on convex shapes.
- Contact Manifold: The set of data describing a collision: contact points, a collision normal vector, and penetration depth.
- Output: A list of concrete contacts fed to the constraint solver to resolve interpenetration.
Constraint Solving
The constraint solver processes all contacts and joints to calculate the impulses or forces needed to satisfy physical constraints, such as preventing interpenetration (contact) or maintaining joint connections.
- Mathematical Framework: Often formulated as a Linear Complementarity Problem (LCP) or a system of equations.
- Iterative Solvers: Projected Gauss-Seidel (PGS) or its faster variant, Sequential Impulse, are common iterative solvers that handle multiple constraints simultaneously.
- Purpose: Ensures simulated bodies behave as solid objects (they don't pass through each other) and that articulated systems (like robots) move according to their joint limits.
Time Integration
Time integration is the final core stage that advances the simulation state forward in time. It takes the net forces and torques (from constraints, gravity, user input) and updates the position and velocity of each body.
- Numerical Methods: Common integrators include the semi-implicit Euler method (fast, moderate stability) and higher-order methods like Runge-Kutta 4 (RK4) (more accurate, computationally heavier).
- State Update: Computes new linear/angular velocities and translates/rotates bodies based on a fixed or variable time step (Δt).
- Stability vs. Accuracy: The choice of integrator and time step is a trade-off between simulation speed, energy conservation, and stability, especially for stiff systems.
Pipeline Extensions & Optimizations
Beyond the core four-stage pipeline, modern physics engines implement additional stages and optimizations for robustness, performance, and specific effects.
- Continuous Collision Detection (CCD): Prevents tunneling of fast-moving objects by testing collisions along their swept trajectory, often integrated after broadphase.
- Island Management: Groups interacting bodies into islands so the constraint solver works on independent sets, enabling parallel solving.
- Sleeping: Deactivates computations for bodies at rest to save CPU cycles, reactivating them when a potential collision is detected.
Engine Implementation Examples
Different physics engines implement the pipeline with varying emphases on speed, accuracy, and feature set.
- NVIDIA PhysX: A dominant real-time engine. Uses a PGS solver, supports GPU acceleration for broadphase and narrowphase, and features specialized pipelines for rigid bodies, cloth, and particles.
- Bullet Physics: Popular in robotics and visual effects. Known for its robust GJK/EPA implementation and support for Featherstone's algorithms for articulated bodies.
- Open Dynamics Engine (ODE): A classic open-source engine. Uses a LCP-based solver and is known for its stability in simulating complex jointed mechanisms.
- MuJoCo: Designed for robotics research. Features a unique constraint solver that combines contacts and joints in a unified framework, prioritizing stability and differentiability for control optimization.
Frequently Asked Questions
Common technical questions about the computational stages within a physics engine, from collision detection to time integration.
A physics pipeline is the sequential computational process within a physics engine that advances a simulated world state from one time step to the next. It works by executing four core stages in a loop: broadphase collision detection to find potentially colliding object pairs, narrowphase collision detection to compute exact contact details, constraint solving to resolve forces preventing interpenetration and enforcing joints, and time integration to update object positions and velocities based on net forces. This deterministic loop is the core of real-time and offline simulations for robotics, gaming, and digital twins.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The physics pipeline is the core computational sequence within a simulation engine. These related terms define its key stages, algorithms, and data structures.
Broadphase
The broadphase is the initial, low-precision stage of the collision detection pipeline. Its purpose is to efficiently cull pairs of objects that are obviously not colliding, drastically reducing the number of expensive pairwise checks needed in the next stage. It uses spatial data structures like Bounding Volume Hierarchies (BVH) or spatial hashing to quickly identify potentially intersecting pairs.
- Purpose: Prune the O(n²) collision problem.
- Common Algorithms: Sweep and Prune, Dynamic AABB Trees, Grid-based partitioning.
- Output: A list of potentially colliding pairs for the narrowphase.
Narrowphase
The narrowphase is the second, high-precision stage of collision detection. It takes the list of potentially colliding pairs from the broadphase and performs exact geometric tests to determine if a collision has actually occurred. This stage computes critical contact data:
- Contact Points: The exact location(s) of intersection.
- Penetration Depth: How far one object has intruded into another.
- Contact Normal: The direction to push the objects apart.
Algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm for convex shapes or the Separating Axis Theorem (SAT) are used here.
Constraint Solver
A constraint solver is the algorithmic core that resolves all forces and impulses to satisfy the physical rules of the simulation. After collisions are detected, the solver's job is to compute how to push intersecting objects apart (contact constraints) and how to enforce connections like hinges or sliders (joint constraints).
- Mathematical Framework: Often formulated as a Linear Complementarity Problem (LCP).
- Common Solvers: Projected Gauss-Seidel (PGS), Sequential Impulse, or Direct solvers.
- Goal: Find forces that prevent penetration and satisfy joint limits while respecting friction and restitution.
Time Integration
Time integration is the final stage that advances the simulation state forward in time. It takes the net forces and torques calculated for each body (from constraints, gravity, user input) and solves Newton's equations of motion to update positions and velocities.
- Core Equation: Solves
F = ma(and its rotational equivalent). - Common Integrators: Semi-implicit Euler (Symplectic Euler), Verlet, or Runge-Kutta methods.
- Challenge: Balancing stability (avoiding explosion) with accuracy and performance. The choice of timestep (fixed vs. variable) is critical.
Continuous Collision Detection (CCD)
Continuous Collision Detection (CCD) is a specialized technique that prevents tunneling, where fast-moving or small objects pass through thin geometry between discrete time steps. Instead of checking for collisions only at the end of a time step, CCD tests the continuous swept volume of an object's motion.
- Use Case: Essential for simulating bullets, fast-moving robots, or objects in low-framerate simulations.
- Methods: Swept sphere tests, conservative advancement, or speculative contacts.
- Trade-off: Computationally more expensive than discrete collision detection.
Contact Generation
Contact generation is a sub-process within the narrowphase that produces the specific data structures (contact manifolds) used by the constraint solver. It is responsible for turning a detected geometric intersection into usable simulation information.
- Manifold Contents: Typically includes 1-4 contact points, a shared contact normal, and penetration depth.
- Clustering: Reduces multiple contact points to a stable set to improve solver performance.
- Persistence: Manifolds are often cached and updated across frames for temporal coherence, improving stability.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us