From bbca942601627f5197be09a679b1ce68fb73e1fb Mon Sep 17 00:00:00 2001 From: terrorfisch Date: Fri, 10 Oct 2014 23:31:01 +0200 Subject: [PATCH] -improved trigonometric precision -cleanup --- apps/openmw/mwmechanics/aiescort.hpp | 1 - apps/openmw/mwmechanics/pathfinding.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp index 4ee019b76..f02cdba22 100644 --- a/apps/openmw/mwmechanics/aiescort.hpp +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -48,7 +48,6 @@ namespace MWMechanics float mMaxDist; float mRemainingDuration; // In seconds - //PathFinder mPathFinder; int mCellX; int mCellY; }; diff --git a/apps/openmw/mwmechanics/pathfinding.cpp b/apps/openmw/mwmechanics/pathfinding.cpp index 62e23db58..8f0da94e1 100644 --- a/apps/openmw/mwmechanics/pathfinding.cpp +++ b/apps/openmw/mwmechanics/pathfinding.cpp @@ -280,7 +280,7 @@ namespace MWMechanics float directionY = nextPoint.mY - y; float directionResult = sqrt(directionX * directionX + directionY * directionY); - return Ogre::Radian(Ogre::Math::ACos(directionY / directionResult) * sgn(Ogre::Math::ASin(directionX / directionResult))).valueDegrees(); + return Ogre::Math::ATan2(directionX,directionY).valueDegrees(); } bool PathFinder::checkWaypoint(float x, float y, float z)