App::cMouseCamera class

Base classes

class ICamera
This class represents a camera in the game, capable of setting the view transformations used for rendering and receiving input events.
class IMessageListener
An interface that can receive messages sent through the app.
class IVirtual
A default interface that provides a virtual destructor, it should only be used internally.

Public functions

auto CalculateViewTransform(Transform& transform) -> void
auto Update(int deltaTime, cViewer* pViewer) -> void override
Event called every game loop, which should set all the transformations of the camera into the given Viewer.
auto OnKeyDown(int virtualKey, KeyModifiers modifiers) -> bool override
An event listener called every time a key is pressed while this camera is active.
auto OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool override
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 override
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 override
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 override
An event listener called every time the mouse wheel is moved while this camera is active.
auto Initialize() -> void override
auto func54h(Vector3& dst) -> void override
auto HandleMessage(uint32_t messageID, void* msg) -> bool override
Called every time a message is received.

Public variables

int mnRefCount
bool mCameraIsMayaStyle
bool mCameraExponential
bool mCameraPanSubjectPos
int field_14
int field_18
int field_1C
int field_20
App::PropertyList* mpPropList
float mCameraZoomScale
float mCameraWheelZoomScale
float mCameraTranslateScale
float mCameraExpPanScale
float mCameraRotateScale
Math::Point mLastMouseDown
Last position of the mouse after OnMouseDown()
bool field_44
float mCameraHeading
Camera rotation on Z axis, also known as 'yaw'.
float mCameraInitialHeading
int field_50
float field_54
float mCameraPitch
Camera rotation on X axis.
float mCameraInitialPitch
int field_60
float field_64
float mCameraRoll
Camera rotation on Y axis.
float field_6C
int field_70
float field_74
Math::Matrix3 mBaseRotation
Math::Vector3 mBaseOffset
Math::Vector3 field_A8
int field_B4
float field_B8
float mCameraFOV
float field_C0
int field_C4
float field_C8
float mCameraOffsetX
float mCameraOffsetY
float mCameraZoom
float mCameraInitialOffsetX
float mCameraInitialOffsetY
float mCameraInitialZoom
int field_E4
int field_E8
float field_EC
float field_F0
float field_F4
float field_F8
float field_FC
Math::Vector3 field_100
float mCameraMinZoomDistance
float mCameraMaxZoomDistance
float mCameraMinPitch
float mCameraMaxPitch
float mCameraNearClip
float mCameraFarClip

Function documentation

void App::cMouseCamera::Update(int deltaTime, cViewer* pViewer) override

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::cMouseCamera::OnKeyDown(int virtualKey, KeyModifiers modifiers) override

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::cMouseCamera::OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) override

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::cMouseCamera::OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) override

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::cMouseCamera::OnMouseMove(float mouseX, float mouseY, MouseState mouseState) override

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::cMouseCamera::OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) override

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.

bool App::cMouseCamera::HandleMessage(uint32_t messageID, void* msg) override

Called every time a message is received.

Parameters
messageID The ID of the message received.
msg The data of the message received, it might be nullptr.
Returns Whether the message was handled or not.

Only the messages with an ID this listener signed up for will call this event.