diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-15 20:09:57 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-15 20:09:57 +0400 |
commit | ba16e7d631ad0fa5ae7add9bc5f0590c3d23e778 (patch) | |
tree | ce907014d2f99ad5d6a12c305f56dc6f6da3d286 /source/blender/blenlib/intern | |
parent | deb95ddb448ee9e7a4971d65ed8e7d17172e9a4d (diff) |
Object tracking: object with object solver constraint is now parented to scene's camera
Made Object Solver operator parent object to scene's camera. Behavior is pretty much
familiar to Child Of constraint -- it stores inverted transformation matrix which gives
constant offset in parent's space.
Current files would open incorrect, to make object aligned well again, just press
"Set Inverse" button in Object Solver constraint.
Fixed orientation operators so now they should work in all cases.
Also changed behavior of Set Origin operator which now sets origin to the median
point of all selected tracks/
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 37cb49fc17b..19aa86ee941 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -195,8 +195,14 @@ void mul_m3_m3m3(float m1[][3], float m3_[][3], float m2_[][3]) m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; } -void mul_m4_m4m3(float (*m1)[4], float (*m3)[4], float (*m2)[3]) +void mul_m4_m4m3(float (*m1)[4], float (*m3_)[4], float (*m2_)[3]) { + float m2[3][3], m3[4][4]; + + /* copy so it works when m1 is the same pointer as m2 or m3 */ + copy_m3_m3(m2, m2_); + copy_m4_m4(m3, m3_); + m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; |