Show:

Matter.SAT

The Matter.SAT module contains methods for detecting collisions using the Separating Axis Theorem.

Methods

Matter.SAT._findSupports

(bodyA, bodyB, normal)
private

Finds supporting vertices given two bodies along a given direction using hill-climbing.

Parameters

Returns

[vector]

Matter.SAT._overlapAxes

(verticesA, verticesB, axes)
private

Find the overlap between two sets of vertices.

Parameters

Returns

result

Matter.SAT._projectToAxis

(projection, vertices, axis)
private

Projects vertices on an axis and returns an interval.

Parameters

Matter.SAT.collides

(bodyA, bodyB, previousCollision)
→ Collision

Detect collision between two bodies using the Separating Axis Theorem.

Parameters

  • bodyA Body
  • bodyB Body
  • previousCollision Collision

Returns

Collision

collision

0.13.0