Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
|
#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 |
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.
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.
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.
frameLength | length 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.
zoom | change in the mouse wheel position |