Changeset 296
- Timestamp:
- 09/21/05 10:30:44 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r295 r296 18 18 int BspTree::sSplitPlaneStrategy = NEXT_POLYGON; 19 19 int BspTree::sConstructionMethod = VIEW_CELLS; 20 float BspTree::sLeastSplitsFactor = 1.0f 21 float BspTree::sBalancedTreeFactor = 2.0f; 22 float BspTree::sVerticalFactor = 50.0f // very important criterium for 2.5d scenes 23 20 24 21 25 /** Evaluates split plane classification with respect to the plane's … … 688 692 } 689 693 690 /*if (sSplitPlaneStrategy & DRIVING_AXIS)694 /*if (sSplitPlaneStrategy & VERTICAL_AXIS) 691 695 { 692 696 const float dot_thres = 0.999; … … 737 741 float BspTree::EvalSplitPlane(const PolygonContainer &polys, const Plane3 &candidatePlane) const 738 742 { 739 float sumBalanced = 0, sumLeastSplits, drivingAxis = 0; 740 741 if (sSplitPlaneStrategy & DRIVING_AXIS) 742 { 743 drivingAxis = (candidatePlane.mNormal.DrivingAxis() == mBox.Size().DrivingAxis()) ? 744 99.0f : 0.0f; // always prefer driving axis => very high value 743 float sumBalanced = 0, sumLeastSplits = 0, verticalAxis = 0; 744 745 if (sSplitPlaneStrategy & VERTICAL_AXIS) 746 { 747 Vector3 thinAxis(0,0,0); thinAxis[mBox.size().ThinAxis()] = 1.0f; 748 // want to minimize this dot product 749 verticalAxis = DotProd(candidatePlane.mNormal, thinAxis); 750 751 //drivingAxis = (candidatePlane.mNormal.DrivingAxis() == mBox.Size().DrivingAxis()) ? 99.0f : 0.0f; 745 752 } 746 753 if ((sSplitPlaneStrategy & BALANCED_TREE) || (sSplitPlaneStrategy & LEAST_SPLITS)) … … 761 768 762 769 // return linear combination of the sums 763 return fabs(sumBalanced) + sumLeastSplits + drivingAxis;770 return sBalancedFactor * fabs(sumBalanced) + sLeastSplitsFactor * sumLeastSplits + sVerticalFactor * dotProd; 764 771 } 765 772 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r295 r296 439 439 LEAST_SPLITS = 2, 440 440 BALANCED_TREE = 4, 441 DRIVING_AXIS = 8,441 VERTICAL_AXIS = 8, 442 442 AXIS_ALIGNED = 16}; 443 443 … … 466 466 static int sConstructionMethod; 467 467 468 static float sLeastSplitsFactor; 469 static float sBalancedTreeFactor; 470 static float sVerticalFactor; 471 468 472 private: 469 473 /** Evaluates split plane classification with respect to the plane's
Note: See TracChangeset
for help on using the changeset viewer.