diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-19 09:36:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-19 09:36:47 +0400 |
commit | fabc46b41f43aa93c5118fceb4f482419e75ed6f (patch) | |
tree | f6b38ffe11ad6fd385184a5c977750ba0e29ee07 /source/blender/blenlib/BLI_math_base.h | |
parent | fc9c790563a55108bc4ebfaf6a576841fafa2117 (diff) |
Math Lib: add rotation_between_vecs_to_mat3
- behaves like rotation_between_vecs_to_quat
- avoids calling sin,cos calls (approx 1.6x faster).
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index de35ccd58f4..68ffb4b4893 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -279,18 +279,24 @@ double double_round(double x, int ndigits); } (void)0 # define BLI_ASSERT_ZERO_M3(m) { \ - BLI_assert(dot_vn_vn((const float *)m, (const float *)m, 9) != 0.0); \ + BLI_assert(dot_vn_vn((const float *)m, (const float *)m, 9) != 0.0); \ } (void)0 # define BLI_ASSERT_ZERO_M4(m) { \ BLI_assert(dot_vn_vn((const float *)m, (const float *)m, 16) != 0.0); \ } (void)0 +# define BLI_ASSERT_UNIT_M3(m) { \ + BLI_ASSERT_UNIT_V3((m)[0]); \ + BLI_ASSERT_UNIT_V3((m)[1]); \ + BLI_ASSERT_UNIT_V3((m)[2]); \ +} (void)0 #else # define BLI_ASSERT_UNIT_V2(v) (void)(v) # define BLI_ASSERT_UNIT_V3(v) (void)(v) # define BLI_ASSERT_UNIT_QUAT(v) (void)(v) # define BLI_ASSERT_ZERO_M3(m) (void)(m) # define BLI_ASSERT_ZERO_M4(m) (void)(m) +# define BLI_ASSERT_UNIT_M3(m) (void)(m) #endif #endif /* __BLI_MATH_BASE_H__ */ |