Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglCamera Class Reference

#include <sglCamera.hpp>

Inheritance diagram for sglCamera::

sglObject sglOrthographicCamera sglPerspectiveCamera List of all members.

Public Methods

 sglCamera ()
virtual ~sglCamera ()
const sglFrustumd& getFrustum () const
virtual void applyProjection () const=0
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Methods

 sglCamera (const sglCamera &)
sglCamera& operator= (const sglCamera &)

Protected Attributes

double m_near
double m_far
sglFrustumd m_frustum

Detailed Description

This is the abstract base class for both sglPerspectiveCamera and sglOrthographicCamera classes. These classes are used to specify the frustum that is to be used for culling in SGL and setting up the projection for rendering in OpenGL. As such the class contains the sglCamera::getFrustum() method for obtaining a reference to the internal sglFrustum class (only double precision for now), so that it can be passed into the sglScene::cull(...) function. It also contains the pure virtual sglCamera::applyProjection() which will set OpenGL's projection matrix to correspond to the internal frustum.

In normal practice, an sglCamera is assigned to an sglViewPlatform to define a position and orientation of the eye point in the 3D scene. See sglViewPlatform's code example for an illustration of the use of these functions.

Definition at line 54 of file sglCamera.hpp.


Constructor & Destructor Documentation

sglCamera::sglCamera ( )
 

default constructor.

sglCamera::~sglCamera ( ) [virtual]
 

virtual destructor.


Member Function Documentation

const sglFrustumd & sglCamera::getFrustum ( ) const [inline]
 

Query the current view frustum. Currently only a double precision frustum is available (OpenGL only takes doubles for the glFrustum commands.

Returns:
A reference to the current frustum.

Definition at line 68 of file sglCamera.hpp.

void sglCamera::applyProjection ( ) const [pure virtual]
 

Setup the OpenGL projection matrix to match the specified frustum. This function leaves the glMatrixMode(GL_PROJECTION) in effect (current) upon return.

Reimplemented in sglOrthographicCamera, and sglPerspectiveCamera.

virtual void sglCamera::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglObject.

Reimplemented in sglOrthographicCamera, and sglPerspectiveCamera.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:07 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001