mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 12:32:40 +00:00
frustum: fix bounding box
default value 0.0 causes to get min or max as 0 if max < 0 or min > 0
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
# ifdef CGLM_DLL
|
||||
|
||||
@@ -184,8 +184,8 @@ glm_frustum_box(vec4 corners[8], mat4 m, vec3 box[2]) {
|
||||
vec3 min, max;
|
||||
int i;
|
||||
|
||||
glm_vec_broadcast(0.0f, min);
|
||||
glm_vec_broadcast(0.0f, max);
|
||||
glm_vec_broadcast(FLT_MAX, min);
|
||||
glm_vec_broadcast(-FLT_MAX, max);
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
glm_mat4_mulv(m, corners[i], v);
|
||||
|
||||
Reference in New Issue
Block a user