Last change
on this file since 3694 was
3683,
checked in by patrick, 20 years ago
|
orxonox/trunk: projectile speed issue: fixed some strange behaveour. still got the problem, that the the projectile have variable relative speeds to the player…
|
File size:
1.1 KB
|
Line | |
---|
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 | |
---|
11 | class Vector; |
---|
12 | class Weapon; |
---|
13 | |
---|
14 | class Projectile : public WorldEntity |
---|
15 | { |
---|
16 | friend class World; |
---|
17 | |
---|
18 | public: |
---|
19 | Projectile (Weapon* weapon); |
---|
20 | virtual ~Projectile (); |
---|
21 | |
---|
22 | void setFlightDirection(Quaternion* flightDirection); |
---|
23 | void setSpeed(float speed); |
---|
24 | void setTTL(float ttl); |
---|
25 | |
---|
26 | virtual void hit (WorldEntity* weapon, Vector* loc); |
---|
27 | virtual void destroy (); |
---|
28 | |
---|
29 | virtual void tick (float time); |
---|
30 | virtual void draw (); |
---|
31 | |
---|
32 | private: |
---|
33 | //physical attriutes like: force, speed, acceleration etc. |
---|
34 | float speed; //!< this is the speed of the projectile |
---|
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 |
---|
37 | Vector* flightDirection; //!< direction in which the shoot flights |
---|
38 | Weapon* weapon; //!< weapon the shoot belongs to |
---|
39 | |
---|
40 | }; |
---|
41 | |
---|
42 | #endif /* _PROJECTILE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.