diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-08 07:50:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-08 07:50:01 +0400 |
commit | 5e232548d3d3362ba5f2af7807237bc7d6b672d6 (patch) | |
tree | c13584da0ac6ab2e26ab45cebb04ffadb6aa306f /source | |
parent | 28b264de67b99023e2e42b895804d8e6d88798dd (diff) |
fix for error in track rotation, found while looking into adding an up axis to this function.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 4e555b02c2b..be383fdc73c 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1542,10 +1542,10 @@ void quat_apply_track(float quat[4], short axis) float axis[3]= {0,0,2}; axis_angle_to_quat(q, axis, -90 * (M_PI / 180)); */ /* notice x/y flipped intentionally */ - const float quat_track[][4]= {{0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* pos-y */ + const float quat_track[][4]= {{0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* pos-y */ {0.70710676908493, 0.70710676908493, 0.0, 0.0}, /* pos-x */ {0.70710676908493, 0.0, 0.0, 0.70710676908493}, /* pos-z */ - {0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* neg-y */ + {0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* neg-y */ {0.70710676908493, -0.70710676908493, 0.0, 0.0}, /* neg-x */ {0.70710676908493, 0.0, 0.0, -0.70710676908493}};/* neg-z */ @@ -1562,7 +1562,7 @@ void vec_apply_track(float vec[3], short axis) case 0: /* pos-x */ /* vec[0]= 0.0; */ vec[1]= tvec[2]; - vec[2]= tvec[1]; + vec[2]= -tvec[1]; break; case 1: /* pos-y */ vec[0]= tvec[2]; @@ -1577,7 +1577,7 @@ void vec_apply_track(float vec[3], short axis) case 3: /* neg-x */ /* vec[0]= 0.0; */ vec[1]= -tvec[1]; - vec[2]= tvec[2]; + vec[2]= -tvec[2]; break; case 4: /* neg-y */ vec[0]= -tvec[0]; |