diff options
author | Ton Roosendaal <ton@blender.org> | 2005-02-25 14:55:03 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-02-25 14:55:03 +0300 |
commit | 4ee71094fa216aab3f4b48e20211fb78d3369454 (patch) | |
tree | c9a2cfd49fdb31c1715e87535d18a1d44c0f8f18 | |
parent | 91fbe7211502a51654a85c8a1472601c2cdbcba4 (diff) |
Added the "initgrabz()" call in new transform, this is needed to calculate
correct mapping of mouse motion to a 3d vector in perspective mode, e.g.
corrected for depth.
-rwxr-xr-x | source/blender/src/transform.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 13b9ac22006..7b85fdc1c1a 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1837,8 +1837,19 @@ int Rotation(TransInfo *t, short mval[2]) void initTranslation(TransInfo *t) { + t->num.idx_max = 2; t->transform = Translation; + + /* initgrabz() defines a factor for perspective depth correction, used in window_to_3d() */ + if (G.obedit) { + float vec[3]; + + VECCOPY(vec, t->center); + Mat4MulVecfl(G.obedit->obmat, vec); + initgrabz(vec[0], vec[1], vec[2]); + } + else initgrabz(t->center[0], t->center[1], t->center[2]); } int Translation(TransInfo *t, short mval[2]) |