diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-02-25 18:35:11 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-02-25 18:35:11 +0000 |
commit | d80ff75aea2dac06d764afef9c40c86116e99bad (patch) | |
tree | 7fc5629408813e70f9ae004bc436e44144463c3e /src/game-server/object.hpp | |
parent | d495ca387a07c0caf78975e1f170c5e6bb9fb326 (diff) | |
download | manaserv-d80ff75aea2dac06d764afef9c40c86116e99bad.tar.gz manaserv-d80ff75aea2dac06d764afef9c40c86116e99bad.tar.bz2 manaserv-d80ff75aea2dac06d764afef9c40c86116e99bad.tar.xz manaserv-d80ff75aea2dac06d764afef9c40c86116e99bad.zip |
Improved hit detection by adding a function to compute collisions between circles and circle sectors.
Diffstat (limited to 'src/game-server/object.hpp')
-rw-r--r-- | src/game-server/object.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/game-server/object.hpp b/src/game-server/object.hpp index 47d9a7d0..e0443f93 100644 --- a/src/game-server/object.hpp +++ b/src/game-server/object.hpp @@ -207,7 +207,7 @@ class MovingObject: public Object { return mOld; } /** - * Sete object direction + * Sets object direction */ void setDirection(int direction) { mDirection = direction; } @@ -215,7 +215,6 @@ class MovingObject: public Object /** * Gets object direction */ - unsigned char getDirection() const { return mDirection; } @@ -226,6 +225,18 @@ class MovingObject: public Object { mSpeed = s; } /** + * Sets object bounding circle radius + */ + void setSize(unsigned s) + { mSize = s; } + + /** + * Gets object bounding circle radius + */ + unsigned getSize() + { return mSize; } + + /** * Moves the object toward its destination. */ void move(); @@ -250,6 +261,7 @@ class MovingObject: public Object Point mDst; /**< target coordinates */ Point mOld; /**< old coordinates */ unsigned short mSpeed; /**< speed */ + unsigned mSize; /**< radius of bounding circle */ std::list<PATH_NODE> mPath; protected: |