bevy/crates/bevy_math/src
Aztro eef7dbefe8
Add single-f32 constructors for a few (very few) primitives (#11934)
# Objective

- I hated having to do `Cuboid::new(1.0, 1.0, 1.0)` or
`Cuboid::from_size(Vec3::splat(1.0))` when there should be a much easier
way to do this.

## Solution

- Implemented a `from_length()` method that only takes in a single
float, and constructs a primitive of equal size in all directions.
- Ex:
  ```rs
  // These:
  Cuboid::new(1.0, 1.0, 1.0);
  Cuboid::from_size(Vec3::splat(1.0));
  // Are equivalent to this:
  Cuboid::from_length(1.0);
  ```
 - For the rest of the changed primitives:
    ```rs
    Rectangle::from_length(1.0);
    Plane3d::default().mesh().from_length(1.0);
    ```
2024-02-18 07:43:45 +00:00
..
bounding Rename RayTest to RayCast (#11635) 2024-02-02 15:01:04 +00:00
primitives Add single-f32 constructors for a few (very few) primitives (#11934) 2024-02-18 07:43:45 +00:00
rects Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
affine3.rs Automatic batching/instancing of draw commands (#9685) 2023-09-21 22:12:34 +00:00
aspect_ratio.rs Introduce AspectRatio struct (#10368) 2023-12-17 02:01:26 +00:00
cubic_splines.rs Remove Default impl for CubicCurve (#11335) 2024-01-14 04:40:37 +00:00
lib.rs Inverse missing_docs logic (#11676) 2024-02-03 21:40:55 +00:00
ray.rs Split Ray into Ray2d and Ray3d and simplify plane construction (#10856) 2023-12-06 14:09:04 +00:00