Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
 All Classes Namespaces Functions Pages
Public Member Functions | List of all members
CameraController Class Reference

#include <CameraController.h>

Public Member Functions

 CameraController (Camera *camera, InputHandler *inputHandler)
 
void startOrbit ()
 
void stopOrbit ()
 
void zoomBy (int zoom)
 
void update (double frameLength)
 
void setPivot (const glm::vec3 &pivot)
 
bool isActive () const
 

Detailed Description

Interprets mouse movements to orbit, zoom and and change the target of a Camera object. While the CameraController is in idle mode, the update() method will have no effect. While in orbit mode, the update() method will query the inputHandler for mouse movements and orbit around the selected pivot point accordingly.

Constructor & Destructor Documentation

CameraController::CameraController ( Camera camera,
InputHandler inputHandler 
)

Initializes a CameraController object that will operate on the provided Camera and will query the mouse position from the provided InputHandler.

Member Function Documentation

bool CameraController::isActive ( ) const

Returns true iff not in idle mode.

void CameraController::setPivot ( const glm::vec3 &  pivot)

Sets the point around which the camera orbits and zooms.

void CameraController::startOrbit ( )

Activates orbit mode.

void CameraController::stopOrbit ( )

Goes to idle mode.

void CameraController::update ( double  frameLength)

Should be called every frame. While the CameraController is in idle mode, the update() method will have no effect. While in orbit mode, the update() method will query the inputHandler for mouse movements and orbit around the selected pivot point accordingly.

Parameters
frameLengthlength of the last from in seconds.
void CameraController::zoomBy ( int  zoom)

Move the camera a little closer to the pivot if zoom is positive or away from the pivot if zoom is negative.

Parameters
zoomchange in the mouse wheel position

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