Changeset 2187 for GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
- Timestamp:
- 03/05/07 11:07:44 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r2105 r2187 238 238 239 239 240 VssRay *RayCaster::RequestRay(const Vector3 &origin, 241 const Vector3 &termination, 242 Intersectable *originObject, 243 Intersectable *terminationObject, 244 const int pass, 245 const float pdf) 246 { 247 #if DEBUG_RAYCAST 248 Debug<<"PR2a"<<flush; 249 #endif 250 251 // old method: always allocate 252 if (1) return new VssRay(origin, termination, originObject, terminationObject, pass, pdf); 253 254 VssRay *vssRay = mVssRayPool.Alloc(); 255 256 #if DEBUG_RAYCAST 257 Debug<<"PR2b"<<flush; 258 #endif 259 260 *vssRay = VssRay(origin, termination, originObject, terminationObject, pass, pdf); 261 262 #if DEBUG_RAYCAST 263 Debug<<"PR2c"<<flush; 264 #endif 265 266 return vssRay; 267 } 268 240 269 241 270 int … … 306 335 307 336 if (!pruneInvalidRays || hitA.mObject) { 308 #if DEBUG_RAYCAST 309 Debug<<"PR2a"<<flush; 310 #endif 311 312 VssRay *vssRay = mVssRayPool.Alloc(); 313 314 #if DEBUG_RAYCAST 315 Debug<<"PR2b"<<flush; 316 #endif 317 *vssRay = VssRay( 318 !castDoubleRay ? simpleRay.mOrigin : clipB, 337 338 VssRay *vssRay = 339 RequestRay(!castDoubleRay ? simpleRay.mOrigin : clipB, 319 340 hitA.mPoint, 320 341 hitB.mObject, … … 323 344 1.0f //simpleRay.mPdf 324 345 ); 325 #if DEBUG_RAYCAST 326 Debug<<"PR2c"<<flush; 327 #endif 328 346 329 347 if (validA) 330 348 vssRay->mFlags |= VssRay::Valid; … … 344 362 if (castDoubleRay && (!pruneInvalidRays || hitB.mObject)) 345 363 { 346 VssRay *vssRay = mVssRayPool.Alloc(); 347 348 *vssRay = VssRay( 349 clipA, 350 hitB.mPoint, 351 hitA.mObject, 352 hitB.mObject, 353 mPreprocessor.mPass, 354 1.0f //simpleRay.mPdf 355 ); 364 VssRay *vssRay = RequestRay( 365 clipA, 366 hitB.mPoint, 367 hitA.mObject, 368 hitB.mObject, 369 mPreprocessor.mPass, 370 1.0f //simpleRay.mPdf 371 ); 356 372 357 373 if (validB) … … 381 397 const bool pruneInvalidRays ) 382 398 { 383 384 385 386 CastRay(399 SimpleRayContainer::const_iterator rit, rit_end = rays.end(); 400 401 for (rit = rays.begin(); rit != rit_end; ++ rit) { 402 CastRay( 387 403 *rit, 388 404 vssRays, … … 390 406 castDoubleRay, 391 407 pruneInvalidRays); 392 393 394 } 395 396 } 408 } 409 } 410 411 412 }
Note: See TracChangeset
for help on using the changeset viewer.