Inheritance diagram for Producer::Camera:
Public Types | |
enum | StatsID { BeginCameraFrame, BeginCull, BeginPreCullCallbacks, EndPreCullCallbacks, BeginInnerCull, EndInnerCull, BeginPostCullCallbacks, EndPostCullCallbacks, EndCull, Vsync, BeginDraw, BeginClear, EndClear, BeginPreDrawCallbacks, EndPreDrawCallbacks, BeginInnerDraw, EndInnerDraw, BeginPostDrawCallbacks, EndPostDrawCallbacks, BeginPostSwapCallbacks, EndPostSwapCallbacks, EndDraw, EndCameraFrame, LastStatsID } |
enum | PipeStatsID { DrawTime, SwapBuffersTime, LastPipeStatsID } |
typedef double | TimeStamp |
Public Member Functions | |
Camera (void) | |
void | enable () |
void | disable () |
bool | isEnabled () const |
void | frame (bool doSwap=true) |
void | setSceneHandler (SceneHandler *sh) |
SceneHandler * | getSceneHandler () |
const SceneHandler * | getSceneHandler () const |
void | setRenderSurface (RenderSurface *rs) |
RenderSurface * | getRenderSurface () |
const RenderSurface * | getRenderSurface () const |
void | setRenderSurfaceWindowRectangle (int x, int y, unsigned int width, unsigned int height, bool resize=true) |
void | setLens (Lens *lens) |
Lens * | getLens () |
const Lens * | getLens () const |
void | setLensPerspective (double hfov, double vfov, double nearClip, double farClip, double xshear=0, double yshear=0) |
void | setLensFrustum (double left, double right, double bottom, double top, double nearClip, double farClip, double xshear=0, double yshear=0) |
void | setLensOrtho (double left, double right, double bottom, double top, double nearClip, double farClip, double xshear=0, double yshear=0) |
void | setLensShear (double xshear, double yshear) |
void | getLensShear (double &xshear, double &yshear) |
bool | convertLensToOrtho (float d) |
bool | convertLensToPerspective (float d) |
Lens::Projection | getLensProjectionType () |
void | applyLens () |
void | getLensParams (double &left, double &right, double &bottom, double &top, double &nearClip, double &farClip, double &xshear, double &yshear) |
float | getLensHorizontalFov () |
float | getLensVerticalFov () |
void | getLensMatrix (Matrix::value_type matrix[16]) |
void | setLensAutoAspect (bool ar) |
bool | getLensAutoAspect () |
void | setLensAspectRatio (double aspectRatio) |
double | getLensAspectRatio () |
void | setProjectionRectangle (const float left, const float right, const float bottom, const float top) |
void | getProjectionRectangle (float &left, float &right, float &bottom, float &top) const |
void | setProjectionRectangle (int x, int y, unsigned int width, unsigned int height) |
void | getProjectionRectangle (int &x, int &y, unsigned int &width, unsigned int &height) const |
Matrix::value_type * | getProjectionMatrix () |
void | setViewByLookat (float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz) |
void | setViewByLookat (const Vec3 &eye, const Vec3 ¢er, const Vec3 &up) |
void | setViewByMatrix (const Matrix &mat) |
void | setFocalDistance (double focal_distance) |
const Matrix::value_type * | getViewMatrix (void) const |
const Matrix::value_type * | getPositionAndAttitudeMatrix (void) const |
void | applyView () |
void | setOffset (const Matrix::value_type matrix[16], Matrix::value_type _xshear=0.0, Matrix::value_type _yshear=0.0) |
void | setOffset (double _xshear, double _yshear) |
void | setOffsetMultiplyMethod (Offset::MultiplyMethod method) |
void | setClearColor (float red, float green, float blue, float alpha) |
void | getClearColor (float &red, float &green, float &blue, float &alpha) |
void | clear (void) |
void | advance (void) |
void | sync (int n=1) |
void | setUpdateCallback (UpdateCallback *cb) |
void | addPreFrameCallback (Callback *cb) |
void | addPostFrameCallback (Callback *cb) |
void | addPreCullCallback (Callback *cb) |
bool | removePreCullCallback (Callback *cb) |
void | addPostCullCallback (Callback *cb) |
bool | removePostCullCallback (Callback *cb) |
void | addPreDrawCallback (Callback *cb) |
bool | removePreDrawCallback (Callback *cb) |
void | addPostDrawCallback (Callback *cb) |
bool | removePostDrawCallback (Callback *cb) |
void | addPostSwapCallback (Callback *cb) |
bool | removePostSwapCallback (Callback *cb) |
virtual int | cancel () |
void | run (void) |
void | setSyncBarrier (Producer::RefBarrier *b) |
void | setFrameBarrier (Producer::RefBarrier *b) |
void | setInitTime (Timer_t initTime) |
const FrameTimeStampSet & | getFrameStats () |
void | setInstrumentationMode (bool mode) |
bool | getInstrumentationMode () const |
void | setBlockOnVsync (bool block) |
bool | getBlockOnVsync () const |
void | setIndex (unsigned int index) |
unsigned int | getIndex () const |
void | setShareLens (bool flag) |
bool | getShareLens () |
void | setShareView (bool flag) |
bool | getShareView () |
double | getTimeOfLastVSync () |
double | getTimeOfNextVSync () |
Protected Member Functions | |
virtual | ~Camera (void) |
Protected Attributes | |
Producer::ref_ptr< Lens > | _lens |
Producer::ref_ptr< Producer::RenderSurface > | _rs |
Producer::ref_ptr< SceneHandler > | _sh |
unsigned int | _index |
ref_ptr< UpdateCallback > | _updateCallback |
std::vector< ref_ptr< Callback > > | preFrameCallbacks |
std::vector< ref_ptr< Callback > > | preCullCallbacks |
std::vector< ref_ptr< Callback > > | postCullCallbacks |
std::vector< ref_ptr< Callback > > | preDrawCallbacks |
std::vector< ref_ptr< Callback > > | postDrawCallbacks |
std::vector< ref_ptr< Callback > > | postSwapCallbacks |
std::vector< ref_ptr< Callback > > | postFrameCallbacks |
Friends | |
class | Producer::CameraGroup |
Classes | |
class | Callback |
Pure virtual class for specifying Camera callbacks. More... | |
class | FrameTimeStampSet |
class | Lens |
A Lens provides control over the PROJECTION matrix. More... | |
struct | Offset |
class | SceneHandler |
A Scene Handler handles the preparation and rendering of a scene for Camera. More... | |
class | UpdateCallback |
Pure virtual class for specifying Camera callbacks, passed a non-const camera for the purpose of updating the Camera's state. More... |
The Camera contains a Lens class and has a RenderSurface. Methods are provided to give the programmer control over the OpenGL PROJECTION matrix throught the Lens and over the initial MODELVIEW matrix through the camera's position and attitude.
The programmer must provide a class derived from Camera::SceneHandler to prepare and render the scene. The Camera does not provide direct control over rendering itself.
typedef double Producer::Camera::TimeStamp |
Producer::Camera::Camera | ( | void | ) |
virtual Producer::Camera::~Camera | ( | void | ) | [protected, virtual] |
void Producer::Camera::enable | ( | ) | [inline] |
void Producer::Camera::disable | ( | ) | [inline] |
bool Producer::Camera::isEnabled | ( | ) | const [inline] |
void Producer::Camera::frame | ( | bool | doSwap = true |
) |
void Producer::Camera::setSceneHandler | ( | SceneHandler * | sh | ) | [inline] |
SceneHandler* Producer::Camera::getSceneHandler | ( | ) | [inline] |
const SceneHandler* Producer::Camera::getSceneHandler | ( | ) | const [inline] |
void Producer::Camera::setRenderSurface | ( | RenderSurface * | rs | ) | [inline] |
RenderSurface* Producer::Camera::getRenderSurface | ( | ) | [inline] |
const RenderSurface* Producer::Camera::getRenderSurface | ( | ) | const [inline] |
void Producer::Camera::setRenderSurfaceWindowRectangle | ( | int | x, | |
int | y, | |||
unsigned int | width, | |||
unsigned int | height, | |||
bool | resize = true | |||
) | [inline] |
void Producer::Camera::setLens | ( | Lens * | lens | ) | [inline] |
Lens* Producer::Camera::getLens | ( | ) | [inline] |
const Lens* Producer::Camera::getLens | ( | ) | const [inline] |
void Producer::Camera::setLensPerspective | ( | double | hfov, | |
double | vfov, | |||
double | nearClip, | |||
double | farClip, | |||
double | xshear = 0 , |
|||
double | yshear = 0 | |||
) | [inline] |
Convenience method for setting the Lens Perspective. See Camera::Lens::setPerspective().
void Producer::Camera::setLensFrustum | ( | double | left, | |
double | right, | |||
double | bottom, | |||
double | top, | |||
double | nearClip, | |||
double | farClip, | |||
double | xshear = 0 , |
|||
double | yshear = 0 | |||
) | [inline] |
Convenience method for setting the Lens Frustum. See Camera::Lens::setFrustum().
void Producer::Camera::setLensOrtho | ( | double | left, | |
double | right, | |||
double | bottom, | |||
double | top, | |||
double | nearClip, | |||
double | farClip, | |||
double | xshear = 0 , |
|||
double | yshear = 0 | |||
) | [inline] |
Convenience method for setting the lens Orthographic projection. See Camera::Lens::setOrtho()
void Producer::Camera::setLensShear | ( | double | xshear, | |
double | yshear | |||
) | [inline] |
Convenience method for setting the lens shear. See Camera::Lens::setShear()
void Producer::Camera::getLensShear | ( | double & | xshear, | |
double & | yshear | |||
) | [inline] |
Convenience method for getting the lens shear. See Camera::Lens::getShear()
bool Producer::Camera::convertLensToOrtho | ( | float | d | ) | [inline] |
Convenience method for converting the Perpective lens to an Orthographic lens. see Camera::lens:convertToOrtho()
bool Producer::Camera::convertLensToPerspective | ( | float | d | ) | [inline] |
Convenience method for converting the Orthographic lens to an Perspective lens. see Camera::lens:convertToPerspective()
Lens::Projection Producer::Camera::getLensProjectionType | ( | ) | [inline] |
Convenience method for getting the lens projection type. See Camera::Lens::setAspectRatio()
void Producer::Camera::applyLens | ( | ) | [inline] |
Convenience method for applying the lens. See Camera::Lens::apply()
void Producer::Camera::getLensParams | ( | double & | left, | |
double & | right, | |||
double & | bottom, | |||
double & | top, | |||
double & | nearClip, | |||
double & | farClip, | |||
double & | xshear, | |||
double & | yshear | |||
) | [inline] |
Convenience method for getting the Lens parameters. See Camera::Lens::apply()
float Producer::Camera::getLensHorizontalFov | ( | ) | [inline] |
Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getHorizontalFov()
float Producer::Camera::getLensVerticalFov | ( | ) | [inline] |
Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getVerticalFov()
void Producer::Camera::getLensMatrix | ( | Matrix::value_type | matrix[16] | ) | [inline] |
Convenience method for getting the Lens ProjectionMatrix. See Camera::Lens::getMatrix()
void Producer::Camera::setLensAutoAspect | ( | bool | ar | ) | [inline] |
Convenience method for setting AutoAspect on the lens. See Camera::Lens::setAutoAspect()
bool Producer::Camera::getLensAutoAspect | ( | ) | [inline] |
Convenience method for getting AutoAspect on the lens. See Camera::Lens::getAutoAspect()
void Producer::Camera::setLensAspectRatio | ( | double | aspectRatio | ) | [inline] |
Convenience method for setting the lens Aspect Ratio. See Camera::Lens::setAspectRatio()
double Producer::Camera::getLensAspectRatio | ( | ) | [inline] |
void Producer::Camera::setProjectionRectangle | ( | const float | left, | |
const float | right, | |||
const float | bottom, | |||
const float | top | |||
) |
void Producer::Camera::getProjectionRectangle | ( | float & | left, | |
float & | right, | |||
float & | bottom, | |||
float & | top | |||
) | const |
void Producer::Camera::setProjectionRectangle | ( | int | x, | |
int | y, | |||
unsigned int | width, | |||
unsigned int | height | |||
) |
void Producer::Camera::getProjectionRectangle | ( | int & | x, | |
int & | y, | |||
unsigned int & | width, | |||
unsigned int & | height | |||
) | const |
Matrix::value_type* Producer::Camera::getProjectionMatrix | ( | ) | [inline] |
void Producer::Camera::setViewByLookat | ( | float | eyex, | |
float | eyey, | |||
float | eyez, | |||
float | centerx, | |||
float | centery, | |||
float | centerz, | |||
float | upx, | |||
float | upy, | |||
float | upz | |||
) |
void Producer::Camera::setViewByMatrix | ( | const Matrix & | mat | ) |
void Producer::Camera::setFocalDistance | ( | double | focal_distance | ) | [inline] |
const Matrix::value_type* Producer::Camera::getViewMatrix | ( | void | ) | const |
const Matrix::value_type* Producer::Camera::getPositionAndAttitudeMatrix | ( | void | ) | const [inline] |
void Producer::Camera::applyView | ( | ) |
void Producer::Camera::setOffset | ( | const Matrix::value_type | matrix[16], | |
Matrix::value_type | _xshear = 0.0 , |
|||
Matrix::value_type | _yshear = 0.0 | |||
) |
void Producer::Camera::setOffset | ( | double | _xshear, | |
double | _yshear | |||
) |
void Producer::Camera::setOffsetMultiplyMethod | ( | Offset::MultiplyMethod | method | ) | [inline] |
void Producer::Camera::setClearColor | ( | float | red, | |
float | green, | |||
float | blue, | |||
float | alpha | |||
) |
void Producer::Camera::getClearColor | ( | float & | red, | |
float & | green, | |||
float & | blue, | |||
float & | alpha | |||
) |
void Producer::Camera::clear | ( | void | ) |
void Producer::Camera::advance | ( | void | ) |
void Producer::Camera::sync | ( | int | n = 1 |
) | [inline] |
void Producer::Camera::setUpdateCallback | ( | UpdateCallback * | cb | ) | [inline] |
void Producer::Camera::addPreFrameCallback | ( | Callback * | cb | ) | [inline] |
void Producer::Camera::addPostFrameCallback | ( | Callback * | cb | ) | [inline] |
void Producer::Camera::addPreCullCallback | ( | Callback * | cb | ) | [inline] |
bool Producer::Camera::removePreCullCallback | ( | Callback * | cb | ) |
void Producer::Camera::addPostCullCallback | ( | Callback * | cb | ) | [inline] |
bool Producer::Camera::removePostCullCallback | ( | Callback * | cb | ) |
void Producer::Camera::addPreDrawCallback | ( | Callback * | cb | ) | [inline] |
bool Producer::Camera::removePreDrawCallback | ( | Callback * | cb | ) |
void Producer::Camera::addPostDrawCallback | ( | Callback * | cb | ) | [inline] |
bool Producer::Camera::removePostDrawCallback | ( | Callback * | cb | ) |
void Producer::Camera::addPostSwapCallback | ( | Callback * | cb | ) | [inline] |
bool Producer::Camera::removePostSwapCallback | ( | Callback * | cb | ) |
virtual int Producer::Camera::cancel | ( | ) | [virtual] |
void Producer::Camera::run | ( | void | ) |
void Producer::Camera::setSyncBarrier | ( | Producer::RefBarrier * | b | ) |
void Producer::Camera::setFrameBarrier | ( | Producer::RefBarrier * | b | ) |
void Producer::Camera::setInitTime | ( | Timer_t | initTime | ) | [inline] |
const FrameTimeStampSet& Producer::Camera::getFrameStats | ( | ) |
void Producer::Camera::setInstrumentationMode | ( | bool | mode | ) | [inline] |
bool Producer::Camera::getInstrumentationMode | ( | ) | const [inline] |
void Producer::Camera::setBlockOnVsync | ( | bool | block | ) | [inline] |
bool Producer::Camera::getBlockOnVsync | ( | ) | const [inline] |
void Producer::Camera::setIndex | ( | unsigned int | index | ) | [inline] |
unsigned int Producer::Camera::getIndex | ( | ) | const [inline] |
void Producer::Camera::setShareLens | ( | bool | flag | ) | [inline] |
bool Producer::Camera::getShareLens | ( | ) | [inline] |
void Producer::Camera::setShareView | ( | bool | flag | ) | [inline] |
bool Producer::Camera::getShareView | ( | ) | [inline] |
double Producer::Camera::getTimeOfLastVSync | ( | ) | [inline] |
double Producer::Camera::getTimeOfNextVSync | ( | ) | [inline] |
friend class Producer::CameraGroup [friend] |
Producer::ref_ptr<Lens> Producer::Camera::_lens [protected] |
Producer::ref_ptr<SceneHandler> Producer::Camera::_sh [protected] |
unsigned int Producer::Camera::_index [protected] |
ref_ptr<UpdateCallback> Producer::Camera::_updateCallback [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::preFrameCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::preCullCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::postCullCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::preDrawCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::postDrawCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::postSwapCallbacks [protected] |
std::vector< ref_ptr<Callback> > Producer::Camera::postFrameCallbacks [protected] |