mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
Correct the center position for the orbit camera controller
This commit is contained in:
parent
2c894acd98
commit
2903271331
@ -409,11 +409,8 @@ namespace CSVRender
|
||||
{
|
||||
static const int DefaultStartDistance = 10000.f;
|
||||
|
||||
osg::Quat rotation = getCamera()->getViewMatrix().getRotate();
|
||||
osg::Vec3d position = getCamera()->getViewMatrix().getTrans();
|
||||
osg::Vec3d offset = rotation * (LocalForward * DefaultStartDistance);
|
||||
|
||||
mCenter = position + offset;
|
||||
osg::Vec3d eye, up;
|
||||
getCamera()->getViewMatrixAsLookAt(eye, mCenter, up, DefaultStartDistance);
|
||||
|
||||
mInitialized = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user