bevy/crates/bevy_math/src
Joona Aalto b36443b6ed
Fix Capsule2d::sample_interior (#15191)
# Objective

`Capsule2d::sample_interior` uses the radius of the capsule for the
width of its rectangular section. It should be using two times the
radius for the full width!

I noticed this as I was getting incorrect results for angular inertia
approximated from a point cloud of points sampled on the capsule. This
hinted that something was wrong with the sampling.

## Solution

Multiply the radius by two to get the full width of the rectangular
section. With this, the sampling produces the correct result in my
tests.
2024-09-14 02:24:08 +00:00
..
bounding Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00
curve Fixing Curve trait not being object safe. (#14939) 2024-08-27 13:29:02 +00:00
primitives Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00
rects Move bevy_math Reflect impls (#13520) 2024-05-27 14:15:22 +00:00
sampling Fix Capsule2d::sample_interior (#15191) 2024-09-14 02:24:08 +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 Make bevy_math's libm feature use libm for all f32methods with unspecified precision (#14693) 2024-08-12 16:13:36 +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 Make bevy_math's libm feature use libm for all f32methods with unspecified precision (#14693) 2024-08-12 16:13:36 +00:00
direction.rs Make bevy_math's libm feature use libm for all f32methods with unspecified precision (#14693) 2024-08-12 16:13:36 +00:00
float_ord.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
isometry.rs Improve isometry docs (#14318) 2024-07-15 16:05:33 +00:00
lib.rs Unify crate-level preludes (#15080) 2024-09-08 17:10:57 +00:00
ops.rs Expose bevy math ops (#14863) 2024-08-22 17:07:00 +00:00
ray.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
rotation2d.rs Make bevy_math's libm feature use libm for all f32methods with unspecified precision (#14693) 2024-08-12 16:13:36 +00:00