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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-09-09 19:15:01 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-09-09 19:15:01 +0400
commite9b08b64fae2c8c5197f9c1e724f4017244a973c (patch)
tree9e11bbeead206fd2059abb425f017f960667de9a /source/blender/blenlib/intern/arithb.c
parent160c0de87b7b7d03a4516e2a1e7bd548d6cbcf3d (diff)
Fix for bug #17402: IK influence blending with pole targets
didn't give smooth transition. Now it blends the result of IK solving in that case.
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r--source/blender/blenlib/intern/arithb.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 50f8ba0fcde..f89f90f7045 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -759,6 +759,28 @@ void Mat4MulSerie(float answ[][4], float m1[][4],
}
}
+void Mat3BlendMat3(float out[][3], float dst[][3], float src[][3], float srcweight)
+{
+ float squat[4], dquat[4], fquat[4];
+ float ssize[3], dsize[3], fsize[4];
+ float rmat[3][3], smat[3][3];
+
+ Mat3ToQuat(dst, dquat);
+ Mat3ToSize(dst, dsize);
+
+ Mat3ToQuat(src, squat);
+ Mat3ToSize(src, ssize);
+
+ /* do blending */
+ QuatInterpol(fquat, dquat, squat, srcweight);
+ VecLerpf(fsize, dsize, ssize, srcweight);
+
+ /* compose new matrix */
+ QuatToMat3(fquat, rmat);
+ SizeToMat3(fsize, smat);
+ Mat3MulMat3(out, rmat, smat);
+}
+
void Mat4BlendMat4(float out[][4], float dst[][4], float src[][4], float srcweight)
{
float squat[4], dquat[4], fquat[4];