bevy/crates/bevy_math/src
Matty 528ca4f95e
Eliminate redundant clamping from sample-interpolated curves (#15620)
# Objective

Currently, sample-interpolated curves (such as those used by the glTF
loader for animations) do unnecessary extra work when `sample_clamped`
is called, since their implementations of `sample_unchecked` are already
clamped. Eliminating this redundant sampling is a small, easy
performance win which doesn't compromise on the animation system's
internal usage of `sample_clamped`, which guarantees that it never
samples curves out-of-bounds.

## Solution

For sample-interpolated curves, define `sample_clamped` in the way
`sample_unchecked` is currently defined, and then redirect
`sample_unchecked` to `sample_clamped`. This is arguably a more
idiomatic way of using the `cores` as well, which is nice.

## Testing

Ran `many_foxes` to make sure I didn't break anything.
2024-10-03 18:26:41 +00:00
..
bounding Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
curve Eliminate redundant clamping from sample-interpolated curves (#15620) 2024-10-03 18:26:41 +00:00
primitives Add to_inner_rectangle, area and perimeter methods to Capsule2d (#15388) 2024-09-30 18:44:49 +00:00
rects
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