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

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
  _debugPrimitive : WireframePrimitiveBase
NodeBase
  _numChildNodes : uint
NodeBase
  numEntities : int
[read-only]
NodeBase
Public Methods
 MethodDefined By
  
Creates a new NodeBase object.
NodeBase
  
Allows the traverser to visit the current node.
NodeBase
  
Finds the partition that contains (or should contain) the given entity.
NodeBase
  
isInFrustum(planes:Vector.<Plane3D>, numPlanes:int):Boolean
Tests if the current node is at least partly inside the frustum.
NodeBase
  
isIntersectingRay(rayPosition:Vector3D, rayDirection:Vector3D):Boolean
Tests if the current node is intersecting with a ray.
NodeBase
Protected Methods
 MethodDefined By
  
NodeBase
  
updateNumEntities(value:int):void
NodeBase
Property Detail
_childNodesproperty
protected var _childNodes:Vector.<NodeBase>

_collectionMarkproperty 
arcane var _collectionMark:uint

_debugPrimitiveproperty 
protected var _debugPrimitive:WireframePrimitiveBase

_numChildNodesproperty 
protected var _numChildNodes:uint

_numEntitiesproperty 
arcane var _numEntities:int

_parentproperty 
arcane var _parent:NodeBase

numEntitiesproperty 
numEntities:int  [read-only]


Implementation
    protected function get numEntities():int
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 
arcane 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(planes:Vector.<Plane3D>, numPlanes:int):Boolean

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

Parameters

planes:Vector.<Plane3D> — The raw data of the view projection matrix
 
numPlanes:int

Returns
Boolean — Whether or not the node is at least partly inside the view frustum.
isIntersectingRay()method 
public function isIntersectingRay(rayPosition:Vector3D, rayDirection:Vector3D):Boolean

Tests if the current node is intersecting with a ray.

Parameters

rayPosition:Vector3D — The starting position of the ray
 
rayDirection:Vector3D — The direction vector of the ray

Returns
Boolean — Whether or not the node is at least partly intersecting the ray.
removeNode()method 
arcane function removeNode(node:NodeBase):void

Removes a child node from the tree.

Parameters

node:NodeBase — The child node to be removed.

updateNumEntities()method 
protected function updateNumEntities(value:int):void

Parameters

value:int