Processors.Wrap

Extension Method in Processors

Declaration

public static float Wrap(this float input, float min, float max)

Description

Wraps the input to the range [min..max]. If the value exceeds the max it wraps around to the min, and if the value is less than the min it wraps back to max.

Parameters

inputThe input value to wrap.
minThe minimum value of the range.
maxThe maximum value of the range.

Returns

floatThe wrapped value.

Overload

Declaration

public static int Wrap(this int input, int min, int max)

Description

Wraps the input to the range [min..max]. If the value exceeds the max it wraps around to the min, and if the value is less than the min it wraps back to max.

Parameters

inputThe input value to wrap.
minThe minimum value of the range.
maxThe maximum value of the range.

Returns

intThe wrapped value.