|
template<class Ops , class Point > |
bool | advanceSimplex (Ops &ops, std::vector< MinkowskiPair< Point > > &simplex, Point &dir) |
| returns true if the origin is contained in the simplex, and if it is not, returns false and generates a new search direction More...
|
|
template<class Ops , class Point > |
bool | advanceSimplex2 (Ops &ops, PairVec< Point > &simplex, Point &dir) |
| returns true if the origin is contained in the segment More...
|
|
template<class Ops , class Point > |
bool | advanceSimplex3 (Ops &ops, PairVec< Point > &simplex, Point &dir) |
| returns true if the origin is contained in the triangle More...
|
|
template<class Ops , class Point > |
bool | advanceSimplex4 (Ops &ops, PairVec< Point > &simplex, Point &dir) |
| returns true if the origin is contained in the tetrahedron More...
|
|
template<class Ops , class SupportFn , class Point , class SimplexHistory , class PointHistory > |
Result | collisionDistance_2d_debug (Ops ops, SupportFn supportFn, Point &a, Point &b, Point &v, SimplexHistory sHist, PointHistory vHist, int maxIter=100) |
|
template<class Ops , class SupportFn , class Point > |
Result | collisionDistance_3d (Ops ops, SupportFn supportFn, Point &a, Point &b, Point &v, int maxIter=100) |
|
template<class Ops , class SupportFn , class Point , class SimplexHistory , class PointHistory , class ErrorHistory > |
Result | collisionDistance_3d_debug (Ops ops, SupportFn supportFn, Point &a, Point &b, Point &v, SimplexHistory sHist, PointHistory vHist, ErrorHistory eHist, int maxIter=100) |
|
template<class Ops , class Point > |
bool | growSimplex2 (Ops &ops, PairVec< Point > &simplex, Point &v) |
| returns true if the origin is contained in the segment More...
|
|
template<class Ops , class Point > |
bool | growSimplex3_2d (Ops &ops, PairVec< Point > &simplex, Point &v) |
| returns true if the origin is contained in the triangle More...
|
|
template<class Ops , class Point > |
bool | growSimplex3_3d (Ops &ops, PairVec< Point > &simplex, Point &v) |
| returns true if the origin is contained in the triangle More...
|
|
template<class Ops , class Point > |
bool | growSimplex4_3d (Ops &ops, PairVec< Point > &simplex, Point &v, int depth=0) |
| returns true if the origin is contained in the tetrahedron More...
|
|
template<class Ops , class Point > |
bool | growSimplex_2d (Ops &ops, std::vector< MinkowskiPair< Point > > &simplex, Point &v) |
| returns true if the origin is contained in the simplex, and if it is not, returns false and generates a new search direction More...
|
|
template<class Ops , class Point > |
bool | growSimplex_3d (Ops &ops, std::vector< MinkowskiPair< Point > > &simplex, Point &v) |
| returns true if the origin is contained in the simplex, and if it is not, returns false and generates a new search direction More...
|
|
template<class Ops , class SupportFn , class Point > |
Result | isCollision (Ops ops, SupportFn supportFn, Point &a, Point &b, Point &d, int maxIter=100) |
| GJK algorithm, determines if two convex objects are in collision. More...
|
|
template<int NDim, class Point > |
bool | isEqual (const Point &a, const Point &b) |
|
template<typename T > |
int | sgn (T val) |
|
template<class Ops , class SupportFn , class Point >
Result mpblocks::gjk88::isCollision |
( |
Ops |
ops, |
|
|
SupportFn |
supportFn, |
|
|
Point & |
a, |
|
|
Point & |
b, |
|
|
Point & |
d, |
|
|
int |
maxIter = 100 |
|
) |
| |
GJK algorithm, determines if two convex objects are in collision.
- Template Parameters
-
Ops | class providing vector math, see note |
SupportFn | functional which computes support points, see note |
Point | a three dimensional vector type, must support math operators + and - |
- Parameters
-
ops | provides vector math, see note |
supportFn | computes support points given a search direction |
a[in|out] | initial search point from object A |
b[in|out] | initial search point frmo object B |
d[out] | output, the last search direction from the algorithm |
maxIter | the maximum number of iterations to run |
- Returns
- either COLLISION, COLLISION_FREE, or INDETERMINANT if maxIter is reached
- Note
- Vector Math:
The point class must support arithmetic operations. For two points a,b the following must be valid and mean what they usually do:
The Ops struct provides dot product and cross product for the point type. These functions may be static, and ops need not have size (in fact, it probably shouldn't).
- Note
- Support Function:
SupportFn (and the object of it's type supportFn
) is a functional (i.e. has an operator() ) which implements the support function for the object pair. The signature should be something like:
void operator()( const Point& d, Point& a, Point& b )
d
is the search direction, and a
and b
are the function outputs. They should be the max/min points in the search direction from the two objects A/B (respectively).
Definition at line 365 of file gjk88.h.