Ignore:
Timestamp:
01/12/09 00:17:58 (15 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.h

    r3267 r3269  
    2121        BvhNode *Construct(int &nodes); 
    2222 
     23        /** Types of split heuristics. 
     24        */       
     25        enum {SPATIAL_MEDIAN, OBJECT_MEDIAN, SAH};       
    2326 
    2427protected: 
    2528 
    26         int SortTriangles(BvhLeaf *leaf, int axis, float position); 
     29        ////////// 
     30        //-- sorting functions 
    2731 
    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        */ 
    3049        BvhNode *SubdivideLeaf(BvhLeaf *leaf, int parentAxis); 
    3150 
    3251        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); 
    3361 
    34         void UpdateBoundingBoxes(BvhNode *node); 
     62        int CountTriangles(BvhNode *node) const; 
     63 
    3564 
    3665 
     
    4574        int mMaxObjects; 
    4675        int mNumNodes; 
     76        int mSplitType; 
     77        int mMaxTriangles; 
    4778}; 
    4879 
Note: See TracChangeset for help on using the changeset viewer.