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.
node.position.set(0, 1, 0);
Setting the position, rotation, or scale of a scene node affects child components.
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.
The node name.
The scene node position. You can call methods on this object to set its values. See https://threejs.org/docs/#api/en/math/Vector3
The scene node rotation. You can call methods on this object to set its values. See https://threejs.org/docs/#api/en/math/Quaternion
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
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.
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.
The newly created component.
Returns in iterator iterating over all the components contained by this node.
Transitions the node to Operating if it is in the Initializing state. Calling this function has no effect if the node is already Operating.
Transitions the node to Destroyed state if it is in any state. Calling this function has no effect if the node is already Destroyed.