diff options
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 49d335f6c5c..e676001fba5 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -37,12 +37,13 @@ extern "C" { void cent_tri_v3(float r[3], float a[3], float b[3], float c[3]); void cent_quad_v3(float r[3], float a[3], float b[3], float c[3], float d[3]); -float normal_tri_v3(float r[3], float a[3], float b[3], float c[3]); -float normal_quad_v3(float r[3], float a[3], float b[3], float c[3], float d[3]); +float normal_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]); +float normal_quad_v3(float r[3], const float a[3], const float b[3], const float c[3], const float d[3]); -float area_tri_v2(float a[2], float b[2], float c[2]); -float area_tri_v3(float a[3], float b[3], float c[3]); -float area_quad_v3(float a[3], float b[3], float c[3], float d[3]); +float area_tri_v2(const float a[2], const float b[2], const float c[2]); +float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2]); +float area_tri_v3(const float a[3], const float b[3], const float c[3]); +float area_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]); float area_poly_v3(int nr, float verts[][3], float normal[3]); /********************************* Distance **********************************/ @@ -120,6 +121,13 @@ void interp_weights_poly_v3(float w[], float v[][3], int n, float p[3]); void interp_cubic_v3(float x[3], float v[3], float x1[3], float v1[3], float x2[3], float v2[3], float t); +void barycentric_transform(float pt_tar[3], float const pt_src[3], + const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3], + const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3]); + +void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], + const float co[2], float w[3]); + /***************************** View & Projection *****************************/ void lookat_m4(float mat[4][4], float vx, float vy, |