diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-01 14:32:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-01 19:24:47 +0400 |
commit | 5fce3457b79bccbbcfe9fad0ed6f1a04643cf71b (patch) | |
tree | 3893f68e5eac87ad03df3fb0c7041eaaab55c7e0 /source/blender/editors | |
parent | a9e7c7b8488637cb1afa9394263c537547ff87c4 (diff) |
Math lib: add axis_angle_normalized_to_quat, use when length is known
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_walk.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 323bc6bc436..7d37326740c 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -834,7 +834,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) } /* Perform the orbital rotation */ - axis_angle_to_quat(q1, zvec_global, sensitivity * vod->reverse * (x - vod->oldx)); + axis_angle_normalized_to_quat(q1, zvec_global, sensitivity * vod->reverse * (x - vod->oldx)); mul_qt_qtqt(vod->viewquat, vod->viewquat, q1); if (vod->use_dyn_ofs) { @@ -3562,7 +3562,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) } /* z-axis */ - axis_angle_to_quat(quat_mul, zvec, angle); + axis_angle_normalized_to_quat(quat_mul, zvec, angle); } else { @@ -3615,7 +3615,7 @@ static void view_roll_angle(ARegion *ar, float quat[4], const float orig_quat[4] float quat_mul[4]; /* camera axis */ - axis_angle_to_quat(quat_mul, dvec, angle); + axis_angle_normalized_to_quat(quat_mul, dvec, angle); mul_qt_qtqt(quat, orig_quat, quat_mul); rv3d->view = RV3D_VIEW_USER; diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 26f942b3ecd..31bb37e98f6 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -973,7 +973,7 @@ static int walkApply(bContext *C, WalkInfo *walk) copy_v3_fl3(upvec, 0.0f, 0.0f, 1.0f); /* Rotate about the relative up vec */ - axis_angle_to_quat(tmp_quat, upvec, x); + axis_angle_normalized_to_quat(tmp_quat, upvec, x); mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat); } } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index fc4e5fcb8e5..98afa2a3c46 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -162,7 +162,7 @@ static void stats_editbone(RegionView3D *rv3d, EditBone *ebo) } /* could move into BLI_math however this is only useful for display/editing purposes */ -static void axis_angle_to_gimbal_axis(float gmat[3][3], float axis[3], float angle) +static void axis_angle_to_gimbal_axis(float gmat[3][3], const float axis[3], const float angle) { /* X/Y are arbitrary axies, most importantly Z is the axis of rotation */ |