Fix T96925: Fast diagonal movement in walk navigation
View moves faster with two active directions. This is probably because `dvec` is not normalized when moving in two directions. Normalizing this direction vector will fix the problem. Differential Revision: https://developer.blender.org/D14729
This commit is contained in:
@@ -1205,7 +1205,6 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
|
||||
dvec_tmp[2] = 0.0f;
|
||||
}
|
||||
|
||||
normalize_v3(dvec_tmp);
|
||||
add_v3_v3(dvec, dvec_tmp);
|
||||
}
|
||||
|
||||
@@ -1226,7 +1225,6 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
|
||||
dvec_tmp[1] = direction * rv3d->viewinv[0][1];
|
||||
dvec_tmp[2] = 0.0f;
|
||||
|
||||
normalize_v3(dvec_tmp);
|
||||
add_v3_v3(dvec, dvec_tmp);
|
||||
}
|
||||
|
||||
@@ -1249,6 +1247,8 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm)
|
||||
}
|
||||
}
|
||||
|
||||
normalize_v3(dvec);
|
||||
|
||||
/* apply movement */
|
||||
mul_v3_fl(dvec, walk->speed * time_redraw);
|
||||
}
|
||||
|
Reference in New Issue
Block a user