Changeset 9110 in orxonox.OLD for trunk/src/world_entities/npcs
- Timestamp:
- Jul 4, 2006, 11:18:41 AM (18 years ago)
- Location:
- trunk/src/world_entities/npcs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/door.cc
r9003 r9110 45 45 46 46 47 Door::Door ()48 {49 this->init();50 }51 52 53 47 Door::Door(const TiXmlElement* root) 54 48 { … … 56 50 this->setClassID(CL_DOOR, "Door"); 57 51 this->scale = 1.0f; 52 this->actionRadius = 1.0; 58 53 59 54 if( root != NULL) … … 62 57 this->toList(OM_COMMON); 63 58 this->bLocked = false; 59 this->bOpen = false; 64 60 65 61 this->loadMD2Texture("maps/doors.jpg"); -
trunk/src/world_entities/npcs/door.h
r9003 r9110 22 22 { 23 23 public: 24 Door (); 25 Door(const TiXmlElement* root); 24 Door(const TiXmlElement* root = NULL); 26 25 virtual ~Door (); 27 26 … … 43 42 44 43 private: 44 void init(); 45 45 bool checkOpen(); 46 46 void setAnimation(int animNum, int playbackMode = 0); -
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.