diff options
| author | QAston <none@none> | 2009-05-15 18:00:50 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2009-05-15 18:00:50 +0200 |
| commit | a796012723dd2410a150264a4f32f00bc570ef76 (patch) | |
| tree | d55cada7db3c9c752815c79d9d164069acd99edc /src/game/Object.h | |
| parent | ae461a4158d6376e28e7bc53d3f7ad5690a5064e (diff) | |
| parent | ad92f5e210b7a2c0584cdabd30560fe723d160be (diff) | |
*Merge some fixes from tc1
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.h')
| -rw-r--r-- | src/game/Object.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/game/Object.h b/src/game/Object.h index 68438c4df85..326b09cfb73 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -461,10 +461,11 @@ class TRINITY_DLL_SPEC WorldObject : public Object virtual const char* GetNameForLocaleIdx(int32 /*locale_idx*/) const { return GetName(); } float GetDistance( const WorldObject* obj ) const; - float GetDistance(const float x, const float y, const float z) const; + float GetDistance(float x, float y, float z) const; float GetDistanceSq(const float &x, const float &y, const float &z) const; + float GetDistanceSq(const WorldObject *obj) const; float GetDistance2d(const WorldObject* obj) const; - float GetDistance2d(const float x, const float y) const; + float GetDistance2d(float x, float y) const; float GetExactDistance2d(const float x, const float y) const; float GetDistanceZ(const WorldObject* obj) const; bool IsInMap(const WorldObject* obj) const @@ -472,14 +473,30 @@ class TRINITY_DLL_SPEC WorldObject : public Object return IsInWorld() && obj->IsInWorld() && GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId() && InSamePhase(obj); } - bool IsWithinDistInMap(const WorldObject* obj, const float dist2compare, const bool is3D = true) const; - bool IsWithinLOS(const float x, const float y, const float z ) const; + bool IsWithinDist3d(float x, float y, float z, float dist2compare) const; + bool IsWithinDist2d(float x, float y, float dist2compare) const; + bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const; + bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const + // use only if you will sure about placing both object at same map + { + return obj && _IsWithinDist(obj,dist2compare,is3D); + } + bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const + { + return obj && IsInMap(obj) && _IsWithinDist(obj,dist2compare,is3D); + } + bool IsWithinLOS(float x, float y, float z) const; bool IsWithinLOSInMap(const WorldObject* obj) const; + bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const; + bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const; + bool IsInRange2d(float x, float y, float minRange, float maxRange) const; + bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const; float GetAngle( const WorldObject* obj ) const; float GetAngle( const float x, const float y ) const; void GetSinCos(const float x, const float y, float &vsin, float &vcos); bool HasInArc( const float arcangle, const WorldObject* obj ) const; + bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const; virtual void SendMessageToSet(WorldPacket *data, bool self, bool to_possessor = true); virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor = true); |
