bevy/crates/bevy_transform
ira 56d69c1427 Fix incorrect rotation in Transform::rotate_around. (#5300)
Someone noted that the `rotate_around` method did not give the results they expected: [discord thread](https://discord.com/channels/691052431525675048/996497295325544479)
I tested `rotate_around` and their workaround and it seems like it was indeed incorrect.

Here is a scene with some cubes at different angles all being rotated around the center on the Y axis.

https://user-images.githubusercontent.com/29694403/178598432-407d7e80-1caf-4b17-b69b-66d9156c81e1.mp4

Interestingly, the middle cube rotates as you might expect. This threw me for a bit of a loop before I added the other cubes to the test haha.

Here is the same scene with the order multiplication of the quaternions flipped in `rotate_around`.

https://user-images.githubusercontent.com/29694403/178598446-a98026f3-524c-448b-8437-4d0d3175c6ca.mp4

That looks better :)

## Changelog

* Fixed `rotate_around` rotating the wrong way around
* Added `translate_around`. - Split out the translation code from `rotate_around`.
* Simplified/optimized `rotate_local_*` methods. - Yep, That works somehow.

<sup>Quaternions sure are wacky. Do not ask me how this works exactly, haha.</sup>

Co-authored-by: devil-ira <justthecooldude@gmail.com>
2022-07-13 15:10:43 +00:00
..
src Fix incorrect rotation in Transform::rotate_around. (#5300) 2022-07-13 15:10:43 +00:00
Cargo.toml Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
README.md transform: remove some dependencies and cleanup 2020-07-10 01:49:23 -07:00

Bevy Transform

This crate is largely a 1:1 port from legion_transform (ecs: legion, math: nalgebra) to bevy (ecs: bevy_ecs, math: glam)