This class is intended to have a camera that supports all degrees of freedom you could ever want (6 degrees of freedom). It takes advantage of the two earlier introduced classes vector3 and quaternion. This class is dependent on the GLU (OpenGL) library (functions gluPerspective
and gluLookAt
).
There is no example for this class, just look at the comments and the class declaration (header file).
This class help to determine the amount of frames that are drawn per second (FPS = frames per second). I usually use them in my OpenGL programs.
Example:
cg::fpscounter fps;
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
...
...
ftp.tick();
glFlush();
glutSwapBuffers();
}
...
cout << fps.get_fps() << endl;
This FPS counter is for Unix environments (Linux, Cygwin, etc.) only.
This function calculates the integer square root of a given number.