Blender  V2.93
Macros | Functions
math_geom_inline.c File Reference
#include "BLI_math.h"
#include "BLI_math_vector.h"
#include <string.h>

Go to the source code of this file.

Macros

#define __MATH_GEOM_INLINE_C__
 
#define SMALL_NUMBER   1.e-8f
 

Functions

MINLINE float cross_tri_v2 (const float v1[2], const float v2[2], const float v3[2])
 
MINLINE float area_tri_signed_v2 (const float v1[2], const float v2[2], const float v3[2])
 
MINLINE float area_tri_v2 (const float v1[2], const float v2[2], const float v3[2])
 
MINLINE float area_squared_tri_v2 (const float v1[2], const float v2[2], const float v3[2])
 
MINLINE void zero_sh (float r[9])
 
MINLINE void copy_sh_sh (float r[9], const float a[9])
 
MINLINE void mul_sh_fl (float r[9], const float f)
 
MINLINE void add_sh_shsh (float r[9], const float a[9], const float b[9])
 
MINLINE float dot_shsh (const float a[9], const float b[9])
 
MINLINE float diffuse_shv3 (float sh[9], const float v[3])
 
MINLINE void vec_fac_to_sh (float r[9], const float v[3], const float f)
 
MINLINE float eval_shv3 (float sh[9], const float v[3])
 
MINLINE void madd_sh_shfl (float r[9], const float sh[9], const float f)
 
MINLINE void axis_dominant_v3 (int *r_axis_a, int *r_axis_b, const float axis[3])
 
MINLINE float axis_dominant_v3_max (int *r_axis_a, int *r_axis_b, const float axis[3])
 
MINLINE int axis_dominant_v3_single (const float vec[3])
 
MINLINE int axis_dominant_v3_ortho_single (const float vec[3])
 
MINLINE int max_axis_v3 (const float vec[3])
 
MINLINE int min_axis_v3 (const float vec[3])
 
MINLINE int poly_to_tri_count (const int poly_count, const int corner_count)
 
MINLINE float plane_point_side_v3 (const float plane[4], const float co[3])
 
MINLINE float shell_angle_to_dist (const float angle)
 
MINLINE float shell_v3v3_normalized_to_dist (const float a[3], const float b[3])
 
MINLINE float shell_v2v2_normalized_to_dist (const float a[2], const float b[2])
 
MINLINE float shell_v3v3_mid_normalized_to_dist (const float a[3], const float b[3])
 
MINLINE float shell_v2v2_mid_normalized_to_dist (const float a[2], const float b[2])
 

Macro Definition Documentation

◆ __MATH_GEOM_INLINE_C__

#define __MATH_GEOM_INLINE_C__

Definition at line 27 of file math_geom_inline.c.

◆ SMALL_NUMBER

#define SMALL_NUMBER   1.e-8f

Definition at line 35 of file math_geom_inline.c.

Function Documentation

◆ add_sh_shsh()

MINLINE void add_sh_shsh ( float  r[9],
const float  a[9],
const float  b[9] 
)

Definition at line 81 of file math_geom_inline.c.

References Freestyle::a, and r.

Referenced by madd_sh_shfl().

◆ area_squared_tri_v2()

MINLINE float area_squared_tri_v2 ( const float  v1[2],
const float  v2[2],
const float  v3[2] 
)

Definition at line 54 of file math_geom_inline.c.

References blender::compositor::area(), area_tri_signed_v2(), v1, and v2.

◆ area_tri_signed_v2()

MINLINE float area_tri_signed_v2 ( const float  v1[2],
const float  v2[2],
const float  v3[2] 
)

Definition at line 44 of file math_geom_inline.c.

References v1, and v2.

Referenced by area_squared_tri_v2(), and area_tri_v2().

◆ area_tri_v2()

MINLINE float area_tri_v2 ( const float  v1[2],
const float  v2[2],
const float  v3[2] 
)

◆ axis_dominant_v3()

MINLINE void axis_dominant_v3 ( int *  r_axis_a,
int *  r_axis_b,
const float  axis[3] 
)

◆ axis_dominant_v3_max()

MINLINE float axis_dominant_v3_max ( int *  r_axis_a,
int *  r_axis_b,
const float  axis[3] 
)

Definition at line 189 of file math_geom_inline.c.

References fabsf.

◆ axis_dominant_v3_ortho_single()

MINLINE int axis_dominant_v3_ortho_single ( const float  vec[3])

Definition at line 222 of file math_geom_inline.c.

References fabsf, x, y, and z.

Referenced by ED_view3d_cursor3d_position_rotation().

◆ axis_dominant_v3_single()

MINLINE int axis_dominant_v3_single ( const float  vec[3])

◆ copy_sh_sh()

MINLINE void copy_sh_sh ( float  r[9],
const float  a[9] 
)

Definition at line 67 of file math_geom_inline.c.

References Freestyle::a, and r.

Referenced by madd_sh_shfl(), and vec_fac_to_sh().

◆ cross_tri_v2()

MINLINE float cross_tri_v2 ( const float  v1[2],
const float  v2[2],
const float  v3[2] 
)

◆ diffuse_shv3()

MINLINE float diffuse_shv3 ( float  sh[9],
const float  v[3] 
)

Definition at line 102 of file math_geom_inline.c.

References sum(), v, x, y, and z.

◆ dot_shsh()

MINLINE float dot_shsh ( const float  a[9],
const float  b[9] 
)

Definition at line 90 of file math_geom_inline.c.

References Freestyle::a, and r.

Referenced by eval_shv3().

◆ eval_shv3()

MINLINE float eval_shv3 ( float  sh[9],
const float  v[3] 
)

Definition at line 150 of file math_geom_inline.c.

References dot_shsh(), v, and vec_fac_to_sh().

◆ madd_sh_shfl()

MINLINE void madd_sh_shfl ( float  r[9],
const float  sh[9],
const float  f 
)

Definition at line 158 of file math_geom_inline.c.

References add_sh_shsh(), copy_sh_sh(), mul_sh_fl(), and r.

◆ max_axis_v3()

MINLINE int max_axis_v3 ( const float  vec[3])

◆ min_axis_v3()

MINLINE int min_axis_v3 ( const float  vec[3])

Definition at line 238 of file math_geom_inline.c.

References x, y, and z.

Referenced by view3d_ruler_pick().

◆ mul_sh_fl()

MINLINE void mul_sh_fl ( float  r[9],
const float  f 
)

Definition at line 72 of file math_geom_inline.c.

References r.

Referenced by madd_sh_shfl(), and vec_fac_to_sh().

◆ plane_point_side_v3()

MINLINE float plane_point_side_v3 ( const float  plane[4],
const float  co[3] 
)

◆ poly_to_tri_count()

MINLINE int poly_to_tri_count ( const int  poly_count,
const int  corner_count 
)

◆ shell_angle_to_dist()

MINLINE float shell_angle_to_dist ( const float  angle)

Definition at line 267 of file math_geom_inline.c.

References angle(), cosf, fabsf, SMALL_NUMBER, and UNLIKELY.

Referenced by Bend(), and BM_mesh_wireframe().

◆ shell_v2v2_mid_normalized_to_dist()

MINLINE float shell_v2v2_mid_normalized_to_dist ( const float  a[2],
const float  b[2] 
)

equivalent to shell_angle_to_dist(angle_normalized_v2v2(a, b) / 2)

Definition at line 309 of file math_geom_inline.c.

References Freestyle::a, add_v2_v2v2(), BLI_ASSERT_UNIT_V2, dot_v2v2(), fabsf, normalize_v2(), SMALL_NUMBER, and UNLIKELY.

◆ shell_v2v2_normalized_to_dist()

MINLINE float shell_v2v2_normalized_to_dist ( const float  a[2],
const float  b[2] 
)

equivalent to shell_angle_to_dist(angle_normalized_v2v2(a, b))

Definition at line 284 of file math_geom_inline.c.

References Freestyle::a, BLI_ASSERT_UNIT_V2, dot_v2v2(), fabsf, SMALL_NUMBER, and UNLIKELY.

◆ shell_v3v3_mid_normalized_to_dist()

MINLINE float shell_v3v3_mid_normalized_to_dist ( const float  a[3],
const float  b[3] 
)

equivalent to shell_angle_to_dist(angle_normalized_v3v3(a, b) / 2)

Definition at line 295 of file math_geom_inline.c.

References Freestyle::a, add_v3_v3v3(), BLI_ASSERT_UNIT_V3, dot_v3v3(), fabsf, normalize_v3(), SMALL_NUMBER, and UNLIKELY.

Referenced by alter_co(), bmo_face_inset_individual(), and bmo_inset_region_exec().

◆ shell_v3v3_normalized_to_dist()

MINLINE float shell_v3v3_normalized_to_dist ( const float  a[3],
const float  b[3] 
)

equivalent to shell_angle_to_dist(angle_normalized_v3v3(a, b))

Definition at line 274 of file math_geom_inline.c.

References Freestyle::a, BLI_ASSERT_UNIT_V3, dot_v3v3(), fabsf, SMALL_NUMBER, and UNLIKELY.

Referenced by BM_vert_calc_shell_factor(), BM_vert_calc_shell_factor_ex(), bmo_inset_region_exec(), MOD_solidify_extrude_modifyMesh(), and solidify_add_thickness().

◆ vec_fac_to_sh()

MINLINE void vec_fac_to_sh ( float  r[9],
const float  v[3],
const float  f 
)

Definition at line 124 of file math_geom_inline.c.

References copy_sh_sh(), mul_sh_fl(), r, v, x, y, and z.

Referenced by eval_shv3().

◆ zero_sh()

MINLINE void zero_sh ( float  r[9])

Definition at line 62 of file math_geom_inline.c.

References r.