Add MapRange utility function (currently unused).

This commit is contained in:
Mari the Deer 2022-12-30 23:16:36 +01:00
commit eff2a9a69b
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r720 \cu(Fri 30 Dec 23:16:16 CET 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r720 \cu(2022-12-30 23:16:16)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r721 \cu(Fri 30 Dec 23:16:36 CET 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r721 \cu(2022-12-30 23:16:36)\c-";

View file

@ -201,6 +201,11 @@ extend Class SWWMUtility
return c;
}
static double MapRange( double amin, double amax, double bmin, double bmax, double theta )
{
return bmin+(theta-amin)*(bmax-bmin)/(amax-amin);
}
// this can probably be simplified, but I'm lazy
static Vector3 HSVtoRGB( Vector3 hsv )
{