style: Compare absolute dot-product to 1.0 when interpolating quaternions.

See the extended commit message for the following spec change:

  6b36d41ebc

Basically, by failing to take the absolute value, for certain content we can end
up doing division by zero which will mean that the test included in this patch
will cause an assertion to fail in debug builds and return
"matrix(NaN, NaN....)" in release builds.

Differential Revision: https://phabricator.services.mozilla.com/D9618
This commit is contained in:
Brian Birtles 2018-10-24 07:06:43 +00:00 committed by Emilio Cobos Álvarez
parent ac873c714f
commit 990f2c6bb9
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -1829,7 +1829,7 @@ impl Animate for Quaternion {
self.3 * other.3)
.min(1.0).max(-1.0);
if dot == 1.0 {
if dot.abs() == 1.0 {
return Ok(*self);
}