Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_INTERSECT_INTERSECT_AABB_AABB_H
00002 #define OPENTISSUE_COLLISION_INTERSECT_INTERSECT_AABB_AABB_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 namespace OpenTissue
00013 {
00014 namespace intersect
00015 {
00016
00028 template<typename vector3_type>
00029 bool aabb_aabb(
00030 vector3_type const & Amin
00031 , vector3_type const & Amax
00032 , vector3_type const & Bmin
00033 , vector3_type const & Bmax
00034 )
00035 {
00036 if(Bmin[0]>Amax[0] || Amin[0]>Bmax[0])
00037 return false;
00038 if(Bmin[1]>Amax[1] || Amin[1]>Bmax[1])
00039 return false;
00040 if(Bmin[2]>Amax[2] || Amin[2]>Bmax[2])
00041 return false;
00042 return true;
00043 }
00044
00045 template<typename aabb_type>
00046 bool aabb_aabb(
00047 aabb_type const & A
00048 , aabb_type const & B
00049 )
00050 {
00051 return aabb_aabb(A.min(),A.max(),B.min(),B.max());
00052 }
00053
00054 }
00055
00056 }
00057
00058
00059 #endif