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/blenlib/intern/math_matrix.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/blenlib/intern/math_matrix.c')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 4bf6d162970..19d116928fd 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1549,7 +1549,7 @@ void mat4_to_loc_quat(float loc[3], float quat[4], float wmat[4][4])
negate_m3(mat3_n);
}
- mat3_to_quat(quat, mat3_n);
+ mat3_normalized_to_quat(quat, mat3_n);
copy_v3_v3(loc, wmat[3]);
}
@@ -1557,7 +1557,7 @@ void mat4_decompose(float loc[3], float quat[4], float size[3], float wmat[4][4]
{
float rot[3][3];
mat4_to_loc_rot_size(loc, rot, size, wmat);
- mat3_to_quat(quat, rot);
+ mat3_normalized_to_quat(quat, rot);
}
/**
@@ -1692,8 +1692,8 @@ void blend_m3_m3m3(float out[3][3], float dst[3][3], float src[3][3], const floa
mat3_to_rot_size(drot, dscale, dst);
mat3_to_rot_size(srot, sscale, src);
- mat3_to_quat(dquat, drot);
- mat3_to_quat(squat, srot);
+ mat3_normalized_to_quat(dquat, drot);
+ mat3_normalized_to_quat(squat, srot);
/* do blending */
interp_qt_qtqt(fquat, dquat, squat, srcweight);
@@ -1715,8 +1715,8 @@ void blend_m4_m4m4(float out[4][4], float dst[4][4], float src[4][4], const floa
mat4_to_loc_rot_size(dloc, drot, dscale, dst);
mat4_to_loc_rot_size(sloc, srot, sscale, src);
- mat3_to_quat(dquat, drot);
- mat3_to_quat(squat, srot);
+ mat3_normalized_to_quat(dquat, drot);
+ mat3_normalized_to_quat(squat, srot);
/* do blending */
interp_v3_v3v3(floc, dloc, sloc, srcweight);