Skip to content

Commit

Permalink
Fix real part of quaternion derivatives (#488)
Browse files Browse the repository at this point in the history
* Fix real part of quaternion derivatives

In the Taylor expansion of a quaternion rotation, the first-order term should be purely imaginary. Seems like something got translated incorrectly in the change from xpbd to the current integrator

* Update snapshot

* Replace the first-order expansion of rotation with true rotation

This should improve the accuracy of rotations, in particular for faster rotation rates (> approx 0.5 radians per substep for a previous error of 5% in rotation rate)

* Add a .renormalize() method on 3D Rotations

Wasn't sure of the best way to handle this:
* `(self) -> Self` vs `(&mut self) -> ()`
* impl on Rotation vs Quaternion (would be harder because it doesn't belong to Avian)

* Simplify quaternion scalar multiply

Replace the weird thing I was doing with something that should also work in f64

* Update cube simulation snapshot
  • Loading branch information
unpairedbracket committed Aug 23, 2024
1 parent 89b733e commit 56d7c59
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 494 deletions.
Loading

0 comments on commit 56d7c59

Please sign in to comment.