Constructor
new CollisionMesh(boxes)
Parameters:
| Name | Type | Description |
|---|---|---|
boxes |
Array.<BoundingBox> | An array of objects thatg resolve to BoundingBox. |
Methods
clone() → {CollisionMesh}
Clone the current collisionmesh to a new object.
Returns:
A clone of this instance
- Type
- CollisionMesh
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.
Returns:
self
- Type
- CollisionMesh
getHeight() → {Number}
Returns the height of this.
Returns:
height
- Type
- Number
getPosition() → {Vector}
Returns the position of this.
Returns:
position
- Type
- Vector
getSize() → {Vector}
Returns the size of this.
Returns:
size
- Type
- Vector
getWidth() → {Number}
Returns the width of this.
Returns:
width
- Type
- Number
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 |
Returns:
self
- Type
- BoundingBox
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 |
Returns:
self
- Type
- BoundingBox
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