From d39ffd72174c28a66c3a8d97054d67cc372f088b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 17 Feb 2014 22:17:31 +1100 Subject: NDOF: remove bias for translation Was noticeable (and annoying) that different axis had different speed, if we want to have axis bias better do as a user preference. --- source/blender/editors/space_view3d/view3d_fly.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_fly.c') diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 9f8d1e14601..813404a5bf9 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -958,28 +958,20 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly) rv3d->rot_angle = 0.0f; /* disable onscreen rotation doo-dad */ if (do_translate) { - const float forward_sensitivity = 1.0f; - const float vertical_sensitivity = 0.4f; - const float lateral_sensitivity = 0.6f; - float speed = 10.0f; /* blender units per second */ + float trans[3]; /* ^^ this is ok for default cube scene, but should scale with.. something */ - - float trans[3] = {lateral_sensitivity * ndof->tvec[0], - vertical_sensitivity * ndof->tvec[1], - forward_sensitivity * ndof->tvec[2]}; - if (fly->use_precision) speed *= 0.2f; - mul_v3_fl(trans, speed * dt); + mul_v3_v3fl(trans, ndof->tvec, speed * dt); /* transform motion from view to world coordinates */ mul_qt_v3(view_inv, trans); if (flag & NDOF_FLY_HELICOPTER) { /* replace world z component with device y (yes it makes sense) */ - trans[2] = speed * dt * vertical_sensitivity * ndof->tvec[1]; + trans[2] = speed * dt * ndof->tvec[1]; } if (rv3d->persp == RV3D_CAMOB) { -- cgit v1.2.3