Why not use bevy::TransformSRT to implement bevy_transform::{GlobalTransform, Transform}? #1310
PixelDust22
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
We actually intentionally chose to not use TransformSRT for ergonomics reasons. If we use the newtype pattern, then people can no longer directly access the translation/rotation/scale fields nicely (ex: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It looks like most if not all of the methods implemented in GlobalTransform and Transform was also implemented in glam::TransformSRT. Since we're using glam as our linear algebra library anyways, we may as well use
glam::TransformSRT
to implement the Transform and GlobalTransform components. This helps us to reduce redundant code.The question is, do we want to directly expose the
TransformSRT
type to the user, or do we want to keep the current behavior as is? In the former case we can just change the definition of GlobalTransform and nuke almost all other methods. Any missing methods could be added toglam
instead. Otherwise we would keep the interface as it is right now and implement the internal functions withTransformSRT
.Beta Was this translation helpful? Give feedback.
All reactions