1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:23:53 +00:00

Merge branch 'basicmath' into 'master'

Compute the rotation normal relative to the door axe, not the world.

See merge request OpenMW/openmw!391
This commit is contained in:
Alexei Dobrohotov 2020-11-03 14:34:25 +00:00
commit 37cce328ca

View file

@ -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;