This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Branch-based sphere-AABB intersection implementation | |
| internal bool SphereInsideAABB_Branched(float4 sphere, float3 aabbMin, float3 aabbMax) | |
| { | |
| float3 center = sphere.xyz; | |
| float radius = sphere.w; | |
| // Check if sphere center is completely outside any face of the AABB | |
| if (center.x < aabbMin.x - radius || center.x > aabbMax.x + radius) return false; | |
| if (center.y < aabbMin.y - radius || center.y > aabbMax.y + radius) return false; |