Skip to content

Commit

Permalink
Tried and rejected the Insomniac fix.
Browse files Browse the repository at this point in the history
It resulted in a large loss of precision in some cases.

Should have another look at what Imath is doing instead.
  • Loading branch information
bitshifter committed Jul 10, 2024
1 parent 855530d commit 07c70c6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/euler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ macro_rules! impl_mat3_to_euler {
let sy = math::sqrt(
self.col(i)[j] * self.col(i)[j] + self.col(i)[k] * self.col(i)[k],
);
// TODO: https://d3cw3dd2w32x2b.cloudfront.net/wp-content/uploads/2012/07/euler-angles1.pdf
if (sy > 16.0 * $scalar::EPSILON) {
ea.x = math::atan2(self.col(i)[j], self.col(i)[k]);
ea.y = math::atan2(sy, self.col(i)[i]);
Expand All @@ -366,7 +365,6 @@ macro_rules! impl_mat3_to_euler {
let cy = math::sqrt(
self.col(i)[i] * self.col(i)[i] + self.col(j)[i] * self.col(j)[i],
);
// TODO: https://d3cw3dd2w32x2b.cloudfront.net/wp-content/uploads/2012/07/euler-angles1.pdf
if (cy > 16.0 * $scalar::EPSILON) {
ea.x = math::atan2(self.col(k)[j], self.col(k)[k]);
ea.y = math::atan2(-self.col(k)[i], cy);
Expand Down

0 comments on commit 07c70c6

Please sign in to comment.