-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Description
What problem does this solve or what need does it fill?
Currently, working with a transform is cumbersome, requiring many lines to perform simple tasks. This can be seen easily in the translation example:
let direction = transform.local_x();
transform.translation += direction * cube.speed * timer.delta_seconds();
Note that this has to be two lines instead of one, because of borrow checker issues.
What solution would you like?
Simple methods like translate
, local_translate
would make such operations much simpler. The above could become
transform.local_translate(Vec3::X * cube.speed * timer.delta_seconds());
which is much simpler and easier to understand.
What alternative(s) have you considered?
The original example does work, but as I said, it's quite cumbersome.
Additional context
I know Unity has functions like these, although I don't know how many other engines do. Notably, Godot does not.
Metadata
Metadata
Assignees
Labels
A-TransformTranslations, rotations and scalesTranslations, rotations and scalesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished