diff options
author | Martin Poirier <theeth@yahoo.com> | 2005-10-24 01:34:20 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2005-10-24 01:34:20 +0400 |
commit | e02336653df6177dbca04e9b624b0abef8c9f910 (patch) | |
tree | c962de41f6243c8af377f49b8b752f68604f1be2 /source/blender/src/transform_constraints.c | |
parent | 847a584744fa2316b625e90459479fbc058f74d5 (diff) |
Fixed backwardstransform.blend bug from orange dudes.
It was literally two lines of code.
This probably fixes a lot of the "constraining transform goes backward" problems.
Was a dumb oversight on my part.
Diffstat (limited to 'source/blender/src/transform_constraints.c')
-rwxr-xr-x | source/blender/src/transform_constraints.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index eed960bde94..b1e3f545a5f 100755 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -169,7 +169,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f) return; - + /* For when view is parallel to constraint... will cause NaNs otherwise So we take vertical motion in 3D space and apply it to the constraint axis. Nice for camera grab + MMB */ @@ -188,18 +188,17 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 float cb[3], ab[3]; VECCOPY(out, axis); - + /* Get view vector on axis to define a plane */ - getViewVector(t->con.center, norm); + VecAddf(vec, t->con.center, in); + getViewVector(vec, norm); + Crossf(vec, norm, axis); /* Project input vector on the plane passing on axis */ Projf(vec, in, vec); VecSubf(vec, in, vec); - /* Get the view vector there */ - getViewVector(vec, norm); - /* intersect the two lines: axis and norm */ Crossf(cb, vec, norm); Crossf(ab, axis, norm); |