You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a scenario where the two geometries are half space and convex shape leads to a seg fault. No warning, no explanation. Just explosion.
Diagnosis
There is no support for half space in the gjk_libccd-inl.h. There is no specialization of GJKInitializer for Halfspace. So, when calling GJKInitializer<Halfspace> its gjk object representation, support function, and center functions are all nullptr. These nullptr's aren't checked, passed to libccd which leads to attempting to dereference the nullptr function pointer. Boom!
Solution
Option 1:
It is may be practical to include a specialization of GJKInitializer for Halfspace. To do so requires the implementation of three methods:
createGJKObject()
it is not immediately clear what the requirements for this object are.
getCenterFunction()
Defining a center point of an infinite volume is not well defined.
getSupportFunction()
This is likewise ill defined. The support point on a half space is infinitely far away in any direction except the normal direction (outward pointing). And in that direction, it is any point on the boundary of the half space.
These issues are most likely the reason this option hasn't been pursued. It's conceivable that some finite approximation can be introduced that is consistent with libccd, but it's probably not worth it.
Option 2:
Introduce a bespoke collision function between Halfspace and Convex. There are already multiple functions for other shapes (e.g., Sphere, Ellipsoid, etc.). Convex is conspicuously absent.
More particularly, there is an implementation for Halfspace and Convex; it's just not enabled.
This should be enabled, tested, and released to the wild.
The text was updated successfully, but these errors were encountered:
Note: The reason it hasn't been wrapped is that it has the wrong API for that mechanism. It should take an optional std::vector<ContactPoint>* as parameter and not individual Vector3<S>*, S*, and Vector3<S>* for contact points, depth, and normal respectively.
Problem
Creating a scenario where the two geometries are half space and convex shape leads to a seg fault. No warning, no explanation. Just explosion.
Diagnosis
There is no support for half space in the
gjk_libccd-inl.h
. There is no specialization ofGJKInitializer
forHalfspace
. So, when callingGJKInitializer<Halfspace>
its gjk object representation, support function, and center functions are allnullptr
. Thesenullptr
's aren't checked, passed to libccd which leads to attempting to dereference thenullptr
function pointer. Boom!Solution
Option 1:
It is may be practical to include a specialization of
GJKInitializer
forHalfspace
. To do so requires the implementation of three methods:These issues are most likely the reason this option hasn't been pursued. It's conceivable that some finite approximation can be introduced that is consistent with libccd, but it's probably not worth it.
Option 2:
Introduce a bespoke collision function between
Halfspace
andConvex
. There are already multiple functions for other shapes (e.g.,Sphere
,Ellipsoid
, etc.).Convex
is conspicuously absent.More particularly, there is an implementation for
Halfspace
andConvex
; it's just not enabled.This should be enabled, tested, and released to the wild.
The text was updated successfully, but these errors were encountered: