Last change
on this file since 8705 was
8705,
checked in by patrick, 18 years ago
|
bsp: work flush, some more npc functions, and a positioning aid
|
File size:
1.1 KB
|
Rev | Line | |
---|
[8514] | 1 | |
---|
| 2 | /*! |
---|
| 3 | * @file generic_npc.h |
---|
| 4 | * generic npc object |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef _GENERIC_ENTITY_H |
---|
| 8 | #define _GENERIC_ENTITY_H |
---|
| 9 | |
---|
| 10 | #include "npc.h" |
---|
| 11 | |
---|
| 12 | #include <string> |
---|
[8516] | 13 | // |
---|
| 14 | #include "sound_source.h" |
---|
[8514] | 15 | |
---|
[8516] | 16 | namespace OrxSound{ class SoundSource; } |
---|
| 17 | namespace OrxSound{ class SoundBuffer; } |
---|
[8514] | 18 | |
---|
| 19 | class TiXmlElement; |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | class GenericNPC : public NPC |
---|
| 23 | { |
---|
| 24 | public: |
---|
| 25 | GenericNPC(const TiXmlElement* root); |
---|
| 26 | virtual ~GenericNPC (); |
---|
| 27 | |
---|
| 28 | void init(); |
---|
| 29 | virtual void loadParams(const TiXmlElement* root); |
---|
| 30 | |
---|
| 31 | void setAnimation(int animationIndex, int animPlaybackMode); |
---|
[8516] | 32 | /** sets the sound volume to @param vol: volume of the sound */ |
---|
| 33 | inline void setVolume(float vol) { this->soundVolume = vol; } |
---|
[8514] | 34 | |
---|
[8705] | 35 | void playAnimation(int animationIndex, int animPlaybackMode); |
---|
| 36 | |
---|
| 37 | void playSound(std::string filename); |
---|
| 38 | void playSound(int i); |
---|
| 39 | |
---|
[8581] | 40 | bool walkTo(const Vector& coordinate, float time); |
---|
| 41 | bool walkTo(float x, float y, float z, float time); |
---|
[8514] | 42 | |
---|
| 43 | void destroy(); |
---|
| 44 | |
---|
| 45 | virtual void tick (float time); |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | private: |
---|
[8516] | 49 | OrxSound::SoundSource soundSource; |
---|
| 50 | OrxSound::SoundBuffer* soundBuffer; |
---|
| 51 | float soundVolume; |
---|
[8514] | 52 | }; |
---|
| 53 | |
---|
| 54 | #endif /* _GENERIC_ENTITY_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.