diff options
author | megamage <none@none> | 2008-10-27 08:28:57 -0500 |
---|---|---|
committer | megamage <none@none> | 2008-10-27 08:28:57 -0500 |
commit | 0e18e4330c0ab109080d5b7f18a3f9f83412e65a (patch) | |
tree | 2b6400615285ab139192cfc727f7f9547d18f021 /src/game/Object.h | |
parent | 1f7ff8104987d1af56284bd67489b1f3bb705680 (diff) |
[svn] Fix some mistakes of the last two commits.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.h')
-rw-r--r-- | src/game/Object.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/game/Object.h b/src/game/Object.h index 9b6b805d53e..2fea4cefaa5 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -372,15 +372,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object // angle to face `obj` to `this` using distance includes size of `obj` GetNearPoint(obj,x,y,z,obj->GetObjectSize(),distance2d,GetAngle( obj )); } - void GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const - { - float object_size = obj->GetObjectSize();//here we use object_size to determine the angle offset, the bigger object the smaller angle offset, then this makes mob move naturally in visual. - //let assume 12.0f is the max size for object to have 0 angle offset. - float angle_offset_ratio = 1 - object_size/12.0f; - if (angle_offset_ratio < 0.05) angle_offset_ratio = 0.05; - // angle to face `obj` to `this`plus a random angle offset(from -90 degree to 90 degree)*angle_offset_ratio using distance from distance2dMin to distance2dMax includes size of `obj` - GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI_2 - M_PI * rand_norm()) * angle_offset_ratio); - } + void GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const; float GetObjectSize() const { |