Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2006, 3:51:36 PM (18 years ago)
Author:
patrick
Message:

new collision registration functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/collision_reaction/collision_event.h

    r8862 r8864  
    99#include "vector.h"
    1010
     11#include "cr_defs.h"
     12
     13
    1114class WorldEntity;
    1215class BoundingVolume;
    1316class Plane;
     17
    1418
    1519
     
    2226
    2327  /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */
    24   inline void collide(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    25   { this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; }
     28  inline void collide(int type, WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
     29  { this->collisionType = type; this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; }
    2630  /** collides two WorldEntities @param entity world entity , @param ground ground plane, @param position position on the ground */
    27   inline void collide(WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position, bool bInWall)
    28   { this->entityA = entity; this->entityB = groundEntity, this->groundNormal = normal; this->position = position; this->bInWall = bInWall; }
     31  inline void collide(int type, WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position, bool bInWall)
     32  { this->collisionType = type; this->entityA = entity; this->entityB = groundEntity, this->groundNormal = normal; this->position = position; this->bInWall = bInWall; }
    2933
    3034
     
    4448  inline Vector getCollisionPosition() { return this->position; }
    4549
     50  /** @return the type of the collision */
     51  inline int getType() { return this->collisionType; }
     52
    4653  /** @return true if the entity is in the wall */
    4754  inline bool isInWall() { return this->bInWall; }
     
    5966
    6067  bool              bInWall;                       //!< true if is in wall
     68  int               collisionType;                 //!< collision type
    6169};
    6270
Note: See TracChangeset for help on using the changeset viewer.