-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Use Isometry
in bevy_gizmos
wherever we can
#14676
Use Isometry
in bevy_gizmos
wherever we can
#14676
Conversation
Here are just some screenshots. This PR also fixes the capsule and cylinder primitive rendering which was broken in the mean time somehow. (The circles connecting points with the orthogonal lines aren't exact) Before: After: Funnily enough I also didn't change any parameters and I don't know why it looks so "simple" in the before-version 🤔 |
93992c6
to
e938ea3
Compare
98c534f
to
48ef983
Compare
c183242
to
08bfa92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't reviewed everything in detail, but the changes overall look fine to me. The changes from a direction to the weird Isometry::from_rotation(Quat::from_rotation_arc())
seems a but ugly, but I don't think we have a nicer solution for that currently.
Wouldn't it be nicer to accept |
Possibly, but isometry is a really useful type, and that will increase complexity and compile times here. |
@alice-i-cecile given that Bevy uses |
Yeah I don't feel super strongly either, but I'd like to merge this as is and then refine later. |
@alice-i-cecile that's fair :) |
Objective
Isometry
typesSolution
bevy_gizmos
crate and give all methods a slight workoverTesting
git switch main && cargo rr --example <X> && git switch <BRANCH> && cargo rr --example <X>
and compare the visual resultsMigration Guide
The gizmos methods function signature changes as follows:
position
&rotation_angle
before ->Isometry2d::new(position, Rot2::radians(rotation_angle))
position
before ->Isometry2d::from_translation(position)
position
&rotation
before ->Isometry3d::new(position, rotation)
position
before ->Isometry3d::from_translation(position)