- Timestamp:
- 12/16/05 18:52:33 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r468 r469 75 75 { 76 76 // cast ray to KD tree to find intersection with other objects 77 mKdTree->CastRay(ray); 78 VssRay vssRay(ray); 79 mViewCellsManager->ComputeSampleContributions(vssRay); 80 return vssRay.mPvsContribution; 77 mKdTree->CastRay(ray); 78 VssRay vssRay(ray); 79 80 mViewCellsManager->ComputeSampleContributions(vssRay); 81 82 return vssRay.mPvsContribution; 81 83 } 82 84 … … 149 151 // pickup a random face of each mesh 150 152 Mesh *mesh = mi->GetMesh(); 151 int face = RandomValue(0, mesh->mFaces.size()-1);153 int face = (int)Random((int)mesh->mFaces.size()); 152 154 153 155 Polygon3 poly(mesh->mFaces[face], mesh); 154 poly.Scale(1.001 );156 poly.Scale(1.001f); 155 157 // now extend a random edge of the face 156 int edge = Random Value(0, poly.mVertices.size()-1);157 float t = RandomValue(0.0f, 1.0f);158 int edge = Random((int)poly.mVertices.size()); 159 float t = RandomValue(0.0f, 1.0f); 158 160 Vector3 target = t*poly.mVertices[edge] + (1.0f-t)*poly.mVertices[(edge + 1)% 159 161 poly.mVertices.size()]; … … 190 192 Debug << "Finding random neighbour" << endl; 191 193 for (int tries = 0; tries < 10; tries++) { 192 int index = Random Value(0, pvsSize - 1);194 int index = Random(pvsSize); 193 195 KdPvsData data; 194 196 KdNode *node;
Note: See TracChangeset
for help on using the changeset viewer.