123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
-
-
- #ifndef _CAMERA_H_
- #define _CAMERA_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(float target[3]);
-
-
-
- float getRadianYaw() { return mTheta; }
-
-
-
- float getRadianPitch() { return mTheta2; }
-
-
-
- void setPosition(float pos[3]);
-
- void setSensitivityX(float sens) { mRotationDeltaX = sens; }
-
- float getSensitivityX() { return mRotationDeltaX; }
-
- void setSensitivityY(float sens) { mRotationDeltaY = sens; }
-
- float getSensitivityY() { return mRotationDeltaY; }
-
-
-
- void update();
-
-
-
- void command(enum camera_command cmd);
-
- private:
-
- void rotate(float angle, float x, float y, float z);
-
- Quaternion mQ;
- float mPos[4];
- float mTarget[4];
- float mViewDistance;
- float mTheta;
- float mTheta2;
- float mRotationDeltaX;
- float mRotationDeltaY;
- };
-
- Camera& getCamera();
-
- #endif
|