Commit Graph

7 Commits

Author SHA1 Message Date
Terence dfb7b6af22 Don't panic ScLERPing `UnitDualQuaternion` with equal rotation
Solves #1013.

Previously, when screw-linearly interpolating two unit dual quaternions
that had an identical orientation, `try_sclerp` would return `None`, as
the operation would introduce a division-by-zero.

This PR splits out the cases where two unit dual quaternions have an
identical orientation from the cases where they have opposite
orientations. In the case where they have identical orientations, the
operation is well-defined, but the exponential parameterization could
not handle it without introducing NaNs. Therefore, the function detects
this case and simply defaults to linearly interpolating the
translational components and using one of the two inputs' rotation
components.

The case where the inputs have opposite rotations is now detected
separately using the dot product of the real (rotation) parts, which was
already being computed anyway.

Also introduces proptests for these specific scenarios, to avoid any
regression.
2021-10-28 00:02:20 -04:00
Crozet Sébastien 6cfd2bca14 Use proptest for all nalgebra tests. 2021-02-28 17:52:14 +01:00
Terence 8c52e4dfdc rustfmt 2021-01-28 19:29:12 -05:00
Terence ac92e68486 add new operators 2021-01-28 19:27:40 -05:00
Terence ecda74f6b2 clippify 2021-01-28 18:50:34 -05:00
Terence 388b77108e rustfmt 2021-01-28 18:46:14 -05:00
Terence 6be0365203 add integration test 2021-01-28 18:45:34 -05:00