Sorry for my English is not my native language ..
Thank you for what you are doing! Your 3D engine is just wonderful!
Now turn to the question…
In the method addNode () NodeBase class
public function addNode(node : NodeBase) : void {
node._parent = this;
_numEntities += node._numEntities;
_childNodes[_numChildNodes++] = node;
node.showDebugBounds = showDebugBounds;var numEntities : int = node._numEntities;
node = this;
do {
node._numEntities += numEntities;
} while (node = node._parent);
}
Why double the current node is added to the number of nodes to be added? It turns out that if you add the node was a node, we add it to the current in the first line _numEntities increases by say 2 and 3 is equal to say, and this is true ...
But then again, _numEntities increases the number of nodes to add the node, and becomes equal to 5, and this is not true ...
do {
node._numEntities += numEntities;
trace(node._childNodes, "==> numEntities: " + node._numEntities);
} while (node = node._parent);
(fcsh)Build succeeded
Done(0)
[Starting debug session with FDB]
[object CameraNode] ==> numEntities: 2
[object CameraNode],[object MeshNode] ==> numEntities: 4