bevy/crates/bevy_sprite/src
Horváth Bálint c285a69f76 Add the Inside version to the Collision enum (#2489)
# Objective
I think the 'collide' function inside the 'bevy/crates/bevy_sprite/src/collide_aabb.rs' file should return 'Some' if the two rectangles are fully overlapping or one is inside the other. This can happen on low-end machines when a lot of time passes between two frames because of a stutter, so a bullet for example gets inside its target. I can also think of situations where this is a valid use case even without stutters. 

## Solution
I added an 'Inside' version to the Collision enum declared in the file. And I use it, when the two rectangles are overlapping, but we can't say from which direction it happened. I gave a 'penetration depth' of minus Infinity to these cases, so that this variant only appears, when the two rectangles overlap from each side fully. I am not sure if this is the right thing to do.

Fixes #1980

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-02-01 22:40:25 +00:00
..
mesh2d Add headless mode (#3439) 2022-01-08 10:39:43 +00:00
render Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bundle.rs Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
collide_aabb.rs Add the Inside version to the Collision enum (#2489) 2022-02-01 22:40:25 +00:00
dynamic_texture_atlas_builder.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
lib.rs Add headless mode (#3439) 2022-01-08 10:39:43 +00:00
rect.rs Implement the Overflow::Hidden style property for UI (#3296) 2021-12-19 05:44:28 +00:00
sprite.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
texture_atlas_builder.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
texture_atlas.rs Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00