bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add .contains_aabb for Frustum

Open Soulghost opened this issue 1 year ago • 3 comments

Objective

  • Fixes: #15663

Solution

  • Add an is_forward_plane method to Aabb, and a contains_aabb method to Frustum.

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.
image
  • Secondly, we move the cuboid by 2 units along both the x-axis and the y-axis to make it more general.

Reference

Soulghost avatar Oct 20 '24 14:10 Soulghost

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.

Soulghost avatar Nov 07 '24 15:11 Soulghost

I'll review later today, I have some comments to the math.

IQuick143 avatar Nov 08 '24 08:11 IQuick143

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!

Soulghost avatar Nov 23 '24 13:11 Soulghost