diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-03 20:34:19 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-03 20:48:17 +0300 |
commit | bbd74e9fd4ce014cc98c76eae03563dd0c0d1727 (patch) | |
tree | d6b1d3f5a33463a2a96911b2fc079c9f00d5cff3 /source/blender/editors | |
parent | 9042532085ad8f9d08a94b210c92f89a1cb58013 (diff) |
Fix T85340: Gizmo rotation inverted (in some perspective angles)
This is an old bug (strange not to have been reported before).
To define the direction of rotation, the View Vector is used.
However, only the projection matrix was being considered, but in
perspective mode, the position of the pivot also matters.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_constraints.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 96671697dc4..007ef7fd5c2 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -573,7 +573,9 @@ static void constraints_rotation_imp(TransInfo *t, } /* don't flip axis if asked to or if num input */ if (r_angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) { - if (dot_v3v3(r_vec, t->viewinv[2]) > 0.0f) { + float view_vector[3]; + view_vector_calc(t, t->center_global, view_vector); + if (dot_v3v3(r_vec, view_vector) > 0.0f) { *r_angle = -(*r_angle); } } |