bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add .contains_aabb for Frustum

Open Soulghost opened this issue 4 months 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