Changeset 1297 for GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
- Timestamp:
- 08/30/06 04:39:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
r1233 r1297 543 543 float sum = pvsBack*(position - minBox) + pvsFront*(maxBox - position); 544 544 float newCost = ct_div_ci + sum/sizeBox; 545 float oldCost = pvsSize;545 float oldCost = (float)pvsSize; 546 546 ratio = newCost/oldCost; 547 547 548 } else { 548 549 // importance based cost … … 559 560 #else 560 561 #if 1 561 float newCost = raysBack*pvsBack + raysFront*pvsFront;562 float newCost = float(raysBack*pvsBack + raysFront*pvsFront); 562 563 float oldCost = (float)leaf->rays.size()*pvsSize; 563 564 ratio = newCost/oldCost; … … 807 808 float maxBand = minBox + 0.9*(maxBox - minBox); 808 809 809 float minRatio = 1e20 ;810 float minRatio = 1e20f; 810 811 811 812 Intersectable::NewMail(); … … 1663 1664 VssTreeLeaf *leaf = (VssTreeLeaf *)node; 1664 1665 float c = leaf->GetImportance(); 1665 int num = (c*ratioPerLeaf + 0.5 );1666 int num = (c*ratioPerLeaf + 0.5f); 1666 1667 // cout<<num<<" "; 1667 1668 … … 1720 1721 { 1721 1722 int nrays = (int)leaf->rays.size(); 1722 for (int i =0; i < numberOfRays; i++) {1723 for (int i = 0; i < numberOfRays; ++ i) { 1723 1724 // pickup 3 random rays 1724 int r1 = (int)RandomValue(0, nrays-1);1725 int r2 = (int)RandomValue(0, nrays-1);1726 int r3 = (int)RandomValue(0, nrays-1);1725 int r1 = (int)RandomValue(0, (float)(nrays-1)); 1726 int r2 = (int)RandomValue(0, (float)(nrays-1)); 1727 int r3 = (int)RandomValue(0, (float)(nrays-1)); 1727 1728 1728 1729 Vector3 o1 = leaf->rays[r1].Extrap(RandomValue(leaf->rays[r1].GetMinT(),
Note: See TracChangeset
for help on using the changeset viewer.