Changeset 8908 in orxonox.OLD for branches/single_player_map/src/world_entities/npcs/generic_npc.h
- Timestamp:
- Jun 29, 2006, 3:30:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/npcs/generic_npc.h
r8894 r8908 10 10 #include "npc.h" 11 11 12 #include <string>13 12 14 13 #include "sound_source.h" 15 16 #include "vector.h"17 #include "quaternion.h"18 19 14 20 15 namespace OrxSound{ class SoundSource; } … … 27 22 class GenericNPC : public NPC 28 23 { 24 25 29 26 public: 30 GenericNPC(); 31 GenericNPC(const TiXmlElement* root); 27 GenericNPC(const TiXmlElement* root = NULL); 32 28 virtual ~GenericNPC (); 33 29 34 void init();35 30 virtual void loadParams(const TiXmlElement* root); 36 31 … … 40 35 41 36 42 /* npc controlling functions */43 37 38 bool finalGoalReached() const { return this->behaviourList.empty(); }; 39 40 /* npc controlling functions to be Queued */ 44 41 /* walking functions */ 45 float walkTo(const Vector& coordinate, const Quaternion& dir); 46 float walkTo(float x, float y, float z); 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); 42 void walkTo(const Vector& coordinate); 43 void walkTo(float x, float y); 44 void walkTo(float x, float y, float z); 49 45 50 46 /* running functions */ 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);47 void runTo(const Vector& coordinate); 48 void runTo(float x, float y); 49 void runTo(float x, float y, float z); 54 50 55 51 /* couching functinos */ 56 float crouchTo(const Vector& coordinate, const Quaternion& dir);57 float crouchTo(float x, float y, float z, float qu, float qx, float qy, float qz);58 float crouchTo(float x, float y, float qu, float qx, float qy, float qz);52 void crouchTo(const Vector& coordinate); 53 void crouchTo(float x, float y); 54 void crouchTo(float x, float y, float z); 59 55 60 56 /* stopping the movement */ … … 62 58 63 59 /* some oriantation functions */ 64 float lookAt(WorldEntity* worldEntity); 65 bool turnTo(float qu, float qx, float qy, float qz); 60 void lookAt(WorldEntity* worldEntity); 61 void turnTo(float qu, float qx, float qy, float qz); 62 void turnTo(float degreeInY); 66 63 67 64 /* talking funcitons*/ 68 floattalkTo(WorldEntity* worldEntity, int dialogNr);65 void talkTo(WorldEntity* worldEntity, int dialogNr); 69 66 70 67 /* shooting functions */ … … 77 74 void playSound(int i); 78 75 79 void setTime(float newTime){ this->time = newTime; };80 81 76 virtual void tick (float time); 82 77 … … 84 79 void destroy(); 85 80 81 private: 82 void init(); 83 86 84 87 85 private: 86 87 typedef enum { 88 Walk, 89 Run, 90 Crouch, 91 Jump, 92 TurnTo, 93 LookAt, 94 TalkTo, 95 96 Shoot, 97 98 99 } AnimType; 100 101 typedef struct Anim 102 { 103 Anim(); 104 105 Vector v; 106 Quaternion q; 107 108 109 WorldEntity* entity; 110 float speed; 111 112 113 AnimType type; 114 }; 115 typedef std::list<GenericNPC::Anim> genNPCAnimList; 116 117 118 88 119 OrxSound::SoundSource soundSource; 89 120 OrxSound::SoundBuffer* soundBuffer; 90 121 float soundVolume; 91 122 123 std::list<GenericNPC::Anim> behaviourList; 92 124 Vector destCoor; 93 125 Quaternion destDir;
Note: See TracChangeset
for help on using the changeset viewer.