Class: AABBNode
physics/aabb/aabbNode.AABBNode
Constructors
constructor
โข new AABBNode(aabb)
Create a AABBNode from a AABB.
Parameters
| Name | Type | Description |
|---|---|---|
aabb | AABB | The node's AABB |
Defined in
src/physics/aabb/aabbNode.ts:22
โข new AABBNode(left, right, margin)
Create a AABBNode from left and right child nodes.
Parameters
| Name | Type | Description |
|---|---|---|
left | AABBNode | The node's left child |
right | AABBNode | The node's right child |
margin | number | The margin to use when creating the fat AABB |
Defined in
src/physics/aabb/aabbNode.ts:31
Properties
aabb
โข aabb: AABB
An AABB containing the node's children, if the node has no children then this AABB contains the CollisionObject.
Defined in
src/physics/aabb/aabbNode.ts:7
childrenCrossed
โข childrenCrossed: boolean = false
Defined in
src/physics/aabb/aabbNode.ts:15
left
โข left: AABBNode
Defined in
src/physics/aabb/aabbNode.ts:12
parent
โข parent: AABBNode
Defined in
src/physics/aabb/aabbNode.ts:9
right
โข right: AABBNode
Defined in
src/physics/aabb/aabbNode.ts:13
Methods
isLeaf
โธ isLeaf(): boolean
Determines wether or not this node is a leaf node.
Returns
boolean
Wether or not this node is a leaf node
Defined in
src/physics/aabb/aabbNode.ts:51
replaceChild
โธ replaceChild(oldChild, newChild): void
Replaces one of the node's children with a new node.
Parameters
| Name | Type | Description |
|---|---|---|
oldChild | AABBNode | The old child to replace |
newChild | AABBNode | The new child |
Returns
void
Defined in
src/physics/aabb/aabbNode.ts:79
sibling
โธ sibling(): AABBNode
Gets this node's sibling.
Returns
this node's sibling
Defined in
src/physics/aabb/aabbNode.ts:94
updateAABB
โธ updateAABB(margin): void
Updates the node's AABB.
If the node is a leaf node the AABB is created from the current aabb's obj.
Otherwise the AABB is the union of the node's children's AABBs.
Parameters
| Name | Type | Description |
|---|---|---|
margin | number | The margin to use when creating the fat AABB |
Returns
void
Defined in
src/physics/aabb/aabbNode.ts:64