Changeset 2726 for GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
- Timestamp:
- 05/30/08 02:37:07 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2724 r2726 966 966 SimpleRayContainer &rays) 967 967 { 968 return strategy.GenerateSamples(number, rays); 968 int invalidSamples; 969 return strategy.GenerateSamples(number, rays, invalidSamples); 970 } 971 972 973 int Preprocessor::GenerateRays(const int number, 974 SamplingStrategy &strategy, 975 SimpleRayContainer &rays, int &invalidSamples) 976 { 977 return strategy.GenerateSamples(number, rays, invalidSamples); 969 978 } 970 979 … … 975 984 SimpleRayContainer &rays) 976 985 { 977 const int startSize = (int)rays.size();978 986 SamplingStrategy *strategy = GenerateSamplingStrategy(sampleType); 987 988 if (!strategy) 989 return 0; 990 979 991 int castRays = 0; 980 981 if (!strategy) 982 { 983 return 0; 984 } 985 992 int invalidSamples; 986 993 #if 1 987 castRays = strategy->GenerateSamples(number, rays );994 castRays = strategy->GenerateSamples(number, rays, invalidSamples); 988 995 #else 989 996 GenerateRayBundle(rays, newRay, 16, 0); … … 1197 1204 1198 1205 // !!!!!!!!!!!!!!!! VH no sorting 1199 if ( 1200 rays.size() > 10000 1201 ) 1206 if (rays.size() > 10000) 1202 1207 { 1203 1208 mRayCaster->SortRays(rays); … … 1316 1321 1317 1322 1318 bool Preprocessor::GenerateRayBundle(SimpleRayContainer &rayBundle, 1319 const SimpleRay &mainRay, 1320 const int number, 1321 const int pertubType) const 1322 { 1323 rayBundle.push_back(mainRay); 1324 1325 const float pertubOrigin = 0.0f; 1326 const float pertubDir = 0.2f; 1327 1328 for (int i = 0; i < number - 1; ++ i) 1329 { 1330 Vector3 pertub; 1331 1332 pertub.x = RandomValue(0.0f, pertubDir); 1333 pertub.y = RandomValue(0.0f, pertubDir); 1334 pertub.z = RandomValue(0.0f, pertubDir); 1335 1336 const Vector3 newDir = mainRay.mDirection + pertub; 1323 bool Preprocessor::GenerateJitteredRays(SimpleRayContainer &rayBundle, 1324 const SimpleRay &mainRay, 1325 int number, 1326 int pertubType) const 1327 { 1328 //rayBundle.push_back(mainRay); 1329 //const float pertubOrigin = 0.0f; 1330 const float pertubDir = 0.01f; 1331 Vector3 pertub; 1332 1333 for (int i = 0; i < number; ++ i) 1334 { 1335 pertub.x = RandomValue(-pertubDir, pertubDir); 1336 pertub.y = RandomValue(-pertubDir, pertubDir); 1337 pertub.z = RandomValue(-pertubDir, pertubDir); 1338 1339 Vector3 newDir = mainRay.mDirection + pertub; 1340 const float c = Magnitude(newDir); 1341 newDir *= 1.0f / c; 1342 1337 1343 //const Vector3 newDir = mainRay.mDirection; 1338 1344 #if 0 1339 1345 pertub.x = RandomValue(0.0f, pertubOrigin); 1340 1346 pertub.y = RandomValue(0.0f, pertubOrigin); … … 1342 1348 1343 1349 const Vector3 newOrigin = mainRay.mOrigin + pertub; 1344 //const Vector3 newOrigin = mainRay.mOrigin; 1350 #endif 1351 const Vector3 newOrigin = mainRay.mOrigin; 1345 1352 1346 1353 rayBundle.push_back(SimpleRay(newOrigin, newDir, 0, 1.0f));
Note: See TracChangeset
for help on using the changeset viewer.