DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CalcTemperatureFromTemperatureSource()

float CalcTemperatureFromTemperatureSource ( notnull UTemperatureSource uts)
protected

heat transfer through air to player (env temperature)

См. определение в файле Environment.c строка 1576

1577 {
1578 float distance = vector.Distance(m_Player.GetPosition(), uts.GetPosition());
1579 distance = Math.Max(distance, 0.1); //min distance cannot be 0 (division by zero)
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 }
map m_Player
Определения EnMath.c:7
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:119
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,...

Перекрестные ссылки vector::Distance(), Math::InverseLerp() и Math::Max().

Используется в ProcessTemperatureSources().