1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
-
-
- #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();
-
-
-
- float getRadianPitch();
-
-
-
- void setPosition(float pos[3]);
-
- void setSensitivityX(float sens);
-
- void setSensitivityY(float sens);
-
-
-
- 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
|