bevy
bevy copied to clipboard
Add .contains_aabb for Frustum
Objective
- Fixes: #15663
Solution
- Add an
is_forward_plane
method toAabb
, and acontains_aabb
method toFrustum
.
Test
- I have created a frustum with an offset along with three unit tests to evaluate the
contains_aabb
algorithm.
Explanation for the Test Cases
- To facilitate the code review, I will explain how the frustum is created. Initially, we create a frustum without any offset and then create a cuboid that is just contained within it.
- Secondly, we move the cuboid by 2 units along both the x-axis and the y-axis to make it more general.