Rev | Line | |
---|
[7934] | 1 | /*! |
---|
[5039] | 2 | * @file collision.h |
---|
[7934] | 3 | * Definition of a collision event |
---|
| 4 | */ |
---|
[4510] | 5 | |
---|
[4511] | 6 | #ifndef _COLLISION_H |
---|
| 7 | #define _COLLISION_H |
---|
[4510] | 8 | |
---|
[4520] | 9 | #include "vector.h" |
---|
[4510] | 10 | |
---|
[4520] | 11 | class WorldEntity; |
---|
| 12 | class BoundingVolume; |
---|
[4510] | 13 | |
---|
[7934] | 14 | |
---|
[4511] | 15 | //! A class representing a simple collision |
---|
[7934] | 16 | class Collision { |
---|
[4510] | 17 | |
---|
| 18 | public: |
---|
[7940] | 19 | Collision(); |
---|
[4511] | 20 | virtual ~Collision(); |
---|
[4510] | 21 | |
---|
[7940] | 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; } |
---|
[7934] | 25 | |
---|
| 26 | |
---|
[7940] | 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 | |
---|
[7934] | 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 |
---|
[4510] | 43 | }; |
---|
| 44 | |
---|
[4511] | 45 | #endif /* _COLLISION_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.