Changeset 8963 in orxonox.OLD for branches/single_player_map/src/world_entities/npcs
- Timestamp:
- Jun 30, 2006, 3:30:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r8961 r8963 176 176 if (!this->behaviourList.empty()) 177 177 { 178 GenericNPC::Anim currentAnimation = this->behaviourList.front(); 179 178 180 switch(this->behaviourList.front().type) 179 181 { 180 182 case Walk: 183 { 181 184 if( this->getAnimation() != RUN) 182 185 this->setAnimation(RUN, MD2_ANIM_LOOP); 186 187 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 188 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 189 } 183 190 break; 184 191 case Run: … … 216 223 return; 217 224 225 218 226 if (!this->behaviourList.empty()) 219 227 { 220 switch(this->behaviourList.front().type) 228 GenericNPC::Anim currentAnimation = this->behaviourList.front(); 229 230 switch( currentAnimation.type) 221 231 { 222 232 case Walk: 233 { 223 234 if( this->getAnimation() != RUN) 224 235 this->setAnimation(RUN, MD2_ANIM_LOOP); 236 237 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 238 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); 239 } 225 240 break; 226 241 case Run: … … 402 417 { 403 418 GenericNPC::Anim currentAnimation = this->behaviourList.front(); 419 404 420 switch( currentAnimation.type) 405 421 { … … 412 428 { 413 429 this->shiftCoor(dest.getNormalized() * currentAnimation.speed * dt); 414 this->setAbsDir(Quaternion(dest.getNormalized(), Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 430 415 431 } 416 432 }
Note: See TracChangeset
for help on using the changeset viewer.