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 Entity


new SceneNode()

Properties:
Name Type Description
name string

The name of the scene node.

parent SceneNode

The parent of this node in the scene hierarchy.

numChildren number

The amount of children attached to this node.

isOnRoot boolean

Indicates whether this node is added directly to the scene root.

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.

worldMatrix Matrix4x4

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

morphPose MorphPose

The MorphPose assigning weights to morph targets. If assigned, all MeshInstances in the hierarchy must have the correct morph targets. Otherwise, assign the morph pose to the MeshInstance.

skeleton Skeleton

The Skeleton defining the rigging for any MeshInstance children in the hierarchy.

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)

Applies a function recursively to all child nodes.

Parameters:
Name Type Description
func

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


applyFunctionConditional(func)

Applies a function recursively to all child nodes while the passed function returns true

Parameters:
Name Type Description
func

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


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.


clone()

Creates a copy of the object.

Inherited From:
Overrides:

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.


disableMatrixUpdates()

This disables listening to the position, rotation, etc. properties. If you need to change a lot of these properties, at once, it may be worth using this.

Inherited From:

enableMatrixUpdates()

This re-enables automatic matrix updates.

Inherited From:

findMaterialByName(name)

Queries the scene graph for a material with the given name

Parameters:
Name Type Description
name

The name of the Material


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: