diff options
author | megamage <none@none> | 2009-05-10 14:29:28 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-10 14:29:28 -0500 |
commit | 40a8e6d3aba7410fe34c4b6b81f4036f26e0f338 (patch) | |
tree | 0fd3b174e4ca985c0a80dcd44e9f5987a0556436 /src/game/Object.cpp | |
parent | c153f7f272d574cf72c7c96825db19973655d209 (diff) |
*Rename some script functions (no real change).
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 6b7a3cdd4ac..a436732f0a6 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1194,6 +1194,14 @@ float WorldObject::GetDistanceSq(const float &x, const float &y, const float &z) return dx*dx + dy*dy + dz*dz; } +float WorldObject::GetDistanceSq(const WorldObject *obj) const +{ + float dx = GetPositionX() - obj->GetPositionX(); + float dy = GetPositionY() - obj->GetPositionY(); + float dz = GetPositionZ() - obj->GetPositionZ(); + return dx*dx + dy*dy + dz*dz; +} + float WorldObject::GetDistance2d(const WorldObject* obj) const { float dx = GetPositionX() - obj->GetPositionX(); |