bevy/crates/bevy_render/src/mesh/primitives/dim3
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
..
capsule.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00
cuboid.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00
cylinder.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00
mod.rs Implement Meshable for some 3D primitives (#11688) 2024-02-06 21:44:13 +00:00
plane.rs Add single-f32 constructors for a few (very few) primitives (#11934) 2024-02-18 07:43:45 +00:00
sphere.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00
torus.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00