Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings and docs for exponential denormalization in rotate functions (alternative to #17604) #17646

Merged

Conversation

Novakasa
Copy link
Contributor

@Novakasa Novakasa commented Feb 2, 2025

Objective

Solution

  • Add a warning of this issue and a recommendation to normalize to the API docs.
  • Add a runtime warning that checks for denormalized axis in debug mode, with a reference to the API docs.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Math Fundamental domain-agnostic mathematical operations labels Feb 2, 2025
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 2, 2025
crates/bevy_transform/src/components/transform.rs Outdated Show resolved Hide resolved
crates/bevy_transform/src/components/transform.rs Outdated Show resolved Hide resolved
@Novakasa Novakasa force-pushed the warn-rotate-axis-denormalization branch from 2411c78 to ddc65e0 Compare February 3, 2025 10:31
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 3, 2025
Merged via the queue into bevyengine:main with commit bdf60d6 Feb 3, 2025
28 checks passed
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
… (alternative to bevyengine#17604) (bevyengine#17646)

# Objective

- When obtaining an axis from the transform and putting that into
`Transform::rotate_axis` or `Transform::rotate_axis_local`, floating
point errors could accumulate exponentially, resulting in denormalized
rotation.
- This is an alternative to and closes bevyengine#17604, due to lack of consent
around this in the [discord
discussion](https://discord.com/channels/691052431525675048/1203087353850364004/1334232710658392227)
- Closes bevyengine#16480 

## Solution

- Add a warning of this issue and a recommendation to normalize to the
API docs.
- Add a runtime warning that checks for denormalized axis in debug mode,
with a reference to the API docs.
joshua-holmes pushed a commit to joshua-holmes/bevy that referenced this pull request Feb 5, 2025
… (alternative to bevyengine#17604) (bevyengine#17646)

# Objective

- When obtaining an axis from the transform and putting that into
`Transform::rotate_axis` or `Transform::rotate_axis_local`, floating
point errors could accumulate exponentially, resulting in denormalized
rotation.
- This is an alternative to and closes bevyengine#17604, due to lack of consent
around this in the [discord
discussion](https://discord.com/channels/691052431525675048/1203087353850364004/1334232710658392227)
- Closes bevyengine#16480 

## Solution

- Add a warning of this issue and a recommendation to normalize to the
API docs.
- Add a runtime warning that checks for denormalized axis in debug mode,
with a reference to the API docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform::rotation denormalizes after applying successive rotations.
4 participants