bevy/crates/bevy_math/src
Lynn 5e1c841f4e
Extrusion bounded (#13346)
# Objective

- Implement `Bounded3d` for some `Extrusion<T>`
- Provide methods to calculate `Aabb3d`s and `BoundingSphere`s for any
extrusion with a `Bounded2d` base shape

## Solution

- Implemented `Bounded3d` for all 2D `bevy_math` primitives with the
exception of `Plane2d`. As far as I can see, `Plane2d` is pretty much a
line? and I think it is very unintuitive to extrude a plane and get a
plane as a result.
- Add `extrusion_bounding_box` and `extrusion_bounding_sphere`. These
are not always used internally since there are faster methods for
specific extrusions. Both of them produce the optimal result within
precision limits though.

## Testing

- Bounds for extrusions are tested within the same module. All unique
implementations are tested.
- The correctness was validated visually aswell.

---------

Co-authored-by: Raphael Büttgenbach <62256001+solis-lumine-vorago@users.noreply.github.com>
Co-authored-by: IQuick 143 <IQuick143cz@gmail.com>
2024-06-04 17:25:12 +00:00
..
bounding Extrusion bounded (#13346) 2024-06-04 17:25:12 +00:00
primitives Clarify cone position (#13568) 2024-05-29 20:19:58 +00:00
rects Move bevy_math Reflect impls (#13520) 2024-05-27 14:15:22 +00:00
sampling Implement ShapeSample for Extrusion<T> (#13567) 2024-05-30 12:08:28 +00:00
affine3.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
aspect_ratio.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
common_traits.rs Remove VectorSpace impl on Quat (#12796) 2024-03-30 17:18:52 +00:00
compass.rs Added CompassQuadrant and CompassOctant as per #13647 (#13653) 2024-06-03 19:46:50 +00:00
cubic_splines.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
direction.rs Dir2 -> Rotation2d conversions (#13670) 2024-06-04 14:44:29 +00:00
float_ord.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
lib.rs Added CompassQuadrant and CompassOctant as per #13647 (#13653) 2024-06-03 19:46:50 +00:00
ray.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
rotation2d.rs Dir2 -> Rotation2d conversions (#13670) 2024-06-04 14:44:29 +00:00