You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everytime I use math.map I forget that I need to clamp the input val and get a RangeError. So I need to write this currently:
var currentFrame = 0;
var startFrame = 10;
var endFrame = 20;
var clampedFrame = mout.math.clamp(currentFrame, startFrame, endFrame);
var result = mout.math.map(clampedFrame, startFrame, endFrame, 0, 100); // result == 0
instead of simply:
var currentFrame = 0;
var startFrame = 10;
var endFrame = 20;
var result = mout.math.map(currentFrame, startFrame, endFrame, 0, 100); // result == 0
I know its not technically correct, but can we remove the RangeError that is causing this in math.norm? Or, if that is too much of a philosophical problem, can we just inline the norm function without the RangeError inside of map so that norm retains its current behavior and map gets a little more robust?
The text was updated successfully, but these errors were encountered:
Everytime I use math.map I forget that I need to clamp the input val and get a RangeError. So I need to write this currently:
instead of simply:
There was a little discussion on this in #199.
I know its not technically correct, but can we remove the RangeError that is causing this in math.norm? Or, if that is too much of a philosophical problem, can we just inline the norm function without the RangeError inside of map so that norm retains its current behavior and map gets a little more robust?
The text was updated successfully, but these errors were encountered: