Files
storyteller-bevy/studio/src/math
Danny McGee e1235d6a8f Mitigate BVH retargeting jitter (#29)
The initial BVH retargeting solution produced very jittery results. Much
of that jitter was eliminated by using linear interpolation between
frames instead of immediate stepped transitions, but some jittering
still remained, particularly noticeable in the finger motions.

This PR largely fixes remaining jitter issues by making a few changes:

#### Frame-time quantization

Previously, we had been using the `BvhAnim::timer` field incorrectly, by
manually resetting it after `Timer::just_finished` returned `true`, and
returning `0.0` as the interpolation parameter for that frame. This
resulted in a herky-jerky animation due to misalignment between the BVH
animation's frame time and the actual application refresh rate, meaning
we would lose fractions of a frame every time the timer elapsed and the
frame was incremented. This PR addresses that by never calling
`Timer::reset` and always using `Timer::percent` for the interpolation
parameter.

#### Matrix instability

This PR refactors the retargeting system to operate on `Affine3A`
matrices instead of `Mat4`s. `Affine3A` represents a SIMD-optimized 3x3
matrix + a translation vector, so using it provides a small performance
boost in addition to being slightly more numerically stable.
Additionally, we now periodically re-orthonormalize the 3x3 matrices
in-between operations to mitigate drifting due to the accumulation of
floating-point errors.
2024-01-19 00:11:01 -05:00
..
2023-11-02 13:32:58 -04:00
2023-11-10 15:51:17 -05:00
2023-12-07 15:46:32 -05:00
2023-11-10 15:51:17 -05:00