1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
-
- #ifndef _CAMERA_H_
- #define _CAMERA_H_
-
- #include "math/math.h"
- #include "math/Quaternion.h"
-
-
- enum camera_command {
- CAMERA_ROTATE_RIGHT,
- CAMERA_ROTATE_LEFT,
- CAMERA_ROTATE_UP,
- CAMERA_ROTATE_DOWN
- };
-
-
- class Camera {
- public:
-
-
- Camera();
-
-
-
- void getTarget(vec3_t target);
-
-
-
- vec_t getRadianYaw();
-
-
-
- vec_t getRadianPitch();
-
-
-
- void setPosition(vec3_t pos);
-
- void setSensitivityX(vec_t sens);
-
- void setSensitivityY(vec_t sens);
-
-
-
- void update();
-
-
-
- void command(enum camera_command cmd);
-
- private:
-
- void rotate(vec_t angle, vec_t x, vec_t y, vec_t z);
-
- Quaternion mQ;
- vec4_t mPos;
- vec4_t mTarget;
- vec_t mViewDistance;
- vec_t mTheta;
- vec_t mTheta2;
- vec_t mRotationDeltaX;
- vec_t mRotationDeltaY;
- };
-
- Camera &getCamera();
-
- #endif
|