ResponseObject

class ResponseObject

An object representing the result of an intersection.

Summary


Properties from ResponseObject

Methods from ResponseObject

object
clear()

Public Properties


a response.js:3
a: Renderable

Renderable

The first object participating in the intersection

aInB response.js:3
aInB: boolean

boolean

Whether the first object is entirely inside the second

b response.js:3
b: Renderable

Renderable

The second object participating in the intersection

bInA response.js:3
bInA: boolean

boolean

Whether the second object is entirely inside the first

indexShapeA response.js:3
indexShapeA: number

number

The index of the colliding shape for the object a body

indexShapeB response.js:3
indexShapeB: number

number

The index of the colliding shape for the object b body

overlap response.js:3
overlap: number

number

Magnitude of the overlap on the shortest colliding axis

overlapN response.js:3
overlapN: Vector2d

Vector2d

The shortest colliding axis (unit-vector)

overlapV response.js:3
overlapV: Vector2d

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

Public Methods


clear response.js:31
clear() → {object}

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:
Type Description
object

this object for chaining


Powered by webdoc!