git-svn-id: svn://db.shs.com.ru/libs@540 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -36,74 +36,66 @@ public:
|
||||
Camera();
|
||||
|
||||
void setPos(const QVector3D & p) {pos_ = p; anglesFromPoints(); buildTransform();}
|
||||
/*void setPosX(const double & o) {QVector3D dv = aim_ - pos_; pos_.setX(o); aim_ = pos_ + dv;}
|
||||
void setPosY(const double & o) {QVector3D dv = aim_ - pos_; pos_.setY(o); aim_ = pos_ + dv;}
|
||||
void setPosZ(const double & o) {QVector3D dv = aim_ - pos_; pos_.setZ(o); aim_ = pos_ + dv;}*/
|
||||
void setAim(const QVector3D & p) {aim_ = p; anglesFromPoints(); buildTransform();}
|
||||
void move(const QVector3D & p) {pos_ += p; aim_ += p; buildTransform();}
|
||||
void move(const double & x, const double & y = 0., const double & z = 0.) {pos_ += QVector3D(x, y, z); aim_ += QVector3D(x, y, z); buildTransform();}
|
||||
void moveForward(const double & x, bool withZ = true);
|
||||
void moveBackward(const double & x, bool withZ = true) {moveForward(-x, withZ);}
|
||||
void moveLeft(const double & x, bool withZ = true);
|
||||
void moveRight(const double & x, bool withZ = true) {moveLeft(-x, withZ);}
|
||||
void moveUp(const double & x, bool onlyZ = false);
|
||||
void moveDown(const double & x, bool onlyZ = false) {moveUp(-x, onlyZ);}
|
||||
void rotateZ(const double & a);
|
||||
void rotateXY(const double & a);
|
||||
void rotateRoll(const double & a) {angles_.setX(angles_.x() + a); buildTransform();}
|
||||
void orbitZ(const double & a);
|
||||
void orbitXY(const double & a);
|
||||
void panZ(const double & a);
|
||||
void panXY(const double & a);
|
||||
void setFOV(const double & f) {fov_ = f;}
|
||||
void move(const float & x, const float & y = 0., const float & z = 0.) {pos_ += QVector3D(x, y, z); aim_ += QVector3D(x, y, z); buildTransform();}
|
||||
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) {angles_.setX(angles_.x() + a); buildTransform();}
|
||||
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 double & a);
|
||||
void setAngleXY(const double & a);
|
||||
void setAngleRoll(const double & a) {angles_.setX(a); buildTransform();}
|
||||
void setAngleLowerLimitXY(const double & a) {angle_limit_lower_xy = a; buildTransform();}
|
||||
void setAngleUpperLimitXY(const double & a) {angle_limit_upper_xy = a; buildTransform();}
|
||||
void setAngleLimitsXY(const double & lower, const double & upper) {angle_limit_lower_xy = lower; angle_limit_upper_xy = upper; buildTransform();}
|
||||
void setDepthStart(const double & d) {depth_start = d;}
|
||||
void setDepthEnd(const double & d) {depth_end = d;}
|
||||
void setAngleZ(const float & a);
|
||||
void setAngleXY(const float & a);
|
||||
void setAngleRoll(const float & a) {angles_.setX(a); buildTransform();}
|
||||
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 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;}
|
||||
void flyCloser(const double & s);
|
||||
void flyFarer(const double & s);
|
||||
void flyToDistance(const double & d);
|
||||
void flyCloser(const float & s);
|
||||
void flyFarer(const float & s);
|
||||
void flyToDistance(const float & d);
|
||||
|
||||
QVector3D aim() const {return aim_;}
|
||||
QVector3D angles() const {return rotation();}
|
||||
QVector3D direction() const {return (aim_ - pos_).normalized();}
|
||||
QVector3D directionXY() const {QVector3D tv = aim_ - pos_; return QVector3D(tv.x(), tv.y(), 0.).normalized();}
|
||||
double FOV() const {return fov_;}
|
||||
double distance() const {return (pos_ - aim_).length();}
|
||||
double angleZ() const {return angles_.z();}
|
||||
double angleXY() const {return angles_.y();}
|
||||
double angleRoll() const {return angles_.x();}
|
||||
double angleLowerLimitXY() const {return angle_limit_lower_xy;}
|
||||
double angleUpperLimitXY() const {return angle_limit_upper_xy;}
|
||||
double depthStart() const {return depth_start;}
|
||||
double depthEnd() const {return depth_end;}
|
||||
float FOV() const {return fov_;}
|
||||
float distance() const {return (pos_ - aim_).length();}
|
||||
float angleZ() const {return angles_.z();}
|
||||
float angleXY() const {return angles_.y();}
|
||||
float angleRoll() const {return angles_.x();}
|
||||
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 apply(const GLdouble & aspect = 1.);
|
||||
void apply(const GLfloat & aspect = 1.);
|
||||
void assign(const Camera & c);
|
||||
//QVector3D pointFromViewport(int x_, int y_, double z_); TODO
|
||||
|
||||
QMatrix4x4 offsetMatrix() const;
|
||||
|
||||
private:
|
||||
//void localTransform(QMatrix4x4 & m);
|
||||
|
||||
QVector3D aim_, offset_;
|
||||
GLdouble fov_;
|
||||
GLdouble depth_start;
|
||||
GLdouble depth_end;
|
||||
GLdouble angle_limit_lower_xy;
|
||||
GLdouble angle_limit_upper_xy;
|
||||
//GLdouble modelview[16], projection[16];
|
||||
//GLint viewport[4];
|
||||
GLfloat fov_;
|
||||
GLfloat depth_start;
|
||||
GLfloat depth_end;
|
||||
GLfloat angle_limit_lower_xy;
|
||||
GLfloat angle_limit_upper_xy;
|
||||
bool mirror_x;
|
||||
bool mirror_y;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user