Rev | Line | |
---|
[7959] | 1 | /*! |
---|
| 2 | * @file collision_event.h |
---|
| 3 | * Definition of a collision event |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #ifndef _COLLISION_EVENT_H |
---|
| 7 | #define _COLLISION_EVENT_H |
---|
| 8 | |
---|
| 9 | #include "vector.h" |
---|
| 10 | |
---|
| 11 | class WorldEntity; |
---|
| 12 | class BoundingVolume; |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | //! A class representing a simple collision |
---|
| 16 | class CollisionEvent { |
---|
| 17 | |
---|
| 18 | public: |
---|
| 19 | CollisionEvent(); |
---|
| 20 | virtual ~CollisionEvent(); |
---|
| 21 | |
---|
| 22 | /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */ |
---|
| 23 | inline void collide(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) |
---|
| 24 | { this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | /** @return CollisionEvent WorldEntity A */ |
---|
[7964] | 28 | inline WorldEntity* getEntityA() const { return this->entityA; } |
---|
[7959] | 29 | /** @return CollisionEvent WorldEntity B */ |
---|
[7964] | 30 | inline WorldEntity* getEntityB() const { return this->entityB; } |
---|
[7959] | 31 | /** @return Bounding Volume from EntityA */ |
---|
[7964] | 32 | inline BoundingVolume* getBVA() const { return this->bvA; } |
---|
[7959] | 33 | /** @return Bounding Volume from EntityB */ |
---|
[7964] | 34 | inline BoundingVolume* getBVB() const { return this->bvB; } |
---|
[7959] | 35 | |
---|
| 36 | |
---|
| 37 | private: |
---|
| 38 | WorldEntity* entityA; //!< the collision body A |
---|
| 39 | WorldEntity* entityB; //!< the collision body B |
---|
| 40 | |
---|
[8028] | 41 | BoundingVolume* bvA; //!< reference to the bounding volume A |
---|
| 42 | BoundingVolume* bvB; //!< reference to the bounding volume B |
---|
[7959] | 43 | }; |
---|
| 44 | |
---|
| 45 | #endif /* _COLLISION_EVENT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.