00001 00007 #ifndef _CAMERA_H_ 00008 #define _CAMERA_H_ 00009 00010 #include "../Math/Quaternion.h" 00011 #include "../Math/Vector.h" 00012 #include "../Common/OpenGL/OpenGLext.h" 00013 00014 class Camera { 00015 public: 00016 Camera(); 00017 virtual ~Camera(); 00018 void changeHeading(float degrees); 00019 void setHeading(float degrees); 00020 void changePitch(float degrees); 00021 void setPitch(float degrees); 00022 void setPrespective(float dTime = 0.0f, bool movePos = true); 00023 void setProjection(float angle, int width, int height, float n, float f); 00024 void moveForward(float val); 00025 void strafeRight(float val); 00026 void moveUp(float val); 00027 void setPosition(Vec3 position); 00028 Vec3 getPosition(); 00029 Vec3 getUp() { return m_up; } 00030 Vec3 getDir() { return m_direction; } 00031 void shake(float time, float speed, float intensity); 00032 void updateFrustum(); 00033 float getPitch() { return m_pitchDegrees; } 00034 float getHeading() { return m_headingDegrees; } 00035 00036 bool sphereInFrustum(Vec3 pos, float r); 00037 00038 protected: 00039 void setPos(float dTime); 00040 bool isMoved; 00041 00042 float m_headingDegrees; 00043 float m_pitchDegrees; 00044 Quaternion m_heading; 00045 Quaternion m_pitch; 00046 Vec3 m_position; 00047 Vec3 m_direction; 00048 Vec3 m_up; 00049 Vec3 m_strafe; 00050 float m_shakeTime; 00051 float m_shakeSpeed; 00052 float m_shakeIntensity; 00053 GLfloat m_Frustum[6][4]; 00054 }; 00055 00056 #endif