Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_INTERSECT_INTERSECT_POINT_AABB_H
00002 #define OPENTISSUE_COLLISION_INTERSECT_INTERSECT_POINT_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 point_aabb(vector3_type const & p,vector3_type const & min_coord,vector3_type const & max_coord)
00030 {
00031 if( min_coord(0) > p(0) )
00032 return false;
00033 if( max_coord(0) < p(0) )
00034 return false;
00035 if( min_coord(1) > p(1) )
00036 return false;
00037 if( max_coord(1) < p(1) )
00038 return false;
00039 if( min_coord(2) > p(2) )
00040 return false;
00041 if( max_coord(2) < p(2) )
00042 return false;
00043 return true;
00044 }
00045
00046 template<typename vector3_type,typename aabb_type>
00047 bool point_aabb(vector3_type const & p,aabb_type const & aabb)
00048 {
00049 return point_aabb(p,aabb.min_coord(),aabb.max_coord());
00050 }
00051
00052 }
00053
00054 }
00055
00056
00057 #endif