diff options
author | Bastien Montagne <bastien@blender.org> | 2021-06-14 13:30:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-06-14 13:32:38 +0300 |
commit | 748475b9431c5b09514b69b042f0daaea1231dc1 (patch) | |
tree | 935b5661487a1603f2811ed8a5b38fe2747c4099 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | b21db5e6988566dc3344b3293eb7e33234ec2597 (diff) |
BLI_math: Cleanup: Use `mul_`/`madd_` functions.
Better to avoid explicit vectors components direct manipulation when a
generic operation for whole vector exists, if nothing else it avoids
potential mistakes in indices.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index e0df9665a7e..db9ece81c59 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -722,6 +722,13 @@ MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], floa r[2] = a[2] + b[2] * f; } +MINLINE void madd_v3_v3v3db_db(double r[3], const double a[3], const double b[3], double f) +{ + r[0] = a[0] + b[0] * f; + r[1] = a[1] + b[1] * f; + r[2] = a[2] + b[2] * f; +} + MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]) { r[0] = a[0] + b[0] * c[0]; |