diff options
author | megamage <none@none> | 2009-04-30 16:13:57 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-30 16:13:57 -0500 |
commit | eb9328e4dbd5e136728f90ae794da1066688953f (patch) | |
tree | 824363814e84c5aa1b90ff51deb183e4e435de8b /src/game/Object.cpp | |
parent | 83758cb2e07be8c8dab9dffed0cbba760260f952 (diff) |
*Fix the calculation of isInLine.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index e7d07422c7a..fe3239e9d6b 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1153,6 +1153,13 @@ float WorldObject::GetDistance2d(float x, float y) const return ( dist > 0 ? dist : 0); } +float WorldObject::GetExactDistance2d(const float x, const float y) const +{ + float dx = GetPositionX() - x; + float dy = GetPositionY() - y; + return sqrt((dx*dx) + (dy*dy)); +} + float WorldObject::GetDistance(const float x, const float y, const float z) const { float dx = GetPositionX() - x; |