123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
-
- #ifndef _CAMERA_H_
- #define _CAMERA_H_
-
- #include "math/math.h"
- #include "math/Matrix.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 getPosition(vec3_t pos);
-
-
-
- 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 rotate(vec_t angle, vec_t x, vec_t y, vec_t z);
-
-
-
- void command(enum camera_command cmd);
-
- private:
- Quaternion mQ;
- vec_t mPos[4];
- vec_t mTarget[4];
- vec_t mUp[4];
- vec_t mSide[4];
- vec_t mViewDistance;
- vec_t mTheta;
- vec_t mTheta2;
- vec_t mRotationDeltaX;
- vec_t mRotationDeltaY;
- };
-
- #endif
|