diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-21 08:11:07 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-21 08:17:22 +0300 |
commit | a0bbd65d57f38344fb71565c3c34396363a4be23 (patch) | |
tree | b01aefca3148e35cc80b656a2feb91988be0df7d | |
parent | dc09cc13ea49a0de72aafcb8a48d6189d13aa6d9 (diff) |
Fix T66713: Walk mode doesn't take scene unit scale into account
When changing a scene's unit scale from 1 to something else, 0.1 for
e.g. walk navigation no longer worked properly. Whenever gravity is
enabled, and the user starts to fall or jump, the view-port glitched out
into low earth orbit.
Reviewed By: campbellbarton
Ref D16277
-rw-r--r-- | source/blender/editors/space_view3d/view3d_navigate_walk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_walk.c b/source/blender/editors/space_view3d/view3d_navigate_walk.c index aea322d73d9..fcb4f549353 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_walk.c +++ b/source/blender/editors/space_view3d/view3d_navigate_walk.c @@ -1231,11 +1231,11 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm) /* keep moving if we were moving */ copy_v2_v2(dvec, walk->teleport.direction); - z_cur = walk->rv3d->viewinv[3][2]; - z_new = walk->teleport.origin[2] - getFreeFallDistance(walk->gravity, t) * walk->grid; + z_cur = walk->rv3d->viewinv[3][2] / walk->grid; + z_new = (walk->teleport.origin[2] / walk->grid) - getFreeFallDistance(walk->gravity, t); /* jump */ - z_new += t * walk->speed_jump * walk->grid; + z_new += t * walk->speed_jump; /* duration is the jump duration */ if (t > walk->teleport.duration) { |