Blender V5.3
BLI_math_vector_c.hh File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Functions

Init
MINLINE void blender::zero_v2 (float r[2])
MINLINE void blender::zero_v3 (float r[3])
MINLINE void blender::zero_v4 (float r[4])
MINLINE void blender::copy_v2_v2 (float r[2], const float a[2])
MINLINE void blender::copy_v3_v3 (float r[3], const float a[3])
MINLINE void blender::copy_v4_v4 (float r[4], const float a[4])
MINLINE void blender::copy_v2_fl (float r[2], float f)
MINLINE void blender::copy_v3_fl (float r[3], float f)
MINLINE void blender::copy_v4_fl (float r[4], float f)
MINLINE void blender::swap_v2_v2 (float a[2], float b[2])
MINLINE void blender::swap_v3_v3 (float a[3], float b[3])
MINLINE void blender::swap_v4_v4 (float a[4], float b[4])
MINLINE void blender::copy_v3_v3_uchar (unsigned char r[3], const unsigned char a[3])
MINLINE void blender::copy_v4_v4_uchar (unsigned char r[4], const unsigned char a[4])
MINLINE void blender::copy_v2_v2_short (short r[2], const short a[2])
MINLINE void blender::copy_v3_v3_short (short r[3], const short a[3])
MINLINE void blender::zero_v3_int (int r[3])
MINLINE void blender::copy_v2_v2_int (int r[2], const int a[2])
MINLINE void blender::copy_v3_v3_int (int r[3], const int a[3])
MINLINE void blender::copy_v4_v4_int (int r[4], const int a[4])
MINLINE void blender::copy_v2_v2_db (double r[2], const double a[2])
MINLINE void blender::copy_v3_v3_db (double r[3], const double a[3])
MINLINE void blender::copy_v4_v4_db (double r[4], const double a[4])
MINLINE void blender::copy_v2fl_v2i (float r[2], const int a[2])
MINLINE void blender::copy_v3fl_v3db (float r[3], const double a[3])
MINLINE void blender::copy_v4fl_v4db (float r[4], const double a[4])
MINLINE void blender::copy_v2db_v2fl (double r[2], const float a[2])
MINLINE void blender::copy_v3db_v3fl (double r[3], const float a[3])
MINLINE void blender::copy_v2_fl2 (float v[2], float x, float y)
MINLINE void blender::copy_v3_fl3 (float v[3], float x, float y, float z)
MINLINE void blender::copy_v4_fl4 (float v[4], float x, float y, float z, float w)
Arithmetic
MINLINE void blender::add_v2_fl (float r[2], float f)
MINLINE void blender::add_v3_fl (float r[3], float f)
MINLINE void blender::add_v2_v2 (float r[2], const float a[2])
MINLINE void blender::add_v2_v2v2 (float r[2], const float a[2], const float b[2])
MINLINE void blender::add_v3_v3 (float r[3], const float a[3])
MINLINE void blender::add_v3_v3_db (double r[3], const double a[3])
MINLINE void blender::add_v3_v3v3 (float r[3], const float a[3], const float b[3])
MINLINE void blender::add_v4_v4 (float r[4], const float a[4])
MINLINE void blender::add_v3fl_v3fl_v3i (float r[3], const float a[3], const int b[3])
MINLINE void blender::add_v3_uchar_clamped (uchar r[3], int i)
MINLINE void blender::sub_v2_v2 (float r[2], const float a[2])
MINLINE void blender::sub_v2_v2v2 (float r[2], const float a[2], const float b[2])
MINLINE void blender::sub_v2_v2v2_db (double r[2], const double a[2], const double b[2])
MINLINE void blender::sub_v2_v2v2_int (int r[2], const int a[2], const int b[2])
MINLINE void blender::sub_v3_v3 (float r[3], const float a[3])
MINLINE void blender::sub_v3_v3v3 (float r[3], const float a[3], const float b[3])
MINLINE void blender::sub_v3_v3v3_int (int r[3], const int a[3], const int b[3])
MINLINE void blender::sub_v3_v3v3_db (double r[3], const double a[3], const double b[3])
MINLINE void blender::sub_v4_v4v4 (float r[4], const float a[4], const float b[4])
MINLINE void blender::sub_v2db_v2fl_v2fl (double r[2], const float a[2], const float b[2])
MINLINE void blender::sub_v3db_v3fl_v3fl (double r[3], const float a[3], const float b[3])
MINLINE void blender::mul_v2_fl (float r[2], float f)
MINLINE void blender::mul_v2_v2fl (float r[2], const float a[2], float f)
MINLINE void blender::mul_v3_fl (float r[3], float f)
MINLINE void blender::mul_v3db_db (double r[3], double f)
MINLINE void blender::mul_v3_v3fl (float r[3], const float a[3], float f)
MINLINE void blender::mul_v2_v2 (float r[2], const float a[2])
MINLINE void blender::mul_v2_v2v2 (float r[2], const float a[2], const float b[2])
MINLINE void blender::mul_v3_v3 (float r[3], const float a[3])
MINLINE void blender::mul_v3_v3v3 (float r[3], const float v1[3], const float v2[3])
MINLINE void blender::mul_v4_fl (float r[4], float f)
MINLINE void blender::mul_v4_v4fl (float r[4], const float a[4], float f)
MINLINE float blender::mul_project_m4_v3_zfac (const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m3_v3_row_x (const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m3_v3_row_y (const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m3_v3_row_z (const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m4_v3_row_x (const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m4_v3_row_y (const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_m4_v3_row_z (const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void blender::madd_v2_v2fl (float r[2], const float a[2], float f)
MINLINE void blender::madd_v3_v3fl (float r[3], const float a[3], float f)
MINLINE void blender::madd_v2_v2v2fl (float r[2], const float a[2], const float b[2], float f)
MINLINE void blender::madd_v3_v3v3fl (float r[3], const float a[3], const float b[3], float f)
MINLINE void blender::madd_v3_v3v3v3 (float r[3], const float a[3], const float b[3], const float c[3])
MINLINE void blender::madd_v4_v4fl (float r[4], const float a[4], float f)
MINLINE void blender::madd_v3fl_v3fl_v3fl_v3i (float r[3], const float a[3], const float b[3], const int c[3])
MINLINE void blender::negate_v2 (float r[2])
MINLINE void blender::negate_v2_v2 (float r[2], const float a[2])
MINLINE void blender::negate_v3 (float r[3])
MINLINE void blender::negate_v3_v3 (float r[3], const float a[3])
MINLINE void blender::negate_v4 (float r[4])
MINLINE void blender::negate_v4_v4 (float r[4], const float a[4])
MINLINE void blender::negate_v3_db (double r[3])
MINLINE void blender::invert_v2 (float r[2])
MINLINE void blender::invert_v3 (float r[3])
MINLINE void blender::invert_v3_safe (float r[3])
MINLINE float blender::dot_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::dot_v2v2_db (const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_v3v3 (const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_v3v3v3 (const float p[3], const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::dot_v4v4 (const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::dot_v3db_v3fl (const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::dot_v3v3_db (const double a[3], const double b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::cross_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::cross_v2v2_db (const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void blender::cross_v3_v3v3 (float r[3], const float a[3], const float b[3])
MINLINE void blender::cross_v3_v3v3_db (double r[3], const double a[3], const double b[3])
MINLINE void blender::add_newell_cross_v3_v3v3 (float n[3], const float v_prev[3], const float v_curr[3])
Length
MINLINE float blender::len_squared_v2 (const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_squared_v3 (const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_manhattan_v2 (const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE int blender::len_manhattan_v2_int (const int v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_manhattan_v3 (const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_v2 (const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::len_v2_db (const double v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_v2v2 (const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double blender::len_v2v2_db (const double v1[2], const double v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_v2v2_int (const int v1[2], const int v2[2])
MINLINE float blender::len_squared_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_squared_v3v3 (const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_squared_v4v4 (const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_manhattan_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE int blender::len_manhattan_v2v2_int (const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_v3 (const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::len_v3v3 (const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::normalize_v2_length (float n[2], float unit_length)
MINLINE float blender::normalize_v2_v2_length (float r[2], const float a[2], float unit_length)
MINLINE float blender::normalize_v3_length (float n[3], float unit_length)
MINLINE float blender::normalize_v3_v3_length (float r[3], const float a[3], float unit_length)
MINLINE double blender::normalize_v3_length_db (double n[3], double unit_length)
MINLINE float blender::normalize_v2 (float n[2])
MINLINE float blender::normalize_v2_v2 (float r[2], const float a[2])
MINLINE float blender::normalize_v3 (float n[3])
MINLINE float blender::normalize_v3_v3 (float r[3], const float a[3])
MINLINE double blender::normalize_v3_db (double n[3])
Interpolation
void blender::interp_v2_v2v2 (float r[2], const float a[2], const float b[2], float t)
void blender::interp_v2_v2v2_db (double target[2], const double a[2], const double b[2], double t)
void blender::interp_v2_v2v2v2 (float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
void blender::interp_v3_v3v3 (float r[3], const float a[3], const float b[3], float t)
void blender::interp_v3_v3v3_db (double target[3], const double a[3], const double b[3], double t)
void blender::interp_v3_v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
void blender::interp_v3_v3v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4])
void blender::interp_v4_v4v4 (float r[4], const float a[4], const float b[4], float t)
void blender::interp_v4_v4v4v4 (float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
void blender::interp_v4_v4v4v4v4 (float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4])
void blender::interp_v3_v3v3v3_uv (float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2])
bool blender::interp_v3_v3v3_slerp (float target[3], const float a[3], const float b[3], float t) ATTR_WARN_UNUSED_RESULT
void blender::interp_v3_v3v3_slerp_safe (float target[3], const float a[3], const float b[3], float t)
void blender::interp_v2_v2v2v2v2_cubic (float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2], float u)
void blender::interp_v3_v3v3_uchar (unsigned char target[3], const unsigned char a[3], const unsigned char b[3], float t)
void blender::mid_v3_v3v3 (float r[3], const float a[3], const float b[3])
void blender::mid_v2_v2v2 (float r[2], const float a[2], const float b[2])
void blender::mid_v3_v3v3v3 (float v[3], const float v1[3], const float v2[3], const float v3[3])
void blender::mid_v2_v2v2v2 (float v[2], const float v1[2], const float v2[2], const float v3[2])
void blender::mid_v3_v3v3v3v3 (float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void blender::mid_v3_v3_array (float r[3], const float(*vec_arr)[3], unsigned int vec_arr_num)
void blender::mid_v3_v3v3_angle_weighted (float r[3], const float a[3], const float b[3])
Comparison
MINLINE bool blender::is_zero_v2 (const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_zero_v3 (const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_zero_v4 (const float v[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_finite_v2 (const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_finite_v3 (const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_finite_v4 (const float v[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::is_one_v3 (const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::equals_v2v2 (const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::equals_v3v3 (const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::equals_v4v4 (const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::equals_v4v4_int (const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::compare_v2v2 (const float v1[2], const float v2[2], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::compare_v3v3 (const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::compare_v4v4 (const float v1[4], const float v2[4], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::compare_len_v3v3 (const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE bool blender::compare_size_v3v3 (const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE float blender::line_point_side_v2 (const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
Angles
float blender::angle_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
float blender::angle_signed_v2v2 (const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
float blender::angle_v2v2v2 (const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT
float blender::angle_normalized_v2v2 (const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
float blender::angle_v3v3 (const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
float blender::angle_v3v3v3 (const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
float blender::cos_v3v3v3 (const float p1[3], const float p2[3], const float p3[3]) ATTR_WARN_UNUSED_RESULT
float blender::cos_v2v2v2 (const float p1[2], const float p2[2], const float p3[2]) ATTR_WARN_UNUSED_RESULT
float blender::angle_on_axis_v3v3_v3 (const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
float blender::angle_signed_on_axis_v3v3_v3 (const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
float blender::angle_normalized_v3v3 (const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
float blender::angle_on_axis_v3v3v3_v3 (const float v1[3], const float v2[3], const float v3[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
float blender::angle_signed_on_axis_v3v3v3_v3 (const float v1[3], const float v2[3], const float v3[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
void blender::angle_tri_v3 (float angles[3], const float v1[3], const float v2[3], const float v3[3])
void blender::angle_quad_v3 (float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void blender::angle_poly_v3 (float *angles, const float *verts[3], int len)
Geometry
void blender::project_v2_v2v2 (float out[2], const float p[2], const float v_proj[2])
void blender::project_v3_v3v3 (float out[3], const float p[3], const float v_proj[3])
void blender::project_v2_v2v2_normalized (float out[2], const float p[2], const float v_proj[2])
void blender::project_v3_v3v3_normalized (float out[3], const float p[3], const float v_proj[3])
void blender::project_plane_v3_v3v3 (float out[3], const float p[3], const float v_plane[3])
void blender::project_plane_normalized_v3_v3v3 (float out[3], const float p[3], const float v_plane[3])
void blender::project_v3_plane (float out[3], const float plane_no[3], const float plane_co[3])
void blender::reflect_v3_v3v3 (float out[3], const float v[3], const float normal[3])
void blender::ortho_basis_v3v3_v3 (float r_n1[3], float r_n2[3], const float n[3])
void blender::ortho_v3_v3 (float out[3], const float v[3])
void blender::ortho_v2_v2 (float out[2], const float v[2])
void blender::bisect_v3_v3v3v3 (float r[3], const float a[3], const float b[3], const float c[3])
void blender::rotate_v2_v2fl (float r[2], const float p[2], float angle)
void blender::rotate_v3_v3v3fl (float r[3], const float p[3], const float axis[3], float angle)
void blender::rotate_normalized_v3_v3v3fl (float out[3], const float p[3], const float axis[3], float angle)
Array Functions
double blender::dot_vn_vn (const float *array_src_a, const float *array_src_b, int size) ATTR_WARN_UNUSED_RESULT
double blender::len_squared_vn (const float *array, int size) ATTR_WARN_UNUSED_RESULT
float blender::normalize_vn_vn (float *array_tar, const float *array_src, int size)
float blender::normalize_vn (float *array_tar, int size)
void blender::range_vn_fl (float *array_tar, int size, float start, float step)
void blender::negate_vn (float *array_tar, int size)
void blender::negate_vn_vn (float *array_tar, const float *array_src, int size)
void blender::mul_vn_vn (float *array_tar, const float *array_src, int size)
void blender::mul_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, int size)
void blender::mul_vn_fl (float *array_tar, int size, float f)
void blender::mul_vn_vn_fl (float *array_tar, const float *array_src, int size, float f)
void blender::add_vn_vn (float *array_tar, const float *array_src, int size)
void blender::add_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, int size)
void blender::sub_vn_vn (float *array_tar, const float *array_src, int size)
void blender::sub_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, int size)
void blender::interp_vn_vn (float *array_tar, const float *array_src, float t, int size)
void blender::add_vn_vn_d (double *array_tar, const double *array_src, int size)
void blender::add_vn_vnvn_d (double *array_tar, const double *array_src_a, const double *array_src_b, int size)
void blender::mul_vn_db (double *array_tar, int size, double f)

Other

#define print_v2_id(v)
#define print_v3_id(v)
#define print_v4_id(v)
#define print_vn_id(v, n)
void blender::print_v2 (const char *str, const float v[2])
void blender::print_v3 (const char *str, const float v[3])
void blender::print_v4 (const char *str, const float v[4])
void blender::print_vn (const char *str, const float v[], int n)
MINLINE void blender::normal_short_to_float_v3 (float out[3], const short in[3])
MINLINE void blender::normal_float_to_short_v3 (short out[3], const float in[3])
void blender::minmax_v4v4_v4 (float min[4], float max[4], const float vec[4])
void blender::minmax_v3v3_v3 (float min[3], float max[3], const float vec[3])
void blender::minmax_v2v2_v2 (float min[2], float max[2], const float vec[2])
void blender::dist_ensure_v3_v3fl (float v1[3], const float v2[3], float dist)
void blender::dist_ensure_v2_v2fl (float v1[2], const float v2[2], float dist)
void blender::axis_sort_v3 (const float axis_values[3], int r_axis_order[3])
MINLINE void blender::clamp_v2 (float vec[2], float min, float max)
MINLINE void blender::clamp_v3 (float vec[3], float min, float max)
MINLINE void blender::clamp_v4 (float vec[4], float min, float max)

Macro Definition Documentation

◆ print_v2_id

#define print_v2_id ( v)
Value:
print_v2(STRINGIFY(v), v)
#define STRINGIFY(x)

Definition at line 569 of file BLI_math_vector_c.hh.

◆ print_v3_id

#define print_v3_id ( v)
Value:
print_v3(STRINGIFY(v), v)

Definition at line 570 of file BLI_math_vector_c.hh.

Referenced by blender::find_nearest_points_test().

◆ print_v4_id

#define print_v4_id ( v)
Value:
print_v4(STRINGIFY(v), v)

Definition at line 571 of file BLI_math_vector_c.hh.

◆ print_vn_id

#define print_vn_id ( v,
n )
Value:
print_vn(STRINGIFY(v), v, n)

Definition at line 572 of file BLI_math_vector_c.hh.