Module tmx_utils::math_utils

source ·
Expand description

Math Utilities

Functions

  • Clamps val between min_val and max_val.
  • Clamps val between 0 and 1. Had intended to use clamp(val, 0, 1), but float doesn’t implement the Ord trait.
  • Linearly interpolates between a and b by t. Does NOT clamp ‘t’ between 0 and 1, allowing for extrapolation.
  • Linearly interpolates between a and b by t. Clamps ‘t’ between 0 and 1.