Logo Search packages:      
Sourcecode: qantenna version File versions  Download package

Camera Class Reference

#include <camera.h>

List of all members.


Detailed Description

Camera class

This class doesn't update the scene (updateGL in GLWidget), but contains camera-related information and applies OpenGL transformations

Definition at line 33 of file camera.h.


Public Member Functions

void applyPos ()
 Calls glTranslatef using -{x,y,z}Pos.
void applyRot ()
 Calls glRotatef using -{x,y,z}Rot.
 Camera (GLfloat x, GLfloat y, GLfloat z, GLfloat newNear, GLfloat newFar)
void commitSpherical ()
 Sets the cartesian coordinates given the current spherical coordinates.
GLfloat distFromOrigin ()
 |Position|
GLfloat getAlphaOrbit () const
GLfloat getBetaOrbit () const
GLfloat getFar () const
GLfloat getNear () const
GLfloat getRhoMax () const
GLfloat getRhoOrbit () const
bool getRun () const
GLfloat getStep () const
GLfloat getXMax () const
GLfloat getXPos () const
 Get.
GLfloat getXRot () const
GLfloat getYMax () const
GLfloat getYPos () const
GLfloat getYRot () const
GLfloat getZMax () const
GLfloat getZPos () const
GLfloat getZRot () const
void lookAt (GLfloat x=0, GLfloat y=0, GLfloat z=0)
 Mathematical implementation of gluLookAt (doesn't make OpenGL calls).
void move (GLfloat angle)
void orbit (GLfloat dAlpha, GLfloat dBeta)
 Sets spherical angles relative to current values (setOrbit assigns new values).
void perspective (GLfloat yFov=45, GLfloat ratio=4.0/3.0, GLfloat newNear=-1, GLfloat newFar=-1)
 Calls gluPerspective and optionally sets near and far.
void reset ()
 Resets values.
void setAlphaOrbit (GLfloat alpha)
void setBetaOrbit (GLfloat beta)
void setLimits (GLfloat newX, GLfloat newY, GLfloat newZ, GLfloat newRho)
void setOrbit (GLfloat newAlpha, GLfloat newBeta, GLfloat newRho)
void setPos (GLfloat x, GLfloat y, GLfloat z)
 Set.
void setRhoOrbit (GLfloat rho)
void setRot (GLfloat newXRot, GLfloat newYRot, GLfloat newZRot)
void setRun (bool newRun)
void setStep (GLfloat newSpeed)
void setXPos (GLfloat x)
void setXRot (GLfloat xAng)
void setYPos (GLfloat y)
void setYRot (GLfloat yAng)
void setZPos (GLfloat z)
void setZRot (GLfloat zAng)
void sphericalFromPosition ()
 Adjust spherical coords from the current cartesian coordinates.
void turn (GLfloat dx, GLfloat dy, GLfloat dz)
 Sets angles relative to current values (setRot assigns new values).

Static Public Member Functions

static int limit (int val, int min, int max)
static GLfloat limit (GLfloat val, GLfloat min, GLfloat max)
 Sets val between min and max.

Private Attributes

GLfloat alphaOrbit
GLfloat betaOrbit
GLfloat farEnd
GLfloat nearEnd
 Minimum and Maximum viewing distance.
GLfloat rhoMax
GLfloat rhoOrbit
bool run
GLfloat step
 Moving speed.
GLfloat xMax
 Position limits: [-max, max].
GLfloat xPos
GLfloat xRot
 Rotation.
GLfloat yMax
GLfloat yPos
 Camera elevation above the horizon.
GLfloat yRot
GLfloat zMax
GLfloat zPos
 Almost never used, but supported.
GLfloat zRot

Static Private Attributes

static const float runDelta = 0.04

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

Generated by  Doxygen 1.6.0   Back to index