- Timestamp:
- 08/28/06 21:13:40 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
r1251 r1292 15 15 16 16 17 SamplingPreprocessor::SamplingPreprocessor(): mPass(0)17 SamplingPreprocessor::SamplingPreprocessor(): Preprocessor(), mPass(0) 18 18 { 19 19 // this should increase coherence of the samples … … 36 36 ) 37 37 { 38 static Ray ray;39 38 AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 40 39 … … 43 42 if (!sbox.IsInside(origin)) 44 43 return 0; 45 46 ray.intersections.clear(); 47 // do not store anything else then intersections at the ray 48 ray.Init(origin, direction, Ray::LOCAL_RAY); 49 50 ray.mFlags &= ~Ray::CULL_BACKFACES; 51 52 44 45 Vector3 point, normal; 46 Intersectable *object; 53 47 54 48 // cast ray to KD tree to find intersection with other objects 55 Intersectable *objectA = NULL; 56 Vector3 pointA; 57 float bsize = Magnitude(box.Size()); 58 59 if (mKdTree->CastRay(ray)) { 60 if (!mDetectEmptyViewSpace || DotProd(ray.intersections[0].mNormal, direction) < 0) { 61 objectA = ray.intersections[0].mObject; 62 pointA = ray.Extrap(ray.intersections[0].mT); 63 } 64 } 65 return objectA; 49 object = CastSimpleRay(origin, 50 direction, 51 mKdTree->GetBox(), 52 point, 53 normal 54 ); 55 56 if (mDetectEmptyViewSpace && DotProd(normal, direction) >= 0) { 57 object = NULL; 58 } 59 60 return object; 66 61 } 67 62
Note: See TracChangeset
for help on using the changeset viewer.