Line | |
---|
1 | /*! |
---|
2 | * @file bounding_volume.h |
---|
3 | * Definition of a bounding volume for collision detection algorithms |
---|
4 | |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _BOUNDING_VOLUME_H |
---|
8 | #define _BOUNDING_VOLUME_H |
---|
9 | |
---|
10 | #include "base_object.h" |
---|
11 | #include "model.h" |
---|
12 | |
---|
13 | |
---|
14 | template<class T> class tList; |
---|
15 | |
---|
16 | |
---|
17 | //! An abstract class representing a bounding volume |
---|
18 | class BoundingVolume : public BaseObject { |
---|
19 | ObjectListDeclaration(BoundingVolume); |
---|
20 | |
---|
21 | public: |
---|
22 | BoundingVolume(); |
---|
23 | virtual ~BoundingVolume(); |
---|
24 | |
---|
25 | inline const Vector& getCenter() const { return this->center; } |
---|
26 | inline const modelInfo* getModelInfo() const { return this->modelInf; } |
---|
27 | |
---|
28 | virtual void mergeWith(const BoundingVolume &bv) = 0; |
---|
29 | |
---|
30 | virtual void drawBV(int currentDepth, int drawMode) const = 0; |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | public: |
---|
35 | Vector center; //!< Weighter average center point of box |
---|
36 | Vector arithCenter; //!< Arithmetical center of the box |
---|
37 | |
---|
38 | const modelInfo* modelInf; //!< Reference to the model's ModelInfo |
---|
39 | const int* triangleIndexes; //!< Array with the triangle indexes in modelInfo |
---|
40 | int triangleIndexesLength; //!< length of the indexes array |
---|
41 | |
---|
42 | float radius; //!< the radius of the box (longest axis) |
---|
43 | }; |
---|
44 | |
---|
45 | #endif /* _BOUNDING_VOLUME_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.