mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +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 <stdint.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# ifdef CGLM_DLL
|
# ifdef CGLM_DLL
|
||||||
|
|||||||
@@ -184,8 +184,8 @@ glm_frustum_box(vec4 corners[8], mat4 m, vec3 box[2]) {
|
|||||||
vec3 min, max;
|
vec3 min, max;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glm_vec_broadcast(0.0f, min);
|
glm_vec_broadcast(FLT_MAX, min);
|
||||||
glm_vec_broadcast(0.0f, max);
|
glm_vec_broadcast(-FLT_MAX, max);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
glm_mat4_mulv(m, corners[i], v);
|
glm_mat4_mulv(m, corners[i], v);
|
||||||
|
|||||||
Reference in New Issue
Block a user