Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DigitalExtinction/Game
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 50e5afbe151315f01d8e2c4b0b1d99a564ed3902
Choose a base ref
..
head repository: DigitalExtinction/Game
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11514ad460a2d7442105d929882e65b4585edfb4
Choose a head ref
Showing with 2 additions and 3 deletions.
  1. +2 −3 crates/core/src/frustum.rs
5 changes: 2 additions & 3 deletions crates/core/src/frustum.rs
Original file line number Diff line number Diff line change
@@ -23,12 +23,11 @@ pub fn intersects_parry(frustum: &Frustum, transform: Transform, aabb: &AabbP) -
///
/// * `aabb` - object space AABB.
pub fn intersects_bevy(frustum: &Frustum, transform: &GlobalTransform, aabb: &Aabb) -> bool {
let model = transform.compute_matrix();
let model_sphere = Sphere {
center: model.transform_point3a(aabb.center),
center: transform.transform_point(aabb.center.into()).into(),
radius: transform.radius_vec3a(aabb.half_extents),
};

frustum.intersects_sphere(&model_sphere, false)
&& frustum.intersects_obb(aabb, &model, false, true)
&& frustum.intersects_obb(aabb, &transform.affine(), false, true)
}