From 6559ab2d511b1c0c1845342133505139166da4b3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 28 Dec 2016 17:44:36 +1100 Subject: 3D View roll & orbit were scaling view-quat length Over time roll and orbit would scale the quaternion which is documented as unit length. In practice any errors would be subtle, but better normalize as other operators do. --- source/blender/editors/space_view3d/view3d_edit.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 620bbf03f32..2b53eb71d99 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -4064,6 +4064,9 @@ static int vieworbit_exec(bContext *C, wmOperator *op) mul_qt_qtqt(quat_new, rv3d->viewquat, quat_mul); + /* avoid precision loss over time */ + normalize_qt(quat_new); + if (view_opposite != RV3D_VIEW_USER) { rv3d->view = view_opposite; /* avoid float in-precision, just get a new orientation */ @@ -4130,6 +4133,10 @@ static void view_roll_angle(ARegion *ar, float quat[4], const float orig_quat[4] axis_angle_normalized_to_quat(quat_mul, dvec, angle); mul_qt_qtqt(quat, orig_quat, quat_mul); + + /* avoid precision loss over time */ + normalize_qt(quat); + rv3d->view = RV3D_VIEW_USER; } -- cgit v1.2.3