Changeset 8909 in orxonox.OLD for branches/single_player_map/src/world_entities/npcs
- Timestamp:
- Jun 29, 2006, 3:48:16 PM (18 years ago)
- Location:
- branches/single_player_map/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r8908 r8909 149 149 void GenericNPC::walkTo(const Vector& coordinate) 150 150 { 151 } 152 153 void GenericNPC::walkTo(float x, float y) 154 {} 151 GenericNPC::Anim anim; 152 anim.v = coordinate; 153 anim.type = Walk; 154 155 this->behaviourList.push_back(anim); 156 } 155 157 156 158 void GenericNPC::walkTo(float x, float y, float z) 157 {} 159 { 160 this->walkTo(Vector(x,y,z)); 161 162 } 158 163 159 164 /* running functions */ 160 165 void GenericNPC::runTo(const Vector& coordinate) 161 {} 162 void GenericNPC::runTo(float x, float y) 163 {} 166 { 167 GenericNPC::Anim anim; 168 anim.v = coordinate; 169 anim.type = Run; 170 171 this->behaviourList.push_back(anim); 172 } 173 164 174 void GenericNPC::runTo(float x, float y, float z) 165 {} 175 { 176 this->runTo(Vector(x,y,z)); 177 } 166 178 167 179 /* couching functinos */ 168 180 void GenericNPC::crouchTo(const Vector& coordinate) 169 {} 170 void GenericNPC::crouchTo(float x, float y) 171 {} 181 { 182 GenericNPC::Anim anim; 183 anim.v = coordinate; 184 anim.type = Crouch; 185 186 this->behaviourList.push_back(anim); 187 } 172 188 void GenericNPC::crouchTo(float x, float y, float z) 173 {} 189 { 190 this->crouchTo(Vector(x,y,z)); 191 } 174 192 175 193 176 194 177 195 void GenericNPC::turnTo(float degreeInY) 178 {} 196 { 197 GenericNPC::Anim anim; 198 anim.q = Quaternion(Vector(0,1,0), degreeInY); 199 anim.type = TurnTo; 200 201 this->behaviourList.push_back(anim); 202 } 179 203 180 204 … … 185 209 */ 186 210 void GenericNPC::lookAt(WorldEntity* worldEntity) 187 {} 211 { 212 GenericNPC::Anim anim; 213 anim.entity = worldEntity; 214 anim.type = LookAt; 215 216 this->behaviourList.push_back(anim); 217 } 188 218 189 219 … … 223 253 if( likely(this->getModel(0) != NULL)) 224 254 ((InteractiveModel*)this->getModel(0))->tick(time); 255 256 257 if (!this->behaviourList.empty()) 258 { 259 switch(this->behaviourList.front().type) 260 { 261 case Walk: 262 break; 263 case Run: 264 break; 265 case Crouch: 266 break; 267 case LookAt: 268 break; 269 case Shoot: 270 break; 271 272 } 273 } 225 274 226 275 } -
branches/single_player_map/src/world_entities/npcs/generic_npc.h
r8908 r8909 41 41 /* walking functions */ 42 42 void walkTo(const Vector& coordinate); 43 void walkTo(float x, float y);44 43 void walkTo(float x, float y, float z); 45 44 46 45 /* running functions */ 47 46 void runTo(const Vector& coordinate); 48 void runTo(float x, float y);49 47 void runTo(float x, float y, float z); 50 48 51 49 /* couching functinos */ 52 50 void crouchTo(const Vector& coordinate); 53 void crouchTo(float x, float y);54 51 void crouchTo(float x, float y, float z); 55 52 56 53 /* stopping the movement */ 57 54 void stop(); 55 void nextStep(); 58 56 59 57 /* some oriantation functions */ … … 101 99 typedef struct Anim 102 100 { 103 Anim();104 105 101 Vector v; 106 102 Quaternion q;
Note: See TracChangeset
for help on using the changeset viewer.