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
Due to float imprecisions, we can't be certain a call to bounding1.merged(bounding2) will results in a bounding containing both shapes (or contains might return false for 1 or both shapes).
Reproduction
let cube1_pos = Vec2::new(3.75,2.6516504);let cube1_pos = Isometry2::translation(cube1_pos.x, cube1_pos.y);let cube2_pos = Isometry2::identity();dbg!(cube1_pos.translation);dbg!(cube2_pos.translation);let bounding_sphere_cube1 = cube1.bounding_sphere(&cube1_pos);let bounding_sphere_cube2 = cube2.bounding_sphere(&cube2_pos);// Merge the two spheres.let bounding_bounding_sphere = dbg!(bounding_sphere_cube1.merged(&bounding_sphere_cube2));// This fails /!\assert!(bounding_bounding_sphere.contains(&bounding_sphere_cube2));
Due to float imprecisions, we can't be certain a call to
bounding1.merged(bounding2)
will results in a bounding containing both shapes (or contains might returnfalse
for 1 or both shapes).Reproduction
That's why
bounding.loosened()
exists.The examples shouldn't encourage this assumption:
parry/crates/parry2d/examples/bounding_sphere2d.rs
Line 31 in 837291f
The text was updated successfully, but these errors were encountered: