1577 {
1579 distance =
Math.
Max(distance, 0.1);
1580 float temperature = 0;
1581
1583 if (distance > uts.GetFullRange())
1584 {
1585 float distFactor =
Math.
InverseLerp(uts.GetMaxRange(), uts.GetFullRange(), distance);
1586 temperature = uts.GetTemperatureCap() * distFactor;
1587 }
1588 else
1589 {
1590 temperature = uts.GetTemperatureCap();
1591 }
1592
1593 return temperature;
1594 }
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,...