bevy/crates
Matthias Seiffert 2f6c464f4b Add builder methods to Transform (#2778)
# 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.
2021-09-09 00:46:39 +00:00
..
bevy_app Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_asset update ndk-glue to 0.4 (#2684) 2021-08-19 01:02:15 +00:00
bevy_audio Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_core Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_derive Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_diagnostic add get_history function to Diagnostic (#2772) 2021-09-06 19:16:08 +00:00
bevy_dylib Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_dynamic_plugin Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_ecs Add error messages for the spooky insertions (#2581) 2021-09-01 20:59:25 +00:00
bevy_gilrs Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_gltf Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_input Add convenience methods for checking a set of inputs (#2760) 2021-09-01 21:21:41 +00:00
bevy_internal update ndk-glue to 0.4 (#2684) 2021-08-19 01:02:15 +00:00
bevy_log Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_macro_utils Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_math Update glam requirement from 0.17.3 to 0.18.0 (#2748) 2021-09-06 18:49:40 +00:00
bevy_pbr Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_reflect Update glam requirement from 0.17.3 to 0.18.0 (#2748) 2021-09-06 18:49:40 +00:00
bevy_render Derive thiserror::Error for HexColorError (#2740) 2021-08-30 21:56:13 +00:00
bevy_scene System Param Lifetime Split (#2605) 2021-08-15 20:51:53 +00:00
bevy_sprite Document collide args (#2721) 2021-08-24 18:07:51 +00:00
bevy_tasks Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_text System Param Lifetime Split (#2605) 2021-08-15 20:51:53 +00:00
bevy_transform Add builder methods to Transform (#2778) 2021-09-09 00:46:39 +00:00
bevy_ui Use Explicit Names for Flex Direction (#2672) 2021-08-24 01:50:21 +00:00
bevy_utils derive Debug, Clone for FixedState (StableAHash) (#2694) 2021-08-24 01:31:39 +00:00
bevy_wgpu Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_window Not me ... us (#2654) 2021-08-15 20:08:52 +00:00
bevy_winit Not me ... us (#2654) 2021-08-15 20:08:52 +00:00