New upstream version 24.0.1+dfsg1

This commit is contained in:
Sebastian Ramacher 2019-09-22 23:19:10 +02:00
parent b14f9eae6d
commit 5a730d6ec3
842 changed files with 42245 additions and 33385 deletions

View file

@ -33,7 +33,7 @@ extern "C" {
#define BOUNDS_MAX_Z 4
#define BOUNDS_OUTSIDE 1
#define BOUNDS_INSIDE 2
#define BOUNDS_INSIDE 2
#define BOUNDS_PARTIAL 3
struct bounds {
@ -53,18 +53,18 @@ static inline void bounds_copy(struct bounds *dst, const struct bounds *b)
}
EXPORT void bounds_move(struct bounds *dst, const struct bounds *b,
const struct vec3 *v);
const struct vec3 *v);
EXPORT void bounds_scale(struct bounds *dst, const struct bounds *b,
const struct vec3 *v);
const struct vec3 *v);
EXPORT void bounds_merge(struct bounds *dst, const struct bounds *b1,
const struct bounds *b2);
const struct bounds *b2);
EXPORT void bounds_merge_point(struct bounds *dst, const struct bounds *b,
const struct vec3 *v);
const struct vec3 *v);
EXPORT void bounds_get_point(struct vec3 *dst, const struct bounds *b,
unsigned int i);
unsigned int i);
EXPORT void bounds_get_center(struct vec3 *dst, const struct bounds *b);
/**
@ -72,59 +72,56 @@ EXPORT void bounds_get_center(struct vec3 *dst, const struct bounds *b);
* the actual size becoming larger than it originally was.
*/
EXPORT void bounds_transform(struct bounds *dst, const struct bounds *b,
const struct matrix4 *m);
const struct matrix4 *m);
EXPORT void bounds_transform3x4(struct bounds *dst, const struct bounds *b,
const struct matrix3 *m);
const struct matrix3 *m);
EXPORT bool bounds_intersection_ray(const struct bounds *b,
const struct vec3 *orig, const struct vec3 *dir, float *t);
const struct vec3 *orig,
const struct vec3 *dir, float *t);
EXPORT bool bounds_intersection_line(const struct bounds *b,
const struct vec3 *p1, const struct vec3 *p2, float *t);
const struct vec3 *p1,
const struct vec3 *p2, float *t);
EXPORT bool bounds_plane_test(const struct bounds *b, const struct plane *p);
EXPORT bool bounds_under_plane(const struct bounds *b,
const struct plane *p);
EXPORT bool bounds_under_plane(const struct bounds *b, const struct plane *p);
static inline bool bounds_inside(const struct bounds *b,
const struct bounds *test)
const struct bounds *test)
{
return test->min.x >= b->min.x &&
test->min.y >= b->min.y &&
test->min.z >= b->min.z &&
test->max.x <= b->max.x &&
test->max.y <= b->max.y &&
test->max.z <= b->max.z;
return test->min.x >= b->min.x && test->min.y >= b->min.y &&
test->min.z >= b->min.z && test->max.x <= b->max.x &&
test->max.y <= b->max.y && test->max.z <= b->max.z;
}
static inline bool bounds_vec3_inside(const struct bounds *b,
const struct vec3 *v)
const struct vec3 *v)
{
return v->x >= (b->min.x-EPSILON) &&
v->x <= (b->max.x+EPSILON) &&
v->y >= (b->min.y-EPSILON) &&
v->y <= (b->max.y+EPSILON) &&
v->z >= (b->min.z-EPSILON) &&
v->z <= (b->max.z+EPSILON);
return v->x >= (b->min.x - EPSILON) && v->x <= (b->max.x + EPSILON) &&
v->y >= (b->min.y - EPSILON) && v->y <= (b->max.y + EPSILON) &&
v->z >= (b->min.z - EPSILON) && v->z <= (b->max.z + EPSILON);
}
EXPORT bool bounds_intersects(const struct bounds *b,
const struct bounds *test, float epsilon);
EXPORT bool bounds_intersects(const struct bounds *b, const struct bounds *test,
float epsilon);
EXPORT bool bounds_intersects_obb(const struct bounds *b,
const struct bounds *test, const struct matrix4 *m,
float epsilon);
const struct bounds *test,
const struct matrix4 *m, float epsilon);
EXPORT bool bounds_intersects_obb3x4(const struct bounds *b,
const struct bounds *test, const struct matrix3 *m,
float epsilon);
const struct bounds *test,
const struct matrix3 *m, float epsilon);
static inline bool bounds_intersects_ray(const struct bounds *b,
const struct vec3 *orig, const struct vec3 *dir)
const struct vec3 *orig,
const struct vec3 *dir)
{
float t;
return bounds_intersection_ray(b, orig, dir, &t);
}
static inline bool bounds_intersects_line(const struct bounds *b,
const struct vec3 *p1, const struct vec3 *p2)
const struct vec3 *p1,
const struct vec3 *p2)
{
float t;
return bounds_intersection_line(b, p1, p2, &t);