Ocular Engine
Ocular::Core::CameraManager Class Reference

#include <CameraManager.hpp>

Public Member Functions

void initialize ()
 
CameragetMainCamera () const
 
CameragetActiveCamera () const
 
void setMainCamera (Camera *camera)
 
void setActiveCamera (Camera *camera)
 
std::vector< Camera * > const & getCameras () const
 

Protected Member Functions

void addCamera (Camera *camera)
 
void removeCamera (Camera *camera)
 

Protected Attributes

std::vector< Camera * > m_Cameras
 
Cameram_MainCamera
 
Cameram_ActiveCamera
 
Graphics::UniformBufferm_UniformBuffer
 
Graphics::UniformPerCamera m_UniformPerCamera
 

Friends

class Camera
 

Detailed Description

Responsible for providing quick access to all Camera instances. Also handles Camera rendering and the setting of UniformBuffer values.

Member Function Documentation

void Ocular::Core::CameraManager::addCamera ( Camera camera)
protected

Adds a camera to the internal tracking container. This is called automatically each time that a new camera is created. If it is the only camera tracked, it will be set as the main camera.

Camera * Ocular::Core::CameraManager::getActiveCamera ( ) const

Returns a pointer to the camera that is actively rendering.

Returns
Pointer to the active camera. May return NULL if no cameras exist or none are current rendering.
std::vector< Camera * > const & Ocular::Core::CameraManager::getCameras ( ) const
Returns
A reference to a vector of all cameras that currently exist. This includes cameras that may not be currently active or in use.
Camera * Ocular::Core::CameraManager::getMainCamera ( ) const

Returns a pointer to the main camera. By default, this is the camera that renders to the primary display's backbuffer.

Returns
Pointer to the main camera. May return NULL if no cameras exist
void Ocular::Core::CameraManager::removeCamera ( Camera camera)
protected

Removes a camera from the internal tracking container. This is called automatically each time that a camera is destroyed. If the camera being removed is the main camera, then a new main camera is set (by default, whichever camera no inhabits index 0 of the container). If the camera is marked as the active camera, then m_ActiveCamera is set to NULL.

void Ocular::Core::CameraManager::setMainCamera ( Camera camera)

Sets the main camera.

Note
As the main camera typically has the connotation of being the camera rendering to the primary window's backbuffer, care should be taken when manually setting the main camera.
Parameters
[in]camera/

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