The NodeBase class is an abstract base class for any type of space partition tree node. The concrete
subtype will control the creation of its child nodes, which are necessarily of the same type. The exception is
the creation of leaf entity nodes, which is handled by the Partition3D class.
protected var _childNodes:Vector.<NodeBase>
protected var _numChildNodes:uint
arcane var _numEntities:int
protected var _parent:NodeBase
The parent node. Null if this node is the root.
public function get parent():NodeBase
public function get showDebugBounds():Boolean
public function set showDebugBounds(value:Boolean):void
public function NodeBase()
Creates a new NodeBase object.
public function acceptTraverser(traverser:PartitionTraverser):void
Allows the traverser to visit the current node. If the traverser's enterNode method returns true, the
traverser will be sent down the child nodes of the tree.
This method should be overridden if the order of traversal is important (such as for BSP trees) - or if static
child nodes are not added using addNode, but are linked to separately.
public function addNode(node:NodeBase):void
Adds a node to the tree. By default, this is used for both static as dynamic nodes, but for some data
structures such as BSP trees, it can be more efficient to only use this for dynamic nodes, and add the
static child nodes using custom links.
node:NodeBase — The node to be added as a child of the current node.
protected function createDebugBounds():WireframePrimitiveBaseReturns
public function findPartitionForEntity(entity:Entity):NodeBase
Finds the partition that contains (or should contain) the given entity.
public function isInFrustum(camera:Camera3D):Boolean
Tests if the current node is at least partly inside the frustum.
camera:Camera3D — The raw data of the view projection matrix
Boolean — Whether or not the node is at least partly inside the view frustum.
public function removeNode(node:NodeBase):void
Removes a child node from the tree.
node:NodeBase — The child node to be removed.
Tue Jul 17 2012, 10:37 AM +01:00