distance3d.gjk.gjk_intersection

distance3d.gjk.gjk_intersection(collider1, collider2, tolerance=1e-10)

Intersection test with Gilbert-Johnson-Keerthi (GJK) algorithm.

This implementation differs in several ways from the libccd version:

  • Support points will be interpolated

  • A configurable numerical tolerance is used to check convergence

  • Simplex selection is done via an integer of which the first 4 bits are used to select or deselect points of the current simplex

Implementation based on Jolt Physics, Copyright 2021 Jorrit Rouwe, MIT license.

Based on: A Fast and Robust GJK Implementation for Collision Detection of Convex Objects - Gino van den Bergen, http://www.dtecta.com/papers/jgt98convex.pdf

Parameters:
collider1ConvexCollider

Convex collider 1.

collider2ConvexCollider

Convex collider 2.

tolerancefloat, optional (default: 1e-10)

Minimal distance between objects when the objects are considered to be colliding.

Returns:
intersectionbool

Do the two colliders intersect?