Hierarchy
- INode
Index
Properties
Methods
Properties
Readonly id
A read-only unique id used to reference this node in a path binding. This id is autogenerated unless it is specifed and created via the Scene.Object.
name
The node name.
Readonly position
The scene node position. You can call methods on this object to set its values. See https://threejs.org/docs/#api/en/math/Vector3
Readonly quaternion
The scene node rotation. You can call methods on this object to set its values. See https://threejs.org/docs/#api/en/math/Quaternion
Readonly scale
The scene node scale vector. You can call methods on this object to set its values. See https://threejs.org/docs/#api/en/math/Vector3
Methods
addComponent
-
Instantiates a component and adds it to the nodes internal component list. This function does nothing if the node is in the Operating or Destroyed state.
Type parameters
Parameters
-
name: T
The registered component name.
-
Optional initialInputs: SceneComponentOptions[T]
initial key-value pairs that will be applied to the component before onInit is called. If the keys do not match the components inputs, they are ignored.
-
Optional id: undefined | string
an optional id for this component, if not specified an id will be computed for the component.
Returns Scene.IComponent
The newly created component.
-
componentIterator
-
Returns in iterator iterating over all the components contained by this node.
Returns IterableIterator<Scene.IComponent>
start
-
Transitions the node to Operating if it is in the Initializing state. Calling this function has no effect if the node is already Operating.
Returns void
stop
-
Transitions the node to Destroyed state if it is in any state. Calling this function has no effect if the node is already Destroyed.
Returns void
Scene Node
A scene node is an object with a 3D transform: position, rotation, and scale. It can contain a collection of components and manages their life cycle.
A scene node has the following states:
Initializing - after construction but before start has been called
Updating - after start has been called but before stop has been called
Destroyed - after stop has been called
Components can only be added during the Initializing state. A scene node cannot be restarted.
sdk.Scene.createNode().then(function(node) { node.addComponent('mp.gltfLoader', { url: 'http://www.someModelSite.com/rabbit.gltf' }); node.position.set(0, 1, 0); node.start(); });
Setting the position, rotation, or scale of a scene node affects child components.