MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / aabb_outside_frustum

Function aabb_outside_frustum

native/shared/src/scene.rs:1032–1053  ·  view source on GitHub ↗
(planes: &[[f32; 4]; 6], bmin: [f32; 3], bmax: [f32; 3])

Source from the content-addressed store, hash-verified

1030}
1031
1032pub(crate) fn aabb_outside_frustum(planes: &[[f32; 4]; 6], bmin: [f32; 3], bmax: [f32; 3]) -> bool {
1033 for p in planes.iter() {
1034 let mut all_outside = true;
1035 for ix in 0..2 {
1036 let x = if ix == 0 { bmin[0] } else { bmax[0] };
1037 for iy in 0..2 {
1038 let y = if iy == 0 { bmin[1] } else { bmax[1] };
1039 for iz in 0..2 {
1040 let z = if iz == 0 { bmin[2] } else { bmax[2] };
1041 if p[0]*x + p[1]*y + p[2]*z + p[3] >= 0.0 {
1042 all_outside = false;
1043 break;
1044 }
1045 }
1046 if !all_outside { break; }
1047 }
1048 if !all_outside { break; }
1049 }
1050 if all_outside { return true; }
1051 }
1052 false
1053}
1054
1055fn mat4_mul(a: &[[f32; 4]; 4], b: &[[f32; 4]; 4]) -> [[f32; 4]; 4] {
1056 let mut result = [[0.0f32; 4]; 4];

Callers 2

prepareMethod · 0.85
end_frame_with_sceneMethod · 0.85

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected