- Timestamp:
- 01/12/09 00:17:58 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.h
r3267 r3269 21 21 BvhNode *Construct(int &nodes); 22 22 23 /** Types of split heuristics. 24 */ 25 enum {SPATIAL_MEDIAN, OBJECT_MEDIAN, SAH}; 23 26 24 27 protected: 25 28 26 int SortTriangles(BvhLeaf *leaf, int axis, float position); 29 ////////// 30 //-- sorting functions 27 31 28 int SortTrianglesSpatialMedian(BvhLeaf *leaf, int axis); 29 32 /** The method of subdividing objects into halves in some axis using spatial median 33 */ 34 int SortTrianglesSpatialMedian(BvhLeaf *leaf, int axis); 35 /** The method of subdividing objects into halves in some axis 36 using object median. 37 */ 38 int SortTrianglesObjectMedian(BvhLeaf *leaf, int axis, float &pos); 39 /** sort triangles along the axis with respect to the splitting plane 40 given by axis/position return index of the first tiangles belong 41 to the front of the splitting plane. 42 */ 43 int SortTriangles(BvhLeaf *leaf, const int axis, const float position); 44 /** sort triangles by their area. 45 */ 46 int SortTrianglesSurfaceArea(BvhLeaf *leaf, float sa); 47 /** This function drives the subdivision. 48 */ 30 49 BvhNode *SubdivideLeaf(BvhLeaf *leaf, int parentAxis); 31 50 32 51 inline bool TerminationCriteriaMet(BvhLeaf *leaf) const; 52 /** Update the bounding box of this node and the child nodes 53 */ 54 void UpdateBoundingBoxes(BvhNode *node); 55 /** Select splitting plane using SAH - returns the position of the splitting plane. 56 */ 57 float SelectPlaneSah(BvhLeaf *leaf, int &axis, float &minCost); 58 /** evaluate the SAH cost of a particulkar splitting plane 59 */ 60 float EvaluateSahCost(BvhLeaf *leaf, int axis, float position); 33 61 34 void UpdateBoundingBoxes(BvhNode *node); 62 int CountTriangles(BvhNode *node) const; 63 35 64 36 65 … … 45 74 int mMaxObjects; 46 75 int mNumNodes; 76 int mSplitType; 77 int mMaxTriangles; 47 78 }; 48 79
Note: See TracChangeset
for help on using the changeset viewer.