bevy/crates/bevy_math/src
TheBigCheese 01dce4742f
Add to_inner_rectangle, area and perimeter methods to Capsule2d (#15388)
# Objective

Unlike `Capsule3d` which has the `.to_cylinder` method, `Capsule2d`
doesn't have an equivalent `.to_inner_rectangle` method and as shown by
#15191 this is surprisingly easy to get wrong

## Solution

Implemented a `Capsule2d::to_inner_rectangle` method as it is
implemented in the fixed `Capsule2d` shape sampling, and as I was adding
tests I noticed `Capsule2d` didn't implement `Measure2d` so I did this
as well.

## Changelog
### Added
- `Capsule2d::to_inner_rectangle`, `Capsule2d::area` and
`Capsule2d::perimeter`

---------

Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
Co-authored-by: James Liu <contact@jamessliu.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-09-30 18:44:49 +00:00
..
bounding Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
curve Make SampleCurve/UnevenSampleCurve succeed at reflection (#15493) 2024-09-30 18:43:19 +00:00
primitives Add to_inner_rectangle, area and perimeter methods to Capsule2d (#15388) 2024-09-30 18:44:49 +00:00
rects Move bevy_math Reflect impls (#13520) 2024-05-27 14:15:22 +00:00
sampling Add to_inner_rectangle, area and perimeter methods to Capsule2d (#15388) 2024-09-30 18:44:49 +00:00
affine3.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
aspect_ratio.rs Add common aspect ratio constants and improve documentation (#15091) 2024-09-09 16:04:41 +00:00
common_traits.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
compass.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
cubic_splines.rs Basic integration of cubic spline curves with the Curve API (#15469) 2024-09-30 17:52:07 +00:00
direction.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
float_ord.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
isometry.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
lib.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
ops.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
ray.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
rotation2d.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00