CLASSES
TagsA - Z

Node

Node

Description

class Node

Node is the basic class for all scene objects (Mesh, Light Camera).

Constructor

new Node(name, scene)

@constructor

Parameters

Name Type Description
name string The node identifier
scene Scene The scene linked to this node.

Members

name : string

The name of the node

id : string

The id of the node

uniqueId : number

state : string

The state of the node

metadata : any

doNotSerialize : boolean

animations : Animation[]

The animations of the node

onReady : (node: Node) => void

Called when node is ready

parent : Node

The parent node of the node

onDisposeObservable : Observable<Node>

An event triggered when the mesh is disposed.

@type {BABYLON.Observable}

onDispose : () => void

Methods

getScene() → Scene

Get the scene linked to this node

getEngine() → Engine

Get the engine linked to this node

getWorldMatrix() → Matrix

Get the world matrix

updateCache(force) → void

Update the cache

Parameters

Name Type Description
optional force boolean True to force the update

isSynchronizedWithParent() → boolean

Return true if the node is synchronized with parent

isSynchronized(updateCache) → boolean

Return true if the node is synchronized

Parameters

Name Type Description
optional updateCache boolean True to update the cache

hasNewParent(update) → boolean

Return true if the node has new parent

Parameters

Name Type Description
optional update boolean True to update the node

isReady() → boolean

Is this node ready to be used/rendered

@return {boolean} is it ready

isEnabled() → boolean

Is this node enabled.

If the node has a parent and is enabled, the parent will be inspected as well.

@return {boolean} whether this node (and its parent) is enabled.

@see setEnabled

setEnabled(value) → void

Set the enabled state of this node.

@see isEnabled

Parameters

Name Type Description
value boolean True to set the node enable ; False otherwise

isDescendantOf(ancestor) → boolean

Is this node a descendant of the given node.

The function will iterate up the hierarchy until the ancestor was found or no more parents defined.

@see parent

Parameters

Name Type Description
ancestor Node The ancestor node to test

getDescendants(directDescendantsOnly, predicate) → Node[]

Will return all nodes that have this node as ascendant.

@return {BABYLON.Node[]} all children nodes of all types.

Parameters

Name Type Description
optional directDescendantsOnly boolean
optional predicate (node: Node) => boolean : an optional predicate that will be called on every evaluated children, the predicate must return true for a given child to be part of the result, otherwise it will be ignored.

getChildren(predicate) → Node[]

@Deprecated, legacy support.

use getDecendants instead.

Parameters

Name Type Description
optional predicate (node: Node) => boolean : an optional predicate that will be called on every evaluated children, the predicate must return true for a given child to be part of the result, otherwise it will be ignored.

getChildMeshes(directDecendantsOnly, predicate) → AbstractMesh[]

Get all child-meshes of this node.

Parameters

Name Type Description
optional directDecendantsOnly boolean
optional predicate (node: Node) => boolean

getAnimationByName(name) → Animation

Parameters

Name Type Description
name string The node identifier

createAnimationRange(name, from, to) → void

Parameters

Name Type Description
name string The node identifier
from number
to number

deleteAnimationRange(name, deleteFrames) → void

Parameters

Name Type Description
name string The node identifier
optional deleteFrames boolean

getAnimationRange(name) → AnimationRange

Parameters

Name Type Description
name string The node identifier

beginAnimation(name, loop, speedRatio, onAnimationEnd) → void

Parameters

Name Type Description
name string The node identifier
optional loop boolean
optional speedRatio number

serializeAnimationRanges() → any

dispose() → void

static ParseAnimationRanges(node, parsedNode, scene) → void

Parameters

Name Type Description
node Node
parsedNode any
scene Scene The scene linked to this node.