Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7833 in orxonox.OLD for branches/bsp_model/src/world_entities


Ignore:
Timestamp:
May 24, 2006, 6:41:08 PM (18 years ago)
Author:
bottac
Message:

collision detection.

Location:
branches/bsp_model/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/world_entities/world_entity.cc

    r7230 r7833  
    275275
    276276/**
     277 *  this function is called, when two entities collide
     278 * @param entity: the world entity with whom it collides
     279 *
     280 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
     281 */
     282void WorldEntity::collidesWithGround(const Vector& location)
     283{
     284  PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassName() );
     285}
     286
     287void WorldEntity::collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2)
     288{
     289 
     290  PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassName() );
     291  Vector v = this->getAbsDirX();
     292  v.x *= 10;
     293  v.y *= 10;
     294  v.z *= 10;
     295  this->setAbsCoor(ray_2 - v);
     296}
     297
     298/**
    277299 *  this is called immediately after the Entity has been constructed, initialized and then Spawned into the World
    278300 *
  • branches/bsp_model/src/world_entities/world_entity.h

    r7221 r7833  
    6262
    6363  virtual void collidesWith (WorldEntity* entity, const Vector& location);
     64  virtual void collidesWithGround(const Vector& location);
     65  virtual void collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2);
    6466  void drawBVTree(unsigned int depth, int drawMode) const;
    6567
Note: See TracChangeset for help on using the changeset viewer.