Created
April 28, 2015 01:39
-
-
Save fahickman/8b05e7e43bf0798b3709 to your computer and use it in GitHub Desktop.
This file contains 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
void discAabb(Vec3 *minOut, Vec3 *maxOut, Vec3 center, Vec3 normal, float radius) | |
{ | |
Vec3 half; | |
float x2 = normal.x * normal.x; | |
float y2 = normal.y * normal.y; | |
float z2 = normal.z * normal.z; | |
half.x = radius * sqrtf(y2 + z2); | |
half.y = radius * sqrtf(z2 + x2); | |
half.z = radius * sqrtf(x2 + y2); | |
*minOut = center - half; | |
*maxOut = center + half; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment