Matter.Bounds
Defined in: src/geometry/Bounds.js:1
The Matter.Bounds
module contains methods for creating and manipulating axis-aligned bounding boxes (AABB).
Methods
Matter.Bounds.contains
(bounds, point)
→ Boolean
Returns true if the bounds contains the given point.
Parameters
bounds
Bounds
point
Vector
Returns
BooleanTrue if the bounds contain the point, otherwise false
Matter.Bounds.create
(vertices)
→ Bounds
Creates a new axis-aligned bounding box (AABB) for the given vertices.
Parameters
vertices
Vertices
Returns
BoundsA new bounds object
Matter.Bounds.overlaps
(boundsA, boundsB)
→ Boolean
Returns true if the two bounds intersect.
Parameters
boundsA
Bounds
boundsB
Bounds
Returns
BooleanTrue if the bounds overlap, otherwise false
Matter.Bounds.shift
(bounds, position)
Shifts the bounds to the given position.
Parameters
bounds
Bounds
position
Vector
Matter.Bounds.translate
(bounds, vector)
Translates the bounds by the given vector.
Parameters
bounds
Bounds
vector
Vector
Matter.Bounds.update
(bounds, vertices, velocity)
Updates bounds using the given vertices and extends the bounds given a velocity.
Parameters
bounds
Bounds
vertices
Vertices
velocity
Vector