Line | |
---|
1 | /*! |
---|
2 | * @file collision.h |
---|
3 | * Definition of a collision event |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _COLLISION_H |
---|
7 | #define _COLLISION_H |
---|
8 | |
---|
9 | #include "vector.h" |
---|
10 | |
---|
11 | class WorldEntity; |
---|
12 | class BoundingVolume; |
---|
13 | |
---|
14 | |
---|
15 | //! A class representing a simple collision |
---|
16 | class Collision { |
---|
17 | |
---|
18 | public: |
---|
19 | Collision(); |
---|
20 | virtual ~Collision(); |
---|
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 Collision WorldEntity A */ |
---|
28 | inline const WorldEntity* getEntityA() const { return this->entityA; } |
---|
29 | /** @return Collision WorldEntity B */ |
---|
30 | inline const WorldEntity* getEntityB() const { return this->entityB; } |
---|
31 | /** @return Bounding Volume from EntityA */ |
---|
32 | inline const BoundingVolume* getBVA() const { return this->bvA; } |
---|
33 | /** @return Bounding Volume from EntityB */ |
---|
34 | inline const 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_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.