Skip to main content

Function: detectCollision()

detectCollision(bodyA, bodyB): null | CollisionManifold

Defined in: physics/collision/detect-collision.ts:45

Detects a collision between two RigidBody instances, dispatching to the appropriate narrow-phase detector based on each body's shape type.

Parameters

bodyA

RigidBody

The first body.

bodyB

RigidBody

The second body.

Returns

null | CollisionManifold

A CollisionManifold if the bodies overlap, otherwise null.

Throws

An error if no detector is registered for the bodies' shape pair.