Namespaces |
namespace | Moller |
Functions |
template<typename vector3_type > |
bool | aabb_aabb (vector3_type const &Amin, vector3_type const &Amax, vector3_type const &Bmin, vector3_type const &Bmax) |
template<typename aabb_type > |
bool | aabb_aabb (aabb_type const &A, aabb_type const &B) |
template<typename vector3_type , typename plane_type , typename real_type > |
bool | line_plane (vector3_type const &O, vector3_type const &D, plane_type const &plane, vector3_type &u, real_type &t) |
template<typename vector3_type , typename plane_type > |
bool | line_plane (vector3_type const &O, vector3_type const &D, plane_type const &plane, vector3_type &u) |
template<typename vector3_type , typename plane_type > |
vector3_type | line_plane (vector3_type const &v0, vector3_type const &v1, plane_type const &plane) |
template<typename vector3_type , typename sphere_type > |
bool | line_sphere (vector3_type const &b, vector3_type const &e, sphere_type const &sphere) |
template<typename vector3_type , typename triangle_type > |
bool | line_triangle (vector3_type const &p0, vector3_type const &p1, triangle_type const &triangle, vector3_type &p) |
template<typename obb_type > |
bool | obb_obb_sat (obb_type const &A, obb_type const &BinA) |
template<typename vector3_type > |
bool | point_aabb (vector3_type const &p, vector3_type const &min_coord, vector3_type const &max_coord) |
template<typename vector3_type , typename aabb_type > |
bool | point_aabb (vector3_type const &p, aabb_type const &aabb) |
template<typename vector3_type , typename real_type > |
bool | point_sphere (vector3_type const &p, vector3_type const ¢er, real_type const &squared_radius) |
template<typename vector3_type , typename sphere_type > |
bool | point_sphere (vector3_type const &p, sphere_type const &sphere) |
template<typename vector3_type , typename triangle_type > |
bool | point_triangle (vector3_type const &p, triangle_type const &triangle) |
template<typename real_type > |
int | rect_quad (real_type *rect, real_type *quad, real_type *ret) |
template<typename real_type > |
int | rect_quad_edges (real_type *rect, real_type *quad, bool *inside, real_type *ret) |
template<typename sphere_type , typename triangle_type > |
bool | sphere_triangle (sphere_type const &sphere, triangle_type const &triangle) |
template<typename triangle_type , typename vector3_container > |
bool | triangle_triangle (triangle_type const &A, triangle_type const &B, vector3_container &points) |
template<typename vector3_type > |
bool | triangle_triangle_sat (vector3_type const &a0, vector3_type const &a1, vector3_type const &a2, vector3_type const &b0, vector3_type const &b1, vector3_type const &b2) |
template<typename vector3_type > |
bool | separation_triangle_triangle (vector3_type const &a0, vector3_type const &a1, vector3_type const &a2, vector3_type const &b0, vector3_type const &b1, vector3_type const &b2) |
template<typename obb_type >
bool OpenTissue::intersect::obb_obb_sat |
( |
obb_type const & |
A, |
|
|
obb_type const & |
BinA | |
|
) |
| | |
OBB Separation Axis Test (SAT)
Typical usage:
CoordSys<real_type> Awcs = .... CoordSys<real_type> Bwcs = .... CoordSys<real_type> B2A = model_update(Awcs,Bwcs); OBB<real_type> A = .... OBB<real_type> B = .... OBB<real_type> BinA = B; BinA.xform(B2A);
bool separation = obb_sat(A,BinA);
- Parameters:
-
| A | A oriented bounding box. |
| BinA | Another oriented bounding box given in OBB A's local model frame. |
- Returns:
- if the return value is true an separation axis was found otherwise the two OBBs are not separated.
template<typename real_type >
Rectangle Quadrilateral Intersection Testing.
Intersection test between a rectanlge, given by the two half-edge extents rect[0] and rect[1], i.e. the rectangle is given by all points, p, lying in side
-rect[0] <= p(0) <= rect[0] and -rect[1] <= p(1) <= rect[1]
The quadrangle (orientated rectangle) are given by the 4 corner points:
q1(0) = quad[0] and q1(1) = quad[1] q2(0) = quad[2] and q2(1) = quad[3] q3(0) = quad[4] and q3(1) = quad[5] q4(0) = quad[6] and q4(1) = quad[7]
This method also returns interior points, not only edge-edge crossings.
- Parameters:
-
| rect | A pointer to an array (2 reals) that defines the rectangle. |
| quad | A pointer to an array (8 reals) that defines the quadrilateral. |
| ret | Upon return holds the coordinates of the intersection points. |
- Returns:
- The number of intersection points.
template<typename real_type >
Rectangle Quadrilateral Edges Intersection Testing.
Intersection test between a rectanlge, given by the two half-edge extents rect[0] and rect[1], i.e. the rectangle is given by all points, p, lying in side
-rect[0] <= p(0) <= rect[0] and -rect[1] <= p(1) <= rect[1]
The quadrangle (orientated rectangle) are given by the 4 corner points:
q1(0) = quad[0] and q1(1) = quad[1] q2(0) = quad[2] and q2(1) = quad[3] q3(0) = quad[4] and q3(1) = quad[5] q4(0) = quad[6] and q4(1) = quad[7]
This method is only concerned about edge-edge crossings, interior points are completely ignored.
- Parameters:
-
| rect | A pointer to an array (2 reals) that defines the rectangle. |
| quad | A pointer to an array (8 reals) that defines the quadrilateral. |
| inside | A pointer to an array (4 booleans) holding the inside status of quadrilateral corners. |
| ret | Upon return holds the coordinates of the intersection points. |
- Returns:
- The number of intersection points.