Ignore:
Timestamp:
08/28/06 21:13:40 (18 years ago)
Author:
bittner
Message:

intel ray caster updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp

    r1251 r1292  
    1515 
    1616 
    17 SamplingPreprocessor::SamplingPreprocessor(): mPass(0) 
     17SamplingPreprocessor::SamplingPreprocessor(): Preprocessor(), mPass(0) 
    1818{ 
    1919  // this should increase coherence of the samples 
     
    3636                                                          ) 
    3737{ 
    38   static Ray ray; 
    3938  AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 
    4039   
     
    4342  if (!sbox.IsInside(origin)) 
    4443        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; 
    5347 
    5448  // 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; 
    6661} 
    6762 
Note: See TracChangeset for help on using the changeset viewer.