+ if (mode==ACTSTRIPMODE_MULT) { /* use source matrix as starting point for desination matrix transform */ + /* Although this code recomposes quats and locs back into a rotation matrix, there seems to be + no other way to get this desirable effect. The multiplied action strip and pose uses the full matrix + of the source strip as the basis of it's own transform. */ + QUATCOPY(dquat, dchan->quat); /* copy source and destination quats so as not to disturb originals */ + QUATCOPY(squat, schan->quat); + QuatToMat4(dquat,amat); /* build 4x4 matrices from quat and location info */ + VecCopyf(amat[3],dchan->loc); + QuatToMat4(squat,bmat); + VecCopyf(bmat[3],schan->loc); + Mat4MulMat4(cmat,amat,bmat); /* do a basic matrix multiply, then break back into quat and loc components */ + Mat4Ortho(cmat); + Mat4ToQuat(cmat,dchan->quat); + NormalQuat(dchan->quat); + VecCopyf(dchan->loc,cmat[3]); }