1570 {
1572 distance =
Math.
Max(distance, 0.1);
1573 float temperature = 0;
1574
1576 if (distance > uts.GetFullRange())
1577 {
1578 float distFactor =
Math.
InverseLerp(uts.GetMaxRange(), uts.GetFullRange(), distance);
1579 temperature = uts.GetTemperatureCap() * distFactor;
1580 }
1581 else
1582 {
1583 temperature = uts.GetTemperatureCap();
1584 }
1585
1586 return temperature;
1587 }
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...