Represents a scene in the engine. More...
#include <Scene.h>
Public Member Functions | |
Scene (const Scene &)=delete | |
Scene & | operator= (const Scene &)=delete |
void | SetCurrentCamera (Camera *cam) |
Sets the current 3D camera for the scene. | |
Camera * | GetCurrentCamera () const |
Gets the current camera for the scene. | |
void | SetCurrentCamera2D (Camera *cam) |
Sets the current 2D camera for the scene. | |
Camera * | GetCurrentCamera2D () const |
Gets the current 2D camera for the scene. | |
void | SetTerrain (const std::string &key) |
Sets the terrain for the scene using a key. | |
Terrain * | GetTerrain () const |
Sets the terrain for the scene using a pointer to a Terrain object. | |
Protected Member Functions | |
template<typename C> | |
void | SetCollisionSelf () |
Sets the collision self test for the specified collidable type. | |
template<typename C1, typename C2> | |
void | SetCollisionPair () |
Sets the collision pair test for the specified collidable types. | |
template<typename Type> | |
void | SetCollisionTerrain () |
Sets up collision detection between the specified type and the current terrain. | |
Private Member Functions | |
virtual void | Initialize ()=0 |
Initializes the scene. Defined by the user. | |
void | Update () |
Updates the scene. Specifically, the broker and managers other than draw. | |
void | Draw () |
Draws the scene. | |
virtual void | SceneEnd ()=0 |
Ends the scene. Defined by the user. | |
void | Register (Updatable *up) |
Registers an updatable GameObject. | |
void | Deregister (Updatable *up) |
Deregisters an updatable GameObject. | |
void | Register (Drawable *dr) |
Registers a drawable GameObject. | |
void | Deregister (Drawable *dr) |
Deregisters a drawable GameObject. | |
void | Register (Alarmable *al, AlarmableManager::ALARM_ID id, float t) |
Registers an alarmable GameObject. | |
void | Deregister (Alarmable *al, AlarmableManager::ALARM_ID id) |
Deregisters an alarmable GameObject. | |
void | Register (Inputable *in, AZUL_KEY k, EventType e) |
Registers an inputable GameObject. | |
void | Deregister (Inputable *in, AZUL_KEY k, EventType e) |
Deregisters an inputable GameObject. | |
void | Register (Inputable *in, AZUL_MOUSE m, EventType e) |
Registers an inputable GameObject for mouse events. | |
void | Deregister (Inputable *in, AZUL_MOUSE m, EventType e) |
Deregisters an inputable GameObject for mouse events. | |
void | SubmitCommand (CommandBase *cmd) |
Submits a command to the scene. | |
CollisionManager * | GetCollisionManager () |
Gets the collision manager for the scene. | |
Private Attributes | |
CameraManager * | cameraManager |
Pointer to the camera manager. | |
SceneRegistrationBroker * | registrationBroker |
Pointer to the scene registration broker. | |
UpdatableManager * | updatableManager |
Pointer to the updatable manager. | |
AlarmableManager * | alarmableManager |
Pointer to the alarmable manager. | |
KeyboardEventManager * | keyboardEventManager |
Pointer to the keyboard event manager. | |
DrawableManager * | drawableManager |
Pointer to the drawable manager. | |
CollisionManager * | collisionManager |
Pointer to the collision manager. | |
TerrainManager * | terrainManager |
Pointer to the current terrain. | |
Friends | |
class | SceneAttorney |
Represents a scene in the engine.
The Scene class is responsible for managing the GameObjects and their interactions within a scene. It provides methods to initialize, update, draw, and end the scene. It also manages the registration and deregistration of GameObjects for various systems such as updates, drawing, alarms, input, and collisions.
|
private |
Deregisters an alarmable GameObject.
al | Pointer to the alarmable GameObject. |
id | The alarm ID to deregister. |
|
private |
Deregisters a drawable GameObject.
dr | Pointer to the drawable GameObject. |
Deregisters an inputable GameObject.
in | Pointer to the inputable GameObject. |
k | The key to deregister. |
e | The event type to deregister. |
Deregisters an inputable GameObject for mouse events.
in | Pointer to the inputable GameObject. |
m | The mouse key to deregister. |
e | The event type to deregister. |
|
private |
Deregisters an updatable GameObject.
up | Pointer to the updatable GameObject. |
|
private |
Gets the collision manager for the scene.
Camera * Scene::GetCurrentCamera | ( | ) | const |
Gets the current camera for the scene.
Camera * Scene::GetCurrentCamera2D | ( | ) | const |
Gets the current 2D camera for the scene.
Terrain * Scene::GetTerrain | ( | ) | const |
|
privatepure virtual |
Initializes the scene. Defined by the user.
Implemented in SceneNull.
|
private |
Registers an alarmable GameObject.
al | Pointer to the alarmable GameObject. |
id | The alarm ID to register. |
t | The time duration for the alarm. |
|
private |
Registers a drawable GameObject.
dr | Pointer to the drawable GameObject. |
Registers an inputable GameObject.
in | Pointer to the inputable GameObject. |
k | The key to register. |
e | The event type to register. |
Registers an inputable GameObject for mouse events.
in | Pointer to the inputable GameObject. |
m | The mouse key to register. |
e | The event type to register. |
|
private |
Registers an updatable GameObject.
up | Pointer to the updatable GameObject. |
|
privatepure virtual |
Ends the scene. Defined by the user.
Implemented in SceneNull.
|
inlineprotected |
Sets the collision pair test for the specified collidable types.
C1 | The first collidable type. |
C2 | The second collidable type. |
|
inlineprotected |
Sets the collision self test for the specified collidable type.
C | The collidable type. |
|
inlineprotected |
Sets up collision detection between the specified type and the current terrain.
Type | The type of the collidable object. |
void Scene::SetCurrentCamera | ( | Camera * | cam | ) |
Sets the current 3D camera for the scene.
cam | Pointer to the camera. |
void Scene::SetCurrentCamera2D | ( | Camera * | cam | ) |
Sets the current 2D camera for the scene.
cam | Pointer to the 2D camera. |
void Scene::SetTerrain | ( | const std::string & | key | ) |
Sets the terrain for the scene using a key.
key | The key associated with the terrain in the TerrainManager. |
|
private |
Submits a command to the scene.
cmd | Pointer to the command. |