Changeset 8490 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Jun 15, 2006, 9:34:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r8316 r8490 21 21 22 22 #include "model.h" 23 #include "md2Model.h" 23 #include "md2/md2Model.h" 24 #include "md3/md3_model.h" 25 24 26 #include "util/loading/resource_manager.h" 25 27 #include "util/loading/load_param.h" … … 77 79 78 80 // registering default reactions: 79 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY); 80 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND, CL_TERRAIN); 81 // this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY); 81 82 82 83 this->toList(OM_NULL); … … 200 201 this->buildObbTree(obbTreeDepth); 201 202 } 203 else if(fileName.find(".md3") != std::string::npos) 204 { 205 PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str()); 206 Model* m = new md3::MD3Model(fileName, this->scaling); 207 this->setModel(m, 0); 208 209 // if( m != NULL) 210 // this->buildObbTree(obbTreeDepth); 211 } 202 212 } 203 213 else … … 411 421 * @param position it collides on the plane 412 422 */ 413 bool WorldEntity::registerCollision(WorldEntity* entity, Plane* plane, Vector position)423 bool WorldEntity::registerCollision(WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position) 414 424 { 415 425 // is there any handler listening? … … 420 430 CollisionEvent* c = CREngine::getInstance()->popCollisionEventObject(); 421 431 assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h 422 c->collide(entity, plane, position);432 c->collide(entity, groundEntity, normal, position); 423 433 424 434 for( int i = 0; i < CREngine::CR_NUMBER; ++i) … … 501 511 502 512 Vector v = this->getAbsDirX(); 503 v.x *= 10; 504 v.y *= 10; 505 v.z *= 10; 506 Vector u = this->getAbsDirY(); 507 508 if(feet.x == (u.x+this->getAbsCoor().x) && feet.y == u.y +this->getAbsCoor().y && feet.z == this->getAbsCoor().z) 513 v.x *= 10.1; 514 v.y *= 10.1; 515 v.z *= 10.1; 516 Vector u = Vector(0.0,-20.0,0.0); 517 518 519 if(!(this->getAbsCoor().x == ray_2.x && this->getAbsCoor().y == ray_2.y && this->getAbsCoor().z == ray_2.z) ) 509 520 { 510 521 511 522 this->setAbsCoor(ray_2 - v); 512 } 513 else 523 524 } 525 else 514 526 { 515 527 if(ray_1.x == this->getAbsCoor().x + v.x && ray_1.y == this->getAbsCoor().y + v.y + 0.1 && ray_1.z ==this->getAbsCoor().z + v.z) … … 521 533 522 534 } 535 536 523 537 } 524 538
Note: See TracChangeset
for help on using the changeset viewer.