From e1e49fd1a8a5bca7f95ba230a7daf12fb059779b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 Nov 2016 16:20:30 +1100 Subject: Math Lib: rotate matrix cleanup - Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix duplicating 'angle_to_mat2' - now used instead. (better avoid matching functions having different behavior). - Add 'axis_angle_to_mat4_single', convenience wrapper for 'axis_angle_to_mat3_single'. - Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'. --- source/blender/alembic/intern/abc_transform.cc | 3 +-- source/blender/alembic/intern/abc_util.cc | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'source/blender/alembic') diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc index 7f8984f9970..e2fc7674c4e 100644 --- a/source/blender/alembic/intern/abc_transform.cc +++ b/source/blender/alembic/intern/abc_transform.cc @@ -92,8 +92,7 @@ void AbcTransformWriter::do_write() /* Only apply rotation to root camera, parenting will propagate it. */ if (m_object->type == OB_CAMERA && !has_parent_camera(m_object)) { float rot_mat[4][4]; - unit_m4(rot_mat); - rotate_m4(rot_mat, 'X', -M_PI_2); + axis_angle_to_mat4_single(rot_mat, 'X', -M_PI_2); mul_m4_m4m4(mat, mat, rot_mat); } diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc index f87d18605d4..979a72fcf4e 100644 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@ -221,8 +221,7 @@ void convert_matrix(const Imath::M44d &xform, Object *ob, if (ob->type == OB_CAMERA) { float cam_to_yup[4][4]; - unit_m4(cam_to_yup); - rotate_m4(cam_to_yup, 'X', M_PI_2); + axis_angle_to_mat4_single(cam_to_yup, 'X', M_PI_2); mul_m4_m4m4(r_mat, r_mat, cam_to_yup); } -- cgit v1.2.3