Changeset 9035 in orxonox.OLD for branches/single_player_map/src/world_entities
- Timestamp:
- Jul 3, 2006, 2:17:40 PM (18 years ago)
- Location:
- branches/single_player_map/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r9032 r9035 40 40 ->addMethod("turnTo", ExecutorLua1<GenericNPC,float>(&GenericNPC::turnTo)) 41 41 ->addMethod("finalGoalReached", ExecutorLua0ret<GenericNPC,bool>(&GenericNPC::finalGoalReached)) 42 // Animation and sound43 ->addMethod("playAnimation", ExecutorLua2<GenericNPC,int,int>(&GenericNPC::playAnimation))44 ->addMethod("playSound", ExecutorLua1<GenericNPC,const std::string&>(&GenericNPC::playSound))45 42 // Display 46 43 ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide)) … … 91 88 92 89 // collision reaction registration 93 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);90 // this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 94 91 } 95 92 … … 172 169 * @param filename: name of the file 173 170 */ 174 void GenericNPC::playSound( const std::string&filename)171 void GenericNPC::playSound(std::string filename) 175 172 {} 176 173 … … 199 196 200 197 Vector dir = (currentAnimation.v - this->getAbsCoor()); 201 dir.y = 0.0f;198 // dir.y = 0.0f; 202 199 dir.getNormalized(); 203 200 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); … … 267 264 268 265 Vector dir = (currentAnimation.v - this->getAbsCoor()); 269 dir.y = 0.0f;266 // dir.y = 0.0f; 270 267 dir.getNormalized(); 271 268 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); … … 478 475 else 479 476 { 480 dest.y = 0.0f; 481 this->shiftCoor(dest.getNormalized() * currentAnimation.speed * dt); 482 477 // dest.y = 0.0f; 478 Vector move = dest.getNormalized() * currentAnimation.speed * dt; 479 this->shiftCoor(move); 480 PRINTF(0)("name %s, move:\n", this->getName()); 481 move.debug(); 482 // this->shiftCoor(Vector(0.0, 1.0, 1.0)); 483 483 } 484 484 } … … 525 525 } 526 526 527 // physical falling of the player 528 if( !this->isOnGround()) 529 { 530 this->fallVelocity += 300.0f * dt; 531 velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 532 // PRINTF(0)("%s is not on ground\n", this->getName()); 533 } 534 else 535 { 536 this->fallVelocity = 0.0f; 537 } 538 539 this->shiftCoor(Vector(0, -this->fallVelocity * dt,0)); 527 // // physical falling of the player 528 // if( !this->isOnGround()) 529 // { 530 // this->fallVelocity += 300.0f * dt; 531 // velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 532 // // PRINTF(0)("%s is not on ground\n", this->getName()); 533 // 534 // this->shiftCoor(Vector(0, -this->fallVelocity * dt,0)); 535 // 536 // } 537 // else 538 // { 539 // this->fallVelocity = 0.0f; 540 // } 540 541 541 542 } -
branches/single_player_map/src/world_entities/world_entity.cc
r9008 r9035 82 82 83 83 // registering default reactions: 84 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);84 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE); 85 85 86 86 this->toList(OM_NULL);
Note: See TracChangeset
for help on using the changeset viewer.