Skip to content

transform: Add transform_vector methods#24319

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
lkolbly:lkolbly/transform-vector
May 21, 2026
Merged

transform: Add transform_vector methods#24319
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
lkolbly:lkolbly/transform-vector

Conversation

@lkolbly
Copy link
Copy Markdown
Contributor

@lkolbly lkolbly commented May 16, 2026

Objective

There isn't a particularly obvious way to transform a vector using a Transform (you have to make an Affine3 first, and then use the matrix)

Solution

This adds a transform_vector method to Transform and GlobalTransform, paralleling the transform_point method.

Testing

Added doctests.

@kfc35 kfc35 added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Transform Translations, rotations and scales S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 20, 2026
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future, please double check your copy and paste 😄

Comment thread crates/bevy_transform/src/components/transform.rs Outdated
Comment thread crates/bevy_transform/src/components/transform.rs Outdated
Comment thread crates/bevy_transform/src/components/transform.rs Outdated
Comment thread crates/bevy_transform/src/components/transform.rs Outdated
Comment thread crates/bevy_transform/src/components/global_transform.rs Outdated
@kfc35 kfc35 added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label May 20, 2026
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 21, 2026
@alice-i-cecile alice-i-cecile enabled auto-merge May 21, 2026 13:00
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 21, 2026
Merged via the queue into bevyengine:main with commit ff01acf May 21, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Transform Translations, rotations and scales C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants