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
optional scene Nullable<Scene>

Members

name : string

id : string

uniqueId : number

state : string

metadata : any

doNotSerialize : boolean

animations : Animation[]

onReady : (node: Node) => void

Parameters

Name Type Description
node Node

parent : Nullable<Node>

onDisposeObservable : Observable<Node>

An event triggered when the mesh is disposed.

@type {BABYLON.Observable}

onDispose : () => void

behaviors : Behavior<Node>[]

Methods

getClassName() string

getScene() Scene

getEngine() Engine

addBehavior(behavior) Node

Parameters

Name Type Description
behavior Behavior<Node>

removeBehavior(behavior) Node

Parameters

Name Type Description
behavior Behavior<Node>

getBehaviorByName(name) Nullable<Behavior<Node>>

Parameters

Name Type Description
name string

getWorldMatrix() Matrix

updateCache(force) void

Parameters

Name Type Description
optional force boolean

isSynchronizedWithParent() boolean

isSynchronized(updateCache) boolean

Parameters

Name Type Description
optional updateCache boolean

hasNewParent(update) boolean

Parameters

Name Type Description
optional update boolean

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

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

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

getChildMeshes(directDescendantsOnly, predicate) AbstractMesh[]

Get all child-meshes of this node.

Parameters

Name Type Description
optional directDescendantsOnly boolean
optional predicate node Node

getChildTransformNodes(directDescendantsOnly, predicate) TransformNode[]

Get all child-transformNodes of this node.

Parameters

Name Type Description
optional directDescendantsOnly boolean
optional predicate node Node

getChildren(predicate) Node[]

Get all direct children of this node.

Parameters

Name Type Description
optional predicate node Node

|

getAnimationByName(name) Nullable<Animation>

Parameters

Name Type Description
name string

createAnimationRange(name, from, to) void

Parameters

Name Type Description
name string
from number
to number

deleteAnimationRange(name, deleteFrames) void

Parameters

Name Type Description
name string
optional deleteFrames boolean

getAnimationRange(name) Nullable<AnimationRange>

Parameters

Name Type Description
name string

beginAnimation(name, loop, speedRatio, onAnimationEnd) void

Parameters

Name Type Description
name string
optional loop boolean
optional speedRatio number

serializeAnimationRanges() any

computeWorldMatrix(force) Matrix

Parameters

Name Type Description
optional force boolean

dispose() void

static ParseAnimationRanges(node, parsedNode, scene) void

Parameters

Name Type Description
node Node
parsedNode any
scene Scene