Skip to content

Adding QoL extensions to Transforms #501

@MarekLg

Description

@MarekLg

I'd like Transforms to have some QoL methods (examples will follow), and would like to hear what the sentiment towards that would be (I know we want to be careful with implementing too many new features).

Here is my wishlist (much of these are influenced by Unity's Transforms:

  • Transform::forward() -> Vec3 Get the normalized direction pointing towards in model-space
  • Transform::look_at(&mut self, &Vec3) Rotate the Transform, so that it looks at a certain position
  • General methods to rotate the Transform e.g. around a certain axis, or orbit around a certain point. Those could be better kept as constructors for Quat, though.
  • Transform::face_towards(&mut self, ..) -> Self same as Transform::new(Mat4::face_towards(..)) but minimizes the amount of Mat4s the average user has to deal with
  • Transform::apply(&mut self, other: &Transform) transform your transform by another transform ;)
  • I'm sure more will come to mind later

The mutable methods would also only be implemented on Transform but not on GlobalTransform (although refining the difference between Global- and Transform could be another Issue).

If everyone's on board I'd like to use this issue to collect wanted features for Transforms and open a pull request to implement them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions