00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef CAJUN_CCAMERA_H
00013 #define CAJUN_CCAMERA_H
00014
00015 #include <cmath>
00016 #include "CQuaternion.H"
00017
00018 #define M_UP 0.01f // Forward speed.
00019 #define M_DOWN -0.01f // Backward speed.
00020 #define M_LEFT 0.7f // Left speed.
00021 #define M_RIGHT -0.7f // Right speed.
00022 #define M_STRAFE_LEFT -0.01f // Left straft speed.
00023 #define M_STRAFE_RIGHT 0.01f // Right straft speed.
00024
00026 class CCamera
00027 {
00028 public:
00029 CCamera ();
00030
00031 void SetMoveBy (float move_by);
00032 void SetCamera (float x, float y, float z,
00033 float xv, float yv, float zv,
00034 float xu, float yu, float zu);
00035 void Follow_Focus (float x, float y, float z);
00036 void Bot_Focus (float x, float y, float z);
00037 void Follow_Bot (float x, float y, float z);
00038 void MoveCamera (float direction);
00039 void UpdateCamera (float xDir, float yDir, float zDir, float dir);
00040 void StrafeCam (float direction);
00041 void StrafeCam (float direction, float x, float y, float z);
00042 void CalculateStrafe ();
00043 void RotateCamera (float AngleDir, float xSpeed, float ySpeed,
00044 float zSpeed);
00045 void RotateByMouse (int mousePosX, int mousePosY, int midX, int midY);
00046
00048 float xPos;
00050 float yPos;
00052 float zPos;
00054 float xView;
00056 float yView;
00058 float zView;
00060 float xUp;
00062 float yUp;
00064 float zUp;
00066 float xStrafe;
00068 float yStrafe;
00070 float zStrafe;
00072 float currentRotationAngle;
00074 float prev_bot_x;
00076 float prev_bot_y;
00078 float prev_bot_z;
00080 float desired_bot_x;
00082 float desired_bot_y;
00084 float desired_bot_z;
00086 float m_move_by;
00087 };
00088 #endif
00089
00090
00091
00092
00093
00094