Skip to main content

Function: detectPolygonPolygonCollision()

detectPolygonPolygonCollision(bodyA, bodyB): null | CollisionManifold

Defined in: physics/collision/detect-polygon-polygon-collision.ts:232

Detects a collision between two convex polygon-shaped bodies using the separating axis theorem with reference/incident face clipping.

Parameters

bodyA

RigidBody

The first body, with a PolygonShape.

bodyB

RigidBody

The second body, with a PolygonShape.

Returns

null | CollisionManifold

A CollisionManifold if the polygons overlap, otherwise null.