Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
blowbox::SceneManager Class Reference

#include <scene_manager.h>

Public Member Functions

 SceneManager ()
 
 ~SceneManager ()
 
SharedPtr< EntityGetRootEntity ()
 
Vector< SharedPtr< Entity > > & GetEntities ()
 
const Vector< SharedPtr< Entity > > & GetEntities () const
 
void SetMainCamera (SharedPtr< Camera > camera)
 
SharedPtr< CameraGetMainCamera ()
 

Protected Member Functions

void Startup ()
 
void Update ()
 
void PostUpdate ()
 
void Shutdown ()
 
void AddEntity (SharedPtr< Entity > entity)
 
void RemoveEntity (SharedPtr< Entity > entity)
 

Private Attributes

SharedPtr< Entityroot_entity_
 
Vector< SharedPtr< Entity > > all_entities_
 
Queue< SharedPtr< Entity > > entities_to_be_added_
 
Queue< SharedPtr< Entity > > entities_to_be_removed_
 
SharedPtr< Cameramain_camera_
 

Friends

class BlowboxCore
 
class EntityFactory
 
class Entity
 

Detailed Description

Manages the entire scene.

Manages the entire scene. It keeps a list of all Entity instances and updates them accordingly. It also keeps track of the root of the scene graph. It also stores stuff like all the lights in the scene and it also keeps track of the main Camera.

Constructor & Destructor Documentation

blowbox::SceneManager::SceneManager ( )

Constructs the SceneManager.

Remarks
Should only be constructed by the BlowboxCore. Do not construct yourself.
blowbox::SceneManager::~SceneManager ( )

Destructs the SceneManager.

Member Function Documentation

void blowbox::SceneManager::AddEntity ( SharedPtr< Entity entity)
protected

Adds an Entity and all of its children to the scene.

Parameters
[in]entityThe entity to add to the scene.
Vector< SharedPtr< Entity > > & blowbox::SceneManager::GetEntities ( )

Returns all the Entity instances in the scene.

Returns
All the Entity instances in the scene.
const Vector< SharedPtr< Entity > > & blowbox::SceneManager::GetEntities ( ) const

Const version of SceneManager::GetEntities().

Returns
All the Entity instances in the scene.
SharedPtr< Camera > blowbox::SceneManager::GetMainCamera ( )
Returns
The main Camera of this scene.
SharedPtr< Entity > blowbox::SceneManager::GetRootEntity ( )

Returns the root Entity.

Returns
The root Entity in the scene.
void blowbox::SceneManager::PostUpdate ( )
protected

PostUpdates the entire scene.

void blowbox::SceneManager::RemoveEntity ( SharedPtr< Entity entity)
protected

Removes an Entity and all of its children from the scene.

Parameters
[in]entityThe entity to remove from the scene.
void blowbox::SceneManager::SetMainCamera ( SharedPtr< Camera camera)

Sets the main Camera of this scene, i.e. the camera from where the scene is rendered.

Parameters
[in]cameraThe camera that should act as the main Camera for this scene.
void blowbox::SceneManager::Shutdown ( )
protected

Shuts down the entire scene.

void blowbox::SceneManager::Startup ( )
protected

Starts up the entire scene.

void blowbox::SceneManager::Update ( )
protected

Updates the entire scene.

Member Data Documentation

Vector<SharedPtr<Entity> > blowbox::SceneManager::all_entities_
private

All Entity instances in the scene.

Queue<SharedPtr<Entity> > blowbox::SceneManager::entities_to_be_added_
private

Queue for Entity instances that need to be added to the scene.

Queue<SharedPtr<Entity> > blowbox::SceneManager::entities_to_be_removed_
private

Queue for Entity instances that need to be removed from the scene.

SharedPtr<Camera> blowbox::SceneManager::main_camera_
private

Stores the main camera for the scene.

SharedPtr<Entity> blowbox::SceneManager::root_entity_
private

The root Entity in the scene.


The documentation for this class was generated from the following files: