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 */ |
---|
28 | inline WorldEntity* getEntityA() const { return this->entityA; } |
---|
29 | /** @return CollisionEvent WorldEntity B */ |
---|
30 | inline WorldEntity* getEntityB() const { return this->entityB; } |
---|
31 | /** @return Bounding Volume from EntityA */ |
---|
32 | inline BoundingVolume* getBVA() const { return this->bvA; } |
---|
33 | /** @return Bounding Volume from EntityB */ |
---|
34 | inline BoundingVolume* getBVB() const { return this->bvB; } |
---|
35 | |
---|
36 | |
---|
37 | private: |
---|
38 | WorldEntity* entityA; //!< the collision body A |
---|
39 | WorldEntity* entityB; //!< the collision body B |
---|
40 | |
---|
41 | BoundingVolume* bvA; //!< reference to the bounding volume A |
---|
42 | BoundingVolume* bvB; //!< reference to the bounding volume B |
---|
43 | }; |
---|
44 | |
---|
45 | #endif /* _COLLISION_EVENT_H */ |
---|