Bug #4241
Posted: 04 Dec 2017, 02:56
Hi all,
today I have found a bug with a camera (https://bugs.openmw.org/issues/4241).
I'm not a C++ and/or OpenMW code guru and after playing with camera.cpp I found a solution which seems to be workaround (lift camera up to 2 points(pixels?) -- it is enough to "fix" issue):
Also this workaround does not work if you change screen resolution in-game but will work again after game restart.
Could you please help -- where is defined camera z() position in first person view? I tried to change almost all members in camera.cpp but without result I found mFirstPersonOffset, setFirstPersonOffset() and setOffset(osg::Vec3d) in npcanimation (from setSneakOffset in camera.cpp) but I'm a bit worry to touch them ...
I'm not pretending to merge this workaround -- it is more for me and better understanding of OpenMW code
Thanks!
today I have found a bug with a camera (https://bugs.openmw.org/issues/4241).
I'm not a C++ and/or OpenMW code guru and after playing with camera.cpp I found a solution which seems to be workaround (lift camera up to 2 points(pixels?) -- it is enough to "fix" issue):
Code: Select all
diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp
index cb6188a54..8a6907de7 100644
--- a/apps/openmw/mwrender/camera.cpp
+++ b/apps/openmw/mwrender/camera.cpp
@@ -98,6 +98,9 @@ namespace MWRender
osg::Vec3d position = worldMat.getTrans();
if (!isFirstPerson())
position.z() += mHeight * mHeightScale;
+ else
+ // lift camera up
+ position.z() += 2.;
return position;
}
Could you please help -- where is defined camera z() position in first person view? I tried to change almost all members in camera.cpp but without result I found mFirstPersonOffset, setFirstPersonOffset() and setOffset(osg::Vec3d) in npcanimation (from setSneakOffset in camera.cpp) but I'm a bit worry to touch them ...
I'm not pretending to merge this workaround -- it is more for me and better understanding of OpenMW code
Thanks!