Functions | |
static int | __ccdEPA (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_simplex_t *simplex, ccd_pt_t *polytope, ccd_pt_el_t **nearest) |
static int | __ccdGJK (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_simplex_t *simplex) |
static ccd_real_t | _ccdDist (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_simplex_t *simplex, ccd_vec3_t *p1, ccd_vec3_t *p2) |
static bool | are_coincident (const ccd_vec3_t &p, const ccd_vec3_t &q) |
static ccd_real_t | ccdGJKDist2 (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_vec3_t *p1, ccd_vec3_t *p2) |
static ccd_real_t | ccdGJKSignedDist (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_vec3_t *p1, ccd_vec3_t *p2) |
static void | ClassifyBorderEdge (ccd_pt_edge_t *edge, std::unordered_set< ccd_pt_edge_t * > *border_edges, std::unordered_set< ccd_pt_edge_t * > *internal_edges) |
static void | ClassifyInternalEdge (ccd_pt_edge_t *edge, std::unordered_set< ccd_pt_edge_t * > *border_edges, std::unordered_set< ccd_pt_edge_t * > *internal_edges) |
static void | ComputeVisiblePatch (const ccd_pt_t &polytope, ccd_pt_face_t &f, const ccd_vec3_t &query_point, std::unordered_set< ccd_pt_edge_t * > *border_edges, std::unordered_set< ccd_pt_face_t * > *visible_faces, std::unordered_set< ccd_pt_edge_t * > *internal_edges) |
static void | ComputeVisiblePatchRecursive (const ccd_pt_t &polytope, ccd_pt_face_t &f, int edge_index, const ccd_vec3_t &query_point, std::unordered_set< ccd_pt_edge_t * > *border_edges, std::unordered_set< ccd_pt_face_t * > *visible_faces, std::unordered_set< ccd_pt_face_t * > *hidden_faces, std::unordered_set< ccd_pt_edge_t * > *internal_edges) |
static bool | ComputeVisiblePatchRecursiveSanityCheck (const ccd_pt_t &polytope, const std::unordered_set< ccd_pt_edge_t * > &border_edges, const std::unordered_set< ccd_pt_face_t * > &visible_faces, const std::unordered_set< ccd_pt_edge_t * > &internal_edges) |
static int | convert2SimplexToTetrahedron (const void *obj1, const void *obj2, const ccd_t *ccd, const ccd_simplex_t *simplex, ccd_pt_t *polytope, ccd_pt_el_t **nearest) |
static int | doSimplex (ccd_simplex_t *simplex, ccd_vec3_t *dir) |
static int | doSimplex2 (ccd_simplex_t *simplex, ccd_vec3_t *dir) |
static int | doSimplex3 (ccd_simplex_t *simplex, ccd_vec3_t *dir) |
static int | doSimplex4 (ccd_simplex_t *simplex, ccd_vec3_t *dir) |
static int | expandPolytope (ccd_pt_t *polytope, ccd_pt_el_t *el, const ccd_support_t *newv) |
static void | extractClosestPoints (ccd_simplex_t *simplex, ccd_vec3_t *p1, ccd_vec3_t *p2, ccd_vec3_t *p) |
static void | extractObjectPointsFromPoint (ccd_support_t *q, ccd_vec3_t *p1, ccd_vec3_t *p2) |
static void | extractObjectPointsFromSegment (ccd_support_t *a, ccd_support_t *b, ccd_vec3_t *p1, ccd_vec3_t *p2, ccd_vec3_t *p) |
static ccd_vec3_t | faceNormalPointingOutward (const ccd_pt_t *polytope, const ccd_pt_face_t *face) |
static bool | isAbsValueLessThanEpsSquared (ccd_real_t val) |
static bool | isOutsidePolytopeFace (const ccd_pt_t *polytope, const ccd_pt_face_t *f, const ccd_vec3_t *pt) |
static bool | isPolytopeEmpty (const ccd_pt_t &polytope) |
static int | nextSupport (const ccd_pt_t *polytope, const void *obj1, const void *obj2, const ccd_t *ccd, const ccd_pt_el_t *el, ccd_support_t *out) |
static int | penEPAPosClosest (const ccd_pt_el_t *nearest, ccd_vec3_t *p1, ccd_vec3_t *p2) |
static ccd_real_t | simplexReduceToTriangle (ccd_simplex_t *simplex, ccd_real_t dist, ccd_vec3_t *best_witness) |
static int | simplexToPolytope2 (const void *obj1, const void *obj2, const ccd_t *ccd, const ccd_simplex_t *simplex, ccd_pt_t *pt, ccd_pt_el_t **nearest) |
static int | simplexToPolytope4 (const void *obj1, const void *obj2, const ccd_t *ccd, ccd_simplex_t *simplex, ccd_pt_t *pt, ccd_pt_el_t **nearest) |
static ccd_vec3_t | supportEPADirection (const ccd_pt_t *polytope, const ccd_pt_el_t *nearest_feature) |
static bool | triangle_area_is_zero (const ccd_vec3_t &a, const ccd_vec3_t &b, const ccd_vec3_t &c) |
_ccd_inline void | tripleCross (const ccd_vec3_t *a, const ccd_vec3_t *b, const ccd_vec3_t *c, ccd_vec3_t *d) |
static void | validateNearestFeatureOfPolytopeBeingEdge (ccd_pt_t *polytope) |
|
static |
Definition at line 1747 of file gjk_libccd-inl.h.
|
static |
Definition at line 1597 of file gjk_libccd-inl.h.
|
inlinestatic |
Definition at line 2035 of file gjk_libccd-inl.h.
|
static |
Reports true if p and q are coincident.
Definition at line 912 of file gjk_libccd-inl.h.
|
inlinestatic |
Definition at line 2249 of file gjk_libccd-inl.h.
|
inlinestatic |
Definition at line 2186 of file gjk_libccd-inl.h.
|
static |
Attempts to classify the given edge
as a border edge, confirming it hasn't already been classified as an internal edge.
edge | The edge to classify. |
border_edges | The set of edges already classified as border. |
internal_edges | The set of edges already classified as internal. |
ThrowFailedAtThisConfiguration | if the edge is being re-classified. |
Definition at line 1170 of file gjk_libccd-inl.h.
|
static |
Attempts to classify the given edge
as an internal edge, confirming it hasn't already been classified as a border edge.
edge | The edge to classify. |
border_edges | The set of edges already classified as border. |
internal_edges | The set of edges already classified as internal. |
ThrowFailedAtThisConfiguration | if the edge is being re-classified. |
Definition at line 1188 of file gjk_libccd-inl.h.
|
static |
Defines the "visible" patch on the given convex polytope
(with respect to the given query_vertex
which is a point outside the polytope.)
A patch is characterized by:
A face f
(with vertices (v₀, v₁, v₂)
and outward pointing normal n̂
) is "visible" and included in the patch if, for query vertex q
:
n̂ ⋅ (q - v₀) > 0
Namely the query vertex q
is on the "outer" side of the face f
.
polytope | The polytope to evaluate. | |
f | A face known to be visible to the query point. | |
query_point | The point from which visibility is evaluated. | |
[out] | border_edges | The collection of patch border edges. |
[out] | visible_faces | The collection of patch faces. |
[out] | internal_edges | The collection of internal edges. |
UnexpectedConfigurationException | in debug builds if the resulting patch is not consistent. |
polytope
is convex. f
is visible from query_point
. Definition at line 1315 of file gjk_libccd-inl.h.
|
static |
This function contains the implementation detail of ComputeVisiblePatch() function. It should not be called by any function other than ComputeVisiblePatch(). The parameters are documented as in ComputeVisiblePatch() but has the additional parameter: hidden_faces. Every visited face will be categorized explicitly as either visible or hidden. By design, whatever classification is first given to a face (visible or hidden) it can't change. This doesn't purport that the first classification is more correct than any subsequent code that might otherwise classify it differently. This simply precludes the possibility of classifying edges multiple ways.
Definition at line 1212 of file gjk_libccd-inl.h.
|
static |
Reports true if the visible patch is valid. The invariant for computing the visible patch is that for each edge in the polytope, if both neighbouring faces are visible, then the edge is an internal edge; if only one neighbouring face is visible, then the edge is a border edge. For each face, if one of its edges is an internal edge, then the face is visible.
Definition at line 1115 of file gjk_libccd-inl.h.
|
static |
Transforms a 2-simplex (triangle) to a polytope (tetrahedron), three vertices required. Both the simplex and the transformed polytope contain the origin. The simplex vertices lie on the surface of the Minkowski difference obj1 ⊖ obj2.
[in] | obj1 | object 1 on which the distance is queried. |
[in] | obj2 | object 2 on which the distance is queried. |
[in] | ccd | The ccd solver. |
[in] | simplex | The simplex (with three vertices) that contains the origin. |
[out] | polytope | The polytope (tetrahedron) that also contains the origin on one of its faces. At input, the polytope should be empty. |
[out] | nearest | If the function detects that obj1 and obj2 are touching, then set *nearest to be the nearest points on obj1 and obj2 respectively; otherwise set *nearest to NULL. |
status | return 0 on success, -1 if touching contact is detected, and -2 on non-recoverable failure (mostly due to memory allocation bug). |
Definition at line 735 of file gjk_libccd-inl.h.
|
static |
Definition at line 573 of file gjk_libccd-inl.h.
|
static |
Definition at line 313 of file gjk_libccd-inl.h.
|
static |
Definition at line 388 of file gjk_libccd-inl.h.
|
static |
Definition at line 479 of file gjk_libccd-inl.h.
|
static |
Expands the polytope by adding a new vertex newv
to the polytope. The new polytope is the convex hull of the new vertex together with the old polytope. This new polytope includes new edges (by connecting the new vertex with existing vertices) and new faces (by connecting the new vertex with existing edges). We only keep the edges and faces that are on the boundary of the new polytope. The edges/faces on the original polytope that would be interior to the new convex hull are discarded.
[in/out] | polytope The polytope. | |
[in] | el | A feature that is visible from the point newv and contains the polytope boundary point that is closest to the origin. This feature should be either a face or an edge. A face is visible from a point outside the original polytope, if the point is on the "outer" side of the face. If an edge is visible from that point, at least one of its neighbouring faces is visible. This feature contains the point that is closest to the origin on the boundary of the polytope. If the feature is an edge, and the two neighbouring faces of that edge are not co-planar, then the origin must lie on that edge. The feature should not be a vertex, as that would imply the two objects are in touching contact, causing the algorithm to exit before calling expandPolytope() function. |
[in] | newv | The new vertex add to the polytope. |
status | Returns 0 on success. Returns -2 otherwise. |
UnexpectedConfigurationException | if expanding is meaningless either because 1) the nearest feature is a vertex, 2) the new vertex lies on an edge of the current polytope, or 3) the visible feature is an edge with one or more adjacent faces with no area. |
Definition at line 1371 of file gjk_libccd-inl.h.
|
static |
Returns the points p1
and p2
on the original shapes that correspond to point p
in the given simplex.
Definition at line 1894 of file gjk_libccd-inl.h.
|
static |
Given a single support point, q
, extract the point p1
and p2
, the points on object 1 and 2, respectively, in the support data of q
.
Definition at line 1805 of file gjk_libccd-inl.h.
|
static |
Given two support points which define a line segment (a
and b
), and a point on that line segment p
, computes the points p1
and p2
, the points on object 1 and 2, respectively, in the support data which correspond to p
.
p = a + s(b - a), 0 <= s <= 1
Definition at line 1818 of file gjk_libccd-inl.h.
|
static |
Computes the normal vector of a triangular face on a polytope, and the normal vector points outward from the polytope. Notice we assume that the origin lives within the polytope, and the normal vector may not have unit length.
[in] | polytope | The polytope on which the face lives. We assume that the origin also lives inside the polytope. |
[in] | face | The face for which the normal vector is computed. |
dir | The vector normal to the face, and points outward from the polytope. dir is unnormalized, that it does not necessarily have a unit length. |
UnexpectedConfigurationException | if built in debug mode and the triangle has zero area (either by being too small, or being co-linear). |
Definition at line 982 of file gjk_libccd-inl.h.
|
static |
Definition at line 379 of file gjk_libccd-inl.h.
|
static |
Definition at line 1092 of file gjk_libccd-inl.h.
|
static |
Definition at line 695 of file gjk_libccd-inl.h.
|
static |
Finds next support point (and stores it in out argument).
[in] | polytope | The current polytope contained inside the Minkowski difference A ⊖ B. |
[in] | obj1 | Geometric object A. |
[in] | obj2 | Geometric object B. |
[in] | ccd | The libccd solver. |
[in] | el | The polytope boundary feature that contains the point nearest to the origin. |
[out] | out | The next support point. |
status | If the next support point is found, then returns 0; otherwise returns -1. There are several reasons why the next support point is not found:
|
Definition at line 1553 of file gjk_libccd-inl.h.
|
static |
Given the nearest point on the polytope inside the Minkowski difference A ⊖ B, returns the point p1 on geometric object A and p2 on geometric object B, such that p1 is the deepest penetration point on A, and p2 is the deepest penetration point on B.
[in] | nearest | The feature with the point that is nearest to the origin on the boundary of the polytope. |
[out] | p1 | the deepest penetration point on A, measured and expressed in the world frame. |
[out] | p2 | the deepest penetration point on B, measured and expressed in the world frame. |
status | Return 0 on success, and -1 on failure. |
Definition at line 2131 of file gjk_libccd-inl.h.
|
static |
Definition at line 189 of file gjk_libccd-inl.h.
|
static |
Transforms simplex to polytope, two vertices required
Definition at line 589 of file gjk_libccd-inl.h.
|
static |
Transforms simplex to polytope. It is assumed that simplex has 4 vertices!
Definition at line 827 of file gjk_libccd-inl.h.
|
static |
In each iteration of EPA algorithm, given the nearest point on the polytope boundary to the origin, a support direction will be computed, to find the support of the Minkowski difference A ⊖ B along that direction, so as to expand the polytope.
polytope | The polytope contained in A ⊖ B. |
nearest_feature | The feature containing the nearest point on the boundary of the polytope to the origin. |
dir | The support direction along which to expand the polytope. Notice that dir is a normalized vector. |
UnexpectedConfigurationException | if the nearest feature is a vertex. |
Definition at line 1489 of file gjk_libccd-inl.h.
|
static |
Determines if the the triangle defined by the three vertices has zero area. Area can be zero for one of two reasons:
Definition at line 943 of file gjk_libccd-inl.h.
_ccd_inline void fcl::detail::libccd_extension::tripleCross | ( | const ccd_vec3_t * | a, |
const ccd_vec3_t * | b, | ||
const ccd_vec3_t * | c, | ||
ccd_vec3_t * | d | ||
) |
Definition at line 223 of file gjk_libccd-inl.h.
|
static |
When the nearest feature of a polytope to the origin is an edge, and the origin is inside the polytope, it implies one of the following conditions
polytope
, such that it stores the correct nearest feature and distance. polytope | The polytope whose nearest feature is being verified (and corrected if the edge should not be nearest feature). |
Definition at line 1670 of file gjk_libccd-inl.h.