Packageaway3d.core.partition
Classpublic class NodeBase
InheritanceNodeBase Inheritance Object
Subclasses EntityNode, NullNode, OctreeNode, QuadTreeNode

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.

See also

away3d.partition.EntityNode
away3d.partition.Partition3D
away3d.containers.Scene3D


Public Properties
 PropertyDefined By
  parent : NodeBase
[read-only] The parent node.
NodeBase
  showDebugBounds : Boolean
NodeBase
Protected Properties
 PropertyDefined By
  _childNodes : Vector.<NodeBase>
NodeBase
  _numChildNodes : uint
NodeBase
  _parent : NodeBase
NodeBase
Public Methods
 MethodDefined By
  
Creates a new NodeBase object.
NodeBase
  
Allows the traverser to visit the current node.
NodeBase
  
addNode(node:NodeBase):void
Adds a node to the tree.
NodeBase
  
Finds the partition that contains (or should contain) the given entity.
NodeBase
  
isInFrustum(camera:Camera3D):Boolean
Tests if the current node is at least partly inside the frustum.
NodeBase
  
removeNode(node:NodeBase):void
Removes a child node from the tree.
NodeBase
Protected Methods
 MethodDefined By
  
NodeBase
Property Detail
_childNodesproperty
protected var _childNodes:Vector.<NodeBase>

_numChildNodesproperty 
protected var _numChildNodes:uint

_numEntitiesproperty 
arcane var _numEntities:int

_parentproperty 
protected var _parent:NodeBase

parentproperty 
parent:NodeBase  [read-only]

The parent node. Null if this node is the root.


Implementation
    public function get parent():NodeBase
showDebugBoundsproperty 
showDebugBounds:Boolean


Implementation
    public function get showDebugBounds():Boolean
    public function set showDebugBounds(value:Boolean):void
Constructor Detail
NodeBase()Constructor
public function NodeBase()

Creates a new NodeBase object.

Method Detail
acceptTraverser()method
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.

Parameters

traverser:PartitionTraverser — The traverser visiting the node.

See also

addNode()method 
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.

Parameters

node:NodeBase — The node to be added as a child of the current node.

createDebugBounds()method 
protected function createDebugBounds():WireframePrimitiveBase

Returns
WireframePrimitiveBase
findPartitionForEntity()method 
public function findPartitionForEntity(entity:Entity):NodeBase

Finds the partition that contains (or should contain) the given entity.

Parameters

entity:Entity

Returns
NodeBase
isInFrustum()method 
public function isInFrustum(camera:Camera3D):Boolean

Tests if the current node is at least partly inside the frustum.

Parameters

camera:Camera3D — The raw data of the view projection matrix

Returns
Boolean — Whether or not the node is at least partly inside the view frustum.
removeNode()method 
public function removeNode(node:NodeBase):void

Removes a child node from the tree.

Parameters

node:NodeBase — The child node to be removed.