Open FocusJP opened 2 years ago
Reducing the cuboid dimensions to
ColliderShape::cuboid(20.0, 1.0, 20.0)
dramatically reduced the jitter I am getting. For now my workaround is to break up large floor panels into smaller panels.
I'm also running into this issue with cast_shape
hit output being imprecise, especially when casting Collider::ball
onto large surfaces, which results in a significant amount of jitter.
I made a minimal reproduction of the issue here: https://github.com/DanielHZhang/bevy_rapier_shape_cast_imprecision
This seems to be caused by rapier itself, and not just the bevy plugin: https://github.com/dimforge/rapier/issues/434
I'm not sure if this is a real issue or just the reality of floating point precision, but I wanted to at least flag it as suspicious.
I have a simple scene with a floor collider of shape
I do a vertical sphere cast from above the floor via
I expect y1 and y2 will both agree on a hit height of ~1.0. In fact, y1 is always within about 1E-7. However, as I vary
start.x
andstart.z
in small 0.01 increments I notice that y2 may drift as little as 5E-8 or as much as 6E-2. I don't know the inner workings of the shape cast algorithm, but is this variation expected?