cugl::BaseCamera Class Reference

#include <cugl.h>

Inheritance diagram for cugl::BaseCamera:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BaseCamera ()
void setSteps (int s)
virtual void idle ()=0
virtual void apply () const=0
virtual void update ()

Protected Attributes

int steps
int maxSteps

Detailed Description

All derived class must implement at least two virtual functions BaseCamera::idle() which will typically be called in the callback function for glutIdleFunc, i.e. within callback function "idle()" DerivedClass::idle() will be called and later in "main" callback "idle()" will be called as parameter to "glutIdleFunc". void idle() { DerivedClass::idle();} int main() { ... glutIdleFunc(idle); ...} BaseCamera::apply() const. Similarly inside callback function for "glutDisplayFunc", say "display()", DerivedClass::apply() will be called. i.e. void display() { DerivedClass::apply();..} int main(){...glutDisplayFunc(display); ...}

Definition at line 1441 of file cugl.h.


Constructor & Destructor Documentation

cugl::BaseCamera::BaseCamera (  )  [inline]

Construct an instance of a BaseCamera. This constructor is usually called from a subclass.

Definition at line 1447 of file cugl.h.


Member Function Documentation

void cugl::BaseCamera::setSteps ( int  s  )  [inline]

Set the number of steps required for a camera movement.

Parameters:
s is the number of steps executed during a movement. s = 10 will give a rapid, possibly jerky, movement. s = 100 will give a slow, smooth movement.

Definition at line 1456 of file cugl.h.

References maxSteps.

virtual void cugl::BaseCamera::idle (  )  [pure virtual]

This function should be called from the GLUT idle() function or its equivalent. It performs one step of the motion until the motion is complete, after which it has no effect.

Implemented in cugl::Camera, and cugl::Interpolator.

virtual void cugl::BaseCamera::apply (  )  const [pure virtual]

This function should be called from the GLUT display() function or its equivalent.

Implemented in cugl::Camera, and cugl::Interpolator.

virtual void cugl::BaseCamera::update (  )  [inline, virtual]

This function is just a suggested wrapper for all derived class for initializations, such as set up first and last position for motions in /c Interpolator, or set up new eye and view parameter for /c Camera. I don't want to force new class to wrap their initialization actions within this function, so, I don't make this method as abstract one. (added by nick)

Reimplemented in cugl::Interpolator.

Definition at line 1483 of file cugl.h.


Member Data Documentation

int cugl::BaseCamera::steps [protected]

Current value of step counter.

Definition at line 1489 of file cugl.h.

int cugl::BaseCamera::maxSteps [protected]

Maximum number of steps for a smooth movement.

Definition at line 1492 of file cugl.h.

Referenced by setSteps().


The documentation for this class was generated from the following file:
Generated on Wed Sep 12 14:31:42 2007 for CUGL by  doxygen 1.5.2