Changeset 9110 in orxonox.OLD for trunk/src/world_entities/npcs/generic_npc.cc
- Timestamp:
- Jul 4, 2006, 11:18:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/generic_npc.cc
r9061 r9110 84 84 this->toList(OM_GROUP_00); 85 85 86 if (this->soundBuffer != NULL)87 ResourceManager::getInstance()->unload(this->soundBuffer);88 86 this->soundBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV); 89 87 … … 93 91 94 92 // collision reaction registration 95 //this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);93 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 96 94 } 97 95 … … 186 184 this->animationStack.push(this->behaviourList); 187 185 this->behaviourList = new std::list<GenericNPC::Anim>; 186 187 if( this->getAnimation() != STAND) 188 this->setAnimation(STAND, MD2_ANIM_LOOP); 188 189 } 189 190 … … 194 195 void GenericNPC::resume() 195 196 { 196 //if() 197 if( this->animationStack.size() == 0) 198 return; 199 197 200 delete this->behaviourList; 198 201 this->behaviourList = this->animationStack.top(); … … 219 222 Vector dir = (currentAnimation.v - this->getAbsCoor()); 220 223 dir.y = 0.0f; 221 dir. getNormalized();224 dir.normalize(); 222 225 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 223 226 … … 518 521 { 519 522 Vector dest = currentAnimation.v - this->getAbsCoor(); 523 dest.y = 0.0f; 520 524 if (dest.len() < .5) 521 525 this->nextStep(); … … 530 534 { 531 535 Vector dest = currentAnimation.v - this->getAbsCoor(); 536 dest.y = 0.0f; 532 537 if (dest.len() < .5) 533 538 this->nextStep();
Note: See TracChangeset
for help on using the changeset viewer.