source: GTP/trunk/App/Games/Jungle_Rumble/src/Bullet.h @ 1378

Revision 1378, 2.0 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#pragma once
2#include "node.h"
3#include "Scene.h"
4#include "Vector.h"
5#include <string>
6#include <vector>
7#include "NxPhysics.h"
8#include "ParticleCube.h"
9#include "ParticleEmitter.h"
10
11class Player;
12class Goodie;
13class SoundNode;
14class GameScene;
15
16#define SPTR boost::shared_ptr
17#define WPTR boost::weak_ptr
18
19class Bullet :
20        public Node
21{
22public:
23        Bullet(void);
24        ~Bullet(void);
25
26        virtual void initBullet() = 0;
27
28        virtual void impactPlayer(Player* player, Vector normal) = 0;
29        virtual void impactTerrain(Vector normal) = 0;
30        virtual void impactGoodie(Goodie* goodie, Vector normal) = 0;
31        virtual void impactOther(Object3d* other, Vector normal) = 0;
32        virtual void impactTimeOut() = 0;
33
34        void addParticleEmitter(ParticleEmitter *_emitter);
35        void addParticleCube(ParticleCube *_cube);
36        void startParticleEmitter();
37       
38        void setWeaponDirection(Vector _dir);
39        void setImpactForce(float _impactForce);
40        float getImpactForce();
41
42        void setImpactRadius(float _radius);
43        float getImpactRadius();
44
45        void setImpactDamage(float _impactDamage);
46        float getImpactDamage();
47
48        void setFlySound(std::string flySoundName);
49        void setImpactSound(std::string impactSoundName);
50
51        void setPlayer(Player* _myPlayer);
52
53        void setBulletType(int type);
54        int getBulletType();
55
56        Vector getDirection();
57       
58        void setExplodeAtDeath(bool _explodeAtDeath);
59
60        virtual void update(float dt);
61        bool exploded;
62        Player *myPlayer;
63
64        virtual void killMe();
65       
66        friend class GameScene;
67protected:
68       
69        int bulletType;
70        Vector dir;
71        float impactForce;
72        float impactDamage;
73        float impactRadius;
74
75        SoundNode *flySound;
76        SoundNode *impactSound;
77        bool explodeAtDeath;
78
79        std::vector<ParticleEmitter*> particleEmitterList;
80        std::vector<ParticleCube*> particleCubeList;
81        virtual void setStandardExplosionForces();
82        void collectEnvironmentInformation();
83
84        //EnvironmentInformation
85        std::vector<NxShape*> shapeList;
86        std::vector<Player*> playerList;
87        std::vector<Bullet*> bulletList;
88        std::vector<Goodie*> goodieList;
89        bool terrainHit;
90        Vector impactNormal;
91};
Note: See TracBrowser for help on using the repository browser.