bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.2k stars 3.57k forks source link

Add `.contains_aabb` for `Frustum` #15663

Open torsteingrindvik opened 1 month ago

torsteingrindvik commented 1 month ago

What problem does this solve or what need does it fill?

Solves making logic decisions based on whether an object is contained in a frustum.

My specific usecase: N cameras exist, M<N should be active. Figure out which M based on visiblity of some AABB.

What solution would you like?

Adding .contains_aabb to Frustum.

What alternative(s) have you considered?

There is .intersects_obb, but that is only intersects and not contains.

Additional context

Discord context feat @Jondolf , @mweatherley : https://discord.com/channels/691052431525675048/1203087353850364004/1292080527125254185

torsteingrindvik commented 1 month ago

Related issue for intersection (but not contains) API docs: #6096