Blender V5.0
BLI_math_vector.h
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.h"
12#include "BLI_math_inline.h"
13#include "BLI_utildefines.h"
14
15/* -------------------------------------------------------------------- */
18
19#ifdef BLI_MATH_GCC_WARN_PRAGMA
20# pragma GCC diagnostic push
21# pragma GCC diagnostic ignored "-Wredundant-decls"
22#endif
23
24MINLINE void zero_v2(float r[2]);
25MINLINE void zero_v3(float r[3]);
26MINLINE void zero_v4(float r[4]);
27
28MINLINE void copy_v2_v2(float r[2], const float a[2]);
29MINLINE void copy_v3_v3(float r[3], const float a[3]);
30MINLINE void copy_v4_v4(float r[4], const float a[4]);
31
32MINLINE void copy_v2_fl(float r[2], float f);
33MINLINE void copy_v3_fl(float r[3], float f);
34MINLINE void copy_v4_fl(float r[4], float f);
35
36MINLINE void swap_v2_v2(float a[2], float b[2]);
37MINLINE void swap_v3_v3(float a[3], float b[3]);
38MINLINE void swap_v4_v4(float a[4], float b[4]);
39
40/* unsigned char */
41
42MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3]);
43MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4]);
44
45/* short */
46
47MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
48MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
49
50/* int */
51
52MINLINE void zero_v3_int(int r[3]);
53MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
54MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
55MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
56
57/* double */
58
59MINLINE void copy_v2_v2_db(double r[2], const double a[2]);
60MINLINE void copy_v3_v3_db(double r[3], const double a[3]);
61MINLINE void copy_v4_v4_db(double r[4], const double a[4]);
62
63/* int <-> float */
64
65MINLINE void copy_v2fl_v2i(float r[2], const int a[2]);
66
67/* double -> float */
68
69MINLINE void copy_v3fl_v3db(float r[3], const double a[3]);
70MINLINE void copy_v4fl_v4db(float r[4], const double a[4]);
71
72/* float -> double */
73
74MINLINE void copy_v2db_v2fl(double r[2], const float a[2]);
75MINLINE void copy_v3db_v3fl(double r[3], const float a[3]);
76
77/* float args -> vec */
78
79MINLINE void copy_v2_fl2(float v[2], float x, float y);
80MINLINE void copy_v3_fl3(float v[3], float x, float y, float z);
81MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w);
82
84
85/* -------------------------------------------------------------------- */
88
89MINLINE void add_v2_fl(float r[2], float f);
90MINLINE void add_v3_fl(float r[3], float f);
91MINLINE void add_v2_v2(float r[2], const float a[2]);
92MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2]);
93MINLINE void add_v3_v3(float r[3], const float a[3]);
94MINLINE void add_v3_v3_db(double r[3], const double a[3]);
95MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]);
96MINLINE void add_v4_v4(float r[4], const float a[4]);
97
98MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3]);
99
100MINLINE void add_v3_uchar_clamped(uchar r[3], int i);
101
102MINLINE void sub_v2_v2(float r[2], const float a[2]);
103MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]);
104MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2]);
105MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2]);
106MINLINE void sub_v3_v3(float r[3], const float a[3]);
107MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]);
108MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3]);
109MINLINE void sub_v3_v3v3_db(double r[3], const double a[3], const double b[3]);
110MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4]);
111
112MINLINE void sub_v2db_v2fl_v2fl(double r[2], const float a[2], const float b[2]);
113MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3]);
114
115MINLINE void mul_v2_fl(float r[2], float f);
116MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f);
117MINLINE void mul_v3_fl(float r[3], float f);
118MINLINE void mul_v3db_db(double r[3], double f);
119MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f);
120MINLINE void mul_v2_v2(float r[2], const float a[2]);
121MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2]);
122MINLINE void mul_v3_v3(float r[3], const float a[3]);
123MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3]);
124MINLINE void mul_v4_fl(float r[4], float f);
125MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f);
138MINLINE float mul_project_m4_v3_zfac(const float mat[4][4],
139 const float co[3]) ATTR_WARN_UNUSED_RESULT;
143MINLINE float dot_m3_v3_row_x(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
144MINLINE float dot_m3_v3_row_y(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
145MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT;
150MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
151MINLINE float dot_m4_v3_row_y(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
152MINLINE float dot_m4_v3_row_z(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT;
153
154MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f);
155MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f);
156MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f);
157MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f);
158MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
159MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f);
160
161MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3],
162 const float a[3],
163 const float b[3],
164 const int c[3]);
165
166MINLINE void negate_v2_v2(float r[2], const float a[2]);
167MINLINE void negate_v3(float r[3]);
168MINLINE void negate_v3_v3(float r[3], const float a[3]);
169MINLINE void negate_v4(float r[4]);
170MINLINE void negate_v4_v4(float r[4], const float a[4]);
171
172/* could add more... */
173
174MINLINE void negate_v3_db(double r[3]);
175
176MINLINE void invert_v2(float r[2]);
177MINLINE void invert_v3(float r[3]);
181MINLINE void invert_v3_safe(float r[3]);
182
183MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
184MINLINE double dot_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT;
185MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
186MINLINE float dot_v3v3v3(const float p[3],
187 const float a[3],
188 const float b[3]) ATTR_WARN_UNUSED_RESULT;
189MINLINE float dot_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT;
190
191MINLINE double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
192
193MINLINE double dot_v3v3_db(const double a[3], const double b[3]) ATTR_WARN_UNUSED_RESULT;
194
195MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
196MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT;
197MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]);
202MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double b[3]);
203
208MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3]);
209
211
212/* -------------------------------------------------------------------- */
215
216MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
217MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
221MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
222MINLINE double len_v2_db(const double v[2]) ATTR_WARN_UNUSED_RESULT;
223MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
224MINLINE double len_v2v2_db(const double v1[2], const double v2[2]) ATTR_WARN_UNUSED_RESULT;
225MINLINE float len_v2v2_int(const int v1[2], const int v2[2]);
226MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
227MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
228MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT;
229MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
230MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT;
231MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT;
232MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
233
234MINLINE float normalize_v2_length(float n[2], float unit_length);
238MINLINE float normalize_v2_v2_length(float r[2], const float a[2], float unit_length);
239MINLINE float normalize_v3_length(float n[3], float unit_length);
243MINLINE float normalize_v3_v3_length(float r[3], const float a[3], float unit_length);
244MINLINE double normalize_v3_length_db(double n[3], double unit_length);
245
246MINLINE float normalize_v2(float n[2]);
247MINLINE float normalize_v2_v2(float r[2], const float a[2]);
248MINLINE float normalize_v3(float n[3]);
249MINLINE float normalize_v3_v3(float r[3], const float a[3]);
250MINLINE double normalize_v3_db(double n[3]);
251
253
254/* -------------------------------------------------------------------- */
257
258void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t);
259void interp_v2_v2v2_db(double target[2], const double a[2], const double b[2], double t);
265 float r[2], const float a[2], const float b[2], const float c[2], const float t[3]);
266void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t);
267void interp_v3_v3v3_db(double target[3], const double a[3], const double b[3], double t);
273 float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]);
278void interp_v3_v3v3v3v3(float p[3],
279 const float v1[3],
280 const float v2[3],
281 const float v3[3],
282 const float v4[3],
283 const float w[4]);
284void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t);
286 float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3]);
287void interp_v4_v4v4v4v4(float p[4],
288 const float v1[4],
289 const float v2[4],
290 const float v3[4],
291 const float v4[4],
292 const float w[4]);
294 float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2]);
295
302bool interp_v3_v3v3_slerp(float target[3], const float a[3], const float b[3], float t)
304
308void interp_v3_v3v3_slerp_safe(float target[3], const float a[3], const float b[3], float t);
309
311void interp_v2_v2v2v2v2_cubic(float p[2],
312 const float v1[2],
313 const float v2[2],
314 const float v3[2],
315 const float v4[2],
316 float u);
317
318void interp_v3_v3v3_uchar(unsigned char target[3],
319 const unsigned char a[3],
320 const unsigned char b[3],
321 float t);
322
323void mid_v3_v3v3(float r[3], const float a[3], const float b[3]);
324void mid_v2_v2v2(float r[2], const float a[2], const float b[2]);
325void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3]);
326void mid_v2_v2v2v2(float v[2], const float v1[2], const float v2[2], const float v3[2]);
327void mid_v3_v3v3v3v3(
328 float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
329void mid_v3_v3_array(float r[3], const float (*vec_arr)[3], unsigned int vec_arr_num);
330
343void mid_v3_v3v3_angle_weighted(float r[3], const float a[3], const float b[3]);
344
346
347/* -------------------------------------------------------------------- */
350
351MINLINE bool is_zero_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
352MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
353MINLINE bool is_zero_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT;
354
355MINLINE bool is_finite_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT;
356MINLINE bool is_finite_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
357MINLINE bool is_finite_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT;
358
359MINLINE bool is_one_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT;
360
361MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
362MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT;
363MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT;
364
365MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT;
366
367MINLINE bool compare_v2v2(const float v1[2],
368 const float v2[2],
369 float limit) ATTR_WARN_UNUSED_RESULT;
370MINLINE bool compare_v3v3(const float v1[3],
371 const float v2[3],
372 float limit) ATTR_WARN_UNUSED_RESULT;
373MINLINE bool compare_v4v4(const float v1[4],
374 const float v2[4],
375 float limit) ATTR_WARN_UNUSED_RESULT;
376
377MINLINE bool compare_len_v3v3(const float v1[3],
378 const float v2[3],
379 float limit) ATTR_WARN_UNUSED_RESULT;
380
381MINLINE bool compare_size_v3v3(const float v1[3],
382 const float v2[3],
383 float limit) ATTR_WARN_UNUSED_RESULT;
384
397MINLINE float line_point_side_v2(const float l1[2],
398 const float l2[2],
399 const float pt[2]) ATTR_WARN_UNUSED_RESULT;
400
402
403/* -------------------------------------------------------------------- */
406
407/* - angle with 2 arguments is angle between vector.
408 * - angle with 3 arguments is angle between 3 points at the middle point.
409 * - angle_normalized_* is faster equivalent if vectors are normalized.
410 */
411
415float angle_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
416float angle_signed_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT;
417float angle_v2v2v2(const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT;
418float angle_normalized_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
422float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
431float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT;
435float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3]) ATTR_WARN_UNUSED_RESULT;
439float cos_v2v2v2(const float p1[2], const float p2[2], const float p3[2]) ATTR_WARN_UNUSED_RESULT;
443float angle_on_axis_v3v3_v3(const float v1[3],
444 const float v2[3],
445 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
446float angle_signed_on_axis_v3v3_v3(const float v1[3],
447 const float v2[3],
448 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
449float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT;
453float angle_on_axis_v3v3v3_v3(const float v1[3],
454 const float v2[3],
455 const float v3[3],
456 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
457float angle_signed_on_axis_v3v3v3_v3(const float v1[3],
458 const float v2[3],
459 const float v3[3],
460 const float axis[3]) ATTR_WARN_UNUSED_RESULT;
461void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3]);
462void angle_quad_v3(
463 float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
464void angle_poly_v3(float *angles, const float *verts[3], int len);
465
467
468/* -------------------------------------------------------------------- */
471
475void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2]);
479void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3]);
483void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2]);
487void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3]);
501void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3]);
502void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const float v_plane[3]);
506void project_v3_plane(float out[3], const float plane_no[3], const float plane_co[3]);
523void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3]);
529void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3]);
535void ortho_v3_v3(float out[3], const float v[3]);
539void ortho_v2_v2(float out[2], const float v[2]);
543void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
547void rotate_v2_v2fl(float r[2], const float p[2], float angle);
548void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], float angle);
553void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle);
554
556
557/* -------------------------------------------------------------------- */
560
561void print_v2(const char *str, const float v[2]);
562void print_v3(const char *str, const float v[3]);
563void print_v4(const char *str, const float v[4]);
564void print_vn(const char *str, const float v[], int n);
565
566#define print_v2_id(v) print_v2(STRINGIFY(v), v)
567#define print_v3_id(v) print_v3(STRINGIFY(v), v)
568#define print_v4_id(v) print_v4(STRINGIFY(v), v)
569#define print_vn_id(v, n) print_vn(STRINGIFY(v), v, n)
570
571MINLINE void normal_short_to_float_v3(float out[3], const short in[3]);
572MINLINE void normal_float_to_short_v3(short out[3], const float in[3]);
573
574void minmax_v4v4_v4(float min[4], float max[4], const float vec[4]);
575void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]);
576void minmax_v2v2_v2(float min[2], float max[2], const float vec[2]);
577
579void dist_ensure_v3_v3fl(float v1[3], const float v2[3], float dist);
580void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist);
581
582void axis_sort_v3(const float axis_values[3], int r_axis_order[3]);
583
584MINLINE void clamp_v2(float vec[2], float min, float max);
585MINLINE void clamp_v3(float vec[3], float min, float max);
586MINLINE void clamp_v4(float vec[4], float min, float max);
587
589
590/* -------------------------------------------------------------------- */
595
596double dot_vn_vn(const float *array_src_a,
597 const float *array_src_b,
599double len_squared_vn(const float *array, int size) ATTR_WARN_UNUSED_RESULT;
600float normalize_vn_vn(float *array_tar, const float *array_src, int size);
601float normalize_vn(float *array_tar, int size);
602void range_vn_i(int *array_tar, int size, int start);
603void range_vn_u(unsigned int *array_tar, int size, unsigned int start);
604void range_vn_fl(float *array_tar, int size, float start, float step);
605void negate_vn(float *array_tar, int size);
606void negate_vn_vn(float *array_tar, const float *array_src, int size);
607void mul_vn_vn(float *array_tar, const float *array_src, int size);
608void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
609void mul_vn_fl(float *array_tar, int size, float f);
610void mul_vn_vn_fl(float *array_tar, const float *array_src, int size, float f);
611void add_vn_vn(float *array_tar, const float *array_src, int size);
612void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
613void sub_vn_vn(float *array_tar, const float *array_src, int size);
614void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size);
615void interp_vn_vn(float *array_tar, const float *array_src, float t, int size);
616void copy_vn_i(int *array_tar, int size, int val);
617void copy_vn_short(short *array_tar, int size, short val);
618void copy_vn_fl(float *array_tar, int size, float val);
619
620void add_vn_vn_d(double *array_tar, const double *array_src, int size);
621void add_vn_vnvn_d(double *array_tar,
622 const double *array_src_a,
623 const double *array_src_b,
624 int size);
625void mul_vn_db(double *array_tar, int size, double f);
626
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
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void project_v2_v2v2_normalized(float out[2], const float p[2], const float v_proj[2])
MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3])
MINLINE double normalize_v3_db(double n[3])
MINLINE float normalize_v2_v2_length(float r[2], const float a[2], float unit_length)
MINLINE void mul_v4_fl(float r[4], float f)
float angle_v2v2v2(const float a[2], const float b[2], const float c[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
void add_vn_vn(float *array_tar, const float *array_src, int size)
void copy_vn_short(short *array_tar, int size, short val)
void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], float angle)
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
void interp_v3_v3v3_db(double target[3], const double a[3], const double b[3], double t)
float angle_on_axis_v3v3_v3(const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void swap_v4_v4(float a[4], float b[4])
void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void axis_sort_v3(const float axis_values[3], int r_axis_order[3])
double len_squared_vn(const float *array, int size) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
float angle_normalized_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_fl(float r[3], float f)
MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE double dot_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
void print_v3(const char *str, const float v[3])
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
void mul_vn_fl(float *array_tar, int size, float f)
MINLINE void swap_v2_v2(float a[2], float b[2])
bool interp_v3_v3v3_slerp(float target[3], const float a[3], const float b[3], float t) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
MINLINE void copy_v2db_v2fl(double r[2], const float a[2])
MINLINE bool is_one_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2_db(double r[2], const double a[2])
float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3_array(float r[3], const float(*vec_arr)[3], unsigned int vec_arr_num)
MINLINE void clamp_v3(float vec[3], float min, float max)
float normalize_vn(float *array_tar, int size)
float angle_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2(float r[2], const float a[2])
void negate_vn(float *array_tar, int size)
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE float len_v2v2_int(const int v1[2], const int v2[2])
MINLINE bool is_finite_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3(float r[3], const float a[3])
void reflect_v3_v3v3(float out[3], const float v[3], const float normal[3])
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
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 interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE void clamp_v4(float vec[4], float min, float max)
MINLINE float dot_v3v3v3(const float p[3], const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool is_zero_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_v2(float r[2], const float a[2])
MINLINE float len_squared_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 double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3])
MINLINE bool compare_v4v4(const float v1[4], const float v2[4], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void add_vn_vnvn_d(double *array_tar, const double *array_src_a, const double *array_src_b, int size)
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3])
MINLINE float normalize_v2_length(float n[2], float unit_length)
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3db_db(double r[3], double f)
MINLINE void mul_v2_fl(float r[2], float f)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
void mid_v2_v2v2v2(float v[2], const float v1[2], const float v2[2], const float v3[2])
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
void project_v3_plane(float out[3], const float plane_no[3], const float plane_co[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
void range_vn_fl(float *array_tar, int size, float start, float step)
MINLINE void add_v3_v3_db(double r[3], const double a[3])
MINLINE void normal_float_to_short_v3(short out[3], const float in[3])
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], float dist)
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE float dot_m3_v3_row_x(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
MINLINE bool is_zero_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
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 copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_m3_v3_row_y(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE void negate_v3_v3(float r[3], const float a[3])
void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3])
void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
void print_v4(const char *str, const float v[4])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE double dot_v3v3_db(const double a[3], const double b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void normal_short_to_float_v3(float out[3], const short in[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
void copy_vn_fl(float *array_tar, int size, float val)
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
void interp_v3_v3v3_slerp_safe(float target[3], const float a[3], const float b[3], float t)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
float cos_v2v2v2(const float p1[2], const float p2[2], const float p3[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE void invert_v3_safe(float r[3])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v2_v2(float r[2], const float a[2])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void print_v2(const char *str, const float v[2])
void mid_v3_v3v3_angle_weighted(float r[3], const float a[3], const float b[3])
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
float normalize_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void add_v2_fl(float r[2], float f)
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
float angle_signed_on_axis_v3v3_v3(const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3_int(int r[3])
void ortho_v3_v3(float out[3], const float v[3])
MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_m4_v3_row_z(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3_short(short r[3], const short a[3])
void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
MINLINE void negate_v4_v4(float r[4], const float a[4])
double dot_vn_vn(const float *array_src_a, const float *array_src_b, int size) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3_v3_length(float r[3], const float a[3], float unit_length)
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
void range_vn_i(int *array_tar, int size, int start)
MINLINE float len_manhattan_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void sub_v2db_v2fl_v2fl(double r[2], const float a[2], const float b[2])
MINLINE bool compare_v2v2(const float v1[2], const float v2[2], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void clamp_v2(float vec[2], float min, float max)
MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
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])
float angle_signed_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3fl_v3db(float r[3], const double a[3])
void minmax_v4v4_v4(float min[4], float max[4], const float vec[4])
MINLINE void zero_v4(float r[4])
MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
MINLINE void copy_v3db_v3fl(double r[3], const float a[3])
MINLINE void invert_v3(float r[3])
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
void print_vn(const char *str, const float v[], int n)
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void copy_vn_i(int *array_tar, int size, int val)
MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE double len_v2_db(const double v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool compare_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void mul_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
void ortho_v2_v2(float out[2], const float v[2])
void negate_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v2(float r[2])
MINLINE void copy_v4fl_v4db(float r[4], const double a[4])
MINLINE float mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double b[3])
MINLINE void copy_v4_v4_int(int r[4], const int a[4])
void range_vn_u(unsigned int *array_tar, int size, unsigned int start)
MINLINE float len_manhattan_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void angle_poly_v3(float *angles, const float *verts[3], int len)
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2(float n[2])
MINLINE double len_v2v2_db(const double v1[2], const double v2[2]) ATTR_WARN_UNUSED_RESULT
void rotate_v2_v2fl(float r[2], const float p[2], float angle)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE bool compare_len_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void copy_v3_v3_db(double r[3], const double a[3])
MINLINE void zero_v3(float r[3])
void mul_vn_vn_fl(float *array_tar, const float *array_src, int size, float f)
void interp_v3_v3v3_uchar(unsigned char target[3], const unsigned char a[3], const unsigned char b[3], float t)
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_v4_db(double r[4], const double a[4])
MINLINE void negate_v3_db(double r[3])
void add_vn_vn_d(double *array_tar, const double *array_src, int size)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE double normalize_v3_length_db(double n[3], double unit_length)
MINLINE bool is_finite_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
void mul_vn_db(double *array_tar, int size, double f)
void interp_v2_v2v2_db(double target[2], const double a[2], const double b[2], double t)
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void invert_v2(float r[2])
MINLINE int len_manhattan_v2_int(const int v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_fl(float r[4], float f)
MINLINE float normalize_v2_v2(float r[2], const float a[2])
MINLINE void add_v3_uchar_clamped(uchar r[3], int i)
void interp_v3_v3v3v3_uv(float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2])
void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE float normalize_v3_length(float n[3], float unit_length)
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], float dist)
MINLINE bool compare_size_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE bool is_finite_v4(const float v[4]) ATTR_WARN_UNUSED_RESULT
void interp_vn_vn(float *array_tar, const float *array_src, float t, int size)
MINLINE float dot_m4_v3_row_y(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float n[3])
void sub_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4])
MINLINE void negate_v4(float r[4])
void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3])
void project_v2_v2v2(float out[2], const float p[2], const float v_proj[2])
MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3_db(double r[3], const double a[3], const double b[3])
MINLINE void copy_v2_fl(float r[2], float f)
MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2])
unsigned char uchar
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:117
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
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
#define str(s)
static float verts[][3]
#define in
#define out
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
#define M
#define min(a, b)
Definition sort.cc:36
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
uint len