Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

merged the network branche back to trunk

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