From ecd10a731eb5c4abb1f6b24e33f0abd57ade395a Mon Sep 17 00:00:00 2001 From: Frederic Chardon Date: Mon, 2 Nov 2020 13:52:36 +0100 Subject: [PATCH] Compute the rotation normal relative to the door axe, not the world. --- apps/openmw/mwworld/worldimp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 095bb1454..be32765ad 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1590,8 +1590,10 @@ namespace MWWorld if (ptr.getClass().isActor()) { - osg::Vec3f direction = osg::Quat(diff, osg::Vec3f(0, 0, 1)) * point - point; + auto localPoint = objPos.asVec3() - point; + osg::Vec3f direction = osg::Quat(diff, osg::Vec3f(0, 0, 1)) * localPoint - localPoint; direction.normalize(); + mPhysics->reportCollision(Misc::Convert::toBullet(point), Misc::Convert::toBullet(normal)); if (direction * normal < 0) // door is turning away from actor continue;