Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-10-23 23:02:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-23 23:02:51 +0300
commitfbca69c69afb370ddc5a0b52e10d9db61c025752 (patch)
tree8dde2bedbc44a98af31d06bf2fa80a1fb04432e7 /source/blender/blenkernel/intern/armature.c
parent3a98426ed6d37a204b1d55834e0590dcb7990b47 (diff)
BLI_math: add mat3_normalized_to_* functions
Many uses of matrices for rotation keep them normalized, so no need to normalize each time.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 6afe7f1abe9..fde25784c22 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1325,18 +1325,20 @@ void BKE_armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inm
/* same as BKE_object_mat3_to_rot() */
void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[3][3], bool use_compat)
{
+ BLI_ASSERT_UNIT_M3(mat);
+
switch (pchan->rotmode) {
case ROT_MODE_QUAT:
- mat3_to_quat(pchan->quat, mat);
+ mat3_normalized_to_quat(pchan->quat, mat);
break;
case ROT_MODE_AXISANGLE:
- mat3_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, mat);
+ mat3_normalized_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, mat);
break;
default: /* euler */
if (use_compat)
- mat3_to_compatible_eulO(pchan->eul, pchan->eul, pchan->rotmode, mat);
+ mat3_normalized_to_compatible_eulO(pchan->eul, pchan->eul, pchan->rotmode, mat);
else
- mat3_to_eulO(pchan->eul, pchan->rotmode, mat);
+ mat3_normalized_to_eulO(pchan->eul, pchan->rotmode, mat);
break;
}
}