mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
3c2830d607
# Objective GlobalTransform's current methods make it unintuitive, long and clunky to access just the rotation or just the scale. ## Solution Dedicated just_rotation() and scale() methods to access just these properties. I'm not sure about the naming, I chose just_rotation() to show that try to indicate there is a waste since it also computes the other fields. ## Testing - Did you test these changes? If so, how? I tried logging the methods with a rotating and scaling cube and the values were correct. - Are there any parts that need more testing? My methods are based on existing bevy/glam methods so should be correct from the getgo. - How can other people (reviewers) test your changes? Is there anything specific they need to know? Probably the easiest is using the 3d_rotations example, adding scaling to it and then logging the methods I added --- ## Showcase ```rust fn log(gt_query: Query<&GlobalTransform>) { for global_transform in gt_query().iter() { println!("{} {}", global_transform.just_rotation(), global_transform.scale()); } } ``` --------- Co-authored-by: Sigma-dev <antonin.programming@gmail.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |