ray vs convex collider does not consider the position of the convex geometry.
The ray-convex collider ignores the position of the convex geometry. It pretends the convex geometry sits at the origin.
There are two implementations for the collision function in convex.cpp toggles with #if 0
guard.
In 2006, the old function was replaced with 'Convex collider by David Walters.'
https://bitbucket.org/odedevs/ode/commits/c8624f53f74f1d9751c799bb9eeb741ec7269fea
Looking at the two versions, it strikes me that:
The old version considers convex->final_posr and ray->final_posr.
The new version only considers ray->final_posr, but does not reference convex->final_posr.
This is consistent with my findings when I place a convex geometry away from the origin. The ray will find an intersection, as if the convex geometry was sitting at the origin, not at the position where the convex shape has been placed.
Questions:
- What was the reason to replace the implementation?
- Is the old implementation good enough to be reinstated, or was it bugger?
- Or could we adapt the new version to use final_posr instead?
Comments (4)
-
reporter -
The pre-2006 version should be stable enoght to bring back in, it was replaced due to performance rather than correctness. I think it should be possible to adapt the new version to use final_posr.
-
- changed status to resolved
Fixed on latest commit. updated the "new" code to do the tests on the convex object space.
-
- changed status to closed
- Log in to comment
I switched back to the pre-2006 collision function, and now I see proper results from Ray vs Convex tests.
This may not be related to this issue, but I do notice that dGeomRaySetClosestHit() is not working: I get collisions that are not first.