distance3d.gjk.gjk_distance_original¶
- distance3d.gjk.gjk_distance_original(collider1, collider2)[source]¶
Gilbert-Johnson-Keerthi (GJK) algorithm for distance calculation.
The original implementation is quite slow, since the distance subalgorithm with the backup procedure is very slow in comparison to simpler, modern versions of the GJK algorithm.
This is the original flavour of the GJK algorithm based on the translation to C of the original Fortran implementation: Ruspini, Diego. gilbert.c, a C version of the original Fortran implementation of the GJK algorithm. ftp://labrea.stanford.edu/cs/robotics/sean/distance/gilbert.c, also available from http://realtimecollisiondetection.net/files/gilbert.c
The original publication describing the algorithm is: E.G. Gilbert, D.W. Johnson, S.S. Keerthi: A fast procedure for computing the distance between complex objects in three-dimensional space, IEEE Journal on Robotics and Automation (1988), https://graphics.stanford.edu/courses/cs448b-00-winter/papers/gilbert.pdf
- Parameters:
- collider1ConvexCollider
Convex collider 1.
- collider2ConvexCollider
Convex collider 2.
- Returns:
- distancefloat
The shortest distance between two convex shapes.
- closest_point1array, shape (3,)
Closest point on first convex shape.
- closest_point2array, shape (3,)
Closest point on second convex shape.
- simplexarray, shape (4, 3)
Simplex defined by 4 points of the Minkowski difference between vertices of the two colliders.
- iterationsint
The amount of iterations the GJK algorithm took. (Primarily used for benchmarking)