mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
ac873c714f
commit
990f2c6bb9
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue