Last change
on this file since 3708 was
3708,
checked in by patrick, 19 years ago
|
orxonox/trunk: added testbullet class. some changes in the weapon class to make it look much better and also more performant
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3573] | 1 | /*! |
---|
| 2 | \projectile.h |
---|
| 3 | \brief a projectile, that is been shooted by a weapon |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #ifndef _PROJECTILE_H |
---|
| 7 | #define _PROJECTILE_H |
---|
| 8 | |
---|
| 9 | #include "world_entity.h" |
---|
| 10 | |
---|
[3632] | 11 | class Vector; |
---|
[3683] | 12 | class Weapon; |
---|
[3573] | 13 | |
---|
| 14 | class Projectile : public WorldEntity |
---|
| 15 | { |
---|
| 16 | friend class World; |
---|
| 17 | |
---|
| 18 | public: |
---|
[3683] | 19 | Projectile (Weapon* weapon); |
---|
[3573] | 20 | virtual ~Projectile (); |
---|
| 21 | |
---|
[3708] | 22 | void setFlightDirection(Quaternion flightDirection); |
---|
[3646] | 23 | void setSpeed(float speed); |
---|
| 24 | void setTTL(float ttl); |
---|
[3632] | 25 | |
---|
[3578] | 26 | virtual void hit (WorldEntity* weapon, Vector* loc); |
---|
| 27 | virtual void destroy (); |
---|
| 28 | |
---|
[3573] | 29 | virtual void tick (float time); |
---|
| 30 | virtual void draw (); |
---|
| 31 | |
---|
[3578] | 32 | private: |
---|
[3583] | 33 | //physical attriutes like: force, speed, acceleration etc. |
---|
[3632] | 34 | float speed; //!< this is the speed of the projectile |
---|
[3646] | 35 | float currentLifeTime; //!< this is the time, the projectile exists in this world (incremented by tick) |
---|
| 36 | float ttl; //!< time to life, after this time, the projectile will garbage collect itself |
---|
[3632] | 37 | Vector* flightDirection; //!< direction in which the shoot flights |
---|
[3683] | 38 | Weapon* weapon; //!< weapon the shoot belongs to |
---|
[3646] | 39 | |
---|
[3573] | 40 | }; |
---|
| 41 | |
---|
| 42 | #endif /* _PROJECTILE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.