An object representing the result of an intersection.

Constructors

Properties

a: any

The first object participating in the intersection

aInB: boolean

Whether the first object is entirely inside the second

b: any

The second object participating in the intersection

bInA: boolean

Whether the second object is entirely inside the first

indexShapeA: number

The index of the colliding shape for the object a body

indexShapeB: number

The index of the colliding shape for the object b body

overlap: number

Magnitude of the overlap on the shortest colliding axis

overlapN: Vector2d

The shortest colliding axis (unit-vector)

overlapV: Vector2d

The overlap vector (i.e. overlapN.scale(overlap, overlap)). If this vector is subtracted from the position of a, a and b will no longer be colliding

Methods

  • Set some values of the response back to their defaults.
    Call this between tests if you are going to reuse a single
    Response object for multiple intersection tests
    (recommended as it will avoid allocating extra memory)

    Returns object

    this object for chaining

    clear