Changeset 453
- Timestamp:
- 12/06/05 01:08:18 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r439 r453 12 12 struct Triangle3; 13 13 class BspLeaf; 14 class VspKdTree; 15 class VspKdTreeLeaf; 14 16 15 17 /** … … 58 60 }; 59 61 62 class VspKdViewCell: public ViewCell 63 { 64 public: 65 VspKdViewCell(): mVspKdLeaves(0) {} 66 VspKdViewCell(Mesh *mesh): 67 ViewCell(mesh), mVspKdLeaves(0) {} 68 69 float GetSize() {return 0;} 70 /// Leaves which hold this view cell. 71 vector<VspKdTreeLeaf *> mVspKdLeaves; 72 }; 60 73 #endif -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r452 r453 1681 1681 return false; 1682 1682 1683 int fdiff = fvc->GetPvs().Diff(bvc->GetPvs());1683 const int fdiff = fvc->GetPvs().Diff(bvc->GetPvs()); 1684 1684 1685 1685 if (fvc->GetPvs().GetSize() + fdiff < mMaxPvs) -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
r452 r453 25 25 #include "Ray.h" 26 26 #include "RayInfo.h" 27 27 #include "ViewCellsManager.h" 28 #include "ViewCell.h" 28 29 29 30 // Static variables … … 269 270 for (it = mRays.begin(); it != mRays.end(); ++ it) 270 271 rays.push_back((*it).mRay); 272 } 273 274 ViewCell *VspKdTreeLeaf::GetViewCell() 275 { 276 return mViewCell; 271 277 } 272 278 … … 1873 1879 {} 1874 1880 1875 int MergeCandidate::ComputePvsDifference() const1876 {1877 return 0;1878 }1879 1880 1881 float MergeCandidate::EvaluateMergeCost() const 1881 1882 { 1882 return 0; 1883 } 1883 // pvs difference 1884 VspKdViewCell *vc1 = dynamic_cast<VspKdViewCell *>(mLeaf1->GetViewCell()); 1885 VspKdViewCell *vc2 = dynamic_cast<VspKdViewCell *>(mLeaf2->GetViewCell()); 1886 1887 const int diff1 = vc1->GetPvs().Diff(vc2->GetPvs()); 1888 1889 //const int diff2 = vc2->GetPvs().Diff(vc1->GetPvs()); 1890 //const float simDiff = (float)max(diff1, diff2); 1891 1892 const float oldCost = 1893 vc1->GetSize() * vc1->GetPvs().GetSize() + 1894 vc2->GetSize() * vc2->GetPvs().GetSize(); 1895 1896 const float mergedPvsCost = 1897 (diff1 + vc1->GetPvs().GetSize()) * 1898 (vc1->GetSize() + vc2->GetSize()); 1899 1900 return mergedPvsCost / oldCost; 1901 } -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h
r452 r453 49 49 /** Computes PVS difference between the leaves. 50 50 */ 51 int ComputePvsDifference() const;51 //int ComputePvsDifference() const; 52 52 53 53 /** Evaluates the merge costs of this leaf. … … 57 57 friend bool operator<(const MergeCandidate &leafa, const MergeCandidate &leafb) 58 58 { 59 return leafa. ComputePvsDifference() < leafb.ComputePvsDifference();59 return leafa.EvaluateMergeCost() < leafb.EvaluateMergeCost(); 60 60 } 61 61 }; … … 322 322 323 323 static int mailID; 324 325 /** Returns view cell. 326 */ 327 ViewCell *GetViewCell(); 324 328 325 329 protected:
Note: See TracChangeset
for help on using the changeset viewer.