Main Page   Class Hierarchy   Compound List   Compound Members  

Producer::Camera Class Reference

A Camera provides a programming interface for 3D graphics applications by means of an abstract camera analogy. More...

Inheritance diagram for Producer::Camera:

Producer::Referenced List of all members.

Public Types

typedef double TimeStamp
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
}

Public Methods

 Camera (void)
void enable ()
void disable ()
bool isEnabled ()
void frame (bool doSwap=true)
void setSceneHandler (SceneHandler *sh)
SceneHandlergetSceneHandler ()
const SceneHandlergetSceneHandler () const
void setRenderSurface (RenderSurface *rs)
RenderSurfacegetRenderSurface ()
const RenderSurfacegetRenderSurface () const
void setRenderSurfaceWindowRectangle (int x, int y, unsigned int width, unsigned int height, bool resize=true)
void setLens (Lens *lens)
LensgetLens ()
const LensgetLens () 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 &center, 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 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 addPreCullCallback (Callback *cb)
void addPostCullCallback (Callback *cb)
void addPreDrawCallback (Callback *cb)
void addPostDrawCallback (Callback *cb)
void addPostSwapCallback (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 ()

Protected Methods

virtual ~Camera (void)

Protected Attributes

Producer::ref_ptr< Lens_lens
Producer::ref_ptr< Producer::RenderSurface_rs
Producer::ref_ptr< SceneHandler_sh
unsigned int _index

Friends

class Producer::CameraGroup

Detailed Description

A Camera provides a programming interface for 3D graphics applications by means of an abstract camera analogy.

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.


Member Function Documentation

void Producer::Camera::applyLens   [inline]
 

Convenience method for applying the lens. See Camera::Lens::apply()

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()

bool Producer::Camera::getLensAutoAspect   [inline]
 

Convenience method for getting AutoAspect on the lens. See Camera::Lens::getAutoAspect()

float Producer::Camera::getLensHorizontalFov   [inline]
 

Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getHorizontalFov()

void Producer::Camera::getLensMatrix Matrix::value_type    matrix[16] [inline]
 

Convenience method for getting the Lens ProjectionMatrix. See Camera::Lens::getMatrix()

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()

Lens::Projection Producer::Camera::getLensProjectionType   [inline]
 

Convenience method for getting the lens projection type. See Camera::Lens::setAspectRatio()

void Producer::Camera::getLensShear double &    xshear,
double &    yshear
[inline]
 

Convenience method for getting the lens shear. See Camera::Lens::getShear()

float Producer::Camera::getLensVerticalFov   [inline]
 

Convenience method for getting the Lens Horizontal field of view. See Camera::Lens::getVerticalFov()

void Producer::Camera::setLensAspectRatio double    aspectRatio [inline]
 

Convenience method for setting the lens Aspect Ratio. See Camera::Lens::setAspectRatio()

void Producer::Camera::setLensAutoAspect bool    ar [inline]
 

Convenience method for setting AutoAspect on the lens. See Camera::Lens::setAutoAspect()

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::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::setLensShear double    xshear,
double    yshear
[inline]
 

Convenience method for setting the lens shear. See Camera::Lens::setShear()


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 15:21:44 2004 for OpenProducer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002