git-svn-id: svn://db.shs.com.ru/libs@651 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-04 17:04:06 +00:00
parent d7797e2278
commit 888f970f44
20 changed files with 224 additions and 329 deletions

View File

@@ -33,29 +33,12 @@ class Camera: public AimedObject
public:
Camera();
void moveForward(const float & x, bool withZ = true);
void moveBackward(const float & x, bool withZ = true) {moveForward(-x, withZ);}
void moveLeft(const float & x, bool withZ = true);
void moveRight(const float & x, bool withZ = true) {moveLeft(-x, withZ);}
void moveUp(const float & x, bool onlyZ = false);
void moveDown(const float & x, bool onlyZ = false) {moveUp(-x, onlyZ);}
void rotateZ(const float & a);
void rotateXY(const float & a);
void rotateRoll(const float & a) {rotateX(a);}
void orbitZ(const float & a);
void orbitXY(const float & a);
void panZ(const float & a);
void panXY(const float & a);
void setFOV(const float & f) {fov_ = f;}
void setAngles(const QVector3D & a) {setRotation(a);}
void setAngleZ(const float & a);
void setAngleXY(const float & a);
void setAngleRoll(const float & a) {setRotationX(a);}
void setAngleLowerLimitXY(const float & a) {angle_limit_lower_xy = a; buildTransform();}
void setAngleUpperLimitXY(const float & a) {angle_limit_upper_xy = a; buildTransform();}
void setAngleLimitsXY(const float & lower, const float & upper) {angle_limit_lower_xy = lower; angle_limit_upper_xy = upper; buildTransform();}
void setAngleZ(const float & a) {setRotationZ(a);}
void setAngleXY(const float & a) {setRotationX(a);}
void setAngleRoll(const float & a) {setRotationY(a);}
void setDepthStart(const float & d) {depth_start = d;}
void setDepthEnd(const float & d) {depth_end = d;}
void setMirrorX(bool yes) {mirror_x = yes;}
void setMirrorY(bool yes) {mirror_y = yes;}
@@ -63,16 +46,11 @@ public:
float angleZ() const {return rotationZ();}
float angleXY() const {return rotationY();}
float angleRoll() const {return rotationZ();}
float angleLowerLimitXY() const {return angle_limit_lower_xy;}
float angleUpperLimitXY() const {return angle_limit_upper_xy;}
float depthStart() const {return depth_start;}
float depthEnd() const {return depth_end;}
bool isMirrorX() const {return mirror_x;}
bool isMirrorY() const {return mirror_y;}
void anglesFromPoints();
void assign(const Camera & c);
virtual ObjectBase * clone(bool withChildren = true);
QMatrix4x4 viewMatrix() const;
QMatrix4x4 projectionMatrix(double aspect) const;
@@ -84,9 +62,6 @@ private:
mutable QVector3D offset_;
GLfloat fov_;
GLfloat depth_start;
GLfloat depth_end;
GLfloat angle_limit_lower_xy;
GLfloat angle_limit_upper_xy;
bool mirror_x;
bool mirror_y;