00001 00002 00003 #ifndef CAMERA_H 00004 #define CAMERA_H 00005 00006 00007 #include "Vector3f.h" 00008 00009 00010 namespace pge { 00011 00012 class Sphere; 00013 00014 class Camera { 00015 00016 00017 public: 00018 //************************************************************************ 00019 // 00020 // Constructor 00021 // 00022 //************************************************************************ 00024 Camera(); 00025 //Camera(Vector3f position, float keyTurn, float turnSens, float sphereRadius, float xzAngle, float xyAngle); 00026 00027 00028 //************************************************************************ 00029 // 00030 // Destructor 00031 // 00032 //************************************************************************ 00034 ~Camera(void); 00035 00036 00037 //************************************************************************ 00038 // 00039 // Functions 00040 // 00041 //************************************************************************ 00042 void timer(unsigned int delay); 00043 Vector3f getPosition(void); 00044 void setPosition(Vector3f position); 00045 void setXZAngle(float xzAngle); 00046 void setXYAngle(float xyAngle); 00047 void setDirection(Vector3f direction); 00048 void forward(void); 00049 void backward(void); 00050 void turnLeft(int delta); 00051 void turnRight(int delta); 00052 void turnUp(int delta); 00053 void turnDown(int delta); 00054 void up(void); 00055 void down(void); 00056 void slideLeft(void); 00057 void slideRight(void); 00058 void applyCameraView(void); 00059 void applyCameraRotation(void); 00060 void applyCameraPosition(void); 00061 void revertCameraView(void); 00062 Sphere* getBoundingSphere(void); 00063 00064 00065 private: 00066 //************************************************************************ 00067 // 00068 // Functions 00069 // 00070 //************************************************************************ 00071 void updateDirection(void); 00072 void updatePhysics(unsigned int delay); 00073 00074 00075 //************************************************************************ 00076 // 00077 // Variables 00078 // 00079 //************************************************************************ 00080 float m_keyTurn; 00081 float m_turnSens; 00082 00083 float m_xyMinAngle; 00084 float m_xyMaxAngle; 00085 00086 float m_xzAngle; 00087 float m_xyAngle; 00088 Vector3f m_direction; 00089 00090 float m_speedUp; 00091 float m_slowDown; 00092 float m_mass; 00093 Vector3f m_force; 00094 Vector3f m_velocity; 00095 00096 Sphere *m_boundingSphere; 00097 }; 00098 }; 00099 00100 #endif