Changeset 9037 in orxonox.OLD for branches/single_player_map
- Timestamp:
- Jul 3, 2006, 3:12:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r9036 r9037 88 88 89 89 // collision reaction registration 90 //this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);90 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 91 91 } 92 92 … … 178 178 */ 179 179 void GenericNPC::stop() 180 {} 180 { 181 182 } 181 183 182 184 … … 196 198 197 199 Vector dir = (currentAnimation.v - this->getAbsCoor()); 198 // dir.y = 0.0f;200 dir.y = this->getAbsCoor().y; 199 201 dir.getNormalized(); 200 202 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); … … 264 266 265 267 Vector dir = (currentAnimation.v - this->getAbsCoor()); 266 // dir.y = 0.0f;268 dir.y = this->getAbsCoor().y; 267 269 dir.getNormalized(); 268 270 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); … … 471 473 { 472 474 Vector dest = currentAnimation.v - this->getAbsCoor(); 475 dest.y = 0.0f; 476 PRINTF(0)("%s distance %f\n", this->getName(), dest.len()); 473 477 if (dest.len() < .5) 474 478 this->nextStep(); 475 479 else 476 480 { 477 //dest.y = 0.0f;481 //dest.y = 0.0f; 478 482 Vector move = dest.getNormalized() * currentAnimation.speed * dt; 479 483 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 484 } 484 485 } … … 525 526 } 526 527 527 //// physical falling of the player528 //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 //else538 //{539 //this->fallVelocity = 0.0f;540 //}528 // physical falling of the player 529 if( !this->isOnGround()) 530 { 531 this->fallVelocity += 300.0f * dt; 532 //velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 533 // PRINTF(0)("%s is not on ground\n", this->getName()); 534 535 this->shiftCoor(Vector(0, -this->fallVelocity * dt,0)); 536 537 } 538 else 539 { 540 this->fallVelocity = 0.0f; 541 } 541 542 542 543 }
Note: See TracChangeset
for help on using the changeset viewer.