droidobject.h 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __DROIDOBJECT__
  2. #define __DROIDOBJECT__
  3. #include <QVector3D>
  4. class DroidWorld;
  5. enum eDROIDOBJECTTYPE { ePLAYER, ePLANET, eASTEROID, eAMMO };
  6. class DroidObject
  7. {
  8. public:
  9. DroidObject(DroidWorld *dw, eDROIDOBJECTTYPE t );
  10. ~DroidObject();
  11. inline QVector3D& getPosition() { return position; }
  12. inline QVector3D& getDirection() { return direction; }
  13. inline eDROIDOBJECTTYPE getType() { return type; }
  14. inline bool isAlive() { return alive; }
  15. inline float getMass() { return mass; }
  16. inline float getDrawSize() { return drawSize; }
  17. inline float getAngle() { return angle; }
  18. void run( float secsPassed );
  19. void draw();
  20. protected:
  21. float angle;
  22. float angleInc;
  23. float drawSize;
  24. float mass;
  25. eDROIDOBJECTTYPE type;
  26. bool alive;
  27. DroidWorld *world;
  28. QVector3D position;
  29. QVector3D direction; // units / sec
  30. };
  31. #endif