GClasses
GClasses::GRayTraceCamera Class Reference

Detailed Description

Represents the camera for a ray tracing scene.

#include <GRayTrace.h>

Inheritance diagram for GClasses::GRayTraceCamera:
GClasses::GCamera

Public Member Functions

 GRayTraceCamera (int width, int height)
 
 GRayTraceCamera (GDomNode *pNode)
 
virtual ~GRayTraceCamera ()
 
G3DReal focalDistance ()
 
G3DReal lensDiameter ()
 
int maxDepth ()
 
virtual GDomNodeserialize (GDom *pDoc) const
 serializes this object More...
 
void setFocalDistance (G3DReal val)
 
void setLensDiameter (G3DReal val)
 
void setMaxDepth (int val)
 
- Public Member Functions inherited from GClasses::GCamera
 GCamera (int width, int height)
 width and height specify the size of the image that this camera will produce More...
 
 GCamera (GDomNode *pNode)
 deserializing constructor More...
 
virtual ~GCamera ()
 
void computeRayDirection (int x, int y, G3DVector *pOutRay)
 Computes the direction that a ray must travel from lookFromPoint() for the specified pixel coordinates (relative to the bottom-left corner of the view image). Note that the ray is not normalized. More...
 
G3DReal halfViewHeight ()
 Returns tan(viewAngle / 2) More...
 
int imageHeight ()
 Returns the height of the 2-D image this camera will produce. More...
 
int imageWidth ()
 Returns the width of the 2-D image this camera will produce. More...
 
const G3DVectorlookDirection ()
 Returns the direction in which this camera is facing. More...
 
G3DVectorlookFromPoint ()
 Returns a reference to the location of this camera. (You can set the values in the vector this returns to move the camera.) More...
 
void project (const G3DVector *pPoint, G3DVector *pOut)
 Projects the 3D point onto the canvas. The x and y position in the output vector specify the location where the point projects onto the camera's canvas (positive x goes to the right with 0 at the left side, positive y goes up with 0 at the bottom). The z position specifies the distance from the camera. If the z position is <= 0, then x and y are set to 0. More...
 
void setDirection (G3DVector *pDirection, G3DReal rollRads)
 Specifies the direction that the camera faces, and the roll in radians. (If rollRads is zero, then the horizon of the XZ-plane would appear as a horizontal line with positive Y above and negative Y below.) More...
 
void setDirection (G3DVector *pDirection, G3DVector *pUpVector)
 If pUpVector is not orthogonal to pDirection, it will be changed to the nearest vector that is orthogonal to pDirection. More...
 
void setImageSize (int width, int height)
 Specifies the size of the 2-D image this camera will produce. More...
 
void setViewAngle (G3DReal val)
 This is the vertical view angle in radians. More...
 
const G3DVectorviewSideVector ()
 Returns the right side vector with respect to this camera. More...
 
const G3DVectorviewUpVector ()
 Returns the up vector with respect to this camera. More...
 

Protected Attributes

G3DReal m_focalDistance
 
G3DReal m_lensDiameter
 
int m_maxDepth
 
- Protected Attributes inherited from GClasses::GCamera
G3DReal m_halfViewHeight
 
G3DVector m_lookDirection
 
G3DVector m_lookFromPoint
 
int m_nHeight
 
int m_nWidth
 
G3DVector m_viewSideVector
 
G3DVector m_viewUpVector
 

Constructor & Destructor Documentation

GClasses::GRayTraceCamera::GRayTraceCamera ( int  width,
int  height 
)
inline
GClasses::GRayTraceCamera::GRayTraceCamera ( GDomNode pNode)
virtual GClasses::GRayTraceCamera::~GRayTraceCamera ( )
inlinevirtual

Member Function Documentation

G3DReal GClasses::GRayTraceCamera::focalDistance ( )
inline
G3DReal GClasses::GRayTraceCamera::lensDiameter ( )
inline
int GClasses::GRayTraceCamera::maxDepth ( )
inline
virtual GDomNode* GClasses::GRayTraceCamera::serialize ( GDom pDoc) const
virtual

serializes this object

Reimplemented from GClasses::GCamera.

void GClasses::GRayTraceCamera::setFocalDistance ( G3DReal  val)
inline
void GClasses::GRayTraceCamera::setLensDiameter ( G3DReal  val)
inline
void GClasses::GRayTraceCamera::setMaxDepth ( int  val)
inline

Member Data Documentation

G3DReal GClasses::GRayTraceCamera::m_focalDistance
protected
G3DReal GClasses::GRayTraceCamera::m_lensDiameter
protected
int GClasses::GRayTraceCamera::m_maxDepth
protected