Blender V5.3
BLI_math_vector_c.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include "BLI_compiler_attrs.hh"
12#include "BLI_math_inline.hh"
13#include "BLI_utildefines.hh"
14
15namespace blender {
16
17/* -------------------------------------------------------------------- */
20
21#ifdef BLI_MATH_GCC_WARN_PRAGMA
22# pragma GCC diagnostic push
23# pragma GCC diagnostic ignored "-Wredundant-decls"
24#endif
25
26MINLINE void zero_v2(float r[2]);
27MINLINE void zero_v3(float r[3]);
28MINLINE void zero_v4(float r[4]);
29
30MINLINE void copy_v2_v2(float r[2], const float a[2]);
31MINLINE void copy_v3_v3(float r[3], const float a[3]);
32MINLINE void copy_v4_v4(float r[4], const float a[4]);
33
34MINLINE void copy_v2_fl(float r[2], float f);
35MINLINE void copy_v3_fl(float r[3], float f);
36MINLINE void copy_v4_fl(float r[4], float f);
37
38MINLINE void swap_v2_v2(float a[2], float b[2]);
39MINLINE void swap_v3_v3(float a[3], float b[3]);
40MINLINE void swap_v4_v4(float a[4], float b[4]);
41
42/* unsigned char */
43
44MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3]);
45MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4]);
46
47/* short */
48
49MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
50MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
51
52/* int */
53
54MINLINE void zero_v3_int(int r[3]);
55MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
56MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
57MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
58
59/* double */
60
61MINLINE void copy_v2_v2_db(double r[2], const double a[2]);
62MINLINE void copy_v3_v3_db(double r[3], const double a[3]);
63MINLINE void copy_v4_v4_db(double r[4], const double a[4]);
64
65/* int <-> float */
66
67MINLINE void copy_v2fl_v2i(float r[2], const int a[2]);
68
69/* double -> float */
70
71MINLINE void copy_v3fl_v3db(float r[3], const double a[3]);
72MINLINE void copy_v4fl_v4db(float r[4], const double a[4]);
73
74/* float -> double */
75
76MINLINE void copy_v2db_v2fl(double r[2], const float a[2]);
77MINLINE void copy_v3db_v3fl(double r[3], const float a[3]);
78
79/* float args -> vec */
80
81MINLINE void copy_v2_fl2(float v[2], float x, float y);
82MINLINE void copy_v3_fl3(float v[3], float x, float y, float z);
83MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w);
84
86
87/* -------------------------------------------------------------------- */
90
91MINLINE void add_v2_fl(float r[2], float f);
92MINLINE void add_v3_fl(float r[3], float f);
93MINLINE void add_v2_v2(float r[2], const float a[2]);
94MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2]);
95MINLINE void add_v3_v3(float r[3], const float a[3]);
96MINLINE void add_v3_v3_db(double r[3], const double a[3]);
97MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]);
98MINLINE void add_v4_v4(float r[4], const float a[4]);
99
100MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3]);
101
102MINLINE void add_v3_uchar_clamped(uchar r[3], int i);
103
104MINLINE void sub_v2_v2(float r[2], const float a[2]);
105MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]);
106MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2]);
107MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2]);
108MINLINE void sub_v3_v3(float r[3], const float a[3]);
109MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]);
110MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3]);
111MINLINE void sub_v3_v3v3_db(double r[3], const double a[3], const double b[3]);
112MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4]);
113
114MINLINE void sub_v2db_v2fl_v2fl(double r[2], const float a[2], const float b[2]);
115MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3]);
116
117MINLINE void mul_v2_fl(float r[2], float f);
118MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f);
119MINLINE void mul_v3_fl(float r[3], float f);
120MINLINE void mul_v3db_db(double r[3], double f);
121MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f);
122MINLINE void mul_v2_v2(float r[2], const float a[2]);
123MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2]);
124MINLINE void mul_v3_v3(float r[3], const float a[3]);
125MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3]);
126MINLINE void mul_v4_fl(float r[4], float f);
127MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f);
140MINLINE float mul_project_m4_v3_zfac(const float mat[4][4],
141 const float co[3]) ATTR_WARN_UNUSED_RESULT;
145MINLINE float dot_m3_v3_row_x(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
146MINLINE float dot_m3_v3_row_y(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
147MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
152MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
153MINLINE float dot_m4_v3_row_y(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
154MINLINE float dot_m4_v3_row_z(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
155
156MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f);
157MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f);
158MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f);
159MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f);
160MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
161MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f);
162
163MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3],
164 const float a[3],
165 const float b[3],
166 const int c[3]);
167
168MINLINE void negate_v2(float r[2]);
169MINLINE void negate_v2_v2(float r[2], const float a[2]);
170MINLINE void negate_v3(float r[3]);
171MINLINE void negate_v3_v3(float r[3], const float a[3]);
172MINLINE void negate_v4(float r[4]);
173MINLINE void negate_v4_v4(float r[4], const float a[4]);
174
175/* could add more... */
176
177MINLINE void negate_v3_db(double r[3]);
178
179MINLINE void invert_v2(float r[2]);
180MINLINE void invert_v3(float r[3]);
184MINLINE void invert_v3_safe(float r[3]);
185
186MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
187MINLINE double dot_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT;
188MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
189MINLINE float dot_v3v3v3(const float p[3],
190 const float a[3],
191 const float b[3]) ATTR_WARN_UNUSED_RESULT;
192MINLINE float dot_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT;
193
194MINLINE double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
195
196MINLINE double dot_v3v3_db(const double a[3], const double b[3]) ATTR_WARN_UNUSED_RESULT;
197
198MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
199MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT;
200MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]);
205MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double b[3]);
206
211MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3]);
212
214
215/* -------------------------------------------------------------------- */
218
219MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
220MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
224MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
225MINLINE double len_v2_db(const double v[2]) ATTR_WARN_UNUSED_RESULT;
226MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
227MINLINE double len_v2v2_db(const double v1[2], const double v2[2]) ATTR_WARN_UNUSED_RESULT;
228MINLINE float len_v2v2_int(const int v1[2], const int v2[2]);
229MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
230MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
231MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT;
232MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
233MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT;
234MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT;
235MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
236
237MINLINE float normalize_v2_length(float n[2], float unit_length);
241MINLINE float normalize_v2_v2_length(float r[2], const float a[2], float unit_length);
242MINLINE float normalize_v3_length(float n[3], float unit_length);
246MINLINE float normalize_v3_v3_length(float r[3], const float a[3], float unit_length);
247MINLINE double normalize_v3_length_db(double n[3], double unit_length);
248
249MINLINE float normalize_v2(float n[2]);
250MINLINE float normalize_v2_v2(float r[2], const float a[2]);
251MINLINE float normalize_v3(float n[3]);
252MINLINE float normalize_v3_v3(float r[3], const float a[3]);
253MINLINE double normalize_v3_db(double n[3]);
254
256
257/* -------------------------------------------------------------------- */
260
261void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t);
262void interp_v2_v2v2_db(double target[2], const double a[2], const double b[2], double t);
268 float r[2], const float a[2], const float b[2], const float c[2], const float t[3]);
269void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t);
270void interp_v3_v3v3_db(double target[3], const double a[3], const double b[3], double t);
276 float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]);
281void interp_v3_v3v3v3v3(float p[3],
282 const float v1[3],
283 const float v2[3],
284 const float v3[3],
285 const float v4[3],
286 const float w[4]);
287void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t);
289 float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3]);
290void interp_v4_v4v4v4v4(float p[4],
291 const float v1[4],
292 const float v2[4],
293 const float v3[4],
294 const float v4[4],
295 const float w[4]);
297 float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2]);
298
305bool interp_v3_v3v3_slerp(float target[3], const float a[3], const float b[3], float t)
307
311void interp_v3_v3v3_slerp_safe(float target[3], const float a[3], const float b[3], float t);
312
314void interp_v2_v2v2v2v2_cubic(float p[2],
315 const float v1[2],
316 const float v2[2],
317 const float v3[2],
318 const float v4[2],
319 float u);
320
321void interp_v3_v3v3_uchar(unsigned char target[3],
322 const unsigned char a[3],
323 const unsigned char b[3],
324 float t);
325
326void mid_v3_v3v3(float r[3], const float a[3], const float b[3]);
327void mid_v2_v2v2(float r[2], const float a[2], const float b[2]);
328void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3]);
329void mid_v2_v2v2v2(float v[2], const float v1[2], const float v2[2], const float v3[2]);
330void mid_v3_v3v3v3v3(
331 float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
332void mid_v3_v3_array(float r[3], const float (*vec_arr)[3], unsigned int vec_arr_num);
333
346void mid_v3_v3v3_angle_weighted(float r[3], const float a[3], const float b[3]);
347
349
350/* -------------------------------------------------------------------- */
353
354MINLINE bool is_zero_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
355MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
356MINLINE bool is_zero_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT;
357
358MINLINE bool is_finite_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
359MINLINE bool is_finite_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
360MINLINE bool is_finite_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT;
361
362MINLINE bool is_one_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
363
364MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
365MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT;
366MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT;
367
368MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT;
369
370MINLINE bool compare_v2v2(const float v1[2],
371 const float v2[2],
372 float limit) ATTR_WARN_UNUSED_RESULT;
373MINLINE bool compare_v3v3(const float v1[3],
374 const float v2[3],
375 float limit) ATTR_WARN_UNUSED_RESULT;
376MINLINE bool compare_v4v4(const float v1[4],
377 const float v2[4],
378 float limit) ATTR_WARN_UNUSED_RESULT;
379
380MINLINE bool compare_len_v3v3(const float v1[3],
381 const float v2[3],
382 float limit) ATTR_WARN_UNUSED_RESULT;
383
384MINLINE bool compare_size_v3v3(const float v1[3],
385 const float v2[3],
386 float limit) ATTR_WARN_UNUSED_RESULT;
387
400MINLINE float line_point_side_v2(const float l1[2],
401 const float l2[2],
402 const float pt[2]) ATTR_WARN_UNUSED_RESULT;
403
405
406/* -------------------------------------------------------------------- */
409
410/* - angle with 2 arguments is angle between vector.
411 * - angle with 3 arguments is angle between 3 points at the middle point.
412 * - angle_normalized_* is faster equivalent if vectors are normalized.
413 */
414
418float angle_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
419float angle_signed_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
420float angle_v2v2v2(const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT;
421float angle_normalized_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
425float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
434float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT;
438float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3]) ATTR_WARN_UNUSED_RESULT;
442float cos_v2v2v2(const float p1[2], const float p2[2], const float p3[2]) ATTR_WARN_UNUSED_RESULT;
446float angle_on_axis_v3v3_v3(const float v1[3],
447 const float v2[3],
448 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
449float angle_signed_on_axis_v3v3_v3(const float v1[3],
450 const float v2[3],
451 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
452float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT;
456float angle_on_axis_v3v3v3_v3(const float v1[3],
457 const float v2[3],
458 const float v3[3],
459 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
460float angle_signed_on_axis_v3v3v3_v3(const float v1[3],
461 const float v2[3],
462 const float v3[3],
463 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
464void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3]);
465void angle_quad_v3(
466 float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
467void angle_poly_v3(float *angles, const float *verts[3], int len);
468
470
471/* -------------------------------------------------------------------- */
474
478void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2]);
482void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3]);
486void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2]);
490void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3]);
504void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3]);
505void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const float v_plane[3]);
509void project_v3_plane(float out[3], const float plane_no[3], const float plane_co[3]);
526void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3]);
532void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3]);
538void ortho_v3_v3(float out[3], const float v[3]);
542void ortho_v2_v2(float out[2], const float v[2]);
546void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
550void rotate_v2_v2fl(float r[2], const float p[2], float angle);
551void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], float angle);
556void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle);
557
559
560/* -------------------------------------------------------------------- */
563
564void print_v2(const char *str, const float v[2]);
565void print_v3(const char *str, const float v[3]);
566void print_v4(const char *str, const float v[4]);
567void print_vn(const char *str, const float v[], int n);
568
569#define print_v2_id(v) print_v2(STRINGIFY(v), v)
570#define print_v3_id(v) print_v3(STRINGIFY(v), v)
571#define print_v4_id(v) print_v4(STRINGIFY(v), v)
572#define print_vn_id(v, n) print_vn(STRINGIFY(v), v, n)
573
574MINLINE void normal_short_to_float_v3(float out[3], const short in[3]);
575MINLINE void normal_float_to_short_v3(short out[3], const float in[3]);
576
577void minmax_v4v4_v4(float min[4], float max[4], const float vec[4]);
578void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]);
579void minmax_v2v2_v2(float min[2], float max[2], const float vec[2]);
580
582void dist_ensure_v3_v3fl(float v1[3], const float v2[3], float dist);
583void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist);
584
585void axis_sort_v3(const float axis_values[3], int r_axis_order[3]);
586
587MINLINE void clamp_v2(float vec[2], float min, float max);
588MINLINE void clamp_v3(float vec[3], float min, float max);
589MINLINE void clamp_v4(float vec[4], float min, float max);
590
592
593/* -------------------------------------------------------------------- */
598
599double dot_vn_vn(const float *array_src_a,
600 const float *array_src_b,
602double len_squared_vn(const float *array, int size) ATTR_WARN_UNUSED_RESULT;
603float normalize_vn_vn(float *array_tar, const float *array_src, int size);
604float normalize_vn(float *array_tar, int size);
605void range_vn_fl(float *array_tar, int size, float start, float step);
606void negate_vn(float *array_tar, int size);
607void negate_vn_vn(float *array_tar, const float *array_src, int size);
608void mul_vn_vn(float *array_tar, const float *array_src, int size);
609void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
610void mul_vn_fl(float *array_tar, int size, float f);
611void mul_vn_vn_fl(float *array_tar, const float *array_src, int size, float f);
612void add_vn_vn(float *array_tar, const float *array_src, int size);
613void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
614void sub_vn_vn(float *array_tar, const float *array_src, int size);
615void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
616void interp_vn_vn(float *array_tar, const float *array_src, float t, int size);
617
618void add_vn_vn_d(double *array_tar, const double *array_src, int size);
619void add_vn_vnvn_d(double *array_tar,
620 const double *array_src_a,
621 const double *array_src_b,
622 int size);
623void mul_vn_db(double *array_tar, int size, double f);
624
626
627} // namespace blender
628
629/* -------------------------------------------------------------------- */
632
633#if BLI_MATH_DO_INLINE
634# include "intern/math_vector_inline.cc" // IWYU pragma: export
635#endif
636
637#ifdef BLI_MATH_GCC_WARN_PRAGMA
638# pragma GCC diagnostic pop
639#endif
640
#define ATTR_WARN_UNUSED_RESULT
#define MINLINE
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
btScalar max
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition btVector3.h:356
#define str(s)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
#define M
BMesh Iterators.
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3])
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
MINLINE float dot_m4_v3_row_z(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
void mul_vn_fl(float *array_tar, int size, float f)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3_angle_weighted(float r[3], const float a[3], const float b[3])
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double len_v2_db(const double v[2]) ATTR_WARN_UNUSED_RESULT
float normalize_vn_vn(float *array_tar, const float *array_src, int size)
void mid_v2_v2v2v2(float v[2], const float v1[2], const float v2[2], const float v3[2])
void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double normalize_v3_length_db(double n[3], double unit_length)
MINLINE bool is_zero_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE bool is_finite_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
bool interp_v3_v3v3_slerp(float target[3], const float a[3], const float b[3], float t) ATTR_WARN_UNUSED_RESULT
void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle)
MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2])
MINLINE float dot_v3v3v3(const float p[3], const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE int len_manhattan_v2_int(const int v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_fl(float r[2], float f)
MINLINE double dot_v3v3_db(const double a[3], const double b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
MINLINE float dot_m3_v3_row_y(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
float angle_v2v2v2(const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void copy_v3db_v3fl(double r[3], const float a[3])
void add_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
float normalize_vn(float *array_tar, int size)
void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3])
MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3])
MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4])
MINLINE void mul_v2_fl(float r[2], float f)
void mul_vn_vn_fl(float *array_tar, const float *array_src, int size, float f)
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE void negate_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3])
void mul_vn_db(double *array_tar, int size, double f)
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2db_v2fl_v2fl(double r[2], const float a[2], const float b[2])
MINLINE float mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2v2_int(const int v1[2], const int v2[2])
MINLINE void invert_v3(float r[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
void print_vn(const char *str, const float v[], int n)
void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2])
MINLINE void copy_v4_v4_db(double r[4], const double a[4])
void project_v3_plane(float out[3], const float plane_no[3], const float plane_co[3])
float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void copy_v3_v3_short(short r[3], const short a[3])
MINLINE float normalize_v2_length(float n[2], float unit_length)
void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3])
void ortho_v2_v2(float out[2], const float v[2])
MINLINE float len_manhattan_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
float angle_signed_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void swap_v2_v2(float a[2], float b[2])
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void swap_v4_v4(float a[4], float b[4])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void copy_v4_fl(float r[4], float f)
void interp_v2_v2v2_db(double target[2], const double a[2], const double b[2], double t)
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
void interp_vn_vn(float *array_tar, const float *array_src, float t, int size)
MINLINE float normalize_v2(float n[2])
void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
ATTR_WARN_UNUSED_RESULT const BMVert * v
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
void add_vn_vn_d(double *array_tar, const double *array_src, int size)
void print_v3(const char *str, const float v[3])
MINLINE void copy_v3_v3_db(double r[3], const double a[3])
MINLINE void copy_v4fl_v4db(float r[4], const double a[4])
void range_vn_fl(float *array_tar, int size, float start, float step)
float angle_signed_on_axis_v3v3_v3(const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2_v2_length(float r[2], const float a[2], float unit_length)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void mul_v2_v2(float r[2], const float a[2])
MINLINE bool is_zero_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool is_finite_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void normal_float_to_short_v3(short out[3], const float in[3])
MINLINE void invert_v3_safe(float r[3])
MINLINE bool compare_v4v4(const float v1[4], const float v2[4], float limit) ATTR_WARN_UNUSED_RESULT
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void copy_v4_v4_int(int r[4], const int a[4])
MINLINE void zero_v4(float r[4])
float 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
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
float angle_normalized_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v2(float r[2])
MINLINE void normal_short_to_float_v3(float out[3], const short in[3])
MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3v3_uv(float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
unsigned char uchar
Definition BKE_text.h:58
double dot_vn_vn(const float *array_src_a, const float *array_src_b, int size) ATTR_WARN_UNUSED_RESULT
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], float dist)
float 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
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void rotate_v2_v2fl(float r[2], const float p[2], float angle)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void swap_v3_v3(float a[3], float b[3])
void 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])
MINLINE void copy_v2_v2_db(double r[2], const double a[2])
MINLINE float dot_m3_v3_row_x(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double b[3])
double len_squared_vn(const float *array, int size) ATTR_WARN_UNUSED_RESULT
void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2])
MINLINE void negate_v3(float r[3])
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
void mul_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE bool is_one_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void clamp_v4(float vec[4], float min, float max)
float cos_v2v2v2(const float p1[2], const float p2[2], const float p3[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_uchar_clamped(uchar r[3], int i)
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double len_v2v2_db(const double v1[2], const double v2[2]) ATTR_WARN_UNUSED_RESULT
void minmax_v4v4_v4(float min[4], float max[4], const float vec[4])
void print_v4(const char *str, const float v[4])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
MINLINE void zero_v3(float r[3])
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist)
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3])
void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
void print_v2(const char *str, const float v[2])
void ortho_v3_v3(float out[3], const float v[3])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE void copy_v3fl_v3db(float r[3], const double a[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3_slerp_safe(float target[3], const float a[3], const float b[3], float t)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float n[3])
MINLINE void mul_v3db_db(double r[3], double f)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2db_v2fl(double r[2], const float a[2])
void interp_v3_v3v3_db(double target[3], const double a[3], const double b[3], double t)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool compare_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE float dot_m4_v3_row_y(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
void sub_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE bool compare_size_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert * v2
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3])
float angle_on_axis_v3v3_v3(const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
void interp_v3_v3v3_uchar(unsigned char target[3], const unsigned char a[3], const unsigned char b[3], float t)
MINLINE void sub_v3_v3v3_db(double r[3], const double a[3], const double b[3])
MINLINE void clamp_v2(float vec[2], float min, float max)
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3])
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3_length(float n[3], float unit_length)
void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE float normalize_v3_v3_length(float r[3], const float a[3], float unit_length)
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
void negate_vn(float *array_tar, int size)
void axis_sort_v3(const float axis_values[3], int r_axis_order[3])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double dot_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void clamp_v3(float vec[3], float min, float max)
void 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 negate_vn_vn(float *array_tar, const float *array_src, int size)
float angle_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool is_finite_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v4(float r[4])
MINLINE float dot_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2])
void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE void add_v3_v3_db(double r[3], const double a[3])
bool ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v4_fl(float r[4], float f)
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3])
MINLINE void negate_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void 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])
MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
MINLINE void add_v2_fl(float r[2], float f)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
MINLINE void invert_v2(float r[2])
MINLINE double normalize_v3_db(double n[3])
MINLINE float normalize_v2_v2(float r[2], const float a[2])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3_int(int r[3])
float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v2(float r[2])
MINLINE float len_manhattan_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3_db(double r[3])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3_array(float r[3], const float(*vec_arr)[3], unsigned int vec_arr_num)
MINLINE bool compare_len_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], float angle)
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE bool compare_v2v2(const float v1[2], const float v2[2], float limit) ATTR_WARN_UNUSED_RESULT
void angle_poly_v3(float *angles, const float *verts[3], int len)
void add_vn_vnvn_d(double *array_tar, const double *array_src_a, const double *array_src_b, int size)
#define min(a, b)
Definition sort.cc:38