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:
Recep Aslantas
2018-01-18 16:12:44 +03:00
parent c58db651a6
commit 565ee2d6eb
2 changed files with 3 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
#include <stdint.h>
#include <math.h>
#include <float.h>
#if defined(_WIN32)
# ifdef CGLM_DLL

View File

@@ -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);