bevy/crates
stevehello166 6729208d39
Implement display for direction (#19942)
# Objective
To implement fmt::Display for the direction types. The reason that this
would be a good addition is that I often find myself using println! to
debug things with directions and adding the extra ":?" was getting a
little annoying. It would also be better for any potential CLI apps that
might need to output a direction.

## Solution
Copied glam's implementation of Display for each length of direction.
I.E Vec3's display for Dir3.

## Testing

- Did you test these changes? If so, how?
Yes, I wrote a little script that printed out the different directions
and compared it to their vector counterparts.
Here it is if anyone's interested
```
use bevy_math::*;

fn main() {
    let dir2 = Dir2::from_xy(0.0, 1.0).unwrap();
    let dir3 = Dir3::from_xyz(0.0, 1.0, 0.0).unwrap();
    let dir3a = Dir3A::from_xyz(0.0, 1.0, 0.0).unwrap();
    let dir4 = Dir4::from_xyzw(0.0, 1.0, 0.0, 0.0).unwrap();
    let vec2 = Vec2::new(0.0, 1.0);
    let vec3 = Vec3::new(0.0, 1.0, 0.0);
    let vec4 = Vec4::new(0.0, 1.0, 0.0, 1.0);
    println!("{dir2} {dir3} {dir3a} {dir4}");
    println!("{vec2}, {vec3}, {vec4}")
}
```
- Are there any parts that need more testing?
Perhaps
2025-07-07 20:00:37 +00:00
..
bevy_a11y Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_animation consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_anti_aliasing fix percentage signs in SMAA (#19987) 2025-07-06 22:24:26 +00:00
bevy_app Run RenderStartup in/before extract instead of after it. (#19926) 2025-07-07 01:31:40 +00:00
bevy_asset fix panic looking for extension in multibyte unicode paths (#19933) 2025-07-03 22:27:07 +00:00
bevy_audio SpatialListener now requires a Transform (#19357) 2025-07-07 19:48:57 +00:00
bevy_camera consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_color Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bevy_core_pipeline consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_core_widgets Newtyped ScrollPosition (#19881) 2025-07-01 17:41:48 +00:00
bevy_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_dev_tools Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_diagnostic updating: very very minorly (#19827) 2025-06-26 21:48:20 +00:00
bevy_dylib Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ecs Unify filtering by id in EntityClonerBuilder (#19977) 2025-07-07 20:00:37 +00:00
bevy_encase_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_feathers Feathers toggle switches. (#19928) 2025-07-03 01:09:31 +00:00
bevy_gilrs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_gizmos Use RenderStartup in bevy_gizmos. (#19898) 2025-07-02 20:38:37 +00:00
bevy_gltf consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_image optimize ktx2 level data concatenation (#19845) 2025-06-29 21:59:56 +00:00
bevy_input bevy_input: build warnings without bevy_reflect (#19862) 2025-06-29 17:13:43 +00:00
bevy_input_focus Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_internal make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_light bevy_light (#19991) 2025-07-07 00:07:38 +00:00
bevy_log Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_macro_utils Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_math Implement display for direction (#19942) 2025-07-07 20:00:37 +00:00
bevy_mesh refactor(mesh): move Mesh3d and Mesh2d into bevy_mesh (#19943) 2025-07-04 16:24:21 +00:00
bevy_mikktspace Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_pbr make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_picking Extract members of PickingPlugin and PointerInputPlugin into new types (#19078) 2025-07-07 19:40:25 +00:00
bevy_platform bevy_platform: clippy without default features (#19860) 2025-06-29 17:12:57 +00:00
bevy_ptr Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_reflect bevy_reflect: Introduce reflect_clone_and_take. (#19944) 2025-07-07 19:57:29 +00:00
bevy_remote Add support for returning all Component and values to query method in the Bevy Remote Protocol (#19857) 2025-07-03 18:51:32 +00:00
bevy_render make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_scene Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_solari Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
bevy_sprite Split bevy_camera out of bevy_render (#19949) 2025-07-04 23:31:16 +00:00
bevy_state doc improvement for StateTransition (#19597) 2025-07-07 19:51:46 +00:00
bevy_tasks Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_text consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_time Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_transform Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_ui consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_ui_render consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_utils Have System::run_unsafe return Result. (#19145) 2025-07-03 21:48:09 +00:00
bevy_window bevy_window: fix compilation without default features (#19870) 2025-06-30 20:51:52 +00:00
bevy_winit bevy_winit: fix compile and clippy on wasm (#19869) 2025-06-29 21:30:28 +00:00