#include <vuPerspectiveCamera.h>
Inheritance diagram for vuPerspectiveCamera:
Public Member Functions | |
vuCameraType | getType (void) |
vuPerspectiveCamera () | |
Default constructor - set initial values. | |
vuPerspectiveCamera (const vuPerspectiveCamera &c) | |
Copy constructor. | |
virtual | ~vuPerspectiveCamera () |
Destructor. | |
float | getFOV (void) |
Get the field of view. | |
void | setFOV (const float fov) |
Set the field of view. | |
float | getAspect (void) |
Get the aspect ratio. | |
void | setAspect (const float aspect) |
Set the aspect ratio. | |
vuVector | getTopLeft (void) |
void | setTopLeft (vuVector &temp) |
thrown in for consistency, calls init () and ignores temp; | |
vuVector | getXStep (void) |
void | setXStep (vuVector &temp) |
vuVector | getYStep (void) |
void | setYStep (vuVector &temp) |
void | init (void) |
Initialize the camera for the current position. | |
void | glInit () |
setup perpective projection for OpenGL according to the settings of the camera | |
vuRay | getRay (float xpixel, float ypixel) |
Get the ray through pixel (xpixel, ypixel). | |
virtual void | TakeSnapShot () |
this will save the current state of the camera to the open file that is being recorded to | |
virtual void | TakeSnapShot (char *Shot) |
This will save the current state of the camera to the string to Shot Shot. | |
void | TakeSnapShotPersp (char *Shot) |
this will save a persective snapshot, ie, the members of perspective camera that are not data members of a basic camera. | |
virtual int | RestoreShot (char *Shot) |
This will take the snapshot contained in Shot and will restore it to the screen. | |
int | RestoreShotPersp (char *Shot) |
this will restore the extra members associated with the perspective camera over the basic camera | |
virtual int | RestoreNextShot () |
This Will take the next line from the loaded file and set this camera equal to the state preserved therein. | |
virtual int | RestorePreviousShot () |
This Will take the Previous line from the loaded file and set this camera equal to the state preserved therein. | |
virtual char * | get_id () |
This will return a ptr to a copy of the appropriate header for a perspective camera with this type of data to prevent situations like a parallel camera attempting to load a perspective camera's data, which inherently cannot work. | |
virtual bool | verify_id (char *id) |
This will return whether or not id equals get_id () (ie, whether or not id is an appropriate file header for a perspective camera). | |
virtual vuPerspectiveCamera & | operator= (const vuPerspectiveCamera &rhs) |
Assignment operator. | |
virtual vuCamera * | create_new () |
This will create a new perspective camera and return a pointer to it cast as a vuCamera pointer. | |
virtual vuCamera * | operator * (float t) |
Multiplication Operator,. | |
virtual vuCamera * | operator *= (float t) |
Multiplication/Assignment operator,. | |
virtual vuCamera * | operator+ (vuPerspectiveCamera &rhs) |
Addition Operator,. | |
virtual vuCamera * | operator+= (vuPerspectiveCamera &rhs) |
Addition/Assignment Operator,. | |
virtual vuCamera * | operator+ (vuPerspectiveCamera *rhs) |
Addition Operator,. | |
virtual vuCamera * | operator+= (vuPerspectiveCamera *rhs) |
Addition/Assignment Operator,. | |
virtual vuPerspectiveCamera * | operator= (vuPerspectiveCamera *rhs) |
Assignment operator,. | |
virtual void | set_defaults () |
This function will restore this camera to it's default value. | |
virtual vuCamera * | set_equal_to_interp (vuCamera *cam1, vuCamera *cam2, float t1, float t2) |
Protected Attributes | |
float | m_FOV |
Field of view. | |
float | m_Aspect |
Aspect ratio. | |
vuVector | m_TopLeft |
Top left of viewing frustum. | |
vuVector | m_XStep |
Distance between adjacent x pixels. | |
vuVector | m_YStep |
Distance between adjacent y pixels. | |
Friends | |
ostream & | operator<< (ostream &out, vuPerspectiveCamera &cam) |
this will store the data of camera to a string and pass that string to the streeam 'in' | |
istream & | operator>> (istream &in, vuPerspectiveCamera &cam) |
This will write restore cam to the state that is passed in by in. | |
vuCamera * | operator * (float t, vuPerspectiveCamera &cam) |
Multiplication operator,. |
This class extends the standard vuCamera with features for a creating vuRay instances for a specific position.
Definition at line 43 of file vuPerspectiveCamera.h.
|
Default constructor - set initial values.
Definition at line 23 of file vuPerspectiveCamera.cpp. |
|
Copy constructor. This will copy all of the data related to the state of the camera for safety, if camera c is recording to or has any files loaded, these files will not carry into the newly created camera Definition at line 53 of file vuPerspectiveCamera.cpp. References m_Aspect, m_FOV, vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_RightVector, m_TopLeft, vuCamera::m_UpVector, vuCamera::m_Width, m_XStep, and m_YStep. |
|
Destructor.
Definition at line 75 of file vuPerspectiveCamera.cpp. References vuCamera::clear_lines(). |
Here is the call graph for this function:
|
This will create a new perspective camera and return a pointer to it cast as a vuCamera pointer. This is so that I can use the camera in vuKeyFramerDialog without concern as to what type of camera this points to (ie, it's easier to program for later). Reimplemented from vuCamera. Definition at line 423 of file vuPerspectiveCamera.cpp. Referenced by operator *(), operator *(), and operator+(). |
|
This will return a ptr to a copy of the appropriate header for a perspective camera with this type of data to prevent situations like a parallel camera attempting to load a perspective camera's data, which inherently cannot work.
Reimplemented from vuCamera. Definition at line 385 of file vuPerspectiveCamera.cpp. Referenced by verify_id(). |
|
Get the aspect ratio.
Definition at line 95 of file vuPerspectiveCamera.cpp. Referenced by operator+(), and operator+=(). |
|
Get the field of view.
Definition at line 81 of file vuPerspectiveCamera.cpp. Referenced by operator+(), and operator+=(). |
|
Get the ray through pixel (xpixel, ypixel).
Reimplemented from vuCamera. Definition at line 193 of file vuPerspectiveCamera.cpp. References vuRay::m_Direction, vuRay::m_Position, m_TopLeft, m_XStep, and m_YStep. |
|
Definition at line 108 of file vuPerspectiveCamera.cpp. |
|
Reimplemented from vuCamera. Definition at line 46 of file vuPerspectiveCamera.h. |
|
Definition at line 122 of file vuPerspectiveCamera.cpp. |
|
Definition at line 136 of file vuPerspectiveCamera.cpp. |
|
setup perpective projection for OpenGL according to the settings of the camera
Reimplemented from vuCamera. Definition at line 228 of file vuPerspectiveCamera.cpp. |
|
Initialize the camera for the current position. This function has to be called everytime the position or orientation of the camera changes. We may can integrate this into wrapped setPosition... functions. Reimplemented from vuCamera. Definition at line 154 of file vuPerspectiveCamera.cpp. References vuVector::cross, m_FOV, M_PI, m_TopLeft, m_XStep, m_YStep, vuVector::makeUnit(), and vuVector::norm(). Referenced by operator *(), operator *(), operator *=(), operator+(), operator+=(), setTopLeft(), setXStep(), and setYStep(). |
Here is the call graph for this function:
|
Multiplication Operator,. This will multiply each component of this camera by t and will create a new camera to store the result and will return a pointer to that camera. Reimplemented from vuCamera. Definition at line 433 of file vuPerspectiveCamera.cpp. References create_new(), init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), and temp_cam_vpc_cgs__. |
Here is the call graph for this function:
|
Multiplication/Assignment operator,. This will multiply each component of this camera by t and return a pointer to this camera. Reimplemented from vuCamera. Definition at line 458 of file vuPerspectiveCamera.cpp. References init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), and vuCamera::setWidth(). |
Here is the call graph for this function:
|
Addition Operator,. This will add each component of the camera pointed to by rhs with the component of this. It will then return a pointer to the camera storing the result (cast as a vuCamera pointer). Note that this method will create the camera which will store the result. Definition at line 558 of file vuPerspectiveCamera.cpp. References create_new(), getAspect(), getFOV(), vuCamera::getHeight(), vuCamera::getLookAtVector(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), and temp_cam_vpc_cgs__. |
Here is the call graph for this function:
|
Addition Operator,. This will add each component of this camera to each component of rhs and store the result in a camera that it creates. It will then return a pointer to the camera which it created in order to store the result. Definition at line 510 of file vuPerspectiveCamera.cpp. References create_new(), getAspect(), getFOV(), vuCamera::getHeight(), vuCamera::getLookAtVector(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), and temp_cam_vpc_cgs__. |
Here is the call graph for this function:
|
Addition/Assignment Operator,. This will perform a componentwise addition of the camera pointed to by rhs and return a pointer to this camera. Definition at line 583 of file vuPerspectiveCamera.cpp. References getAspect(), getFOV(), vuCamera::getHeight(), vuCamera::getLookAtVector(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), and vuCamera::setWidth(). |
Here is the call graph for this function:
|
Addition/Assignment Operator,. This will add each component of rhs to this camera and will then return a pointer to this camera. Definition at line 535 of file vuPerspectiveCamera.cpp. References getAspect(), getFOV(), vuCamera::getHeight(), vuCamera::getLookAtVector(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), init(), m_Aspect, m_FOV, setAspect(), setFOV(), vuCamera::setHeight(), vuCamera::setLookAtVector(), vuCamera::setPosition(), vuCamera::setUpVector(), and vuCamera::setWidth(). |
Here is the call graph for this function:
|
Assignment operator,. This will assign each component of the camera pointed to by rhs to this camera. Definition at line 606 of file vuPerspectiveCamera.cpp. References m_Aspect, m_FOV, vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_RightVector, m_TopLeft, vuCamera::m_UpVector, vuCamera::m_Width, m_XStep, and m_YStep. |
|
Assignment operator.
Definition at line 205 of file vuPerspectiveCamera.cpp. References m_Aspect, m_FOV, vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_RightVector, m_TopLeft, vuCamera::m_UpVector, vuCamera::m_Width, m_XStep, and m_YStep. |
|
This Will take the next line from the loaded file and set this camera equal to the state preserved therein. Please refer to the comments surrounding bool vuCamera::load (char* filename); for a complete description Please refer to virtual int vuCamera::RestoreNextShot () for a complete description. Reimplemented from vuCamera. Definition at line 347 of file vuPerspectiveCamera.cpp. References get_next_comma(), vuCamera::IsNextAvailable(), vuCamera::RestoreShotBasic(), and RestoreShotPersp(). |
Here is the call graph for this function:
|
This Will take the Previous line from the loaded file and set this camera equal to the state preserved therein. Please refer to the comments surrounding bool vuCamera::load (char* filename); for a complete description Please refer to virtual int vuCamera::RestorePreviousShot () for a complete description. Reimplemented from vuCamera. Definition at line 366 of file vuPerspectiveCamera.cpp. References get_next_comma(), vuCamera::IsPreviousAvailable(), vuCamera::RestoreShotBasic(), and RestoreShotPersp(). |
Here is the call graph for this function:
|
This will take the snapshot contained in Shot and will restore it to the screen.
Reimplemented from vuCamera. Definition at line 297 of file vuPerspectiveCamera.cpp. References get_next_comma(), vuCamera::RestoreShotBasic(), and RestoreShotPersp(). Referenced by operator>>(). |
Here is the call graph for this function:
|
this will restore the extra members associated with the perspective camera over the basic camera
Definition at line 307 of file vuPerspectiveCamera.cpp. References clear_blanks(), get_next_close(), get_next_comma(), get_next_open(), vuVector::load(), m_Aspect, m_FOV, m_TopLeft, m_XStep, and m_YStep. Referenced by RestoreNextShot(), RestorePreviousShot(), and RestoreShot(). |
Here is the call graph for this function:
|
This function will restore this camera to it's default value.
Reimplemented from vuCamera. Definition at line 37 of file vuPerspectiveCamera.cpp. |
|
Reimplemented from vuCamera. Definition at line 629 of file vuPerspectiveCamera.cpp. References m_Aspect, m_FOV, vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_RightVector, m_TopLeft, vuCamera::m_UpVector, vuCamera::m_Width, m_XStep, and m_YStep. |
|
Set the aspect ratio.
Definition at line 101 of file vuPerspectiveCamera.cpp. References m_Aspect. Referenced by operator *(), operator *(), operator *=(), operator+(), operator+=(), vu1512113::setImageSize(), vu1112113::setImageSize(), and vu1512122::setImageSize(). |
|
Set the field of view.
Definition at line 87 of file vuPerspectiveCamera.cpp. References m_FOV. Referenced by operator *(), operator *(), operator *=(), operator+(), and operator+=(). |
|
thrown in for consistency, calls init () and ignores temp;
Definition at line 114 of file vuPerspectiveCamera.cpp. References init(). |
Here is the call graph for this function:
|
Definition at line 128 of file vuPerspectiveCamera.cpp. References init(). |
Here is the call graph for this function:
|
Definition at line 142 of file vuPerspectiveCamera.cpp. References init(). |
Here is the call graph for this function:
|
This will save the current state of the camera to the string to Shot Shot.
Reimplemented from vuCamera. Definition at line 249 of file vuPerspectiveCamera.cpp. References vuCamera::TakeSnapShotBasic(), and TakeSnapShotPersp(). |
Here is the call graph for this function:
|
this will save the current state of the camera to the open file that is being recorded to
Reimplemented from vuCamera. Definition at line 235 of file vuPerspectiveCamera.cpp. Referenced by operator<<(). |
|
this will save a persective snapshot, ie, the members of perspective camera that are not data members of a basic camera.
Definition at line 262 of file vuPerspectiveCamera.cpp. References m_Aspect, m_FOV, m_TopLeft, m_XStep, m_YStep, and vuVector::save(). Referenced by TakeSnapShot(). |
Here is the call graph for this function:
|
This will return whether or not id equals get_id () (ie, whether or not id is an appropriate file header for a perspective camera). NB, must be overridden in derived classes if any data is added or changed
Reimplemented from vuCamera. Definition at line 391 of file vuPerspectiveCamera.cpp. References get_id(). |
Here is the call graph for this function:
|
Multiplication operator,. This will multiply each component of cam by t and create a new camera to store the result in. It will return a pointer to the camera that stores the result. Definition at line 485 of file vuPerspectiveCamera.cpp. |
|
this will store the data of camera to a string and pass that string to the streeam 'in'
Definition at line 397 of file vuPerspectiveCamera.cpp. |
|
This will write restore cam to the state that is passed in by in.
Definition at line 411 of file vuPerspectiveCamera.cpp. |
|
Aspect ratio.
Definition at line 199 of file vuPerspectiveCamera.h. Referenced by operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotPersp(), set_equal_to_interp(), setAspect(), TakeSnapShotPersp(), and vuPerspectiveCamera(). |
|
Field of view.
Definition at line 198 of file vuPerspectiveCamera.h. Referenced by init(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotPersp(), set_equal_to_interp(), setFOV(), TakeSnapShotPersp(), and vuPerspectiveCamera(). |
|
Top left of viewing frustum.
Definition at line 201 of file vuPerspectiveCamera.h. Referenced by getRay(), init(), operator=(), RestoreShotPersp(), set_equal_to_interp(), TakeSnapShotPersp(), and vuPerspectiveCamera(). |
|
Distance between adjacent x pixels.
Definition at line 202 of file vuPerspectiveCamera.h. Referenced by getRay(), init(), operator=(), RestoreShotPersp(), set_equal_to_interp(), TakeSnapShotPersp(), and vuPerspectiveCamera(). |
|
Distance between adjacent y pixels.
Definition at line 203 of file vuPerspectiveCamera.h. Referenced by getRay(), init(), operator=(), RestoreShotPersp(), set_equal_to_interp(), TakeSnapShotPersp(), and vuPerspectiveCamera(). |