Closed mweatherley closed 1 week ago
Gizmos could use isometries to position figures in addition to raw translation/rotations.
I'm quite nervous about doubling the API surface there for some sugar 🤔 Is there a benefit that I'm missing?
I'm quite nervous about doubling the API surface there for some sugar 🤔 Is there a benefit that I'm missing?
Well, I'm also nervous about it, but I think it's worth thinking about at least. My main thought here was mostly that the gizmo functions are essentially just indirectly asking for isometries as inputs — on the other hand, just changing the inputs to isometries seems like it could lead to poor ergonomics in cases where an isometry isn't readily on hand (since you'll have to call Isometry3d::new
wrapping what you previously would have just passed as parameters). That's why I wrote "in addition to" above: I didn't really give much thought to the fact that that doubles the API surface, though.
As I write this, I'm becoming a little more skeptical that the "from raw parts" aspect will be typical if people are typically going to be extracting these from transforms, so maybe if the story for Transform -> Isometry3d
is good, just taking isometries as inputs would be okay.
so maybe if the story for Transform -> Isometry3d is good, just taking isometries as inputs would be okay.
Yeah, that makes sense to me. I think I'd be fine to swap to a pure Isometry API, assuming you can do .into
from Transforms :)
Tackling gizmos in https://github.com/bevyengine/bevy/pull/14676 now
14269 introduced isometry types to bevy_math. There are some places where it makes sense to integrate these that should probably be addressed in some fashion; the purpose of this issue is to track these.
Transform
/GlobalTransform
andIsometry3d
. (#14478)Bounded2d
/Bounded3d
could use isometry types in addition to raw translations/rotations. (#14485)These are all relatively similar in flavor, so it would be good if they blended harmoniously together (e.g. making it relatively easy to extract an
Isometry3d
from aTransform
to position a sphere gizmo, for example).