Class: SceneNode

SceneNode

SceneNode is an empty hierarchical container for the scene graph. It can be attached to other SceneNode objects and have SceneNode objects attached to itself.

SceneNode also functions as the base class for other scene graph objects, such as entities (ModelInstance, lights, camera, ...).


new SceneNode()

Properties:
Name Type Description
name string

The name of te scene node.

parent SceneNode

The parent of this node in the scene hierarchy.

numChildren number

The amount of children attached to this node.

visible boolean

Defines whether or not this and any children attached to this node should be rendered or not.

raycast boolean

Defines whether or not this and any children attached to this node should be tested when raycasting.

worldBounds BoundingVolume

The bounding volume for this node and its children in world coordinates.

worldMatrix Matrix4x4

The matrix transforming from the node's local space to world space.

Author:
  • derschmale <http://www.derschmale.com>
See:

Extends

Members


euler

The rotation of the object.

Inherited From:

matrix

The matrix representing the transform.

Inherited From:

position

The position of the object.

Inherited From:

rotation

The rotation of the object.

Inherited From:

scale

The scale of the object.

Inherited From:

Methods


applyFunction(func [, thisRef])

Applies a function recursively to all child nodes.

Parameters:
Name Type Argument Description
func

The function to call (using the traversed node as argument)

thisRef <optional>

Optional reference to "this" in the calling function, to keep the scope of "this" in the called method.


attach()

Attaches a child SceneNode to this node.


attachAfter(child, refChild)

Attaches a child SceneNode to this node.

Parameters:
Name Type Description
child SceneNode

The child to be attached.

refChild SceneNode

The scene node after which to add the new child.


contains()

Returns whether or not a child is contained in a parent. This works recursively!


copyTransform()

Copies the state of another Transform object

Inherited From:

destroy()

Removes the scene node from the scene and destroys it and all of its children.


detach()

Removes a child SceneNode from this node.


findMaterialByName()

Finds a material with the given name somewhere in this node's children.


findNodeByName()

Finds a scene node with the given name somewhere in this node's children.


getChild()

Retrieves a child SceneNode with the given index.


getChildIndex(child)

Returns the index of a child SceneNode.

Parameters:
Name Type Description
child
Returns:
Type
*

isContainedIn()

Returns whether or not this scene node is contained by a parent. This works recursively.


lookAt()

Orients the object in such a way as to face the target point.

Inherited From: