Away3D 4.0 Beta :: NodeBase :: This is a bug or not?

Software: Away3D 4.x

redefy, Newbie
Posted: 19 February 2012 08:03 AM   Total Posts: 8

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] 
==> numEntities2
[object CameraNode]
,[object MeshNode] ==> numEntities

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X