App::ICamera class

This class represents a camera in the game, capable of setting the view transformations used for rendering and receiving input events.

The active camera receives user input (mouse and keyboard) before the active game mode. Every game loop, The ICamera::Update() method is called on the active camera passing the active Viewer as the parameter, where the view transformations must be set. To have multiple cameras apart from the active one, the input events and update methods can be called manually.

The class DefaultCamera provides default implementations for most methods in an ICamera, allowing you to create one without much trouble.

Base classes

class Object
This class represents a basic reference counted object.

Derived classes

class DefaultCamera
Defines a default implementation of ICamera.
class Editors::EditorCamera

Public static variables

static const uint32_t TYPE

Public functions

auto OnAttach(ICameraManager* pManager) -> bool pure virtual
Event called when the camera is added to the camera manager.
auto OnDeattach() -> bool pure virtual
Event called when the camera is no longer in the camera manager.
void OnEnter() pure virtual
Event called when the camera is set as the active camera.
void OnExit() pure virtual
Event called when the camera is no longer the active camera.
void Update(int deltaTime, cViewer* pViewer) pure virtual
Event called every game loop, which should set all the transformations of the camera into the given Viewer.
void func24h(bool) pure virtual
auto OnKeyDown(int virtualKey, KeyModifiers modifiers) -> bool pure virtual
An event listener called every time a key is pressed while this camera is active.
auto OnKeyUp(int virtualKey, KeyModifiers modifiers) -> bool pure virtual
An event listener called every time a key is released while this camera is active.
auto OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool pure virtual
An event listener called every time a mouse key is pressed while this camera is active.
auto OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool pure virtual
An event listener called every time a mouse key is released while this camera is active.
auto OnMouseMove(float mouseX, float mouseY, MouseState mouseState) -> bool pure virtual
An event listener called every time the mouse is moved while this camera is active.
auto OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) -> bool pure virtual
An event listener called every time the mouse wheel is moved while this camera is active.
auto func40h(int) -> bool pure virtual
auto func44h(int) -> bool pure virtual
auto func48h(int) -> bool pure virtual
auto GetPropertyList() -> PropertyList* pure virtual
Gets the property list from which this camera was generated.
void Initialize() pure virtual
void func54h(Vector3& dst) pure virtual

Function documentation

void App::ICamera::Update(int deltaTime, cViewer* pViewer) pure virtual

Event called every game loop, which should set all the transformations of the camera into the given Viewer.

Parameters
deltaTime The time ellapsed since the last call, in milliseconds.
pViewer The Viewer instance where the transformations must be set.

bool App::ICamera::OnKeyDown(int virtualKey, KeyModifiers modifiers) pure virtual

An event listener called every time a key is pressed while this camera is active.

Parameters
virtualKey The VK code of the key.
modifiers The modifiers (Ctrl, Alt and Shift) currently being pressed.
Returns Whether the event was handled or not.

bool App::ICamera::OnKeyUp(int virtualKey, KeyModifiers modifiers) pure virtual

An event listener called every time a key is released while this camera is active.

Parameters
virtualKey The VK code of the key.
modifiers The modifiers (Ctrl, Alt and Shift) currently being pressed.
Returns Whether the event was handled or not.

bool App::ICamera::OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) pure virtual

An event listener called every time a mouse key is pressed while this camera is active.

Parameters
mouseButton The button that was pressed.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool App::ICamera::OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) pure virtual

An event listener called every time a mouse key is released while this camera is active.

Parameters
mouseButton The button that was released.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool App::ICamera::OnMouseMove(float mouseX, float mouseY, MouseState mouseState) pure virtual

An event listener called every time the mouse is moved while this camera is active.

Parameters
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool App::ICamera::OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) pure virtual

An event listener called every time the mouse wheel is moved while this camera is active.

Parameters
wheelDelta The amount of units the wheel moved. This is a multiple of UTFWin::kMouseWheelDelta.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.