bevy/crates/bevy_math
Joona Aalto c31f3aa128
Add Aabb2d::new and Aabb3d::new constructors (#11433)
# Objective

Currently, the only way to create an AABB is to specify its `min` and
`max` coordinates. However, it's often more useful to use the center and
half-size instead.

## Solution

Add `new` constructors for `Aabb2d` and `Aabb3d`.

This:

```rust
let aabb = Aabb3d {
    min: center - half_size,
    max: center + half_size,
}
```

becomes this:

```rust
let aabb = Aabb3d::new(center, half_size);
```

I also made the usage of "half-extents" vs. "half-size" a bit more
consistent.
2024-01-20 20:12:20 +00:00
..
src Add Aabb2d::new and Aabb3d::new constructors (#11433) 2024-01-20 20:12:20 +00:00
Cargo.toml Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00