bevy/crates/bevy_math/src/bounding/bounded3d
Lynn fb3a560a1c
Allow Bounded3d implementations for custom primitives (#13688)
# Objective

- Due to coherency, it was previously not possible to implement
`Bounded3d` for `Extrusion<MyCustomPrimitive>`. This PR fixes that.

## Solution

- Added a new trait `BoundedExtrusion: Primitive2d + Bounded2d` which
provides functions for bounding boxes and spheres of extrusions of 2D
primitives.
- Changed all implementations of `Bounded3d for Extrusion<T>` to
`BoundedExtrusion for T`
- Implemented `Bounded3d for Extrusion<T: BoundedExtrusion>`
- Removed the `extrusion_bounding_box` and `extrusion_bounding_sphere`
functions and used them as default implementations in `BoundedExtrusion`

## Testing

- This PR does not change any implementations

---------

Co-authored-by: Lynn Büttgenbach <62256001+solis-lumine-vorago@users.noreply.github.com>
Co-authored-by: Matty <weatherleymatthew@gmail.com>
2024-06-05 19:40:02 +00:00
..
extrusion.rs Allow Bounded3d implementations for custom primitives (#13688) 2024-06-05 19:40:02 +00:00
mod.rs Allow Bounded3d implementations for custom primitives (#13688) 2024-06-05 19:40:02 +00:00
primitive_impls.rs Add triangle_math tests and fix Triangle3d::bounding_sphere bug (#13467) 2024-05-23 15:03:00 +00:00