Rev | Line | |
---|
[8508] | 1 | /*! |
---|
| 2 | * @file aabb.h |
---|
| 3 | * Definition of an AABB (Axix Aligned Bounding Box) |
---|
| 4 | |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef _AABB_H |
---|
| 8 | #define _AABB_H |
---|
| 9 | |
---|
| 10 | #include "base_object.h" |
---|
| 11 | #include "bounding_volume.h" |
---|
| 12 | |
---|
| 13 | //! A class representing an extended bounding volume tree: an obb tree |
---|
| 14 | class AABB : public BoundingVolume { |
---|
[9869] | 15 | ObjectListDeclaration(AABB); |
---|
[8508] | 16 | |
---|
| 17 | public: |
---|
| 18 | AABB(); |
---|
| 19 | virtual ~AABB(); |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | inline Vector getAxisX () const { return this->axis[0]; } |
---|
| 23 | inline Vector getAxisY () const { return this->axis[1]; } |
---|
| 24 | inline Vector getAxisZ () const { return this->axis[2]; } |
---|
| 25 | |
---|
| 26 | inline const float* getHalfLength() const { return this->halfLength; } |
---|
| 27 | |
---|
| 28 | virtual void mergeWith(const BoundingVolume &bv); |
---|
| 29 | |
---|
| 30 | virtual void drawBV(int currentDepth, int drawMode) const; |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | public: |
---|
| 35 | Vector axis[3]; //!< Axes of oriented box [x,y,z] |
---|
| 36 | float halfLength[3]; //!< Half lengths of the box along the axis |
---|
| 37 | float covarianceMatrix[3][3]; //!< the covariance matrix |
---|
| 38 | |
---|
| 39 | bool bCollided; //!< is true if this obb has collided |
---|
| 40 | |
---|
| 41 | }; |
---|
| 42 | |
---|
| 43 | #endif /* _AABB_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.