CGSGTraverser Class
A Traverser is an utility class that traverse the scene graph and return a list of node, depending on conditions you fixed
Constructor
CGSGTraverser
()
Methods
_check
(
private
-
rootNode
-
condition
-
excludedNodes
traverse
(
Array
public
-
rootNode
-
condition.
-
excludedNodes
Returns:
Array:
the list of nodes recursively under 'rootNode', accepting the 'condition' and not in 'excludedNodes'
Example:
var condition = function(node) { return node.color == "yellow"; };
var traverser = new CGSGTraverser();
var listSquares = traverser.traverse(this.rootNode, condition, null);
for (var s = 0; s < listSquares.length; s++) {
...
}