Changeset 8186 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Jun 7, 2006, 2:40:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r8037 r8186 312 312 313 313 /** 314 * this function is called, when two entities collide 315 * @param entity: the world entity with whom it collides 316 * 317 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 318 */ 319 void WorldEntity::collidesWithGround(const Vector& location) 320 { 321 PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassName() ); 322 } 323 324 void WorldEntity::collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2) 325 { 326 327 // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassName() ); 328 329 Vector v = this->getAbsDirX(); 330 v.x *= 10; 331 v.y *= 10; 332 v.z *= 10; 333 Vector u = this->getAbsDirY(); 334 335 if(feet.x == (u.x+this->getAbsCoor().x) && feet.y == u.y +this->getAbsCoor().y && feet.z == this->getAbsCoor().z) 336 { 337 338 this->setAbsCoor(ray_2 - v); 339 } 340 else 341 { 342 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) 343 { 344 this->setAbsCoor(feet -u ); 345 } 346 347 this->setAbsCoor(ray_2 - v); 348 349 } 350 } 351 352 /** 314 353 * this is called immediately after the Entity has been constructed, initialized and then Spawned into the World 315 354 *
Note: See TracChangeset
for help on using the changeset viewer.