RoundingMode
Select the rounding direction for integer tweens. The default ToEven rounds midpoint ties to an even integer.
public enum RoundingMode : byteIntegerOptions.cs · L5Truncate an integer counter
Add using MeatMotion;. Halfway from 0 to 5 the interpolated value is 2.5. ToZero writes 2 to the counter.
int counter = 0;
using var world = new MotionWorld();
MMotion.Create(0, 5, 1f).WithRoundingMode(RoundingMode.ToZero)
.WithScheduler(world).Bind(v => counter = v);
world.Tick(0.5);
Members
ToEven
Round to the nearest integer and choose even at a midpoint.
ToEvenAwayFromZero
Round fractional values away from zero, upward for positive values and downward for negative ones.
AwayFromZeroToZero
Discard the fractional part toward zero.
ToZeroToPositiveInfinity
Round upward toward positive infinity.
ToPositiveInfinityToNegativeInfinity
Round downward toward negative infinity.
ToNegativeInfinity
MeatMotion