#include <sglPerspectiveCamera.hpp>
Inheritance diagram for sglPerspectiveCamera::
Public Methods | |
sglPerspectiveCamera () | |
virtual | ~sglPerspectiveCamera () |
bool | setFOV (double fovy, double aspect, double near_clip, double far_clip) |
bool | getFOV (double &fovy, double &aspect, double &near_clip, double &far_clip) const |
double | getFOVY () const |
double | getFOVX () const |
void | setSimple (double left, double right, double bottom, double top, double near_clip, double far_clip) |
void | getSimple (double &left, double &right, double &bottom, double &top, double &near_clip, double &far_clip) const |
virtual void | applyProjection () const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
sglPerspectiveCamera (const sglPerspectiveCamera &) | |
sglPerspectiveCamera& | operator= (const sglPerspectiveCamera &) |
Protected Attributes | |
bool | m_simple_flag |
double | m_left |
double | m_right |
double | m_bottom |
double | m_top |
double | m_fovx |
Example:
sglPerspectiveCamera *view_camera = new sglPerspectiveCamera; view_camera->setFOV(0.25*M_PI, (double)win_x/(double)win_y, 1.0, 200.0); // OR view_camera->setSimple(0.0, 0.4, 0.0, 0.3, 1.0, 200.0); // off-axis
Definition at line 57 of file sglPerspectiveCamera.hpp.
|
default constructor.
|
|
virtual destructor.
|
|
This function is used to specify a symmetric perspective frusta (projections). The arguments match those of the gluPerspective function in OpenGL. If any of the parameters are out of range then the function returns false, and none of the parameters are set. If near_clip is greater than the far_clip then the parameters are swapped.
|
|
This function gets the parameter values, but returns false if setSimple was last called to indicate that the fovy parameter returned is computed internally based on the parameters to setSimple (and not that specified in setFOV) and does not have the implied symmetry. |
|
Returns the vertical field of view in radians.
Definition at line 92 of file sglPerspectiveCamera.hpp. |
|
Returns the horizontal field of view in radians.
Definition at line 94 of file sglPerspectiveCamera.hpp. |
|
The most basic method for setting frusta (parameters corresponds to those in glFrustum) which can also be used to set off-axis projections. The lower left and upper right locations on the near clip plane is defined as (left, bottom, -near) and (right, top, -near) with the camera positioned at the origin.
|
|
Query the parameters for the current perspective frustum. |
|
Setup the OpenGL projection matrix to match the specified frustum. This function leaves the glMatrixMode(GL_PROJECTION) in effect (current) upon return. Reimplemented from sglCamera. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglCamera. |