Ignore:
Timestamp:
07/05/06 16:21:45 (18 years ago)
Author:
mattausch
Message:

worked on object space /view space partitioning

File:
1 edited

Legend:

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

    r1074 r1077  
    882882                                                         float maxBand); 
    883883 
    884         /** Prepares objects for SAH. 
    885                 @returns pvs size of the ray container 
    886         */ 
    887         int PrepareHeuristics(const RayInfoContainer &rays); 
    888  
    889         int PrepareHeuristics(Intersectable *object); 
    890  
    891884        /** Computes pvs increase with respect to the previous pvs for SAH. 
    892885        */ 
     
    916909        void RemoveContriFromPvs(KdLeaf *leaf, int &pvs) const; 
    917910        void AddContriToPvs(KdLeaf *leaf, int &pvs) const; 
     911 
     912        /** Prepares objects for SAH. 
     913                @returns pvs size of the ray container 
     914        */ 
     915        int PrepareHeuristics(const RayInfoContainer &rays); 
     916 
     917        int PrepareHeuristics(Intersectable *object); 
    918918 
    919919        /** Subdivides the rays into front and back rays according to the split plane. 
     
    13331333        // For sorting objects 
    13341334        // -------------------------------------------------------------- 
    1335         struct SortableEntry 
     1335        struct  SortableEntry 
    13361336        { 
    1337                 enum EType  
     1337                enum 
    13381338                { 
    1339                         ERayMin, 
    1340                         ERayMax 
     1339                        BOX_MIN, 
     1340                        BOX_MAX 
    13411341                }; 
    13421342 
    13431343                int type; 
    13441344                float value; 
    1345                 VssRay *ray; 
    1346    
     1345                Intersectable *mObject; 
     1346 
    13471347                SortableEntry() {} 
    1348                 SortableEntry(const int t, const float v, VssRay *r):type(t), 
    1349                                           value(v), ray(r)  
     1348 
     1349                SortableEntry(const int t, const float v, Intersectable *obj): 
     1350                type(t), value(v), mObject(obj)  
     1351                {} 
     1352 
     1353                bool operator<(const SortableEntry &b) const  
    13501354                { 
    1351                 } 
    1352                  
    1353                 friend bool operator<(const SortableEntry &a, const SortableEntry &b)  
    1354                 { 
    1355                         return a.value < b.value; 
     1355                        return value < b.value; 
    13561356                } 
    13571357        }; 
    13581358 
     1359  
    13591360        /** faster evaluation of split plane cost for kd axis aligned cells. 
    13601361        */ 
     
    14491450        /** Computes best cost for axis aligned planes. 
    14501451        */ 
    1451         float EvalLocalCostHeuristics(const RayInfoContainer &rays, 
     1452/*      float EvalLocalCostHeuristics(const RayInfoContainer &rays, 
    14521453                                                                  const AxisAlignedBox3 &box, 
    14531454                                                                  const int pvsSize, 
    14541455                                                                  const int axis, 
    14551456                                                                  float &position); 
     1457*/ 
     1458        float EvalLocalCostHeuristics(BspLeaf *node, 
     1459                const AxisAlignedBox3 &box, 
     1460                const int axis, 
     1461                float &position, 
     1462                int &objectsBack, 
     1463                int &objectsFront); 
    14561464 
    14571465        /** Subdivides the rays into front and back rays according to the split plane. 
     
    15231531        float GetMemUsage() const; 
    15241532 
     1533        /** Evaluates the influence on the pvs of the visibility event ve. 
     1534                @param ve the visibility event 
     1535                @param pvsLeft updates the left pvs 
     1536                @param rightPvs updates the right pvs 
     1537        */ 
     1538        void EvalPvsIncr(const SortableEntry &ve, 
     1539                                          int &pvsLeft, 
     1540                                          int &pvsRight) const; 
     1541 
     1542        void RemoveContriFromPvs(Intersectable *object, int &pvs) const; 
     1543        void AddContriToPvs(Intersectable *object, int &pvs) const; 
     1544 
     1545        /** Prepares objects for SAH. 
     1546                @returns pvs size of the ray container 
     1547        */ 
     1548        int PrepareHeuristics(const RayInfoContainer &rays); 
     1549 
     1550        int PrepareHeuristics(Intersectable *object); 
    15251551 
    15261552protected: 
Note: See TracChangeset for help on using the changeset viewer.