Fix the secondary navigation method for OrbitCameraController.

openmw-39
Aesylwinn 9 years ago
parent 3c83128abc
commit dede171886

@ -520,8 +520,14 @@ namespace CSVRender
void OrbitCameraController::translate(const osg::Vec3d& offset)
{
mCenter += offset;
getCamera()->getViewMatrix() *= osg::Matrixd::translate(offset);
osg::Vec3d eye, center, up;
getCamera()->getViewMatrixAsLookAt(eye, center, up);
osg::Vec3d newOffset = getCamera()->getViewMatrix().getRotate().inverse() * offset;
mCenter += newOffset;
eye += newOffset;
getCamera()->setViewMatrixAsLookAt(eye, mCenter, up);
}
void OrbitCameraController::zoom(double value)

Loading…
Cancel
Save