Hierarchy

Hierarchy interface class, hierarchies of SceneObjects or Components.

Mixins

Hierarchy

Properties

activeInHierarchy bool

Is this object and all of its anscestors active?

childCount number

The number of children this object has

children Array

List of children of this object.

fullPath String

The full path of the object is its name along with all of it's ancestor names separated by "/".

isRoot bool

Is this object the root of the hierarchy, meaning it has no parent?

parent Hierarchy

The parent of this object

scene Scene

The scene the object belongs to

selectableInHierarchy bool

Is this object and all of its ancestors selectable?

visibleInHierarchy bool

Is this object and all of its ancestors visible?

Methods

addChild(object, index)

Add a child to the object, setting the child's parent to be this object.

Parameters
object Hierarchy
index number

findObjectById(id)

Find a child with the given id.

Parameters
id String

findObjectByName(name, recursive) → nullable Hierarchy

Find a child with the given name.

Parameters
name String

The name of the object to look for.

recursive bool

If true, all descendents will be searched.

Returns
Hierarchy

findObjectsByFilter(filter) → Array.<Hierarchy>

Return a list of objects that pass the given filter

Parameters
filter function

Returns true if the object should be included

Returns
Array.<Hierarchy>

getChild(index)

Get the child at the given index.

Parameters
index number

hasChild(obj) → bool

Checks if the given object a child of this object/

Parameters
obj Hierarchy
Returns
bool

removeAllChildren()

Remove all children from the object.

removeChild(object)

Remove a child from this objects list of children.

Parameters
object Hierarchy