API Docs for: v2.1.0
Show:

CGSGTraverser Class

Extends Object
Module: Util

A Traverser is an utility class that traverse the scene graph and return a list of node, depending on conditions you fixed

Constructor

CGSGTraverser

()

Item Index

Methods

Properties

Methods

_check

(
  • rootNode
  • condition
  • excludedNodes
)
private

Parameters:

traverse

(
  • rootNode
  • condition.
  • excludedNodes
)
Array public

Parameters:

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++) {
                ...
            }

Properties

lastResults

Array

Last results provided by the last check