mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Fix the secondary navigation method for OrbitCameraController.
This commit is contained in:
parent
3c83128abc
commit
dede171886
1 changed files with 8 additions and 2 deletions
|
@ -520,8 +520,14 @@ namespace CSVRender
|
||||||
|
|
||||||
void OrbitCameraController::translate(const osg::Vec3d& offset)
|
void OrbitCameraController::translate(const osg::Vec3d& offset)
|
||||||
{
|
{
|
||||||
mCenter += offset;
|
osg::Vec3d eye, center, up;
|
||||||
getCamera()->getViewMatrix() *= osg::Matrixd::translate(offset);
|
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)
|
void OrbitCameraController::zoom(double value)
|
||||||
|
|
Loading…
Reference in a new issue