Collision detection is the algorithmic process of determining if and where the geometric boundaries of two or more simulated objects intersect. It is a critical, computationally intensive component of any physics engine used for robotic simulation, as it provides the necessary data for the subsequent contact dynamics resolution that generates realistic forces and motion. The process is typically divided into a broad phase for efficient culling of non-interacting object pairs and a narrow phase for precise geometric intersection tests on the remaining candidates.
Glossary
Collision Detection

What is Collision Detection?
Collision detection is the computational process of identifying when and where two or more simulated objects intersect or come into contact, a foundational component of physics-based robotic simulation.
Accurate collision detection is essential for training and validating robotic systems in simulation, as it directly affects the fidelity of interactions like grasping, navigation, and manipulation. Inaccuracies here widen the reality gap, making sim-to-real transfer more difficult. Modern simulators like MuJoCo, PyBullet, and NVIDIA Isaac Sim implement highly optimized detection algorithms to support the complex, multi-body interactions required for reinforcement learning for robotics and hardware-in-the-loop (HIL) simulation.
Core Characteristics of Collision Detection
Collision detection is the computational process of identifying when and where two or more simulated objects intersect or come into contact, typically performed in two phases: a broad phase for efficient culling and a narrow phase for precise geometric intersection tests.
Two-Phase Architecture
Efficient collision detection systems universally employ a two-phase architecture to balance performance and accuracy.
- Broad Phase: This initial, low-fidelity pass quickly identifies pairs of objects that could be colliding. It uses spatial data structures like Bounding Volume Hierarchies (BVH), Spatial Hashing, or Sweep and Prune to cull obviously non-intersecting objects, drastically reducing the number of pairs sent for expensive precise checks.
- Narrow Phase: For each candidate pair from the broad phase, this phase performs exact geometric intersection tests. Algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm for convex shapes or the Separating Axis Theorem (SAT) determine precise contact points, penetration depths, and surface normals, which are critical for the subsequent contact dynamics resolution.
Bounding Volume Hierarchies (BVH)
A Bounding Volume Hierarchy (BVH) is a tree structure used to organize objects in space for efficient broad-phase culling. Each node in the tree has a simple bounding volume—like an Axis-Aligned Bounding Box (AABB) or a sphere—that encloses all the geometry of its children.
- Construction: The tree is built by recursively partitioning a set of objects, creating a hierarchy where parent volumes fully contain their children.
- Traversal: During collision queries, the tree is traversed; if the bounding volumes of two nodes do not overlap, all their children are guaranteed not to collide and are culled without further tests.
- Dynamic Updates: For moving objects, refitting algorithms update the bounding volumes up the tree, which is faster than rebuilding the entire hierarchy each frame. BVHs are foundational in engines like NVIDIA Isaac Sim and MuJoCo.
Gilbert–Johnson–Keerthi (GJK) Algorithm
The GJK algorithm is a highly efficient iterative method for computing the distance between two convex shapes and detecting collision. It is the standard narrow-phase algorithm in modern physics engines like Bullet and ODE.
- Core Mechanism: GJK uses the concept of a Minkowski Difference. If two convex sets A and B intersect, the Minkowski difference (A - B) contains the origin. The algorithm iteratively constructs a simplex (a point, line segment, triangle, or tetrahedron) within this difference to check for origin containment.
- Output: It returns a boolean collision result. A companion algorithm, the Expanding Polytope Algorithm (EPA), can be used after GJK detects a collision to compute the penetration depth and contact normal.
- Efficiency: Its speed comes from using support functions, which return the farthest point on a shape in a given direction, making it ideal for complex convex meshes.
Continuous Collision Detection (CCD)
Continuous Collision Detection (CCD), also known as time-of-impact detection, is essential for preventing tunneling—where fast-moving or thin objects pass through each other between discrete simulation time steps.
- The Problem: Standard discrete collision detection only checks for intersections at the end of each time stepping interval. A bullet moving faster than the thickness of a wall can be on one side at time t and the other side at time t+Δt, never registering a collision.
- The Solution: CCD models the continuous motion of objects between time steps (often as a linear sweep). It computes the exact time of impact, allowing the physics engine to roll back the simulation to that moment for accurate contact dynamics resolution.
- Use Case: Critical for simulating fast projectiles, precise robotic grasping, and any simulation requiring high simulation fidelity with large time steps or high velocities.
Contact Generation & Manifold
After collision is detected, the system must generate a contact manifold—a simplified representation of the intersecting surfaces—for the constraint-based solver to resolve physically.
- Contact Point: The precise 3D location where objects touch.
- Contact Normal: A unit vector perpendicular to the collision surface at the contact point, defining the direction of the separation impulse.
- Penetration Depth: The distance one object has intersected another, used to calculate the magnitude of the corrective force.
- Persistent Contact: For objects resting or sliding, engines like MuJoCo use warm starting, caching contact information from the previous time step to improve solver stability and performance. The manifold data is the primary input for solving the Linear Complementarity Problem (LCP) that models friction and restitution.
Sensor Simulation & Ray Casting
Collision detection is not only for dynamics but also for simulating robotic sensors that perceive contact and proximity.
- Ray Casting: A fundamental technique for simulating LiDAR, proximity sensors, and touch. A virtual ray is projected from a sensor origin. The collision detection system computes the first intersection with any object in the scene, returning the hit point, distance, and surface normal. This is a specialized, single-ray form of collision query.
- Contact Sensor: A virtual sensor attached to a robot link that triggers a boolean signal or reports contact forces when the link's geometry intersects with another object. This is crucial for simulating tactile feedback or bump sensors.
- Volume Queries: Simulating sensors like ultrasonic range finders may involve casting a volume (e.g., a cone) and detecting all collisions within it. These queries rely on the same underlying broad-phase and narrow-phase infrastructure as dynamics collision.
Broad Phase vs. Narrow Phase: A Technical Comparison
A systematic comparison of the two fundamental algorithmic stages in collision detection pipelines for physics-based simulation and robotics.
| Feature | Broad Phase | Narrow Phase |
|---|---|---|
Primary Objective | Efficient culling of non-interacting object pairs | Precise geometric intersection test on candidate pairs |
Algorithmic Complexity | O(n log n) or O(n) with spatial hashing | O(k) where k is the number of candidate pairs |
Typical Data Structures | Bounding Volume Hierarchies (BVH), Spatial Hashing Grids, Sweep and Prune | Convex Hulls, Polygon Meshes, Signed Distance Fields (SDF) |
Output | List of potentially colliding object pairs (AABBs overlap) | Exact contact points, penetration depth, and contact normals |
Common Algorithms | Sort and Sweep, Grid-based methods, Dynamic AABB Trees | Gilbert–Johnson–Keerthi (GJK), Separating Axis Theorem (SAT), Minkowski Portal Refinement (MPR) |
Deterministic Output | ||
Parallelization Potential | High (independent pair tests) | Moderate to Low (per-pair tests are complex) |
Performance Impact | Dictates overall scalability for large n | Dictates physical accuracy and stability of contact resolution |
Frequently Asked Questions
Collision detection is a foundational computational process in physics-based robotic simulation, enabling virtual robots to interact with their environment. These questions address its core mechanisms, performance considerations, and role in modern robotics development.
Collision detection is the computational process of identifying when and where two or more simulated objects intersect or come into contact. It typically operates in two distinct phases for efficiency. The broad phase performs a quick, approximate culling using spatial data structures like bounding volume hierarchies (BVH) or spatial hashing to identify pairs of objects that are potentially colliding. The narrow phase then performs precise geometric intersection tests on these candidate pairs using algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm or Separating Axis Theorem (SAT) to determine the exact points of contact, penetration depth, and surface normals. This data is passed to a constraint-based solver to resolve the contact forces.
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
Collision detection is a foundational component of physics-based simulation. These related concepts define the computational systems and algorithms that model physical interactions for robotic training and testing.
Physics Engine
A physics engine is the core software library responsible for simulating Newtonian mechanics in a virtual environment. It integrates several key subsystems:
- Rigid-body dynamics to calculate object motion from forces.
- Collision detection to identify intersections.
- Contact dynamics solvers to compute collision responses (forces, friction). Engines like MuJoCo, Bullet, and ODE differ in their numerical methods (e.g., penalty-based vs. constraint-based solvers) which trade off between speed, stability, and physical accuracy.
Contact Dynamics
Contact dynamics refers to the mathematical modeling and computational resolution of forces generated when simulated objects collide or maintain persistent contact. After collision detection identifies an intersection, the contact dynamics solver calculates the appropriate response to prevent inter-penetration and model physical effects:
- Normal force using a restitution coefficient (bounciness).
- Tangential friction force using static and dynamic friction coefficients.
- Resting contacts for stable stacking. Solvers often frame this as a Linear Complementarity Problem (LCP) or use a faster, less accurate penalty-based method.
Constraint-Based Solver
A constraint-based solver is the algorithmic core in advanced physics engines that calculates forces to satisfy hard kinematic and dynamic limits. It treats contact non-penetration and joint limits as mathematical constraints that must not be violated. The primary computational challenge is solving a Linear Complementarity Problem (LCP) or a similar numerical optimization at each simulation time step to find the correct set of contact impulses. This method produces more stable and physically plausible results for complex, multi-contact scenarios (like a robot hand grasping an object) compared to simpler spring-damper penalty methods.
Broad Phase & Narrow Phase
Collision detection is typically performed in two algorithmic phases for efficiency:
- Broad Phase: A fast, approximate culling stage that identifies pairs of objects that are potentially colliding. It uses spatial partitioning data structures like Bounding Volume Hierarchies (BVH), Sweep and Prune, or Grids to avoid expensive O(n²) pairwise checks.
- Narrow Phase: A precise geometric intersection test performed on the candidate pairs from the broad phase. This stage uses algorithms like the Gilbert–Johnson–Keerthi (GJK) algorithm for convex shapes or Minkowski Portal Refinement (MPR) to compute exact contact points, penetration depth, and separating axes.
Simulation Fidelity
Simulation fidelity measures how accurately a virtual environment replicates real-world physics and sensor outputs. High-fidelity collision detection is a critical contributor. Key aspects include:
- Geometric accuracy of collision meshes (convex decomposition vs. raw mesh).
- Temporal resolution of collision checks (sub-stepping).
- Physical correctness of material properties (friction, restitution). Low fidelity can lead to a significant reality gap, where policies trained in simulation fail on physical hardware because contact interactions are unrealistic.
Contact Sensor
A contact sensor is a simulated version of a physical touch or force-torque sensor. It is implemented by querying the collision detection and contact dynamics system. When a collision is detected on a specific robot link, the sensor can output:
- Binary contact state (touch/no-touch).
- Contact force vector and magnitude.
- Contact point location on the link's surface. These signals are essential for training and testing manipulation policies, allowing robots to sense grasps, slips, and collisions in simulation before real-world deployment.

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