mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-02 15:51:34 +00:00
Correct the center position for the orbit camera controller
This commit is contained in:
parent
2c894acd98
commit
2903271331
1 changed files with 2 additions and 5 deletions
|
@ -409,11 +409,8 @@ namespace CSVRender
|
||||||
{
|
{
|
||||||
static const int DefaultStartDistance = 10000.f;
|
static const int DefaultStartDistance = 10000.f;
|
||||||
|
|
||||||
osg::Quat rotation = getCamera()->getViewMatrix().getRotate();
|
osg::Vec3d eye, up;
|
||||||
osg::Vec3d position = getCamera()->getViewMatrix().getTrans();
|
getCamera()->getViewMatrixAsLookAt(eye, mCenter, up, DefaultStartDistance);
|
||||||
osg::Vec3d offset = rotation * (LocalForward * DefaultStartDistance);
|
|
||||||
|
|
||||||
mCenter = position + offset;
|
|
||||||
|
|
||||||
mInitialized = true;
|
mInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue