bevy
bevy copied to clipboard
Add .contains_aabb for Frustum
Objective
- Fixes: #15663
Solution
- Add an
is_forward_planemethod toAabb, and acontains_aabbmethod toFrustum.
Test
- I have created a frustum with an offset along with three unit tests to evaluate the
contains_aabbalgorithm.
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.
Reference
Hi @alice-i-cecile , this pull request is ready for review. Could you please remove the "Waiting on Author" label and assign some reviewers. Thank you.
I'll review later today, I have some comments to the math.
Hi @IQuick143 , sorry for the late response. I have resolved all the issues and added some cases involving rotation, please take another look and review them. Thank you!