diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-10-22 19:08:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-10-22 19:09:28 +0300 |
commit | 80470b639c1c5091541c56ae80212fa8e5148913 (patch) | |
tree | f86e47e0213f7e93a5aa9adfec33380700ff51c4 /source/blender/editors/space_view3d/view3d_walk.c | |
parent | 0d54aa9c024261851bef24a3ebfd2bd875fec380 (diff) |
BLI_math: axis_angle_to_quat_single
Useful to avoid defining a vector for an axis-aligned rotation.
Matches axis_angle_to_mat3_single behavior.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_walk.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_walk.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 0bda6e37fd1..4d36d703ae7 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -972,9 +972,6 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */ float dvec[3] = {0.0f, 0.0f, 0.0f}; /* this is the direction that's added to the view offset per redraw */ - /* Camera Uprighting variables */ - float upvec[3] = {0.0f, 0.0f, 0.0f}; /* stores the view's up vector */ - int moffset[2]; /* mouse offset from the views center */ float tmp_quat[4]; /* used for rotating the view */ @@ -1033,6 +1030,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) { /* rotate about the X axis- look up/down */ if (moffset[1]) { + float upvec[3]; float angle; float y; @@ -1064,6 +1062,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) /* rotate about the Y axis- look left/right */ if (moffset[0]) { + float upvec[3]; float x; /* if we're upside down invert the moffset */ @@ -1082,10 +1081,8 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) /* user adjustement factor */ x *= walk->mouse_speed; - copy_v3_fl3(upvec, 0.0f, 0.0f, 1.0f); - /* Rotate about the relative up vec */ - axis_angle_normalized_to_quat(tmp_quat, upvec, x); + axis_angle_to_quat_single(tmp_quat, 'Z', x); mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat); } } |