#interpolation #bevy #math #utility #gamedev

bevy_utilitarian

A collection of mostly maths, interpolation and geometric utilities that aim to make Bevy programmers happier

4 releases (breaking)

0.4.0 Mar 5, 2024
0.3.0 Feb 20, 2024
0.2.0 Feb 19, 2024
0.1.0 Feb 19, 2024

#808 in Game dev

Download history 455/week @ 2024-02-19 48/week @ 2024-02-26 152/week @ 2024-03-04 20/week @ 2024-03-11 1/week @ 2024-03-18 39/week @ 2024-04-01

67 downloads per month
Used in bevy_firework

MIT/Apache

37KB
1K SLoC

Crates.io Crates.io CI

Bevy Utilitarian

Contains a varied set of utilities to make bevy programming easier. Currently, mostly geometric, maths and interpolation utilities.

What?

Currently, this library offers:

  • curves module: Parametric curves.

  • steppers module: Dynamic interpolation helpers: used for when you cannot express the change of the value you want to interpolate easily as a parametric curve, such as when using a spring-damper system as an interpolator or when you want to update the interpolation target before it has been reached.

    You simply set the current value, target value and some interpolator-specific parameters (e.g. spring and damping coefficient for spring interpolator, speed for linear interpolator) and call .tick() every frame to update the current value. Using .get() you access the current value.

  • geometric module: Offers PitchYaw and PitchYawClamped types, representing spherical positions (i.e. Euler rotations without the roll field). PitchYaw wraps around the boundary, whereas PitchYawClamped is clamped to the allowable angle ranges. The latter is useful for use in interpolation helpers where you don't want the interpolator to move the current value across the -PI->PI boundary. Specific use case examples of either of these types are: aiming/look direction in first/third person character controllers, look direction parameter for animation (where you don't want the character's head to turn 360 degrees).

  • randomized_values module: Offers RandValue trait and implementations for RandVec3 and RandF32. They are self-contained data types with an ergonomic API for generating random values based on some parameters.

Version table

bevy_utilitarian bevy
0.1 0.12
0.2 0.12
0.3 0.12
0.4 0.13

Dependencies

~39–81MB
~1M SLoC