Ignore:
Timestamp:
01/20/07 00:14:25 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1981 r1999  
    99#include "Mesh.h" 
    1010#include "Halton.h" 
     11#include "Triangle3.h" 
     12 
    1113 
    1214namespace GtpVisibilityPreprocessor { 
     
    556558AxisAlignedBox3::IsInside(const Vector3 &v) const 
    557559{ 
    558   return ! (v.x < mMin.x || 
    559             v.x > mMax.x || 
    560             v.y < mMin.y || 
    561             v.y > mMax.y || 
    562             v.z < mMin.z || 
    563             v.z > mMax.z); 
     560  return ! ((v.x < mMin.x) || 
     561            (v.x > mMax.x) || 
     562            (v.y < mMin.y) || 
     563            (v.y > mMax.y) || 
     564            (v.z < mMin.z) || 
     565            (v.z > mMax.z)); 
    564566} 
    565567#endif 
     
    23532355} 
    23542356 
     2357 
     2358 bool AxisAlignedBox3::Intersects(const Mesh &mesh) const 
     2359 { 
     2360         VertexContainer::const_iterator vit, vit_end = mesh.mVertices.end(); 
     2361 
     2362         for (vit = mesh.mVertices.begin(); vit != vit_end; ++ vit) 
     2363         { 
     2364                if (IsInside(*vit)) 
     2365                        return true; 
     2366         } 
     2367          
     2368         return false; 
     2369 } 
     2370 
     2371 
     2372 bool AxisAlignedBox3::Intersects(const Triangle3 &tri) const 
     2373 { 
     2374         if (IsInside(tri.mVertices[0]) || 
     2375                 IsInside(tri.mVertices[1]) || 
     2376                 IsInside(tri.mVertices[2])) 
     2377         { 
     2378                        return true; 
     2379         } 
     2380 
     2381         return false; 
     2382 } 
     2383 
    23552384/* 
    23562385int inline GetIntersection(const float fDst1,  
Note: See TracChangeset for help on using the changeset viewer.