Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
Camera Class Reference

#include <Camera.hpp>

Public Member Functions

TransformationgetTransform ()
 
bool const sideWayActive ()
 
void sideWayActive (bool const value)
 
 Camera (Application *app)
 
mat4 const & getView ()
 
bool const hasViewChanged ()
 
int const getMouseBorder ()
 
void update (double time, double timeDelta)
 
void onKeyStateChanged (int key, bool pressed)
 

Private Attributes

Transformation m_transformation
 
Applicationm_app
 
bool m_hasViewChanged
 
int m_mouseBorder
 
bool m_cameraSideWayActive
 

Detailed Description

Camera is used to handle the scenes camera.

Definition at line 10 of file Camera.hpp.

Constructor & Destructor Documentation

Camera ( Application app)

Constructs a Camera-object.

Parameters
appThe global application.

Definition at line 3 of file Camera.cpp.

Member Function Documentation

int const getMouseBorder ( )
inline

Accessor to the mouse-border-size in pixel.

Returns
The mouse-border size in pixel.

Definition at line 56 of file Camera.hpp.

Transformation& getTransform ( )
inline

Wheter the mouse-border is active or not

Accessor to the local transformation.

Returns
Reference to the local transformation.

Definition at line 23 of file Camera.hpp.

mat4 const& getView ( )
inline

Accessor to the view-matrix.

Returns
The view-matrix.

Definition at line 46 of file Camera.hpp.

bool const hasViewChanged ( )
inline

Accessor to wheter the view has changed or not.

Returns
Wheter the view has changed or not.

Definition at line 51 of file Camera.hpp.

void onKeyStateChanged ( int  key,
bool  pressed 
)

Callback of key-state-changes. Toggles mouse-border-active on SCROLL-key.

Parameters
keyThe key
pressedWheter the key was pressed or released.

Definition at line 49 of file Camera.cpp.

bool const sideWayActive ( )
inline

Accessor to wheter the mouse-border is active or not.

Returns
Wheter the mouse-border is active or not.

Definition at line 28 of file Camera.hpp.

void sideWayActive ( bool const  value)
inline

Accessor to wheter the mouse-border is active or not.

Parameters
valueWheter the mouse-border is active or not.

Definition at line 33 of file Camera.hpp.

void update ( double  time,
double  timeDelta 
)

Updates the camera-object.

Moves it according to WASD-keys pressed. Moves it according to mouse-border-hovering.

Parameters
timeThe absolute frame time.
timeDeltaThe time since the last frame.

Definition at line 11 of file Camera.cpp.

Member Data Documentation

Application* m_app
private

The local transformation of the cammera (inverse matrix is view-matrix)

Definition at line 13 of file Camera.hpp.

bool m_cameraSideWayActive
private

The size of the mouse-border in pixel

Definition at line 16 of file Camera.hpp.

bool m_hasViewChanged
private

The global application

Definition at line 14 of file Camera.hpp.

int m_mouseBorder
private

Wheter the view has changed since the last frame

Definition at line 15 of file Camera.hpp.

Transformation m_transformation
private

Definition at line 12 of file Camera.hpp.


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