-
Notifications
You must be signed in to change notification settings - Fork 0
Scene
Description of the Scene
manager.
This describes the whole scene. It contains Entity
s, each with Component
s attached. A scene can be saved into an XML file, or loaded from one. Saving an XML scene means to save all the current states of all the Entity
s and Component
s in the scene. Loading an XML scene destroys the current scene and then creates a new one.
When creating a Scene
a ComponentFactory
must be specified. The ComponentFactory
is the one in charge of creating a new Component
of the corresponding type when reading the XML file. A ComponentFactory
is an abstract class. The DefaultComponentFactory
can be used; it is able to create RenderableMesh
, RigidBody
, Light
and Camera
. If new Component
types are added, then a new ComponentFactory
must be created which is able to recognize the new Component
from the XML scene.
It does nothing, it exists only for standardization purposes. All the Entity
s and Components
are created by loading an XML scene.
It only removes all children from the root node. This is a recursive process so all Entity
s in the scene get deleted. Whenever an Entity
is deleted it deletes all its Component
s which get unregistered from their respective managers at destruction.