#include <CCamera.h>
Public Types | |
enum | CameraType { orthographic, perspective } |
Public Member Functions | |
CCamera () | |
CCamera (double rdEyePosX, double rdEyePosY, double rdEyePosZ, double rdRefPointX, double rdRefPointY, double rdRefPointZ, double rdViewUpX, double rdViewUpY, double rdViewUpZ, const CBoundingBox3D &cBBox=CBoundingBox3D(-1,-1,-1, 1, 1, 1), double rdVerAngle=30.0, int nVPHeight=480, double rdRatio=4.0/3.0, double rdNearPlane=0.0001, double rdFarPlane=10000.0, int nTimeStep=0) | |
CCamera (CP3D cEyePos, CP3D cRefPoint, CV3D cViewUp, const CBoundingBox3D &cBBox=CBoundingBox3D(-1,-1,-1, 1, 1, 1), double rdVerAngle=30.0, int nVPHeight=480, double rdRatio=4.0/3.0, double rdNearPlane=0.0001, double rdFarPlane=10000.0, CameraType ctype=perspective, int nTimeStep=0) | |
virtual | ~CCamera () |
void | rotate (double rdAngle, CV3D cAxis, bool global=true) |
void | translate (CV3D vDiff) |
void | setRefPoint (const CP3D &cRefPoint) |
const CP3D & | getRefPoint () const |
void | setEyePos (const CP3D &cEyePos) |
const CP3D & | getEyePos () const |
void | setViewUp (const CV3D &cViewUp) |
const CV3D & | getViewUp () const |
const CV3D & | getViewDir () const |
const CV3D & | getViewRight () const |
void | setHVAngle (double rdHorAngle, double rdVerAngle) |
void | getHVAngle (double &rdHorAngle, double &rdVerAngle) const |
void | setClipPlanes (double rdNearPlane, double rdFarPlane) |
void | getClipPlanes (double &rdNearPlane, double &rdFarPlane) const |
void | setBoundingBox (const CBoundingBox3D &cBBox, bool fViewAll=true) |
const CBoundingBox3D & | getBoundingBox () const |
void | setCameraType (CameraType type) |
CameraType | getCameraType () const |
void | getVVolume (double array[6]) const |
void | setVPRes (int nVPWidth, int nVPHeight) |
void | getVPRes (int &nVPWidth, int &nVPHeight) const |
void | getVPParams (CP3D &origin, CV3D &xStep, CV3D &yStep, int nXSize, int nYSize) const |
CMat4D | getModelview () const |
CMat4D | getOrtho () const |
CMat4D | getFrustrum () const |
CMat4D | getProjection () const |
CMat4D | getVPTrans (int nXSize, int nYSize) const |
void | setRatio (double rdRatio) |
double | getRatio () const |
void | setFovy (double rdFovy) |
double | getFovy () const |
void | setVPHeight (int nVPHeight) |
int | getVPHeight () const |
void | setTimeStep (int nTimeStep) |
int | getTimeStep () const |
void | viewAll () |
void | print () |
Private Attributes | |
CameraType | m_CameraType |
CBoundingBox3D | m_cBBox |
double | m_rdVerAngle |
double | m_rdRatio |
double | m_rdNearPlane |
double | m_rdFarPlane |
int | m_nVPHeight |
bool | m_fValidViewDir |
bool | m_fValidViewRight |
CP3D | m_cEyePos |
CP3D | m_cRefPoint |
CV3D | m_cViewUp |
CV3D | m_cViewDir |
CV3D | m_cViewRight |
int | m_nTimeStep |
This class implements a camera including functionality to modify the camera (rotate, move, etc.).
|
An enum type for the different types of projection. |
|
Default Constructor Eye is at (0,0,-1), center is at (0,0,0), and up is (0,1,0) and it has a boundingbox with the edge (-1,-1,-1) and (1,1,1). |
|
Constructor defining the view parameters.
|
|
The same as above but different types of parameters. |
|
Default Destructor. |
|
Returns the boundingbox. |
|
Returns the type of the camera (perspective or orthographic). |
|
Returns the distance between eye point and near/far clipplane. |
|
Get the current eye-point. |
|
This method returns the fovy angle. |
|
This method returns the glFrustrum() like matrix. |
|
Get horizontal and vertical angle of view of the camera.
|
|
This method gets you the modelview matrix of the current setup just like gluLookAt(). |
|
This method returns the glOrtho() like matrix. |
|
This method gets you the projection matrix of the current setup just like glFrustrum()/glOrtho(). |
|
This method returns the ratio. |
|
Get the current reference-point. |
|
Get the TimeStep of the Camera for a 4DVolume |
|
Get the current normalized viewdirection-vector. |
|
Get the current normalized viewright-vector. |
|
Get the current viewup-vector. |
|
This method returns the vertical resolution of the viewplane. |
|
Returns all parameters of a viewplane which is orthogonal to the viewdirection and with a dimension of nXSize x nYSize.
|
|
Returns the resolution of the viewplane in x- and y-direction. |
|
This method gets you the viewport transformation matrix of the current setup just like glViewport(). |
|
Returns the viewing volume. The values are in right order: |
|
Prints the camera parameter to standard output. |
|
Rotates the camera by an angle of 'rdAngle' degrees around an axis which goes through the reference point if 'global' is set to 'true'. If 'global' is 'false' the axis goes through the point of the eye position (for pitch, roll and yaw the camera). The direction of the axis is specified with 'cAxis'. This method changes the position of the camera if 'global' is 'true'. |
|
Sets the dimension of the scene as a boundingbox in world coordinates. |
|
Sets the type of the camera (perspective or orthographic). |
|
Set distance between eye point and near/far clipplane. |
|
Set a new eye-point. |
|
This method sets the fovy (i.e. vertical opening) angle of the camera. |
|
Set horizontal and vertical angle of view of the camera. The range for the angles goes from 0 to 180 degrees. Remember to adjust the resolution of the viewplane of the camera to the right ratio. If you don't do that you will get a distorted view volume by calling 'getVVolume()'.
|
|
This method sets the ratio between width and height (horizontal and vertical opening angle). |
|
Sets a new reference-point. |
|
Set the TimeStep in a 4DVolume |
|
Set a new viewup-vector. |
|
This method sets the vertical resolution of the viewplane. |
|
Set resolution of the viewplane in x- and y-direction. Remember to adjust the opening angles of the camera to the right ratio if don't want to get distorted view volume by calling 'getVVolume()'.
|
|
Move the camera relative to the current position by any distance in a 3-dimensional direction given by 'vDiff'.
|
|
Modifies the camera that the bounding box fits within the currently defined view frustum. |
|
Reads a vector from the given stream. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|