Working with Scene
A scene is a 3d world populated with Node.
Nodes are container objects taking meaning through the use of components.
Node & Components
Calling Scene.CreateNode returns an empty node with no component attached. In this state, it serves little to no purpose as it will not be drawn or implement any concrete behavior.
In order to be drawn a node must provide two essential informations:
- A transformation: This is done using Node.SetTransform to assign it a Transform component.
- A visual representation: This is done using Node.SetObject to assign it an Object component.
The same components can be assigned to multiple nodes.
Assign the Camera component to nodes to turn them into observers into the scene.
For more information on how this integrates with drawing a scene, see Drawing a Scene.
Assign the Light component to nodes to turn them into light sources.
Scenes can be instantiated in one another. This is useful to create multiple complex parts with their own animations or scripts from which you compose a larger world.
Note: Instances are automatically setup when loading a scene.
Managing Scene Resources
The scene has strong ownership of the resources it manages.