MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / boundsOverlap3D

Function boundsOverlap3D

TheForceEngine/TFE_Editor/editorMath.h:37–43  ·  view source on GitHub ↗

Return true if the DD bounds (packed as Vec4f) overlap.

Source from the content-addressed store, hash-verified

35 }
36 // Return true if the DD bounds (packed as Vec4f) overlap.
37 inline bool boundsOverlap3D(const Vec3f* bounds0, const Vec3f* bounds1, f32 padding = 0.0f)
38 {
39 // We only need to apply padding to one set of bounds, so pick the first one.
40 return intervalOverlap(bounds0[0].x - padding, bounds0[1].x + padding, bounds1[0].x, bounds1[1].x) && // x intervals overlap
41 intervalOverlap(bounds0[0].y - padding, bounds0[1].y + padding, bounds1[0].y, bounds1[1].y) && // y intervals overlap
42 intervalOverlap(bounds0[0].z - padding, bounds0[1].z + padding, bounds1[0].z, bounds1[1].z); // z intervals overlap
43 }
44}

Callers 1

Calls 1

intervalOverlapFunction · 0.85

Tested by

no test coverage detected