git-svn-id: svn://db.shs.com.ru/libs@60 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -59,13 +59,27 @@ void Camera::apply(const GLdouble & aspect) {
|
||||
pm.rotate(angles_.z(), 0., 0., 1.);
|
||||
//pm.translate(-aim_);
|
||||
if (parent_) {
|
||||
pm.translate(-aim_);
|
||||
pm *= parent_->worldTransform().inverted();
|
||||
//double dist = pm(2, 3);
|
||||
QMatrix4x4 pmat = parent_->worldTransform();//.inverted();
|
||||
//offset_.setZ(offset_.z() - dist);
|
||||
offset_ = pmat.column(3).toVector3D();
|
||||
pmat(0, 3) = pmat(1, 3) = pmat(2, 3) = 0.;
|
||||
pmat.translate(aim_);
|
||||
//pm.translate(-aim_);
|
||||
pm *= pmat.inverted();
|
||||
//qDebug() << pmat;
|
||||
}
|
||||
setGLMatrix(pm);
|
||||
//qDebug() << angles_;
|
||||
}
|
||||
|
||||
|
||||
QMatrix4x4 Camera::offsetMatrix() const {
|
||||
QMatrix4x4 ret;
|
||||
ret.translate(parent_ ? -offset_ : -aim_);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
void Camera::localTransform(QMatrix4x4 & m) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user