Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

bolt.h

Go to the documentation of this file.
00001 #include "collidable.h"
00003 class Bolt : public IdCollidable {
00004 public:
00006 
00009     class CollideKey {
00010     public:
00012 
00013         double radius;
00014         CollideKey (double r):radius(r){} 
00015         CollideKey (int s, double r):radius(r){} 
00016 
00017 
00018         bool operator < (const CollideKey & b) const{
00019             return radius<b.radius;
00020         }
00021     };
00022     void calculateCollideKey () {
00023         collideKey.radius=getPosition().Magnitude2d();
00024     }
00025 protected:
00026     CollideKey collideKey;
00027 public:
00028     void collide (class Spectre *oth);
00029     Bolt () : IdCollidable (), collideKey (0) {}
00030     Bolt (std::string name, const Matrix &pos, int id=-1);
00031 //          : IdCollidable (name, pos, id) {}
00032     void setPosition (const QVector &newPos) {
00033         pos.pos()=newPos;
00034 //      calculateCollideKey();
00035     }
00036     CollideKey getCollideKey () {
00037         return collideKey;
00038     }
00040     CollideKey recalculateCollideKey () {
00041         return CollideKey(getPosition().Magnitude2d());
00042     }
00044     void changeKey (const CollideKey &key) {
00045         collideKey=key;
00046     }
00047 };

Generated on Mon Jul 7 21:13:44 2003 for Ethereal by doxygen1.2.15