Last change
on this file since 4880 was
4880,
checked in by bensch, 19 years ago
|
orxonox/branches/weaponSystem: more functionality, but firing does not work anymore… this will soon be fixed
|
File size:
1.9 KB
|
Rev | Line | |
---|
[4827] | 1 | /*! |
---|
[3618] | 2 | \file weapon.h |
---|
[4836] | 3 | * a weapon that a player can use |
---|
[3618] | 4 | |
---|
| 5 | A Player has a list of weapons, that can be choosen to shoot projectiles |
---|
| 6 | (projectiles.{cc,h}) at ennemies. These weapons can be shooted sequentially |
---|
| 7 | or (if able) combined. Therefore you can choose the weapon mode = choose |
---|
| 8 | a weapon. |
---|
| 9 | |
---|
| 10 | A weapon is characterized by: |
---|
| 11 | o firing-rate: the initial firing rate of a weapon (1/s = Herz) |
---|
| 12 | o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! |
---|
| 13 | o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile |
---|
[4827] | 14 | |
---|
[3618] | 15 | Furthermore there are some other attributes, that will help to represent a firing |
---|
| 16 | weapon in this world: |
---|
| 17 | o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented |
---|
| 18 | o shooting animation |
---|
[4827] | 19 | |
---|
[3618] | 20 | */ |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifndef _TEST_GUN_H |
---|
| 24 | #define _TEST_GUN_H |
---|
| 25 | |
---|
| 26 | #include "weapon.h" |
---|
| 27 | |
---|
| 28 | class Projectile; |
---|
[3631] | 29 | class Vector; |
---|
| 30 | class Quaternion; |
---|
[3851] | 31 | class Animation3D; |
---|
[3618] | 32 | |
---|
| 33 | |
---|
| 34 | class TestGun : public Weapon |
---|
| 35 | { |
---|
| 36 | friend class World; |
---|
| 37 | |
---|
[4827] | 38 | public: |
---|
| 39 | TestGun (PNode* parent, const Vector& coordinate, const Quaternion& direction, int leftRight); |
---|
| 40 | virtual ~TestGun (); |
---|
[3618] | 41 | |
---|
[4827] | 42 | virtual void activate(); |
---|
| 43 | virtual void deactivate(); |
---|
[3618] | 44 | |
---|
[4827] | 45 | virtual void fire(); |
---|
| 46 | virtual void hit (WorldEntity* weapon, Vector* loc); |
---|
| 47 | virtual void destroy(); |
---|
[3618] | 48 | |
---|
[4827] | 49 | virtual void weaponIdle(); |
---|
| 50 | virtual void draw(); |
---|
[3752] | 51 | |
---|
[4827] | 52 | private: |
---|
| 53 | Animation3D* animation1; |
---|
| 54 | Animation3D* animation2; |
---|
| 55 | Animation3D* animation3; |
---|
[3888] | 56 | |
---|
[4827] | 57 | PNode* objectComponent1; //<! the gun is made of multiple parts, these PNodes represent their location and orientation |
---|
| 58 | PNode* objectComponent2; |
---|
| 59 | PNode* objectComponent3; |
---|
[3888] | 60 | |
---|
[4827] | 61 | Vector projectileOffset; |
---|
| 62 | int leftRight; // this will become an enum |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
[3618] | 66 | }; |
---|
| 67 | |
---|
| 68 | #endif /* _TEST_GUN_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.