1
2
3
4
5
6
7
8
9
10
11
|
// Normalize an input value to 0,1 range.
f32 Normalize(f32 Input, f32 Minimum, f32 Maximum)
{
return (Input - Minimum) / (Maximum - Minimum);
}
// Map one range onto another. Ex: Map Value Between 0-1800 to -20, 20.
f32 Remap(f32 Input, f32 InputStart, f32 InputEnd, f32 OutputStart, f32 OutputEnd)
{
return (Input - InputStart) / (InputEnd - InputStart) * (OutputEnd - OutputStart) + OutputStart;
}
|