00001 #ifndef _CAMERA_H 00002 00003 #include <stdio.h> // Header File For Standard Input/Output 00004 #include <GL/gl.h> 00005 #include <GL/glu.h> 00006 #include <string> 00007 #include <iostream> 00008 #include <fstream> 00009 #include <cmath> 00010 #include <cassert> 00011 //#include "coldet.h" // Header File For Collision Detection Library 00012 //#include "mesh.h" 00013 #include "quat.h" 00014 //#include "entity.h" 00015 //#include "entitylist.h" 00016 00017 using namespace std; 00018 00019 class CAMERA 00020 { 00021 private: 00022 //OLD NEWZ 00023 GLdouble transform_matrix[16]; 00024 GLdouble velocity_matrix[16]; 00025 00026 void GenerateTransform(); 00027 00028 public: 00029 CAMERA(); 00030 00031 VERTEX position; 00032 VERTEX pos_vel; 00033 00034 //HOT NEWZ 00035 QUATERNION dir; 00036 QUATERNION dir_vel; 00037 QUATERNION dir_coupled; 00038 00039 void Update(); 00040 00041 //OLD AND BUSTED 00042 /*void RotateX(float theta); 00043 void RotateY(float theta); 00044 void RotateZ(float theta);*/ 00045 00046 //NEW HOTNESS 00047 void Rotate(float a, float ax, float ay, float az); 00048 00049 void MoveRelative(float mx, float my, float mz); 00050 00051 //for FPS movement when we don't want to move up and down 00052 void MoveRelativeConstrainY(float mx, float my, float mz); 00053 00054 void Move(float mx, float my, float mz); 00055 00056 void PutTransformInto(GLdouble *matrix16); 00057 void PutVelocityInto(GLdouble *matrix16); 00058 00059 void LoadVelocityIdentity(); 00060 00061 VERTEX GetPosition(); 00062 void SetPosition(VERTEX newpos); 00063 VERTEX GetVelocity(); 00064 //VERTEX GetRotation(); 00065 00066 void SetVelocity(VERTEX new_velocity); 00067 00068 void Chase(); 00069 00070 //what camera mode we're in 00071 string cam_mode; 00072 int chase_ent; 00073 00074 //frustum information 00075 float frustum[6][4]; 00076 void ExtractFrustum(); 00077 }; 00078 00079 #define _CAMERA_H 00080 #endif
1.4.6