forked from teamnwah/openmw-tes3coop
-improved trigonometric precision
-cleanup
This commit is contained in:
parent
5248917a6c
commit
bbca942601
2 changed files with 1 additions and 2 deletions
|
@ -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…
Reference in a new issue