-improved trigonometric precision

-cleanup
deque
terrorfisch 10 years ago
parent 5248917a6c
commit bbca942601

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

@ -280,7 +280,7 @@ namespace MWMechanics
float directionY = nextPoint.mY - y; float directionY = nextPoint.mY - y;
float directionResult = sqrt(directionX * directionX + directionY * directionY); 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) bool PathFinder::checkWaypoint(float x, float y, float z)

Loading…
Cancel
Save