New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -19,10 +19,8 @@
|
|||
#include "matrix3.h"
|
||||
#include "plane.h"
|
||||
|
||||
void plane_from_tri(struct plane *dst,
|
||||
const struct vec3 *v1,
|
||||
const struct vec3 *v2,
|
||||
const struct vec3 *v3)
|
||||
void plane_from_tri(struct plane *dst, const struct vec3 *v1,
|
||||
const struct vec3 *v2, const struct vec3 *v3)
|
||||
{
|
||||
struct vec3 temp;
|
||||
|
||||
|
|
@ -34,7 +32,7 @@ void plane_from_tri(struct plane *dst,
|
|||
}
|
||||
|
||||
void plane_transform(struct plane *dst, const struct plane *p,
|
||||
const struct matrix4 *m)
|
||||
const struct matrix4 *m)
|
||||
{
|
||||
struct vec3 temp;
|
||||
|
||||
|
|
@ -48,7 +46,7 @@ void plane_transform(struct plane *dst, const struct plane *p,
|
|||
}
|
||||
|
||||
void plane_transform3x4(struct plane *dst, const struct plane *p,
|
||||
const struct matrix3 *m)
|
||||
const struct matrix3 *m)
|
||||
{
|
||||
struct vec3 temp;
|
||||
|
||||
|
|
@ -60,7 +58,7 @@ void plane_transform3x4(struct plane *dst, const struct plane *p,
|
|||
}
|
||||
|
||||
bool plane_intersection_ray(const struct plane *p, const struct vec3 *orig,
|
||||
const struct vec3 *dir, float *t)
|
||||
const struct vec3 *dir, float *t)
|
||||
{
|
||||
float c = vec3_dot(&p->dir, dir);
|
||||
|
||||
|
|
@ -74,10 +72,10 @@ bool plane_intersection_ray(const struct plane *p, const struct vec3 *orig,
|
|||
}
|
||||
|
||||
bool plane_intersection_line(const struct plane *p, const struct vec3 *v1,
|
||||
const struct vec3 *v2, float *t)
|
||||
const struct vec3 *v2, float *t)
|
||||
{
|
||||
float p1_dist, p2_dist, p1_abs_dist, dist2;
|
||||
bool p1_over, p2_over;
|
||||
bool p1_over, p2_over;
|
||||
|
||||
p1_dist = vec3_plane_dist(v1, p);
|
||||
p2_dist = vec3_plane_dist(v2, p);
|
||||
|
|
@ -108,11 +106,9 @@ bool plane_intersection_line(const struct plane *p, const struct vec3 *v1,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool plane_tri_inside(const struct plane *p,
|
||||
const struct vec3 *v1,
|
||||
const struct vec3 *v2,
|
||||
const struct vec3 *v3,
|
||||
float precision)
|
||||
bool plane_tri_inside(const struct plane *p, const struct vec3 *v1,
|
||||
const struct vec3 *v2, const struct vec3 *v3,
|
||||
float precision)
|
||||
{
|
||||
/* bit 1: part or all is behind the plane */
|
||||
/* bit 2: part or all is in front of the plane */
|
||||
|
|
@ -140,7 +136,7 @@ bool plane_tri_inside(const struct plane *p,
|
|||
}
|
||||
|
||||
bool plane_line_inside(const struct plane *p, const struct vec3 *v1,
|
||||
const struct vec3 *v2, float precision)
|
||||
const struct vec3 *v2, float precision)
|
||||
{
|
||||
/* bit 1: part or all is behind the plane */
|
||||
/* bit 2: part or all is in front of the plane */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue