Skip to content

Documentation / scene / SceneNode

Class: SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:143

The base class of all scene graph objects.

Remarks

Responsibilities:

  • Defines hierarchical transform (position, rotation, scale) with lazily computed matrices.
  • Integrates with the scene graph (parent/children, attachment notifications).
  • Provides traversal utilities (iterate, iterateBottomToTop, traverse).
  • Manages visibility state and CPU/GPU picking flags.
  • Computes and caches local/world bounding volumes, notifies scene for spatial updates.
  • Supports cloning and shared model instancing.
  • Emits events on visibility, transform, bounding volume, attachment, and disposal.

Performance:

  • localMatrix, worldMatrix, and invWorldMatrix are cached until invalidated.
  • Transform mutations and invalidateBoundingVolume update caches and spatial structures.

Events:

  • nodeattached, noderemoved, visiblechanged, transformchanged, bvchanged, dispose.

Extends

  • object & Disposable<this>

Extended by

Implements

  • IDisposable

Constructors

Constructor

new SceneNode(scene): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:266

Construct a scene node.

Parameters

scene

Scene

Scene that will own this node.

Returns

SceneNode

Remarks

If a scene is provided and this is not the root node, the node is reparented under the scene's root immediately.

Overrides

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().constructor

Properties

BBOXDRAW_INHERITED

readonly static BBOXDRAW_INHERITED: -1 = -1

Defined in: libs/scene/src/scene/scene_node.ts:167

Bounding-box draw mode inherited from nearest graph ancestor.


BBOXDRAW_DISABLED

readonly static BBOXDRAW_DISABLED: 0 = 0

Defined in: libs/scene/src/scene/scene_node.ts:169

Disable bounding-box visualization.


BBOXDRAW_LOCAL

readonly static BBOXDRAW_LOCAL: 1 = 1

Defined in: libs/scene/src/scene/scene_node.ts:171

Draw local-space bounding box.


BBOXDRAW_WORLD

readonly static BBOXDRAW_WORLD: 2 = 2

Defined in: libs/scene/src/scene/scene_node.ts:173

Draw world-space bounding box.

Accessors

disposed

Get Signature

get disposed(): boolean

Defined in: libs/base/dist/index.d.ts:6107

Returns

boolean

Implementation of

IDisposable.disposed

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().disposed


placeToOctree

Get Signature

get placeToOctree(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:313

Whether the node should be inserted into the scene's spatial structure.

Remarks

Toggling this hints the scene to (re)place the node in octree/acceleration structures.

Returns

boolean

Set Signature

set placeToOctree(val): void

Defined in: libs/scene/src/scene/scene_node.ts:316

Parameters
val

boolean

Returns

void


runtimeId

Get Signature

get runtimeId(): number

Defined in: libs/scene/src/scene/scene_node.ts:327

Node's runtime unique identifier

Returns

number


persistentId

Get Signature

get persistentId(): string

Defined in: libs/scene/src/scene/scene_node.ts:336

Node's persistent identifier.

Remarks

Changing this affects serialization and registry lookup; ensure uniqueness.

Returns

string

Set Signature

set persistentId(id): void

Defined in: libs/scene/src/scene/scene_node.ts:339

Parameters
id

string

Returns

void


prefabId

Get Signature

get prefabId(): string

Defined in: libs/scene/src/scene/scene_node.ts:348

If not empty, this node was loaded from a prefab

Remarks

Internal used for serialization

Returns

string

Set Signature

set prefabId(id): void

Defined in: libs/scene/src/scene/scene_node.ts:351

Parameters
id

string

Returns

void


jointTypeT

Get Signature

get jointTypeT(): "none" | "animated" | "static"

Defined in: libs/scene/src/scene/scene_node.ts:367

Translation type if this is a joint node of any skeleton

Remarks

Internal used for serialization

Returns

"none" | "animated" | "static"

Set Signature

set jointTypeT(val): void

Defined in: libs/scene/src/scene/scene_node.ts:370

Parameters
val

"none" | "animated" | "static"

Returns

void


jointTypeS

Get Signature

get jointTypeS(): "none" | "animated" | "static"

Defined in: libs/scene/src/scene/scene_node.ts:379

Scale type if this is a joint node of any skeleton

Remarks

Internal used for serialization

Returns

"none" | "animated" | "static"

Set Signature

set jointTypeS(val): void

Defined in: libs/scene/src/scene/scene_node.ts:382

Parameters
val

"none" | "animated" | "static"

Returns

void


jointTypeR

Get Signature

get jointTypeR(): "none" | "animated" | "static"

Defined in: libs/scene/src/scene/scene_node.ts:391

Rotation type if this is a joint node of any skeleton

Remarks

Internal used for serialization

Returns

"none" | "animated" | "static"

Set Signature

set jointTypeR(val): void

Defined in: libs/scene/src/scene/scene_node.ts:394

Parameters
val

"none" | "animated" | "static"

Returns

void


metaData

Get Signature

get metaData(): Metadata

Defined in: libs/scene/src/scene/scene_node.ts:403

Arbitrary metadata associated with this node.

Remarks

Stored and transported with the node; format is application-defined.

Returns

Metadata

Set Signature

set metaData(val): void

Defined in: libs/scene/src/scene/scene_node.ts:406

Parameters
val

Metadata

Returns

void


script

Get Signature

get script(): string

Defined in: libs/scene/src/scene/scene_node.ts:415

Attached script filename or identifier (engine-specific).

Remarks

Integrates with the engine’s scripting system if available.

Returns

string

Set Signature

set script(fileName): void

Defined in: libs/scene/src/scene/scene_node.ts:418

Parameters
fileName

string

Returns

void


scriptConfig

Get Signature

get scriptConfig(): object | unknown[]

Defined in: libs/scene/src/scene/scene_node.ts:431

Script component configuration payload used by editor/runtime script components.

Returns

object | unknown[]

Set Signature

set scriptConfig(value): void

Defined in: libs/scene/src/scene/scene_node.ts:434

Parameters
value

object | unknown[]

Returns

void


scripts

Get Signature

get scripts(): ScriptAttachment[]

Defined in: libs/scene/src/scene/scene_node.ts:448

All script attachments on this node.

Returns

ScriptAttachment[]

Set Signature

set scripts(value): void

Defined in: libs/scene/src/scene/scene_node.ts:451

Parameters
value

ScriptAttachment[]

Returns

void


scriptConfigs

Get Signature

get scriptConfigs(): unknown[]

Defined in: libs/scene/src/scene/scene_node.ts:457

Script configs for all script attachments.

Returns

unknown[]

Set Signature

set scriptConfigs(value): void

Defined in: libs/scene/src/scene/scene_node.ts:460

Parameters
value

unknown[]

Returns

void


name

Get Signature

get name(): string

Defined in: libs/scene/src/scene/scene_node.ts:475

Display name of the node (for UI/debugging).

Returns

string

Set Signature

set name(val): void

Defined in: libs/scene/src/scene/scene_node.ts:478

Parameters
val

string

Returns

void


scene

Get Signature

get scene(): Scene

Defined in: libs/scene/src/scene/scene_node.ts:482

The owning scene.

Returns

Scene


attached

Get Signature

get attached(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:488

Whether this node is currently attached under the scene's root.

Returns

boolean


sealed

Get Signature

get sealed(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:502

If true, the node is logically sealed; some operations (like cloning as child) may be restricted by engine policies.

Returns

boolean

Set Signature

set sealed(val): void

Defined in: libs/scene/src/scene/scene_node.ts:505

Parameters
val

boolean

Returns

void


animationSet

Get Signature

get animationSet(): AnimationSet

Defined in: libs/scene/src/scene/scene_node.ts:514

Lazily created animation set for this node.

Remarks

Accessing this schedules the node for update in the scene.

Returns

AnimationSet


sharedModel

Get Signature

get sharedModel(): SharedModel

Defined in: libs/scene/src/scene/scene_node.ts:524

Shared model reference for instancing/streaming systems.

Returns

SharedModel

Set Signature

set sharedModel(model): void

Defined in: libs/scene/src/scene/scene_node.ts:527

Parameters
model

SharedModel

Returns

void


morphTargetGroups

Get Signature

get morphTargetGroups(): SceneMorphTargetGroup[]

Defined in: libs/scene/src/scene/scene_node.ts:531

Runtime morph target groups bound to this model instance.

Returns

SceneMorphTargetGroup[]

Set Signature

set morphTargetGroups(groups): void

Defined in: libs/scene/src/scene/scene_node.ts:534

Parameters
groups

SceneMorphTargetGroup[]

Returns

void


clipTestEnabled

Get Signature

get clipTestEnabled(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:779

Clip mode

Returns

boolean

Set Signature

set clipTestEnabled(val): void

Defined in: libs/scene/src/scene/scene_node.ts:782

Parameters
val

boolean

Returns

void


hidden

Get Signature

get hidden(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:786

Computed value of show state

Returns

boolean


showState

Get Signature

get showState(): SceneNodeVisible

Defined in: libs/scene/src/scene/scene_node.ts:794

Show state

Returns

SceneNodeVisible

Set Signature

set showState(val): void

Defined in: libs/scene/src/scene/scene_node.ts:797

Parameters
val

SceneNodeVisible

Returns

void


pickable

Get Signature

get pickable(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:815

Whether this node is enabled for CPU picking

Returns

boolean

Set Signature

set pickable(val): void

Defined in: libs/scene/src/scene/scene_node.ts:818

Parameters
val

boolean

Returns

void


gpuPickable

Get Signature

get gpuPickable(): boolean

Defined in: libs/scene/src/scene/scene_node.ts:822

Whether this node is enabled for GPU picking

Returns

boolean

Set Signature

set gpuPickable(val): void

Defined in: libs/scene/src/scene/scene_node.ts:825

Parameters
val

boolean

Returns

void


computedBoundingBoxDrawMode

Get Signature

get computedBoundingBoxDrawMode(): number

Defined in: libs/scene/src/scene/scene_node.ts:907

Computed value for bounding box draw mode

Returns

number


boundingBoxDrawMode

Get Signature

get boundingBoxDrawMode(): number

Defined in: libs/scene/src/scene/scene_node.ts:918

Bounding box draw mode

Returns

number

Set Signature

set boundingBoxDrawMode(mode): void

Defined in: libs/scene/src/scene/scene_node.ts:921

Parameters
mode

number

Returns

void


parent

Get Signature

get parent(): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1211

Parent of the xform

Returns

SceneNode

Set Signature

set parent(p): void

Defined in: libs/scene/src/scene/scene_node.ts:1214

Parameters
p

SceneNode

Returns

void


children

Get Signature

get children(): SceneNode[]

Defined in: libs/scene/src/scene/scene_node.ts:1220

Children of this xform

Returns

SceneNode[]


position

Get Signature

get position(): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1226

Position of the xform relative to it's parent

Returns

Vector3

Set Signature

set position(val): void

Defined in: libs/scene/src/scene/scene_node.ts:1229

Parameters
val

Vector3

Returns

void


scale

Get Signature

get scale(): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1235

Scaling of the xform

Returns

Vector3

Set Signature

set scale(val): void

Defined in: libs/scene/src/scene/scene_node.ts:1238

Parameters
val

Vector3

Returns

void


rotation

Get Signature

get rotation(): Quaternion

Defined in: libs/scene/src/scene/scene_node.ts:1244

Rotation of the xform

Returns

Quaternion

Set Signature

set rotation(val): void

Defined in: libs/scene/src/scene/scene_node.ts:1247

Parameters
val

Quaternion

Returns

void


localMatrix

Get Signature

get localMatrix(): Immutable<Matrix4x4>

Defined in: libs/scene/src/scene/scene_node.ts:1353

Local transformation matrix of the xform

Returns

Immutable<Matrix4x4>

Set Signature

set localMatrix(matrix): void

Defined in: libs/scene/src/scene/scene_node.ts:1360

Parameters
matrix

Immutable<Matrix4x4>

Returns

void


worldMatrix

Get Signature

get worldMatrix(): Immutable<Matrix4x4>

Defined in: libs/scene/src/scene/scene_node.ts:1364

World transformation matrix of the xform

Returns

Immutable<Matrix4x4>


worldMatrixDet

Get Signature

get worldMatrixDet(): number

Defined in: libs/scene/src/scene/scene_node.ts:1369

The determinant of world matrix

Returns

number


invWorldMatrix

Get Signature

get invWorldMatrix(): Immutable<Matrix4x4>

Defined in: libs/scene/src/scene/scene_node.ts:1374

Inverse of the world transformation matrix of the xform

Returns

Immutable<Matrix4x4>

Methods

on()

Call Signature

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:671

IEventTarget.on

Type Parameters
K

K extends "dispose" | "nodeattached" | "noderemoved" | "visiblechanged" | "transformchanged" | "bvchanged"

Parameters
type

K

listener

EventListener<object & object, K>

context?

unknown

Returns

void

Implementation of

IDisposable.on

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().on

Call Signature

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:630

IEventTarget.on

Type Parameters
K

K extends "dispose"

Parameters
type

K

listener

EventListener<{ dispose: []; }, K>

context?

unknown

Returns

void

Implementation of

IDisposable.on

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().on


once()

Call Signature

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:675

IEventTarget.once

Type Parameters
K

K extends "dispose" | "nodeattached" | "noderemoved" | "visiblechanged" | "transformchanged" | "bvchanged"

Parameters
type

K

listener

EventListener<object & object, K>

context?

unknown

Returns

void

Implementation of

IDisposable.once

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().once

Call Signature

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:634

IEventTarget.once

Type Parameters
K

K extends "dispose"

Parameters
type

K

listener

EventListener<{ dispose: []; }, K>

context?

unknown

Returns

void

Implementation of

IDisposable.once

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().once


off()

Call Signature

off<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:679

IEventTarget.off

Type Parameters
K

K extends "dispose" | "nodeattached" | "noderemoved" | "visiblechanged" | "transformchanged" | "bvchanged"

Parameters
type

K

listener

EventListener<object & object, K>

context?

unknown

Returns

void

Implementation of

IDisposable.off

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().off

Call Signature

off<K>(type, listener?, context?): void

Defined in: libs/base/dist/index.d.ts:638

IEventTarget.off

Type Parameters
K

K extends "dispose"

Parameters
type

K

listener?

EventListener<{ dispose: []; }>

context?

unknown

Returns

void

Implementation of

IDisposable.off

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().off


dispatchEvent()

Call Signature

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:683

IEventTarget.dispatchEvent

Type Parameters
K

K extends "dispose" | "nodeattached" | "noderemoved" | "visiblechanged" | "transformchanged" | "bvchanged"

Parameters
type

K

args

...object & object[K]

Returns

void

Implementation of

IDisposable.dispatchEvent

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().dispatchEvent

Call Signature

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:642

IEventTarget.dispatchEvent

Type Parameters
K

K extends "dispose"

Parameters
type

K

args

...object[K]

Returns

void

Implementation of

IDisposable.dispatchEvent

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().dispatchEvent


dispose()

dispose(): void

Defined in: libs/base/dist/index.d.ts:6108

Returns

void

Implementation of

IDisposable.dispose

Inherited from

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().dispose


getPrefabNode()

getPrefabNode(): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:358

Get prefab node this node belongs to, or null if this node does not belongs to any prefab

Returns

SceneNode

prefab node this node belongs to


clone()

clone(): Promise<SceneNode>

Defined in: libs/scene/src/scene/scene_node.ts:548

Clone this node.

Returns

Promise<SceneNode>

New node instance

Remarks

If a shared model exists, it may create an instanced node. The clone is attached under the same parent; children are cloned based on method and recursive.


hasChild()

hasChild(child): boolean

Defined in: libs/scene/src/scene/scene_node.ts:578

Whether the given node is a direct child of this node.

Parameters

child

SceneNode

The node to be checked

Returns

boolean

true if the given node is a direct child of this node, false otherwise


removeChildren()

removeChildren(): void

Defined in: libs/scene/src/scene/scene_node.ts:584

Remove all children from this node.

Returns

void


isParentOf()

isParentOf(child): boolean

Defined in: libs/scene/src/scene/scene_node.ts:592

Whether this node is an ancestor (direct or indirect) of the given node.

Parameters

child

SceneNode

Returns

boolean


remove()

remove(): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:603

Detach this node from its parent.

Returns

SceneNode

this


traverse()

traverse(v): void

Defined in: libs/scene/src/scene/scene_node.ts:612

Depth-first traversal of this node's subtree (pre-order).

Parameters

v

Visitor<SceneNode>

Visitor invoked on each node.

Returns

void


iterate()

iterate(callback): boolean

Defined in: libs/scene/src/scene/scene_node.ts:626

Iterate self and descendants in pre-order.

Warning: Do not remove children during this iteration. To allow removal, use iterateBottomToTop.

Parameters

callback

NodeIterateFunc

Called for each node; if returns true, iteration stops.

Returns

boolean

If returns true, the iteration will immediately stop.


iterateBottomToTop()

iterateBottomToTop(callback): boolean

Defined in: libs/scene/src/scene/scene_node.ts:645

Iterate self and descendants in reverse post-order (bottom-to-top).

Child nodes can be safely removed during this iteration.

Parameters

callback

NodeIterateFunc

Called for each node; if returns true, iteration stops.

Returns

boolean

If returns true, the iteration will immediately stop.


isGraphNode()

isGraphNode(): this is GraphNode

Defined in: libs/scene/src/scene/scene_node.ts:658

Type guard: true if this node is a graph node.

Returns

this is GraphNode


isLight()

isLight(): this is BaseLight

Defined in: libs/scene/src/scene/scene_node.ts:662

Type guard: true if this node is a light.

Returns

this is BaseLight


isMesh()

isMesh(): this is Mesh

Defined in: libs/scene/src/scene/scene_node.ts:666

Type guard: true if this node is a mesh.

Returns

this is Mesh


isSprite()

isSprite(): this is Sprite

Defined in: libs/scene/src/scene/scene_node.ts:670

Type guard: true if this node is a sprite

Returns

this is Sprite


isMSDFTextSprite()

isMSDFTextSprite(): this is MSDFTextSprite

Defined in: libs/scene/src/scene/scene_node.ts:674

Type guard: true if this node is a MSDF text sprite

Returns

this is MSDFTextSprite


isMSDFText()

isMSDFText(): this is MSDFText

Defined in: libs/scene/src/scene/scene_node.ts:678

Type guard: true if this node is a MSDF text sprite

Returns

this is MSDFText


isWater()

isWater(): this is Water

Defined in: libs/scene/src/scene/scene_node.ts:682

Type guard: true if this node is a water node.

Returns

this is Water


isHair()

isHair(): this is HairNode

Defined in: libs/scene/src/scene/scene_node.ts:686

Type guard: true if this node is a hair node.

Returns

this is HairNode


isParticleSystem()

isParticleSystem(): this is ParticleSystem

Defined in: libs/scene/src/scene/scene_node.ts:690

Type guard: true if this node is a particle system.

Returns

this is ParticleSystem


isBatchGroup()

isBatchGroup(): this is BatchGroup

Defined in: libs/scene/src/scene/scene_node.ts:694

Type guard: true if this node is a batch group.

Returns

this is BatchGroup


isClipmapTerrain()

isClipmapTerrain(): this is ClipmapTerrain

Defined in: libs/scene/src/scene/scene_node.ts:698

Type guard: true if this node is a clipmap terrain.

Returns

this is ClipmapTerrain


isCamera()

isCamera(): this is Camera

Defined in: libs/scene/src/scene/scene_node.ts:702

true if this is a camera node, false otherwise

Returns

this is Camera


isPunctualLight()

isPunctualLight(): this is PunctualLight

Defined in: libs/scene/src/scene/scene_node.ts:706

true if this is a punctual light node, false otherwise

Returns

this is PunctualLight


computeBoundingVolume()

computeBoundingVolume(): BoundingVolume

Defined in: libs/scene/src/scene/scene_node.ts:713

Computes the bounding volume of the node

Returns

BoundingVolume

The output bounding volume


getBoundingVolume()

getBoundingVolume(): BoundingVolume

Defined in: libs/scene/src/scene/scene_node.ts:720

Gets the bounding volume of the node

Returns

BoundingVolume

The bounding volume of the node


setBoundingVolume()

setBoundingVolume(bv): void

Defined in: libs/scene/src/scene/scene_node.ts:731

Sets the bounding volume of the node

Parameters

bv

BoundingVolume

The bounding volume to set

Returns

void


getWorldBoundingVolume()

getWorldBoundingVolume(): BoundingVolume

Defined in: libs/scene/src/scene/scene_node.ts:742

Gets the world space bounding volume of the node

Returns

BoundingVolume

The world space bounding volume of the node


computeWorldBoundingVolume()

computeWorldBoundingVolume(localBV): BoundingVolume

Defined in: libs/scene/src/scene/scene_node.ts:752

Computes the world space bounding volume of the node

Parameters

localBV

BoundingVolume

Returns

BoundingVolume

The output bounding volume


invalidateBoundingVolume()

invalidateBoundingVolume(): void

Defined in: libs/scene/src/scene/scene_node.ts:758

Force the bounding volume to be recalculated

Returns

void


invalidateWorldBoundingVolume()

invalidateWorldBoundingVolume(transformChanged): void

Defined in: libs/scene/src/scene/scene_node.ts:763

Force the world space bounding volume to be recalculated

Parameters

transformChanged

boolean

Returns

void


findNodeById()

findNodeById<T>(id): T

Defined in: libs/scene/src/scene/scene_node.ts:835

Finds a scene node by its persistent ID.

Type Parameters

T

T extends SceneNode

Expected node type.

Parameters

id

string

Persistent identifier to match against SceneNode.persistentId.

Returns

T

The first matching node, or null if not found.


findSkeletonById()

findSkeletonById(id): SkinBinding

Defined in: libs/scene/src/scene/scene_node.ts:850

Finds a skeleton object by its persistent ID.

Parameters

id

string

Persistent identifier to match against Skeleton.persistentId.

Returns

SkinBinding

The first matchign node, or null if not found.


findSkinBindingById()

findSkinBindingById(id): SkinBinding

Defined in: libs/scene/src/scene/scene_node.ts:858

Finds a skin binding by its persistent ID.

Parameters

id

string

Persistent identifier to match against SkinBinding.persistentId.

Returns

SkinBinding

The first matching binding, or null if not found.


findSkeletonRigById()

findSkeletonRigById(id): SkeletonRig

Defined in: libs/scene/src/scene/scene_node.ts:873

Finds a shared skeleton rig by its persistent ID.

Parameters

id

string

Persistent identifier to match against SkeletonRig.persistentId.

Returns

SkeletonRig

The first matching rig, or null if not found.


findNodeByName()

findNodeByName<T>(name): T

Defined in: libs/scene/src/scene/scene_node.ts:895

Finds a scene node by name.

If multiple nodes share the same name, returns the first match encountered during traversal.

Type Parameters

T

T extends SceneNode

Expected node type.

Parameters

name

string

Node name to match.

Returns

T

The first matching node, or null if not found.

Remarks

Names are not guaranteed unique. Prefer IDs for stable references.


getSerializedMorphTargetGroups()

getSerializedMorphTargetGroups(): SerializedMorphTargetGroup[]

Defined in: libs/scene/src/scene/scene_node.ts:978

Returns serialized morph target groups for this node.

Returns

SerializedMorphTargetGroup[]


setSerializedMorphTargetGroups()

setSerializedMorphTargetGroups(groups): void

Defined in: libs/scene/src/scene/scene_node.ts:996

Restores serialized morph target groups for this node.

Parameters

groups

SerializedMorphTargetGroup[]

Returns

void


invalidateTransform()

invalidateTransform(invalidateLocal?): void

Defined in: libs/scene/src/scene/scene_node.ts:1032

Force transform update and notify descendants.

Parameters

invalidateLocal?

boolean = true

If true, also invalidate local matrix; otherwise only invalidate world matrix.

Returns

void


setMorphTargetWeight()

setMorphTargetWeight(name, weight): void

Defined in: libs/scene/src/scene/scene_node.ts:1040

Set morph target weight by name for all meshes in the subtree.

Parameters

name

string

Morph target name

weight

number

Morph target weight

Returns

void


setMorphTargetGroupWeight()

setMorphTargetGroupWeight(name, weight): void

Defined in: libs/scene/src/scene/scene_node.ts:1056

Set morph target group weight for the model instance.

Parameters

name

string

Morph target group name

weight

number

Group weight

Returns

void


getMorphTargetGroupWeight()

getMorphTargetGroupWeight(name): number

Defined in: libs/scene/src/scene/scene_node.ts:1078

Get morph target group weight.

Parameters

name

string

Morph target group name

Returns

number

The group weight, or 0 if no group was found


collectMorphTargetNames()

collectMorphTargetNames(): string[]

Defined in: libs/scene/src/scene/scene_node.ts:1086

Collect all morph target names from meshes in the subtree.

Returns

string[]

Array of unique morph target names


collectMorphTargetGroupNames()

collectMorphTargetGroupNames(): string[]

Defined in: libs/scene/src/scene/scene_node.ts:1102

Collect all model-level morph target group names.

Returns

string[]

Array of morph target group names


onPostClone()

protected onPostClone(): void | Promise<void>

Defined in: libs/scene/src/scene/scene_node.ts:1111

Get called when the node was just created by cloning from other node

Returns

void | Promise<void>


onDispose()

protected onDispose(): void

Defined in: libs/scene/src/scene/scene_node.ts:1113

Disposes the node

Returns

void

Overrides

makeObservable(Disposable)<{ /** Emitted on all ancestors when a node is attached under them. */ nodeattached: [node: SceneNode]; /** Emitted on all ancestors when a node is removed from under them. */ noderemoved: [node: SceneNode]; /** Emitted when effective visibility changes (considering inheritance). */ visiblechanged: [node: SceneNode]; /** Emitted when local/world transform changes. */ transformchanged: [node: SceneNode]; /** Emitted when local/world bounding volume changes. */ bvchanged: [node: SceneNode]; /** Emitted when the node is disposed. */ dispose: []; }>().onDispose


_onAttached()

protected _onAttached(): void

Defined in: libs/scene/src/scene/scene_node.ts:1181

Get called when this node is attached to scene

Returns

void


_onDetached()

protected _onDetached(): void

Defined in: libs/scene/src/scene/scene_node.ts:1185

Get called when this node is detached from scene

Returns

void


worldToThis()

Call Signature

worldToThis(v, result?): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1256

Transform world coordinate to local space

Parameters
v

Vector3

point or vector in world space

result?

Vector3

The output result

Returns

Vector3

The transformed local space coordinate

Call Signature

worldToThis(v, result?): Vector4

Defined in: libs/scene/src/scene/scene_node.ts:1257

Transform world coordinate to local space

Parameters
v

Vector4

point or vector in world space

result?

Vector4

The output result

Returns

Vector4

The transformed local space coordinate


otherToThis()

Call Signature

otherToThis(other, v, result?): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1276

Transform coordinate in other coordinate space to local space

Parameters
other

SceneNode

The other coordinate space

v

Vector3

point or vector in other coordinate space

result?

Vector3

The output result

Returns

Vector3

The transformed local space coordinate

Call Signature

otherToThis(other, v, result?): Vector4

Defined in: libs/scene/src/scene/scene_node.ts:1277

Transform coordinate in other coordinate space to local space

Parameters
other

SceneNode

The other coordinate space

v

Vector4

point or vector in other coordinate space

result?

Vector4

The output result

Returns

Vector4

The transformed local space coordinate


thisToWorld()

Call Signature

thisToWorld(v, result?): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1287

Transform local coordinate to world space

Parameters
v

Vector3

point or vector in local space

result?

Vector3

The output result

Returns

Vector3

The transformed world space coordinate

Call Signature

thisToWorld(v, result?): Vector4

Defined in: libs/scene/src/scene/scene_node.ts:1288

Transform local coordinate to world space

Parameters
v

Vector4

point or vector in local space

result?

Vector4

The output result

Returns

Vector4

The transformed world space coordinate


thisToOther()

Call Signature

thisToOther(other, v, result?): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1307

Transform local space coordinate to other coordinate space

Parameters
other

SceneNode

The other coordinate space

v

Vector3

point or vector in localspace

result?

Vector3

The output result

Returns

Vector3

The transformed coordinate in other coordinate space

Call Signature

thisToOther(other, v, result?): Vector4

Defined in: libs/scene/src/scene/scene_node.ts:1308

Transform local space coordinate to other coordinate space

Parameters
other

SceneNode

The other coordinate space

v

Vector4

point or vector in localspace

result?

Vector4

The output result

Returns

Vector4

The transformed coordinate in other coordinate space


getWorldPosition()

getWorldPosition(outPos?): Vector3

Defined in: libs/scene/src/scene/scene_node.ts:1316

Gets the position of the xform in world space

Parameters

outPos?

Vector3

Returns

Vector3

position of the xform in world space


moveBy()

moveBy(delta): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1327

Moves the xform by an offset vector

Parameters

delta

Vector3

The offset vector

Returns

SceneNode

self


scaleBy()

scaleBy(factor): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1336

Scales the xform by a given scale factor

Parameters

factor

Vector3

The scale factor

Returns

SceneNode

self


setLocalTransform()

setLocalTransform(matrix): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1345

Sets the local transform matrix of the xform

Parameters

matrix

Matrix4x4

The transform matrix to set

Returns

SceneNode

self


calculateLocalTransform()

calculateLocalTransform(outMatrix): void

Defined in: libs/scene/src/scene/scene_node.ts:1382

Calculate local transform matrix

Parameters

outMatrix

Matrix4x4

Matrix object that holds the result of calculation

Returns

void


calculateWorldTransform()

calculateWorldTransform(outMatrix): void

Defined in: libs/scene/src/scene/scene_node.ts:1389

Calculate world transform matrix

Parameters

outMatrix

Matrix4x4

Matrix object that holds the result of calculation

Returns

void


lookAt()

lookAt(eye, target, up): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1403

Sets the local tranformation matrix by a look-at matrix

Parameters

eye

Vector3

The eye position used to make the look-at matrix

target

Vector3

The target position used to make the look-at matrix

up

Vector3

The up vector used to make the look-at matrix

Returns

SceneNode

self


update()

update(frameId, elapsedInSeconds, deltaInSeconds): void

Defined in: libs/scene/src/scene/scene_node.ts:1413

Update node state once per-frame

Parameters

frameId

number

Current frame id

elapsedInSeconds

number

Elapsed time from game start in seconds

deltaInSeconds

number

Elapsed time since previous frame in seconds

Returns

void


updatePerCamera()

updatePerCamera(_camera, _elapsedInSeconds, _deltaInSeconds): void

Defined in: libs/scene/src/scene/scene_node.ts:1433

Update node state once per-camera

Parameters

_camera

Camera

Updates according to which camera

_elapsedInSeconds

number

Elapsed time from game start in seconds

_deltaInSeconds

number

Elapsed time since previous frame in seconds

Returns

void


reparent()

reparent(p?): SceneNode

Defined in: libs/scene/src/scene/scene_node.ts:1439

Removes this node from it's parent and add this node to another parent node if required

Parameters

p?

SceneNode

The new parent node that this node should be added to or null

Returns

SceneNode

self

Released under the MIT License.