wrap

open fun wrap(value: Double, min: Double, max: Double): Double

Constrains value to the given range (including min, excluding max) via modular arithmetic.

Same formula as used in Core GL (wrap.hpp) std::fmod((std::fmod((value - min), d) + d), d) + min;

Return

Wrapped value

Parameters

value

Value to wrap

min

Minimum value

max

Maximum value