CGFLib - A library for Computer Graphics @ FEUP
 All Classes Files Functions Variables Pages
Public Member Functions | Protected Types | Protected Attributes | List of all members
CGFcamera Class Reference

This class can be used to implement a point of view for the application. More...

#include <CGFcamera.h>

Public Member Functions

 CGFcamera ()
 Base constructor.
 
virtual ~CGFcamera ()
 Base destructor.
 
virtual void applyView ()
 Applies View transformation (typically used in the beginning of a scene render, in CGFscene::display() )
 
virtual void updateProjectionMatrix (int width, int height)
 Updates the projection matrix. Typically invoked after viewport change, e.g. as a result of a window reshape that triggers CGFapplication::reshape()
 
virtual void setExamineMode ()
 Sets the camera to move in Examine mode i.e., to rotate around a fixed point in front of it.
 
virtual void setWalkMode ()
 Sets the camera to move in Walk mode i.e., to rotate around itself.
 
virtual void setX (float value)
 Sets camera X coordinate.
 
virtual void setY (float value)
 Sets camera Y coordinate.
 
virtual void setZ (float value)
 Sets camera Z coordinate.
 
Utility functions for relative/incremental camera movement
virtual bool rotateTo (int axis, float angle, float increment=0.5f)
 Rotates the camera around axis by increment degrees, unless it has reached angle degrees. Useful for stepping a rotation in an animation.
 
virtual bool rotate (int axis, float angle)
 Rotates the camera around axis by angle degrees.
 
virtual bool setRotation (int axis, float angle)
 Sets the rotation around axis to be angle degrees.
 
virtual bool moveTo (int axis, float value, float increment=0.5f)
 Moves the camera along axis by increment units, unless value has been reached.
 
virtual bool translate (int axis, float value)
 Moves the camera along axis by value units.
 

Protected Types

enum  CAMERA_MODE { EXAMINE_MODE, WALK_MODE, TARGET_MODE }
 

Protected Attributes

float position [3]
 
float target [3]
 
float rotation [3]
 
CAMERA_MODE mode
 

Detailed Description

This class can be used to implement a point of view for the application.