Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_GJK_GJK_OUTSIDE_VERTEX_EDGE_VORONOI_PLANE_H
00002 #define OPENTISSUE_COLLISION_GJK_GJK_OUTSIDE_VERTEX_EDGE_VORONOI_PLANE_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/core/math/math_is_number.h>
00013
00014 #include <cassert>
00015
00016 namespace OpenTissue
00017 {
00018 namespace gjk
00019 {
00020
00021 namespace detail
00022 {
00023
00036 template< typename V >
00037 inline bool outside_vertex_edge_voronoi_plane(
00038 V const & p
00039 , V const & A
00040 , V const & B
00041 )
00042 {
00043 typedef typename V::value_traits value_traits;
00044 typedef typename V::value_type T;
00045
00046 V const n = (A-B);
00047 assert( dot( n, n ) > value_traits::zero() || !"outside_vertex_edge_voronoi_plane(): Degenerate edge encountered");
00048
00049 T const sign_p = dot( n, (p-A) );
00050 assert( is_number( sign_p ) || !"outside_vertex_edge_voronoi_plane(): Not a Number encountered");
00051
00052 return sign_p >= value_traits::zero();
00053 }
00054
00055
00056 }
00057
00058 }
00059
00060 }
00061
00062
00063 #endif