Fix T53455: Object disappear w/ TrackTo constraint

Regression caused by own commit 16fbb47c88,
this is really an edge case though since calling normalize twice fixes.
This commit is contained in:
Campbell Barton 2018-01-11 10:57:30 +11:00
parent d0cc5d8948
commit ac2ebf9c54
Notes: blender-bot 2023-02-14 06:21:53 +01:00
Referenced by issue #53455, Track To constraint makes object disappear
1 changed files with 4 additions and 1 deletions

View File

@ -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 */