Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cr/src/lib/collision_reaction/collision.h @ 8001

Last change on this file since 8001 was 7968, checked in by patrick, 18 years ago

cr: process call line almost clear now

File size: 1.4 KB
Line 
1/*!
2 * @file collision.h
3 *  Definition of a collision as a two WE hit each other
4 */
5
6#ifndef _COLLISION_H
7#define _COLLISION_H
8
9#include "vector.h"
10#include <vector>
11
12class WorldEntity;
13class BoundingVolume;
14class CollisionEvent;
15
16//! A class representing a simple collision
17class Collision
18{
19
20  public:
21    Collision();
22    virtual ~Collision();
23
24    /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */
25    inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; }
26
27
28    /** @return Collision WorldEntity A */
29    inline WorldEntity* getEntityA() const { return this->entityA; }
30    /** @return Collision WorldEntity B */
31    inline WorldEntity* getEntityB() const { return this->entityB; }
32
33    /** registers a @param event CollisionEvent to take place */
34    inline void registerCollisionEvent(CollisionEvent* event) { this->collisionEvents.push_back(event); }
35
36    void handleCollisionEvents();
37
38
39  private:
40    void flushCollisionEvents();
41
42
43  private:
44    WorldEntity*                 entityA;                       //!< the collision body A
45    WorldEntity*                 entityB;                       //!< the collision body B
46
47    std::vector<CollisionEvent*> collisionEvents;               //!< the collision event list
48};
49
50#endif /* _COLLISION_H */
Note: See TracBrowser for help on using the repository browser.