Revision 3262,
800 bytes
checked in by mattausch, 15 years ago
(diff) |
working on pompeii loading. fixed bug in obj conversion
|
Rev | Line | |
---|
[3262] | 1 | #ifndef __BVHCONSTRUCTOR_H
|
---|
| 2 | #define __BVHCONSTRUCTOR_H
|
---|
| 3 |
|
---|
| 4 | #include "Bvh.h"
|
---|
| 5 |
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | namespace CHCDemoEngine
|
---|
| 9 | {
|
---|
| 10 |
|
---|
| 11 | /** This class represents a bvh construction algorithm
|
---|
| 12 | */
|
---|
| 13 | class BvhConstructor
|
---|
| 14 | {
|
---|
| 15 | BvhConstructor(SceneEntity **entities, int first, int last);
|
---|
| 16 |
|
---|
| 17 | /** Constructs a bvh and returns the root and the number of bvh nodes.
|
---|
| 18 | */
|
---|
| 19 | BvhNode *Construct(int &nodes);
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | protected:
|
---|
| 23 |
|
---|
| 24 | int SortTriangles(BvhLeaf *leaf, int axis, float position);
|
---|
| 25 |
|
---|
| 26 | int SortTrianglesSpatialMedian(BvhLeaf *leaf, int axis);
|
---|
| 27 |
|
---|
| 28 | BvhNode *SubdivideLeaf(BvhLeaf *leaf, int parentAxis);
|
---|
| 29 |
|
---|
| 30 | inline bool TerminationCriteriaMet(BvhLeaf *leaf) const;
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | /////////////////
|
---|
| 34 |
|
---|
| 35 | SceneEntity **mEntities;
|
---|
| 36 |
|
---|
| 37 | int mFirst;
|
---|
| 38 | int mLast;
|
---|
| 39 |
|
---|
| 40 | int mMaxDepth;
|
---|
| 41 | int mMaxObjects;
|
---|
| 42 | int mNumNodes;
|
---|
| 43 | };
|
---|
| 44 |
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | #endif // __BVH_H |
---|
Note: See
TracBrowser
for help on using the repository browser.