Just wanted to share some nice functions I came across that can be used with the ModifiersPlugin.
Doing a normal modulus calculation restarts the value at 0, which may not be what you want.
500 % 500 // => 0
This function will allow you to do a modulus operation for a min/max range.
wrap(500, -100, 500); // => -100
function wrap(value, min, max) {
var v = value - min;
var r = max - min;
return ((r + v % r) % r) + min;
}
And this is a modified version of that function that