Ignore:
Timestamp:
01/16/08 21:30:29 (16 years ago)
Author:
bittner
Message:

Havran ray Caster update

File:
1 edited

Legend:

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

    r2599 r2602  
    9292// We give a box to which each ray is clipped to before the 
    9393// ray shooting is computed ! 
    94 void HavranRayCaster::CastRaysPacket4(const Vector3 &boxmax, 
    95                                                                           const Vector3 &boxmin, 
    96                                                                           const Vector3 origin4[], 
    97                                                                           const Vector3 direction4[], 
    98                                                                           int     result4[], 
    99                                                                           float   dist4[]) 
    100 { 
    101 #if defined(_USE_HAVRAN_SSE) 
    102 #ifdef USE_HAVRAN_RAYCASTER  
     94void HavranRayCaster::CastRaysPacket4(const Vector3 &minBox, 
     95                                      const Vector3 &maxBox, 
     96                                      const Vector3 origin4[], 
     97                                      const Vector3 direction4[], 
     98                                      int     result4[], 
     99                                      float   dist4[]) 
     100{ 
     101#ifdef USE_HAVRAN_RAYCASTER  
     102#ifdef _USE_HAVRAN_SSE  
    103103  for (int i = 0; i < 4; i++) { 
    104104    result4[i] = -1; 
    105         //      raypack.SetObject(i, NULL); 
    106105    raypack.SetLoc(i, origin4[i]); 
    107106    raypack.SetDir(i, direction4[i]); 
     
    111110  // a particular ASDS, otherwise it is emulated by decomposition 
    112111  // of a packet to individual rays and traced individually. 
    113   mKtbtree->FindNearestI(raypack, (Vector3&)boxmin, (Vector3&)boxmax); 
    114   //  mKtbtree->FindNearestI(raypack, bmin, bmax); 
     112  mKtbtree->FindNearestI(raypack, minBox, maxBox); 
    115113 
    116114  for (int i = 0; i < 4; i++) { 
     
    120118    if ( (intersectable = raypack.GetObject(i)) ) { 
    121119      // $$JB this is very hacky - > should be replaced with fetching the index of the triangle 
     120      // $$VH - this is object ID - is this the triangle index ??? 
    122121      result4[i] = intersectable->mId; 
    123122      dist4[i] = raypack.GetT(i); 
     
    126125   
    127126  return; 
    128 #endif // USE_HAVRAN_RAYCASTER  
    129127#else // _USE_HAVRAN_SSE 
    130128  // Compute the result ray by ray 
     
    133131    sray.mOrigin = origin4[i]; 
    134132    sray.mDirection = direction4[i]; 
    135     mKtbtree->FindNearestI(sray, (Vector3&)boxmin, (Vector3&)boxmax); 
     133    mKtbtree->FindNearestI(sray, minBox, maxBox); 
    136134    if (SimpleRay::IntersectionRes[0].intersectable) { 
    137135      // This is object ID - is this the triangle index ??? 
     
    145143   
    146144#endif // _USE_HAVRAN_SSE   
     145#endif // USE_HAVRAN_RAYCASTER  
    147146} 
    148147 
Note: See TracChangeset for help on using the changeset viewer.