mirror of
https://github.com/bevyengine/bevy
synced 2025-01-11 04:38:57 +00:00
029dd06f7d
# Objective Make direction construction a bit more ergonomic. ## Solution Add `Direction2d::from_xy` and `Direction3d::from_xyz`, similar to `Transform::from_xyz`: ```rust let dir2 = Direction2d::from_xy(0.5, 0.5).unwrap(); let dir3 = Direction3d::from_xyz(0.5, 0.5, 0.5).unwrap(); ``` This can be a bit cleaner than using `new`: ```rust let dir2 = Direction2d::new(Vec2::new(0.5, 0.5)).unwrap(); let dir3 = Direction3d::new(Vec3::new(0.5, 0.5, 0.5)).unwrap(); ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |