Ignore:
Timestamp:
06/09/06 01:26:46 (18 years ago)
Author:
mattausch
Message:

started viewspace-objectspace subdivision
removed memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h

    r1002 r1006  
    1 #ifndef _VspBspTree_H__ 
    2 #define _VspBspTree_H__ 
     1#ifndef _VspOspTree_H__ 
     2#define _VspOspTree_H__ 
    33 
    44#include "Mesh.h" 
     
    3131 
    3232/** 
    33         This is a view space partitioning specialised BSPtree.   
    34         There are no polygon splits, but we split the sample rays.  
    35         The candidates for the next split plane are evaluated only  
    36         by checking the sampled visibility information.  
    37         The polygons are employed merely as candidates for the next split planes. 
     33        This class implements a structure holding two different hierarchies, 
     34        one for object space partitioning and one for view space partitioning. 
     35 
     36        The object space and the view space are subdivided using a cost heuristics. 
     37        If an object space split or a view space split is chosen is also evaluated 
     38        based on the heuristics.  
     39         
     40        The view space heuristics is evaluated by weighting and adding the pvss of the back and 
     41        front node of each specific split. unlike for the standalone method vspbsp tree, 
     42        the pvs of an object would not be the pvs of single object but that of all objects 
     43        which are contained in the same leaf of the object subdivision. This could be done 
     44        by storing the pointer to the object space partition parent, which would allow access to all children. 
     45        Another possibility is to include traced kd-cells in the ray casing process. 
     46 
     47        Accordingly, the object space heuristics is evaluated by storing a pvs of view cells with each object. 
     48        the contribution to an object to the pvs is the number of view cells it can be seen from. 
     49 
     50 
     51        There is a potential efficiency problem involved in a sense that once a certain type 
     52        of split is chosen for view space / object space, the candidates for the next split of  
     53        object space / view space must be reevaluated. 
     54         
    3855*/ 
    39 class VspBspTree  
     56class VspOspTree  
    4057{ 
    4158        friend class ViewCellsParseHandlers; 
    4259        friend class VspBspViewCellsManager; 
     60 
    4361public: 
    4462         
     63        /** A definition for an axis aligned plane. 
     64        */ 
     65        struct AxisAlignedPlane 
     66        { 
     67        public: 
     68                int mAxis; 
     69                float mPosition; 
     70        }; 
     71 
    4572        /** Additional data which is passed down the BSP tree during traversal. 
    4673        */ 
    47         class VspBspTraversalData 
     74        class VspOspTraversalData 
    4875        {   
    4976        public: 
    5077                /// the current node 
    5178                BspNode *mNode; 
    52                 /// polygonal data for splitting 
    53                 PolygonContainer *mPolygons; 
    5479                /// current depth 
    5580                int mDepth; 
     
    5883                /// the probability that this node contains view point 
    5984                float mProbability; 
    60                 /// geometry of node as induced by planes 
    61                 BspNodeGeometry *mGeometry; 
     85                /// the bounding box of the node 
     86                AxisAlignedBox3 mBoundingBox; 
    6287                /// pvs size 
    6388                int mPvs; 
    6489                /// how often this branch has missed the max-cost ratio 
    6590                int mMaxCostMisses; 
    66                 /// if this node is a kd-node (i.e., boundaries are axis aligned 
    67                 bool mIsKdNode; 
    6891                // current axis 
    6992                int mAxis; 
     
    80103 
    81104 
    82                 VspBspTraversalData(): 
     105                VspOspTraversalData(): 
    83106                mNode(NULL), 
    84                 mPolygons(NULL), 
    85107                mDepth(0), 
    86108                mRays(NULL), 
    87109                mPvs(0), 
    88110                mProbability(0.0), 
    89                 mGeometry(NULL), 
    90111                mMaxCostMisses(0),  
    91                 mIsKdNode(false), 
    92112                mPriority(0), 
    93113                mAxis(0) 
    94114                {} 
    95115                 
    96                 VspBspTraversalData(BspNode *node,  
    97                                                         PolygonContainer *polys,  
     116                VspOspTraversalData(BspNode *node,  
    98117                                                        const int depth,  
    99118                                                        RayInfoContainer *rays, 
    100119                                                        const int pvs, 
    101120                                                        const float p, 
    102                                                         BspNodeGeometry *geom):  
     121                                                        const AxisAlignedBox3 &box):  
    103122                mNode(node),  
    104                 mPolygons(polys),  
    105123                mDepth(depth),  
    106124                mRays(rays), 
    107125                mPvs(pvs), 
    108126                mProbability(p), 
    109                 mGeometry(geom), 
     127                mBoundingBox(box), 
    110128                mMaxCostMisses(0), 
    111                 mIsKdNode(false), 
    112129                mPriority(0), 
    113130                mAxis(0) 
    114131                {} 
    115132 
    116                 VspBspTraversalData(PolygonContainer *polys,  
     133                VspOspTraversalData(PolygonContainer *polys,  
    117134                                                        const int depth,  
    118135                                                        RayInfoContainer *rays, 
    119                                                         BspNodeGeometry *geom):  
     136                                                        const AxisAlignedBox3 &box):  
    120137                mNode(NULL),  
    121                 mPolygons(polys),  
    122138                mDepth(depth),  
    123139                mRays(rays), 
    124140                mPvs(0), 
    125141                mProbability(0), 
    126                 mGeometry(geom), 
    127142                mMaxCostMisses(0), 
    128                 mIsKdNode(false), 
    129                 mAxis(0) 
     143                mAxis(0), 
     144                mBoundingBox(box) 
    130145                {} 
    131146 
     
    141156                void Clear() 
    142157                { 
    143                         DEL_PTR(mPolygons); 
    144158                        DEL_PTR(mRays); 
    145                         DEL_PTR(mGeometry); 
    146                 } 
    147  
    148                 friend bool operator<(const VspBspTraversalData &a, const VspBspTraversalData &b) 
     159                } 
     160 
     161                friend bool operator<(const VspOspTraversalData &a, const VspOspTraversalData &b) 
    149162                { 
    150163                        return a.GetCost() < b.GetCost(); 
     
    153166         
    154167 
    155         typedef std::priority_queue<VspBspTraversalData> VspBspTraversalQueue; 
    156          
    157          
    158         struct VspBspSplitCandidate 
     168        typedef std::priority_queue<VspOspTraversalData> VspOspTraversalQueue; 
     169         
     170         
     171        struct VspOspSplitCandidate 
    159172        {   
    160                 /// the current node 
    161                 Plane3 mSplitPlane; 
    162                 /// split axis of this plane (0, 1, 2, or 3 if non-axis-aligned) 
    163                 int mSplitAxis; 
     173                /// the current plane 
     174                AxisAlignedPlane mSplitPlane; 
    164175                /// the number of misses of max cost ratio until this split 
    165176                int mMaxCostMisses; 
    166  
    167                 // parent data 
    168                 VspBspTraversalData mParentData; 
    169                 // cost of applying this split 
     177                /// parent data 
     178                VspOspTraversalData mParentData; 
     179                /// cost of applying this split 
    170180                float mRenderCost; 
    171181 
    172                 VspBspSplitCandidate(): mRenderCost(0)  
     182                VspOspSplitCandidate(): mRenderCost(0)  
    173183                {}; 
    174184 
    175                 VspBspSplitCandidate(const Plane3 &plane, const VspBspTraversalData &tData):  
     185                VspOspSplitCandidate(const AxisAlignedPlane &plane, const VspOspTraversalData &tData):  
    176186                mSplitPlane(plane), mParentData(tData), mRenderCost(0) 
    177187                {} 
     
    189199                } 
    190200 
    191                 friend bool operator<(const VspBspSplitCandidate &a, const VspBspSplitCandidate &b) 
     201                friend bool operator<(const VspOspSplitCandidate &a, const VspOspSplitCandidate &b) 
    192202                { 
    193203                        return a.GetCost() < b.GetCost(); 
     
    195205    }; 
    196206 
    197         typedef std::priority_queue<VspBspSplitCandidate> VspBspSplitQueue; 
     207        typedef std::priority_queue<VspOspSplitCandidate> VspOspSplitQueue; 
    198208 
    199209        /** Default constructor creating an empty tree. 
    200210        */  
    201         VspBspTree(); 
    202  
    203          
    204         /** Constructor creating an empty tree. Loads parameters  
    205                 from an environment file. 
    206         */  
    207         VspBspTree(Environment *env); 
     211        VspOspTree(); 
    208212 
    209213        /** Default destructor. 
    210214        */ 
    211         ~VspBspTree(); 
     215        ~VspOspTree(); 
    212216 
    213217        /** Returns BSP Tree statistics. 
     
    252256        int CastRay(Ray &ray); 
    253257 
    254         /// bsp tree construction types 
    255         enum {FROM_INPUT_VIEW_CELLS, FROM_SCENE_GEOMETRY, FROM_SAMPLES}; 
    256258 
    257259        /** finds neighbouring leaves of this tree node. 
     
    260262                                          vector<BspLeaf *> &neighbors,  
    261263                                          const bool onlyUnmailed) const; 
    262  
    263         /** Constructs geometry associated with the half space intersections  
    264                 leading to this node. 
    265         */ 
    266         void ConstructGeometry(BspNode *n, BspNodeGeometry &geom) const; 
    267          
    268         /** Construct geometry of view cell. 
    269         */ 
    270         void ConstructGeometry(ViewCell *vc, BspNodeGeometry &geom) const; 
    271264 
    272265        /** Returns random leaf of BSP tree. 
     
    400393        /** faster evaluation of split plane cost for kd axis aligned cells. 
    401394        */ 
    402         float EvalAxisAlignedSplitCost(const VspBspTraversalData &data, 
    403                                                                    const AxisAlignedBox3 &box, 
    404                                                                    const int axis, 
    405                                                                    const float &position, 
    406                                                                    float &pFront, 
    407                                                                    float &pBack) const; 
     395        float EvalSplitCost(const VspOspTraversalData &data, 
     396                                                const AxisAlignedBox3 &box, 
     397                                                const int axis, 
     398                                                const float &position, 
     399                                                float &pFront, 
     400                                                float &pBack) const; 
    408401 
    409402        /** Evaluates candidate for splitting. 
    410403        */ 
    411         void EvalSplitCandidate(VspBspTraversalData &tData, VspBspSplitCandidate &splitData); 
     404        void EvalSplitCandidate(VspOspTraversalData &tData, VspOspSplitCandidate &splitData); 
    412405 
    413406        /** Computes priority of the traversal data and stores it in tData. 
    414407        */ 
    415         void EvalPriority(VspBspTraversalData &tData) const; 
     408        void EvalPriority(VspOspTraversalData &tData) const; 
    416409 
    417410        /** Evaluates render cost decrease of next split. 
    418411        */ 
    419412        float EvalRenderCostDecrease(const Plane3 &candidatePlane, 
    420                                                                  const VspBspTraversalData &data) const; 
     413                                                                 const VspOspTraversalData &data) const; 
    421414 
    422415        /** Constructs tree using the split priority queue. 
    423416        */ 
    424         void ConstructWithSplitQueue(const PolygonContainer &polys, RayInfoContainer *rays); 
     417        void Construct(RayInfoContainer *rays); 
    425418 
    426419        /** Collects view cells in the subtree under root. 
     
    451444        /** Evaluates tree stats in the BSP tree leafs. 
    452445        */ 
    453         void EvaluateLeafStats(const VspBspTraversalData &data); 
     446        void EvaluateLeafStats(const VspOspTraversalData &data); 
    454447 
    455448        /** Subdivides node with respect to the traversal data. 
     
    458451                @returns new root of the subtree 
    459452        */ 
    460         BspNode *Subdivide(VspBspTraversalQueue &tStack,  
    461                                            VspBspTraversalData &tData); 
    462  
    463         BspNode *Subdivide(VspBspSplitQueue &tQueue, 
    464                                            VspBspSplitCandidate &splitCandidate); 
    465  
    466         /** Constructs the tree from the given traversal data. 
    467                 @param polys stores set of polygons on which subdivision may be based 
    468                 @param rays storesset of rays on which subdivision may be based 
    469         */ 
    470         void Construct(const PolygonContainer &polys, RayInfoContainer *rays); 
    471  
    472         /** Selects the best possible splitting plane.  
    473                 @param plane returns the split plane 
    474                 @param leaf the leaf to be split 
    475                 @param polys the polygon list on which the split decition is based 
    476                 @param rays ray container on which selection may be based 
    477                 @note the polygons can be reordered in the process 
    478                 @returns true if the cost of the split is under maxCostRatio 
    479  
    480         */ 
    481         bool SelectPlane(Plane3 &plane,  
    482                                          BspLeaf *leaf,  
    483                                          VspBspTraversalData &data, 
    484                                          VspBspTraversalData &frontData, 
    485                                          VspBspTraversalData &backData, 
    486                                          int &splitAxis); 
    487          
    488         /** Strategies where the effect of the split plane is tested 
    489             on all input rays. 
    490  
    491                 @returns the cost of the candidate split plane 
    492         */ 
    493         float EvalSplitPlaneCost(const Plane3 &candidatePlane,  
    494                                                          const VspBspTraversalData &data, 
    495                                                          BspNodeGeometry &geomFront, 
    496                                                          BspNodeGeometry &geomBack, 
    497                                                          float &pFront, 
    498                                                          float &pBack) const; 
    499  
     453        BspNode *Subdivide(VspOspSplitQueue &tQueue, 
     454                                           VspOspSplitCandidate &splitCandidate); 
     455 
     456         
    500457        /** Subdivides leaf. 
    501458                @param leaf the leaf to be subdivided 
     
    513470 
    514471        BspInterior *SubdivideNode(const Plane3 &splitPlane, 
    515                                                            VspBspTraversalData &tData, 
    516                                                            VspBspTraversalData &frontData, 
    517                                VspBspTraversalData &backData, 
    518                                                            PolygonContainer &coincident); 
    519  
    520         /** Extracts the meshes of the objects and adds them to polygons.  
    521                 Adds object aabb to the aabb of the tree. 
    522                 @param maxPolys the maximal number of objects to be stored as polygons 
    523                 @returns the number of polygons 
    524         */ 
    525         int AddToPolygonSoup(const ObjectContainer &objects,  
    526                                                  PolygonContainer &polys,  
    527                                                  int maxObjects = 0); 
    528  
    529         /** Extracts the meshes of the view cells and and adds them to polygons. 
    530                 Adds view cell aabb to the aabb of the tree. 
    531                 @param maxPolys the maximal number of objects to be stored as polygons 
    532                 @returns the number of polygons 
    533         */ 
    534         int AddToPolygonSoup(const ViewCellContainer &viewCells,  
    535                                                  PolygonContainer &polys,  
    536                                                  int maxObjects = 0); 
    537  
    538         /** Extract polygons of this mesh and add to polygon container. 
    539                 @param mesh the mesh that drives the polygon construction 
    540                 @param parent the parent intersectable this polygon is constructed from 
    541                 @returns number of polygons 
    542         */ 
    543         int AddMeshToPolygons(Mesh *mesh, PolygonContainer &polys, MeshInstance *parent); 
     472                                                           VspOspTraversalData &tData, 
     473                                                           VspOspTraversalData &frontData, 
     474                               VspOspTraversalData &backData); 
    544475 
    545476        /** Selects an axis aligned for the next split. 
    546477                @returns cost for this split 
    547478        */ 
    548         float SelectAxisAlignedPlane(Plane3 &plane,  
    549                                                                  const VspBspTraversalData &tData, 
    550                                                                  int &axis, 
    551                                                                  BspNodeGeometry **frontGeom, 
    552                                                                  BspNodeGeometry **backGeom, 
    553                                                                  float &pFront, 
    554                                                                  float &pBack, 
    555                                                                  const bool useKdSplit); 
     479        float SelectPlane(const VspOspTraversalData &tData, 
     480                                          AxisAlignedPlane &plane, 
     481                                          float &pFront, 
     482                                          float &pBack); 
    556483 
    557484        /** Sorts split candidates for surface area heuristics for axis aligned splits. 
     
    573500                                                                  float &position); 
    574501 
    575         /** Selects an axis aligned split plane. 
    576                 @Returns true if split is valied 
    577         */ 
    578         bool SelectAxisAlignedPlane(Plane3 &plane, const PolygonContainer &polys) const; 
    579  
    580502        /** Subdivides the rays into front and back rays according to the split plane. 
    581503                 
     
    593515                                  RayInfoContainer &backRays) const; 
    594516 
    595  
    596         /** Extracts the split planes representing the space bounded by node n. 
    597         */ 
    598         void ExtractHalfSpaces(BspNode *n, vector<Plane3> &halfSpaces) const; 
    599  
    600517        /** Adds the object to the pvs of the front and back leaf with a given classification. 
    601518 
     
    618535        /** Returns true if tree can be terminated. 
    619536        */ 
    620         inline bool LocalTerminationCriteriaMet(const VspBspTraversalData &data) const; 
     537        inline bool LocalTerminationCriteriaMet(const VspOspTraversalData &data) const; 
    621538 
    622539        /** Returns true if global tree can be terminated. 
    623540        */ 
    624         inline bool GlobalTerminationCriteriaMet(const VspBspTraversalData &data) const; 
    625  
    626         /** Computes accumulated ray lenght of this rays. 
    627         */ 
    628         float AccumulatedRayLength(const RayInfoContainer &rays) const; 
    629  
    630         /** Splits polygons with respect to the split plane. 
    631  
    632                 @param plane the split plane 
    633                 @param polys the polygons to be split. the polygons are consumed and 
    634                            distributed to the containers frontPolys, backPolys, coincident. 
    635                 @param frontPolys returns the polygons in the front of the split plane 
    636                 @param backPolys returns the polygons in the back of the split plane 
    637                 @param coincident returns the polygons coincident to the split plane 
    638  
    639                 @returns the number of splits    
    640         */ 
    641         int SplitPolygons(const Plane3 &plane, 
    642                                           PolygonContainer &polys,  
    643                                           PolygonContainer &frontPolys,  
    644                                           PolygonContainer &backPolys,  
    645                                           PolygonContainer &coincident) const; 
     541        inline bool GlobalTerminationCriteriaMet(const VspOspTraversalData &data) const; 
    646542 
    647543        /** Adds ray sample contributions to the PVS. 
     
    655551                                  int &contributingSamples); 
    656552 
    657  
    658  
    659  
    660  
    661          
    662         /** Take 3 ray endpoints, where two are minimum and one a maximum 
    663                 point or the other way round. 
    664         */ 
    665         Plane3 ChooseCandidatePlane(const RayInfoContainer &rays) const; 
    666  
    667         /** Take plane normal as plane normal and the midpoint of the ray. 
    668                 PROBLEM: does not resemble any point where visibility is  
    669                 likely to change 
    670         */ 
    671         Plane3 ChooseCandidatePlane2(const RayInfoContainer &rays) const; 
    672  
    673         /** Fit the plane between the two lines so that the plane  
    674                 has equal shortest distance to both lines. 
    675         */ 
    676         Plane3 ChooseCandidatePlane3(const RayInfoContainer &rays) const; 
    677    
    678         /** Collects candidates for merging. 
    679                 @param leaves the leaves to be merged 
    680                 @returns number of leaves in queue 
    681         */ 
    682         int CollectMergeCandidates(const vector<BspLeaf *> leaves, vector<MergeCandidate> &candidates); 
    683  
    684         /** Collects candidates for the merge in the merge queue. 
    685                 @returns number of leaves in queue 
    686         */ 
    687         int CollectMergeCandidates(const VssRayContainer &rays, vector<MergeCandidate> &candidates); 
    688          
    689         /** Preprocesses polygons and throws out all polygons which are coincident to 
    690                 the view space box faces (they can be problematic). 
    691         */ 
    692         void PreprocessPolygons(PolygonContainer &polys); 
    693          
    694553        /** Propagates valid flag up the tree. 
    695554        */ 
     
    707566        /** Returns estimated memory usage of tree. 
    708567        */ 
    709         //float GetMemUsage(const VspBspTraversalQueue &tstack) const; 
    710568        float GetMemUsage() const; 
    711569 
    712570 
     571protected: 
     572 
     573        ViewCellsManager *mViewCellsManager; 
     574        vector<SortableEntry> *mSplitCandidates; 
    713575 
    714576        /// Pointer to the root of the tree 
     
    716578                 
    717579        BspTreeStatistics mBspStats; 
    718  
    719         /// Strategies for choosing next split plane. 
    720         enum {NO_STRATEGY = 0, 
    721                   RANDOM_POLYGON = 1,  
    722                   AXIS_ALIGNED = 2, 
    723                   LEAST_RAY_SPLITS = 256, 
    724                   BALANCED_RAYS = 512, 
    725                   PVS = 1024 
    726                 }; 
     580         
     581        /// View cell corresponding to the space outside the valid view space 
     582        BspViewCell *mOutOfBoundsCell; 
    727583 
    728584        /// box around the whole view domain 
    729585        AxisAlignedBox3 mBox; 
    730586 
    731         bool mUseCostHeuristics; 
     587 
     588 
     589        //-- local termination 
    732590 
    733591        /// minimal number of rays before subdivision termination 
     
    741599        /// maximal contribution per ray 
    742600        float mTermMaxRayContribution; 
    743         /// minimal accumulated ray length 
    744         float mTermMinAccRayLength; 
    745  
    746         //HACK 
    747         int mTermMinPolygons; 
    748  
    749         float mTermMinGlobalCostRatio; 
    750         int mTermGlobalCostMissTolerance; 
    751  
    752         int mGlobalCostMisses; 
    753  
    754         bool mUseSplitCostQueue; 
    755         //-- termination criteria for axis aligned split 
    756  
    757         /// minimal number of rays for axis aligned split 
    758         int mTermMinRaysForAxisAligned; 
    759         // max ray contribution 
    760         float mTermMaxRayContriForAxisAligned; 
    761  
    762         /// strategy to get the best split plane 
    763         int mSplitPlaneStrategy; 
    764         /// number of candidates evaluated for the next split plane 
    765         int mMaxPolyCandidates; 
    766         /// number of candidates for split planes evaluated using the rays 
    767         int mMaxRayCandidates; 
    768         /// balancing factor for PVS criterium 
    769         float mCtDivCi; 
    770  
    771         bool mUseDrivingAxisForMaxCost; 
    772         //-- axis aligned split criteria 
    773         float mAxisAlignedCtDivCi; 
    774         /// spezifies the split border of the axis aligned split 
    775         float mAxisAlignedSplitBorder; 
    776  
    777601        /// maximal acceptable cost ratio 
    778602        float mTermMaxCostRatio; 
     
    780604        int mTermMissTolerance; 
    781605 
    782         //-- factors guiding the split plane heuristics 
    783         float mLeastRaySplitsFactor; 
    784         float mBalancedRaysFactor; 
    785         float mPvsFactor; 
    786  
    787         /// if area or volume should be used for PVS heuristics 
    788         bool mUseAreaForPvs; 
    789         /// tolerance for polygon split 
    790         float mEpsilon; 
    791         /// maximal number of test rays used to evaluate candidate split plane 
    792         int mMaxTests; 
    793         /// normalizes different bsp split plane criteria 
    794         float mCostNormalizer; 
     606 
     607        //-- global criteria 
     608        float mTermMinGlobalCostRatio; 
     609        int mTermGlobalCostMissTolerance; 
     610        int mGlobalCostMisses; 
     611 
    795612        /// maximal number of view cells 
    796613        int mMaxViewCells; 
    797          
    798         ofstream  mSubdivisionStats; 
    799  
    800         // if rays should be stored in leaves 
    801         bool mStoreRays; 
    802          
    803         /// if only driving axis should be used for split 
    804         bool mOnlyDrivingAxis; 
    805  
    806         ViewCellsManager *mViewCellsManager; 
    807  
    808         vector<SortableEntry> *mSplitCandidates; 
    809  
    810          
    811         float mRenderCostWeight; 
    812         /// View cell corresponding to the space outside the valid view space 
    813         BspViewCell *mOutOfBoundsCell; 
    814  
    815614        /// maximal tree memory 
    816615        float mMaxMemory; 
    817616        /// the tree is out of memory 
    818617        bool mOutOfMemory; 
    819          
    820         float mTotalCost; 
    821         int mTotalPvsSize; 
    822  
    823         float mMinBand; 
    824         float mMaxBand; 
    825  
    826         //int mSplits; 
    827         /// subdivision stats output file 
    828         ofstream mSubdivsionStats; 
     618 
     619 
     620 
     621        //-- split heuristics based parameters 
     622         
     623        bool mUseCostHeuristics; 
     624        /// balancing factor for PVS criterium 
     625        float mCtDivCi;  
     626        /// if only driving axis should be used for split 
     627        bool mOnlyDrivingAxis; 
    829628        /// if random split axis should be used 
    830629        bool mUseRandomAxis; 
    831         /// use polygon split whenever there are polys left 
    832         bool mUsePolygonSplitIfAvailable; 
     630        /// if vsp bsp tree should simulate octree 
     631        bool mCirculatingAxis; 
     632        /// minimal relative position where the split axis can be placed 
     633        float mMinBand; 
     634        /// maximal relative position where the split axis can be placed 
     635        float mMaxBand; 
     636 
     637 
    833638        /// current time stamp (used for keeping split history) 
    834639        int mTimeStamp; 
     640        // if rays should be stored in leaves 
     641        bool mStoreRays; 
     642 
     643        /// epsilon for geometric comparisons 
     644        float mEpsilon; 
     645 
     646        /// if we should use breath first priority for the splits 
     647        int mNodePriorityQueueType; 
     648 
     649        // priority queue strategy 
     650        enum {BREATH_FIRST, DEPTH_FIRST, COST_BASED}; 
     651 
     652 
     653        /// subdivision stats output file 
     654        ofstream  mSubdivisionStats; 
     655        /// keeps track of cost during subdivision 
     656        float mTotalCost; 
     657        /// keeps track of overall pvs size during subdivision 
     658        int mTotalPvsSize; 
    835659        /// number of currenly generated view cells 
    836660        int mCreatedViewCells; 
    837         /// if vsp bsp tree should simulate octree 
    838         bool mCirculatingAxis; 
    839  
    840         /// if we should use breath first priority for the splits 
    841         int mNodePriorityQueueType; 
    842  
    843         bool mEmptyViewCellsMergeAllowed; 
    844  
    845         // priority queue strategy 
    846         enum {BREATH_FIRST, DEPTH_FIRST, COST_BASED}; 
     661 
    847662private: 
    848663 
Note: See TracChangeset for help on using the changeset viewer.