git-svn-id: svn://db.shs.com.ru/libs@46 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -25,8 +25,9 @@ QMatrix4x4 globCameraMatrix;
|
||||
|
||||
Camera::Camera() {
|
||||
fov_ = 60.;
|
||||
angle_limit_lower_xy = -180.;
|
||||
angle_limit_upper_xy = 180.;
|
||||
angle_limit_lower_xy = 0.;
|
||||
angle_limit_upper_xy = 360.;
|
||||
angles_.setY(270.);
|
||||
depth_start = 0.1;
|
||||
depth_end = 1000.;
|
||||
mirror_x = mirror_y = false;
|
||||
@@ -37,7 +38,7 @@ void Camera::anglesFromPoints() {
|
||||
QVector3D dv = aim_ - pos_, tv;
|
||||
tv = QVector3D(dv.x(), dv.y(), 0.);
|
||||
angles_.setZ(atan2(tv.x(), tv.y()) * rad2deg);
|
||||
angles_.setY(piClamp<GLdouble>(atan2(tv.length(), dv.z()) * rad2deg, angle_limit_lower_xy, angle_limit_upper_xy));
|
||||
angles_.setY(piClamp<GLdouble>(atan2(tv.length(), dv.z()) * rad2deg, angle_limit_lower_xy, angle_limit_upper_xy) + 180.);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +61,7 @@ void Camera::apply(const GLdouble & aspect) {
|
||||
if (parent_)
|
||||
pm *= parent_->worldTransform().inverted();
|
||||
setGLMatrix(pm);
|
||||
//qDebug() << angles_;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user