diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-11 02:57:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-11 02:57:30 +0300 |
commit | ac2ebf9c54a9081662ab17f04240c00d9e5ac799 (patch) | |
tree | 207850e003cc1df46b33c1faea5219255b91d443 /source/blender/blenkernel/intern/constraint.c | |
parent | d0cc5d89485f0c34cd3b79752320a40c140af050 (diff) |
Fix T53455: Object disappear w/ TrackTo constraint
Regression caused by own commit 16fbb47c886,
this is really an edge case though since calling normalize twice fixes.
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a5d0df88198..c77cac7bcbd 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1018,8 +1018,11 @@ static void vectomat(const float vec[3], const float target_up[3], short axis, s u[2] = 1; } + /* note: even though 'n' is normalized, don't use 'project_v3_v3v3_normalized' below + * because precision issues cause a problem in near degenerate states, see: T53455. */ + /* project the up vector onto the plane specified by n */ - project_v3_v3v3_normalized(proj, u, n); /* first u onto n... */ + project_v3_v3v3(proj, u, n); /* first u onto n... */ sub_v3_v3v3(proj, u, proj); /* then onto the plane */ /* proj specifies the transformation of the up axis */ |