osg::CameraNode Class Reference

Inheritance diagram for osg::CameraNode:

osg::Transform osg::CullSettings osg::Group osg::Node osg::Object osg::Referenced List of all members.

Public Types

typedef std::map< BufferComponent,
Attachment
BufferAttachmentMap
 PRE_MULTIPLY
 POST_MULTIPLY
 PRE_RENDER
 NESTED_RENDER
 POST_RENDER
 FRAME_BUFFER_OBJECT
 PIXEL_BUFFER_RTT
 PIXEL_BUFFER
 FRAME_BUFFER
 SEPERATE_WINDOW
 DEPTH_BUFFER
 STENCIL_BUFFER
 COLOR_BUFFER
 COLOR_BUFFER0 = COLOR_BUFFER
 COLOR_BUFFER1 = COLOR_BUFFER+1
 COLOR_BUFFER2 = COLOR_BUFFER+2
 COLOR_BUFFER3 = COLOR_BUFFER+3
 COLOR_BUFFER4 = COLOR_BUFFER+4
 COLOR_BUFFER5 = COLOR_BUFFER+5
 COLOR_BUFFER6 = COLOR_BUFFER+6
 COLOR_BUFFER7 = COLOR_BUFFER+7
enum  TransformOrder { PRE_MULTIPLY, POST_MULTIPLY }
enum  RenderOrder { PRE_RENDER, NESTED_RENDER, POST_RENDER }
enum  RenderTargetImplementation {
  FRAME_BUFFER_OBJECT, PIXEL_BUFFER_RTT, PIXEL_BUFFER, FRAME_BUFFER,
  SEPERATE_WINDOW
}
enum  BufferComponent {
  DEPTH_BUFFER, STENCIL_BUFFER, COLOR_BUFFER, COLOR_BUFFER0 = COLOR_BUFFER,
  COLOR_BUFFER1 = COLOR_BUFFER+1, COLOR_BUFFER2 = COLOR_BUFFER+2, COLOR_BUFFER3 = COLOR_BUFFER+3, COLOR_BUFFER4 = COLOR_BUFFER+4,
  COLOR_BUFFER5 = COLOR_BUFFER+5, COLOR_BUFFER6 = COLOR_BUFFER+6, COLOR_BUFFER7 = COLOR_BUFFER+7
}

Public Member Functions

 CameraNode ()
 CameraNode (const CameraNode &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 META_Node (osg, CameraNode)
void setClearColor (const Vec4 &color)
const Vec4getClearColor () const
void setClearMask (GLbitfield mask)
GLbitfield getClearMask () const
void setColorMask (osg::ColorMask *colorMask)
void setColorMask (bool red, bool green, bool blue, bool alpha)
const ColorMaskgetColorMask () const
ColorMaskgetColorMask ()
void setViewport (osg::Viewport *viewport)
void setViewport (int x, int y, int width, int height)
const ViewportgetViewport () const
ViewportgetViewport ()
void setTransformOrder (TransformOrder order)
TransformOrder getTransformOrder () const
void setProjectionMatrix (const osg::Matrixf &matrix)
void setProjectionMatrix (const osg::Matrixd &matrix)
void setProjectionMatrixAsOrtho (double left, double right, double bottom, double top, double zNear, double zFar)
void setProjectionMatrixAsOrtho2D (double left, double right, double bottom, double top)
void setProjectionMatrixAsFrustum (double left, double right, double bottom, double top, double zNear, double zFar)
void setProjectionMatrixAsPerspective (double fovy, double aspectRatio, double zNear, double zFar)
osg::MatrixdgetProjectionMatrix ()
const osg::MatrixdgetProjectionMatrix () const
bool getProjectionMatrixAsOrtho (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar)
bool getProjectionMatrixAsFrustum (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar)
bool getProjectionMatrixAsPerspective (double &fovy, double &aspectRatio, double &zNear, double &zFar)
void setViewMatrix (const osg::Matrixf &matrix)
void setViewMatrix (const osg::Matrixd &matrix)
void setViewMatrixAsLookAt (const osg::Vec3 &eye, const osg::Vec3 &center, const osg::Vec3 &up)
osg::MatrixdgetViewMatrix ()
const osg::MatrixdgetViewMatrix () const
void getViewMatrixAsLookAt (osg::Vec3 &eye, osg::Vec3 &center, osg::Vec3 &up, float lookDistance=1.0f)
Matrixd getInverseViewMatrix () const
void setRenderOrder (RenderOrder order, int orderNum=0)
RenderOrder getRenderOrder () const
int getRenderOrderNum () const
bool isRenderToTextureCamera () const
void setRenderTargetImplementation (RenderTargetImplementation impl)
void setRenderTargetImplementation (RenderTargetImplementation impl, RenderTargetImplementation fallback)
RenderTargetImplementation getRenderTargetImplementation () const
RenderTargetImplementation getRenderTargetFallback () const
void setDrawBuffer (GLenum buffer)
GLenum getDrawBuffer () const
void setReadBuffer (GLenum buffer)
GLenum getReadBuffer () const
void attach (BufferComponent buffer, GLenum internalFormat)
void attach (BufferComponent buffer, osg::Texture *texture, unsigned int level=0, unsigned int face=0, bool mipMapGeneration=false)
void attach (BufferComponent buffer, osg::Image *image)
void detach (BufferComponent buffer)
BufferAttachmentMapgetBufferAttachmentMap ()
const BufferAttachmentMapgetBufferAttachmentMap () const
void setGraphicsContext (GraphicsContext *context)
GraphicsContextgetGraphicsContext ()
const GraphicsContextgetGraphicsContext () const
void setRenderingCache (unsigned int contextID, osg::Object *rc)
osg::ObjectgetRenderingCache (unsigned int contextID)
const osg::ObjectgetRenderingCache (unsigned int contextID) const
void setPostDrawCallback (DrawCallback *cb)
DrawCallbackgetPostDrawCallback ()
const DrawCallbackgetPostDrawCallback () const
OpenThreads::Mutex * getDataChangeMutex () const
virtual void releaseGLObjects (osg::State *=0) const
virtual bool computeLocalToWorldMatrix (Matrix &matrix, NodeVisitor *) const
virtual bool computeWorldToLocalMatrix (Matrix &matrix, NodeVisitor *) const

Protected Member Functions

virtual ~CameraNode ()

Protected Attributes

OpenThreads::Mutex _dataChangeMutex
Vec4 _clearColor
GLbitfield _clearMask
ref_ptr< ColorMask_colorMask
ref_ptr< Viewport_viewport
TransformOrder _transformOrder
Matrixd _projectionMatrix
Matrixd _viewMatrix
RenderOrder _renderOrder
int _renderOrderNum
GLenum _drawBuffer
GLenum _readBuffer
RenderTargetImplementation _renderTargetImplementation
RenderTargetImplementation _renderTargetFallback
BufferAttachmentMap _bufferAttachmentMap
ref_ptr< GraphicsContext_graphicsContext
buffered_object< ref_ptr<
Object > > 
_renderingCache
ref_ptr< DrawCallback_postDrawCallback

Classes

struct  Attachment
struct  DrawCallback

Detailed Description

CameraNode - is a subclass of Transform which represents encapsulates the settings of a Camera.


Member Typedef Documentation

typedef std::map< BufferComponent, Attachment> osg::CameraNode::BufferAttachmentMap


Member Enumeration Documentation

enum osg::CameraNode::BufferComponent

Enumerator:
DEPTH_BUFFER 
STENCIL_BUFFER 
COLOR_BUFFER 
COLOR_BUFFER0 
COLOR_BUFFER1 
COLOR_BUFFER2 
COLOR_BUFFER3 
COLOR_BUFFER4 
COLOR_BUFFER5 
COLOR_BUFFER6 
COLOR_BUFFER7 

enum osg::CameraNode::RenderOrder

Enumerator:
PRE_RENDER 
NESTED_RENDER 
POST_RENDER 

enum osg::CameraNode::RenderTargetImplementation

Enumerator:
FRAME_BUFFER_OBJECT 
PIXEL_BUFFER_RTT 
PIXEL_BUFFER 
FRAME_BUFFER 
SEPERATE_WINDOW 

enum osg::CameraNode::TransformOrder

Enumerator:
PRE_MULTIPLY 
POST_MULTIPLY 


Constructor & Destructor Documentation

osg::CameraNode::CameraNode (  ) 

osg::CameraNode::CameraNode ( const CameraNode ,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::CameraNode::~CameraNode (  )  [protected, virtual]


Member Function Documentation

void osg::CameraNode::attach ( BufferComponent  buffer,
osg::Image image 
)

void osg::CameraNode::attach ( BufferComponent  buffer,
osg::Texture texture,
unsigned int  level = 0,
unsigned int  face = 0,
bool  mipMapGeneration = false 
)

void osg::CameraNode::attach ( BufferComponent  buffer,
GLenum  internalFormat 
)

virtual bool osg::CameraNode::computeLocalToWorldMatrix ( Matrix matrix,
NodeVisitor  
) const [virtual]

Transform method that must be defined to provide generic interface for scene graph traversals.

Reimplemented from osg::Transform.

virtual bool osg::CameraNode::computeWorldToLocalMatrix ( Matrix matrix,
NodeVisitor  
) const [virtual]

Transform method that must be defined to provide generic interface for scene graph traversals.

Reimplemented from osg::Transform.

void osg::CameraNode::detach ( BufferComponent  buffer  ) 

const BufferAttachmentMap& osg::CameraNode::getBufferAttachmentMap (  )  const [inline]

Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.

BufferAttachmentMap& osg::CameraNode::getBufferAttachmentMap (  )  [inline]

Get the BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.

const Vec4& osg::CameraNode::getClearColor (  )  const [inline]

Returns the clear color.

GLbitfield osg::CameraNode::getClearMask (  )  const [inline]

Get the clear mask.

ColorMask* osg::CameraNode::getColorMask (  )  [inline]

Get the ColorMask.

const ColorMask* osg::CameraNode::getColorMask (  )  const [inline]

Get the const ColorMask.

OpenThreads::Mutex* osg::CameraNode::getDataChangeMutex (  )  const [inline]

GLenum osg::CameraNode::getDrawBuffer (  )  const [inline]

Get the draw buffer used at the start of each frame draw.

const GraphicsContext* osg::CameraNode::getGraphicsContext (  )  const [inline]

Get the const GraphicsContext.

GraphicsContext* osg::CameraNode::getGraphicsContext (  )  [inline]

Get the GraphicsContext.

Matrixd osg::CameraNode::getInverseViewMatrix (  )  const

Get the inverse view matrix.

const DrawCallback* osg::CameraNode::getPostDrawCallback (  )  const [inline]

Get the const post draw callback.

DrawCallback* osg::CameraNode::getPostDrawCallback (  )  [inline]

Get the post draw callback.

const osg::Matrixd& osg::CameraNode::getProjectionMatrix (  )  const [inline]

Get the const projection matrix.

osg::Matrixd& osg::CameraNode::getProjectionMatrix (  )  [inline]

Get the projection matrix.

bool osg::CameraNode::getProjectionMatrixAsFrustum ( double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar 
)

Get the frustum setting of a perspective projection matrix. Returns false if matrix is not a perspective matrix, where parameter values are undefined.

bool osg::CameraNode::getProjectionMatrixAsOrtho ( double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar 
)

Get the othographic settings of the orthographic projection matrix. Returns false if matrix is not an orthographic matrix, where parameter values are undefined.

bool osg::CameraNode::getProjectionMatrixAsPerspective ( double &  fovy,
double &  aspectRatio,
double &  zNear,
double &  zFar 
)

Get the frustum setting of a symmetric perspective projection matrix. Returns false if matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost. Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.

GLenum osg::CameraNode::getReadBuffer (  )  const [inline]

Get the read buffer for any required copy operations to use.

const osg::Object* osg::CameraNode::getRenderingCache ( unsigned int  contextID  )  const [inline]

Get the const Rendering object that is used to implement rendering of the subgraph.

osg::Object* osg::CameraNode::getRenderingCache ( unsigned int  contextID  )  [inline]

Get the Rendering object that is used to implement rendering of the subgraph.

RenderOrder osg::CameraNode::getRenderOrder (  )  const [inline]

Get the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within.

int osg::CameraNode::getRenderOrderNum (  )  const [inline]

Get the rendering order number of this camera relative to any sibling cameras in this subgraph.

RenderTargetImplementation osg::CameraNode::getRenderTargetFallback (  )  const [inline]

Get the render target fallback.

RenderTargetImplementation osg::CameraNode::getRenderTargetImplementation (  )  const [inline]

Get the render target.

TransformOrder osg::CameraNode::getTransformOrder (  )  const [inline]

Get the transformation order.

const osg::Matrixd& osg::CameraNode::getViewMatrix (  )  const [inline]

Get the const view matrix.

osg::Matrixd& osg::CameraNode::getViewMatrix (  )  [inline]

Get the view matrix.

void osg::CameraNode::getViewMatrixAsLookAt ( osg::Vec3 eye,
osg::Vec3 center,
osg::Vec3 up,
float  lookDistance = 1.0f 
)

Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt.

Viewport* osg::CameraNode::getViewport (  )  [inline]

Get the viewport.

const Viewport* osg::CameraNode::getViewport (  )  const [inline]

Get the const viewport.

bool osg::CameraNode::isRenderToTextureCamera (  )  const

Return true if this Camera is set up as a render to texture camera, i.e. it has textures assigned to it.

osg::CameraNode::META_Node ( osg  ,
CameraNode   
)

virtual void osg::CameraNode::releaseGLObjects ( osg::State = 0  )  const [virtual]

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objexts for all graphics contexts.

Reimplemented from osg::Group.

void osg::CameraNode::setClearColor ( const Vec4 color  )  [inline]

Sets the clear color.

void osg::CameraNode::setClearMask ( GLbitfield  mask  )  [inline]

Set the clear mask used in glClear(..). Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT.

void osg::CameraNode::setColorMask ( bool  red,
bool  green,
bool  blue,
bool  alpha 
)

Set the color mask of the camera to specified values.

void osg::CameraNode::setColorMask ( osg::ColorMask colorMask  ) 

Set the color mask of the camera to use specified osg::ColorMask.

void osg::CameraNode::setDrawBuffer ( GLenum  buffer  )  [inline]

Set the draw buffer used at the start of each frame draw. Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.

void osg::CameraNode::setGraphicsContext ( GraphicsContext context  )  [inline]

Set the GraphicsContext that provides the mechansim for managing the OpenGL graphics context associated with this camera.

void osg::CameraNode::setPostDrawCallback ( DrawCallback cb  )  [inline]

Set the post draw callback for custom operations to do done after the drawing of the camera's subgraph has been completed.

void osg::CameraNode::setProjectionMatrix ( const osg::Matrixd matrix  )  [inline]

Set the projection matrix. Can be thought of as setting the lens of a camera.

void osg::CameraNode::setProjectionMatrix ( const osg::Matrixf matrix  )  [inline]

Set the projection matrix. Can be thought of as setting the lens of a camera.

void osg::CameraNode::setProjectionMatrixAsFrustum ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)

Set to a perspective projection. See OpenGL glFrustum documentation for further details.

void osg::CameraNode::setProjectionMatrixAsOrtho ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)

Set to an orthographic projection. See OpenGL glOrtho for documentation further details.

void osg::CameraNode::setProjectionMatrixAsOrtho2D ( double  left,
double  right,
double  bottom,
double  top 
)

Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.

void osg::CameraNode::setProjectionMatrixAsPerspective ( double  fovy,
double  aspectRatio,
double  zNear,
double  zFar 
)

Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details. Aspect ratio is defined as width/height.

void osg::CameraNode::setReadBuffer ( GLenum  buffer  )  [inline]

Set the read buffer for any required copy operations to use. Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.

void osg::CameraNode::setRenderingCache ( unsigned int  contextID,
osg::Object rc 
) [inline]

Set the Rendering object that is used to implement rendering of the subgraph.

void osg::CameraNode::setRenderOrder ( RenderOrder  order,
int  orderNum = 0 
) [inline]

Set the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within. For rendering to a texture, one typically uses PRE_RENDER. For Head Up Displays, one would typically use POST_RENDER.

void osg::CameraNode::setRenderTargetImplementation ( RenderTargetImplementation  impl,
RenderTargetImplementation  fallback 
)

Set the render target and fall-back that's used if the former isn't available.

void osg::CameraNode::setRenderTargetImplementation ( RenderTargetImplementation  impl  ) 

Set the render target.

void osg::CameraNode::setTransformOrder ( TransformOrder  order  )  [inline]

Set the transformation order for world-to-local and local-to-world transformation.

void osg::CameraNode::setViewMatrix ( const osg::Matrixd matrix  )  [inline]

Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates.

void osg::CameraNode::setViewMatrix ( const osg::Matrixf matrix  )  [inline]

Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates.

void osg::CameraNode::setViewMatrixAsLookAt ( const osg::Vec3 eye,
const osg::Vec3 center,
const osg::Vec3 up 
)

Set to the position and orientation of view matrix, using the same convention as gluLookAt.

void osg::CameraNode::setViewport ( int  x,
int  y,
int  width,
int  height 
)

Set the viewport of the camera to specified dimensions.

void osg::CameraNode::setViewport ( osg::Viewport viewport  ) 

Set the viewport of the camera to use specified osg::Viewport.


Member Data Documentation

BufferAttachmentMap osg::CameraNode::_bufferAttachmentMap [protected]

Vec4 osg::CameraNode::_clearColor [protected]

GLbitfield osg::CameraNode::_clearMask [protected]

ref_ptr<ColorMask> osg::CameraNode::_colorMask [protected]

OpenThreads::Mutex osg::CameraNode::_dataChangeMutex [mutable, protected]

GLenum osg::CameraNode::_drawBuffer [protected]

ref_ptr<GraphicsContext> osg::CameraNode::_graphicsContext [protected]

ref_ptr<DrawCallback> osg::CameraNode::_postDrawCallback [protected]

Matrixd osg::CameraNode::_projectionMatrix [protected]

GLenum osg::CameraNode::_readBuffer [protected]

buffered_object< ref_ptr<Object> > osg::CameraNode::_renderingCache [protected]

RenderOrder osg::CameraNode::_renderOrder [protected]

int osg::CameraNode::_renderOrderNum [protected]

RenderTargetImplementation osg::CameraNode::_renderTargetFallback [protected]

RenderTargetImplementation osg::CameraNode::_renderTargetImplementation [protected]

TransformOrder osg::CameraNode::_transformOrder [protected]

Matrixd osg::CameraNode::_viewMatrix [protected]

ref_ptr<Viewport> osg::CameraNode::_viewport [protected]


The documentation for this class was generated from the following file:
Generated on Sun Oct 1 13:17:05 2006 for openscenegraph by  doxygen 1.4.7