mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
2f6c464f4b
# Objective Make it easier to construct transforms. E.g. ```rs Transform::from_xyz(0.0, 0.0, 10.0).with_scale(Vec3::splat(2.0)) ``` I found myself writing an extension method to do this so I don't have to write: ```rs Transform { translation: Vec3::new(0.0, 0.0, 10.0), scale: Vec3::splat(2.0), ..Default::default() } ``` ## Solution Add *builder style* methods to `Transform`. Methods: - `with_translation` - `with_rotation` - `with_scale` I also added these methods to `GlobalTransform`. But they are probably less useful there. |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
Cargo.toml | ||
README.md |
Bevy Transform
This crate is largely a 1:1 port from legion_transform (ecs: legion, math: nalgebra) to bevy (ecs: bevy_ecs, math: glam)