mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +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. |
||
---|---|---|
.. | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_gilrs | ||
bevy_gltf | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_pbr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_wgpu | ||
bevy_window | ||
bevy_winit |