Class: Scene
WebSG.Scene
Class representing the root of a scene graph.
Table of contents
Constructors
Methods
Constructors
constructor
• new Scene()
Methods
addNode
▸ addNode(node
): Scene
Adds a node to the scene.
Parameters
Name | Type | Description |
---|---|---|
node | Node | The node to be added to the scene. |
Returns
The instance of the Scene class (for method chaining).
Defined in
getNode
▸ getNode(index
): undefined
| Node
Gets a node from the scene by its index.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the node to be retrieved. |
Returns
undefined
| Node
The node at the given index, or undefined if no node exists at the index.
Defined in
nodes
▸ nodes(): NodeIterator
Returns an iterator for the nodes in the scene.
Returns
An iterator for the nodes in the scene.
Defined in
removeNode
▸ removeNode(node
): Scene
Removes a node from the scene.
Parameters
Name | Type | Description |
---|---|---|
node | Node | The node to be removed from the scene. |
Returns
The instance of the Scene class (for method chaining).