DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
TemperatureData.c
См. документацию.
2{
5 float m_Value; //target or increment, depends on context!
6 float m_AdjustedTarget; //actual target of the operation (can be adjusted via over-time interpolation, not necessarily the original target value!)
7 float m_UpdateTimeInfo; //if the temperature change was accumulated over some time, pass this info to temperature subsystems
8 float m_UpdateTimeCoef; //multiplies the time
9 float m_HeatPermeabilityCoef; //permeability multiplier (modifies change speed).
10
11 float m_InterpolatedStepSize; //only useful for interpolated temperature values
12 float m_InterpolatedFraction; //only useful for interpolated temperature values
13
14 void TemperatureData(float val, ETemperatureAccessTypes accessType = ETemperatureAccessTypes.ACCESS_UNKNOWN, float time = -1, float timeCoef = 1, float heatPermCoef = 1)
15 {
16 m_Value = val;
17 m_AdjustedTarget = val;
18 m_AccessType = accessType;
19 m_UpdateTimeInfo = time;
20 m_UpdateTimeCoef = timeCoef;
21 m_HeatPermeabilityCoef = heatPermCoef;
22
23 Init();
24 }
25
26 protected void Init()
27 {
28 m_UseGlobalCooling = true;
30 }
31}
32
33class TemperatureDataInterpolated : TemperatureData
34{
35 void InterpolateTemperatureDelta(float start)
36 {
39 float target = m_Value;
42 if (start != target)
43 {
44 float diffAbs = Math.Max(start,target) - Math.Min(start,target);
48 float coef = m_UpdateTimeCoef;
49 float absBaseTempChange = m_UpdateTimeInfo * m_InterpolatedStepSize;
50
51 if (start > target)
52 {
53 absBaseTempChange *= -1;
56 }
57
59 absBaseTempChange *= coef;
60
61 m_AdjustedTarget = start + Math.Clamp(absBaseTempChange,-diffAbs,diffAbs);
62 }
63 }
64}
ETemperatureAccessTypes
Определения TemperatureAccessConstants.c:2
float m_InterpolatedStepSize
Определения TemperatureData.c:44
float m_InterpolatedFraction
Определения TemperatureData.c:45
float m_AdjustedTarget
Определения TemperatureData.c:39
float m_HeatPermeabilityCoef
Определения TemperatureData.c:42
float m_UpdateTimeInfo
Определения TemperatureData.c:40
float m_UpdateTimeCoef
Определения TemperatureData.c:41
bool m_UseGlobalCooling
Определения TemperatureData.c:37
class TemperatureData InterpolateTemperatureDelta(float start)
Определения TemperatureData.c:35
Определения constants.c:659
Определения EnMath.c:7
float m_AdjustedTarget
Определения TemperatureData.c:6
void TemperatureData(float val, ETemperatureAccessTypes accessType=ETemperatureAccessTypes.ACCESS_UNKNOWN, float time=-1, float timeCoef=1, float heatPermCoef=1)
Определения TemperatureData.c:14
ETemperatureAccessTypes m_AccessType
Определения TemperatureData.c:3
bool m_UseGlobalCooling
Определения TemperatureData.c:4
float m_InterpolatedStepSize
Определения TemperatureData.c:11
float m_InterpolatedFraction
Определения TemperatureData.c:12
float m_UpdateTimeInfo
Определения TemperatureData.c:7
float m_UpdateTimeCoef
Определения TemperatureData.c:8
float m_HeatPermeabilityCoef
Определения TemperatureData.c:9
void Init()
Определения TemperatureData.c:26
float m_Value
Определения TemperatureData.c:5
Определения TemperatureData.c:2
string m_Value
Определения EnEntity.c:806
const float TEMP_COEF_COOLING_GLOBAL
Определения constants.c:947
static const float TEMPERATURE_RATE_MAX_ABS
Определения constants.c:921
static const float TEMPERATURE_INTERPOLATION_THRESHOLD_MIN_ABS
Определения constants.c:923
static const float TEMPERATURE_RATE_AVERAGE_ABS
Определения constants.c:920
static const float TEMPERATURE_INTERPOLATION_THRESHOLD_MAX_ABS
Определения constants.c:924
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...