1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 18:53:54 +00:00

-improved trigonometric precision

-cleanup
This commit is contained in:
terrorfisch 2014-10-10 23:31:01 +02:00
parent 5248917a6c
commit bbca942601
2 changed files with 1 additions and 2 deletions

View file

@ -48,7 +48,6 @@ namespace MWMechanics
float mMaxDist;
float mRemainingDuration; // In seconds
//PathFinder mPathFinder;
int mCellX;
int mCellY;
};

View file

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