Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/npcs/generic_npc.h @ 8796

Last change on this file since 8796 was 8796, checked in by patrick, 18 years ago

merged the bsp model branche back to trunk and some npc code changes :D

File size: 1.9 KB
Line 
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>
13
14#include "sound_source.h"
15
16#include "vector.h"
17#include "quaternion.h"
18
19
20namespace OrxSound{ class SoundSource; }
21namespace OrxSound{ class SoundBuffer; }
22
23class TiXmlElement;
24
25
26class GenericNPC : public NPC
27{
28 public:
29  GenericNPC(const TiXmlElement* root);
30  virtual ~GenericNPC ();
31
32  void init();
33  virtual void loadParams(const TiXmlElement* root);
34
35  void setAnimation(int animationIndex, int animPlaybackMode);
36  /** sets the sound volume to @param vol: volume of the sound */
37  inline void setVolume(float vol) { this->soundVolume = vol; }
38
39  void playAnimation(int animationIndex, int animPlaybackMode);
40
41  void playSound(std::string filename);
42  void playSound(int i);
43
44  float lookAt(WorldEntity* worldEntity);
45
46  float walkTo(const Vector& coordinate, const Quaternion& dir);
47  float walkTo(float x, float y, float z, float qu, float qx, float qy, float qz);
48  float walkTo(float x, float y, float qu, float qx, float qy, float qz);
49
50  float runTo(const Vector& coordinate, const Quaternion& dir);
51  float runTo(float x, float y, float z, float qu, float qx, float qy, float qz);
52  float runTo(float x, float y, float qu, float qx, float qy, float qz);
53
54  float crouchTo(const Vector& coordinate, const Quaternion& dir);
55  float crouchTo(float x, float y, float z, float qu, float qx, float qy, float qz);
56  float crouchTo(float x, float y, float qu, float qx, float qy, float qz);
57
58  float talkTo(WorldEntity* worldEntity, int dialogNr);
59
60
61  void destroy();
62
63  virtual void tick (float time);
64
65
66 private:
67   OrxSound::SoundSource                   soundSource;
68   OrxSound::SoundBuffer*                  soundBuffer;
69   float                                   soundVolume;
70
71   Vector                                  destCoor;
72   Quaternion                              destDir;
73};
74
75#endif /* _GENERIC_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.