31 #define BOUNDS_MAX_X 1 32 #define BOUNDS_MAX_Y 2 33 #define BOUNDS_MAX_Z 4 35 #define BOUNDS_OUTSIDE 1 36 #define BOUNDS_INSIDE 2 37 #define BOUNDS_PARTIAL 3 43 static inline void bounds_zero(
struct bounds *dst)
49 static inline void bounds_copy(
struct bounds *dst,
const struct bounds *b)
51 vec3_copy(&dst->min, &b->min);
52 vec3_copy(&dst->
max, &b->
max);
56 const struct vec3 *v);
59 const struct vec3 *v);
64 const struct vec3 *v);
80 const struct vec3 *orig,
const struct vec3 *dir,
float *t);
82 const struct vec3 *p1,
const struct vec3 *p2,
float *t);
86 const struct plane *p);
88 static inline bool bounds_inside(
const struct bounds *b,
91 return test->min.x >= b->min.x &&
92 test->min.y >= b->min.y &&
93 test->min.z >= b->min.z &&
99 static inline bool bounds_vec3_inside(
const struct bounds *b,
100 const struct vec3 *v)
102 return v->
x >= (b->min.x-
EPSILON) &&
111 const struct bounds *test,
float epsilon);
119 static inline bool bounds_intersects_ray(
const struct bounds *b,
120 const struct vec3 *orig,
const struct vec3 *dir)
126 static inline bool bounds_intersects_line(
const struct bounds *b,
127 const struct vec3 *p1,
const struct vec3 *p2)
EXPORT void bounds_merge(struct bounds *dst, const struct bounds *b1, const struct bounds *b2)
EXPORT void bounds_scale(struct bounds *dst, const struct bounds *b, const struct vec3 *v)
EXPORT void bounds_transform(struct bounds *dst, const struct bounds *b, const struct matrix4 *m)
EXPORT bool bounds_intersects_obb(const struct bounds *b, const struct bounds *test, const struct matrix4 *m, float epsilon)
EXPORT void bounds_get_point(struct vec3 *dst, const struct bounds *b, unsigned int i)
EXPORT bool bounds_under_plane(const struct bounds *b, const struct plane *p)
EXPORT void bounds_get_center(struct vec3 *dst, const struct bounds *b)
EXPORT void bounds_move(struct bounds *dst, const struct bounds *b, const struct vec3 *v)
float z
Definition: vec3.h:36
#define EPSILON
Definition: math-defs.h:34
#define EXPORT
Definition: c99defs.h:49
EXPORT bool bounds_plane_test(const struct bounds *b, const struct plane *p)
struct vec3 min max
Definition: bounds.h:40
__m128 m
Definition: vec3.h:39
EXPORT bool bounds_intersection_line(const struct bounds *b, const struct vec3 *p1, const struct vec3 *p2, float *t)
EXPORT bool bounds_intersects(const struct bounds *b, const struct bounds *test, float epsilon)
EXPORT bool bounds_intersection_ray(const struct bounds *b, const struct vec3 *orig, const struct vec3 *dir, float *t)
float x
Definition: vec3.h:36
float y
Definition: vec3.h:36
EXPORT void bounds_merge_point(struct bounds *dst, const struct bounds *b, const struct vec3 *v)
EXPORT float bounds_min_dist(const struct bounds *b, const struct plane *p)
EXPORT void bounds_transform3x4(struct bounds *dst, const struct bounds *b, const struct matrix3 *m)
EXPORT bool bounds_intersects_obb3x4(const struct bounds *b, const struct bounds *test, const struct matrix3 *m, float epsilon)