forked from mirror/openmw-tes3mp
CS: Fix camera orbit control with keys
This commit is contained in:
parent
5e076ee015
commit
bfad5ebde4
1 changed files with 3 additions and 1 deletions
|
@ -690,7 +690,9 @@ namespace CSVRender
|
||||||
osg::Vec3 absoluteUp = osg::Vec3(0,0,1);
|
osg::Vec3 absoluteUp = osg::Vec3(0,0,1);
|
||||||
|
|
||||||
osg::Vec3d forward = center - eye;
|
osg::Vec3d forward = center - eye;
|
||||||
osg::Quat rotation = osg::Quat(value, absoluteUp ^ forward);
|
|
||||||
|
osg::Vec3d axis = absoluteUp ^ forward * (up.z() < 0.0 ? -1.0 : 1.0);
|
||||||
|
osg::Quat rotation = osg::Quat(value,axis);
|
||||||
osg::Vec3d oldOffset = eye - mCenter;
|
osg::Vec3d oldOffset = eye - mCenter;
|
||||||
osg::Vec3d newOffset = rotation * oldOffset;
|
osg::Vec3d newOffset = rotation * oldOffset;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue