1
1

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:
Pratik Borhade
2022-04-25 13:07:18 +02:00
committed by Dalai Felinto
parent d2a01bb7cb
commit 0a86ab6639

View File

@@ -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);
}