ray vs convex collider does not consider the position of the convex geometry.

Issue #55 closed
Bram Stolk created an issue

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:

  1. What was the reason to replace the implementation?
  2. Is the old implementation good enough to be reinstated, or was it bugger?
  3. Or could we adapt the new version to use final_posr instead?

Comments (4)

  1. Bram Stolk reporter

    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.

  2. Kwizatz

    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.

  3. Log in to comment