Changeset 8966 in orxonox.OLD for branches/single_player_map/src/world_entities/npcs
- Timestamp:
- Jun 30, 2006, 4:15:48 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
r8964 r8966 87 87 88 88 time = 30.0f; 89 89 90 // collision reaction registration 90 //this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);91 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 91 92 } 92 93 … … 141 142 142 143 144 /** 145 * sets the animation speed of this entity 146 */ 147 void GenericNPC::setAnimationSpeed(float speed) 148 { 149 if( likely(this->getModel(0) != NULL)) 150 ((InteractiveModel*)this->getModel(0))->setAnimationSpeed(speed); 151 } 152 153 143 154 144 155 /** … … 187 198 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 188 199 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 200 201 this->setAnimationSpeed(0.5f); 189 202 } 190 203 break; … … 196 209 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 197 210 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 211 212 this->setAnimationSpeed(1.0f); 198 213 } 199 214 break; … … 205 220 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 206 221 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); 222 223 this->setAnimationSpeed(1.0f); 207 224 } 208 225 break; … … 247 264 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 248 265 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); 266 267 this->setAnimationSpeed(0.5f); 249 268 } 250 269 break; … … 256 275 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 257 276 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); 277 278 this->setAnimationSpeed(1.0f); 258 279 } 259 280 break; … … 265 286 Vector dir = (currentAnimation.v - this->getAbsCoor()).getNormalized(); 266 287 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); 288 289 this->setAnimationSpeed(1.0f); 267 290 } 268 291 break; … … 505 528 int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX); 506 529 530 this->setAnimationSpeed(1.0f); 531 507 532 if( randi == 1) 508 533 this->setAnimation(DEATH_FALLBACK, MD2_ANIM_ONCE); -
branches/single_player_map/src/world_entities/npcs/generic_npc.h
r8957 r8966 82 82 int getAnimation(); 83 83 bool isAnimationFinished(); 84 void setAnimationSpeed(float speed); 84 85 85 86 void initNPC();
Note: See TracChangeset
for help on using the changeset viewer.