Changeset 8186 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jun 7, 2006, 2:40:46 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/WorldEntities.am
r8068 r8186 15 15 world_entities/test_entity.cc \ 16 16 world_entities/planet.cc \ 17 world_entities/bsp_entity.cc \ 17 18 \ 18 19 world_entities/weapons/test_gun.cc \ … … 67 68 test_entity.h \ 68 69 planet.h \ 70 bsp_entity.h \ 69 71 \ 70 72 weapons/test_gun.h \ -
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 * -
trunk/src/world_entities/world_entity.h
r8037 r8186 63 63 bool buildObbTree(int depth); 64 64 virtual void collidesWith (WorldEntity* entity, const Vector& location); 65 /** @returns a reference to the obb tree of this worldentity */ 65 virtual void collidesWithGround(const Vector& location); 66 virtual void collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2); 67 68 69 /** @returns a reference to the obb tree of this worldentity */ 66 70 inline BVTree* getOBBTree() const { return this->obbTree; }; 67 71 void drawBVTree(int depth, int drawMode) const;
Note: See TracChangeset
for help on using the changeset viewer.