parry icon indicating copy to clipboard operation
parry copied to clipboard

Bug: cast_shapes_nonlinear fails to detect collision between cuboids

Open kalmjasper opened this issue 10 months ago • 2 comments

I've been using Parry3d for a couple months now to detect collisions without any issue. Yesterday I discovered an edge case where cast_shapes_nonlinear does not report a pretty obvious collision however... Unfortunately I'm not experienced enough with the code to properly debug this issue, it would be very much appreciated if someone who does could take a look.

Description

cast_shapes_nonlinear incorrectly returns no collision between two cuboids that clearly intersect. The contact function correctly reports penetration between the same objects, confirming they do intersect.

Reproduction

Repository with minimal reproduction case: https://github.com/kalmjasper/parry_collision_bug

Visualisation of the situation: Visualization showing collision

Steps:

  1. Run the example code
  2. Observe that the red cuboid visibly intersects with the static gray cuboid
  3. Note that cast_shapes_nonlinear returns None (no collision)
  4. While contact correctly reports penetration depth

Environment

  • parry3d version: 0.18.0

kalmjasper avatar Feb 26 '25 12:02 kalmjasper

  • Thanks for the report! This is related to https://github.com/dimforge/parry/pull/298 ; https://github.com/dimforge/parry/issues/70

To be noted that your coordinates being 6000+ really exacerbate the issue, and floating point errors are not too surprising at this distance.

ThierryBerger avatar Jun 20 '25 07:06 ThierryBerger

Allright good tip! I'll center the coordinates around 0

kalmjasper avatar Jun 24 '25 14:06 kalmjasper