Constructor
new CollisionMesh(boxes)
Parameters:
Name | Type | Description |
---|---|---|
boxes |
Array.<BoundingBox>
|
An array of objects thatg resolve to BoundingBox. |
Methods
getBoundingBox() → {BoundingBox}
Returns a BoundingBox instance version of this collisionmesh, which encapsulates all of it's internal boxes.
Returns:
- Type:
-
BoundingBox
getColliding(other) → {BoundingBox|undefined}
Returns which box of other
that this
intersects an area of, not an edge.
Parameters:
Name | Type | Description |
---|---|---|
other |
CollisionMesh
|
Array.<BoundingBox>
|
Returns:
- Type:
-
BoundingBox
|undefined
getCollisionMesh() → {CollisionMesh}
Resolve this object down to a CollisionMesh instance. Since this instance is already a collisionmesh, it returns itself.
getHeight() → {Number}
Returns the height of this
.
Returns:
- Type:
-
Number
height
getWidth() → {Number}
Returns the width of this
.
Returns:
- Type:
-
Number
width
isColliding(other) → {Boolean}
Determines if this
intersects an area of other
, not an edge.
Parameters:
Name | Type | Description |
---|---|---|
other |
CollisionMesh
|
Array.<BoundingBox>
|
Returns:
- Type:
-
Boolean
isContains(other) → {Boolean}
Determines if this
encapsulates all of other
.
Parameters:
Name | Type | Description |
---|---|---|
other |
CollisionMesh
|
Array.<BoundingBox>
|
Returns:
- Type:
-
Boolean
isTouching(other) → {Boolean}
Determines if this
touches an edge of other
, but does not intersect area.
Parameters:
Name | Type | Description |
---|---|---|
other |
CollisionMesh
|
Array.<BoundingBox>
|
Returns:
- Type:
-
Boolean
moveBy(deltaLeftopt, deltaTopopt) → {BoundingBox}
Move this
relatively to position by deltaLeft
and/or deltaTop
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
deltaLeft |
Number
|
<optional> |
null | |
deltaTop |
Number
|
<optional> |
null |
moveTo(leftopt, topopt) → {BoundingBox}
Move this
to position at left
and/or top
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
left |
Number
|
<optional> |
null | |
top |
Number
|
<optional> |
null |
someColliding(others) → {Boolean}
Determines if this
intersects an area of one of others
, not an edge.
Parameters:
Name | Type | Description |
---|---|---|
others |
Array.<CollisionMesh>
|
Returns:
- Type:
-
Boolean
someContains(other) → {Boolean}
Determines if this
encapsulates at least one of other
.
Parameters:
Name | Type | Description |
---|---|---|
other |
CollisionMesh
|
Array.<BoundingBox>
|
Returns:
- Type:
-
Boolean
someTouching(others) → {Boolean}
Determines if this
touches an edge of one of others
, but does not intersect area.
Parameters:
Name | Type | Description |
---|---|---|
others |
Array.<CollisionMesh>
|
Returns:
- Type:
-
Boolean