Data Structures | |
class | EnvironmentDrynessData |
Enumerations | |
enum | EEnvironmentHeatcomfortBehaviorCategory { DEFAULT , CAR_ENGINE_ON } |
Categories that are changing behavior of Heat comfort processing. More... | |
Functions | |
void | Environment (PlayerBase pPlayer) |
void | Init () |
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system) | |
void | Update (float pDelta) |
Main loop that runs calculations for various Environment parts (wetness, heatcomfort, watercontact, etc.) | |
bool | IsTemperatureSet () |
For safe-guards, waiting for the proper temperature to be set. | |
protected float | GetPlayerHeat () |
Character's heat (calculated from movement speed multiplied by constant) | |
bool | IsUnderRoof () |
Is character under roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). Runs when player is not inside of building. | |
bool | IsInsideBuilding () |
Is character inside building? (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). | |
protected bool | IsWaterContact () |
Is character in contact with water body? (periodically checked - GameConstants.ENVIRO_TICK_RATE). | |
private bool | IsChildOfType (array< typename > typenames) |
Returns true if character is child of given parent type(s) | |
private bool | IsUnderRoofBuilding () |
Is character under building's roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). There might be situations where the surface under is external, but character is inside building. | |
protected bool | IsRaining () |
Rain phenomenon actual value > RAIN_LIMIT_LOW. | |
protected bool | IsSnowing () |
Snowfall phenomenon actual value > SNOWFALL_LIMIT_LOW. | |
protected bool | DetermineHeatcomfortBehavior () |
Changes Heat Comfort curve behavior based on where the character is. | |
protected void | CheckUnderRoof () |
Checks whether character is sheltered and sets the information. | |
protected void | CheckWaterContact (out float pWaterLevel) |
Checks player's contanct with water. | |
float | GetWindModifierPerSurface () |
Wind intensity (influence) modifier of temperature value. | |
float | GetTemperature () |
float | GetTargetHeatComfort () |
protected float | GetEnvironmentTemperature () |
Calculations of temperarute for different situations. | |
float | GetWetDelta () |
Calculates soaking/drying delta based on character's location and weather. | |
protected void | CollectAndSetPlayerData () |
Sets character related value for furher use. | |
protected void | CollectAndSetEnvironmentData () |
Sets actual weather related values for further use (rain, snow, wind, etc.) | |
void | SetEnvironmentTemperature () |
void | SetAreaGenericColdness () |
Determines whether player is in cold area which restricts use of some actions (digging) | |
protected void | ProcessWetnessByWaterLevel (float pWaterLevel) |
Processes items wetness in player possession based on the current water level (the character is in) | |
protected void | ProcessItemsWetness (array< int > pSlotIds) |
Soak items at specific Slot ID(s) | |
protected void | ApplyWetnessToItem (ItemBase pItem) |
protected void | ProcessItemsDryness () |
Dry items in player possession. | |
protected void | ApplyDrynessToItem (ItemBase pItem) |
protected void | ApplyDrynessToItemEx (ItemBase pItem, EnvironmentDrynessData pDrynessData) |
protected void | ProcessHeatComfort () |
Calculates and process player's heatcomfort related to defined body parts. | |
protected void | SetTargetHeatComfort (float value) |
protected void | SetHeatcomfortDirectly () |
protected void | ProcessHeatBuffer (EnvironmentSnapshotData data) |
protected float | GetApplicableHeatbuffer () |
protected void | ProcessItemsTemperature (array< int > pBodyPartIds) |
Iterate through items in player posession (by given body parts) and cool/warm them to neutral temparature. | |
protected void | ProcessItemsInHandsTemperature () |
Process temperature of item in character hands and cool/warm it to neutral temparature. | |
protected void | ProcessItemHierarchyRecursive (ItemBase item, float heatPermeabilityCoef=1.0) |
protected void | SetProcessedItemTemperature (ItemBase item, float heatPermeabilityCoef=1.0) |
protected float | EnvTempToCoef (float pTemp) |
protected void | BodyPartHeatProperties (int pBodyPartId, float pCoef, out float pHeatComfort, out float pHeat) |
Iterate through given body part and calculates heatcofort and item heat value. | |
protected float | NakedBodyPartHeatComfortPenalty (int pBodyPartSlotId, float pCoef) |
Calculates penalty value for heatcomfort - this simulates uncovered body part reaction. | |
protected void | GatherTemperatureSources () |
Checks characters proximity for usable Universal Temperature Sources and register them. | |
protected void | ProcessTemperatureSources () |
Processes registered UTSources and calculates resulting m_UTSAverageTemperature. | |
protected void | SetItemHeatingCoef (float val) |
protected void | OnTemperatureSourcesEnter () |
Event fired when characters enters into UTSource proximity. | |
protected void | OnTemperatureSourcesLeft () |
Event fired when characters leave the UTSource proximity. | |
float | GetUniversalSourcesTemperageAverage () |
float | CalcTemperatureFromTemperatureSource (notnull UTemperatureSource uts) |
string | GetDebugMessage () |
debug | |
int | GetNextRoofCheck () |
float | GetWaterLevel () |
private bool | IsNeutralTemperature (float temperature, float lowerLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, float upperLimit=GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT) |
private float | NormalizedTemperature (float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT) |
void | Init (PlayerBase pPlayer) |
used for calculations before the data modification | |
protected bool | OverridenHeatComfort (out float value) |
void | AddToEnvironmentTemperature (float pTemperature) |
protected void | ProcessItemsHeat () |
protected void | ProcessWetnessByRain () |
float | GetTemperatureHeightCorrection () |
protected void | BodyPartHeatProperties (array< int > pBodyPartIds, float pCoef, out float pHeatComfort, out float pHeat) |
returns weighted avg heat comfort for bodypart | |
protected void | SetEnvironmentSnapshotData () |
protected void | ProcessHeatBuffer (float heatComfortCloths) |
backward compatibility [<1.27] | |
protected float | WindEffectTemperatureValue (float temperatureInput) |
backward compatibility [<1.28] | |
float | GetDayOrNight () |
protected bool | IsInsideVehicle () |
Variables | |
enum EEnvironmentHeatcomfortBehaviorCategory | m_ClothingHeatComfort |
float | m_TargetHeatComfort |
player's heatcomfort (buffered, stored in player stats) | |
class EnvironmentDrynessData | RAIN_LIMIT_LOW = 0.05 |
Simulates influence of environment to character Takes input data from WorldData, Weather system and entities simulating temperature and wetness. | |
protected const float | SNOWFALL_LIMIT_LOW = 0.5 |
protected const float | SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3 |
const float | WATER_LEVEL_HIGH = 1.5 |
const float | WATER_LEVEL_MID = 1.2 |
const float | WATER_LEVEL_LOW = 0.5 |
const float | WATER_LEVEL_NONE = 0.15 |
protected float | m_WetDryTick |
protected float | m_ItemsWetnessMax |
protected float | m_RoofCheckTimer |
keeps wetness of most wet item in player's possesion | |
protected PlayerBase | m_Player |
protected float | m_PlayerHeightPos |
protected float | m_PlayerSpeed |
protected float | m_PlayerTemperature |
protected float | m_PlayerHeat |
protected float | m_HeatComfort |
protected float | m_Rain = 0 |
target value of heatcomfort (non-buffered) | |
protected float | m_Snowfall = 0 |
protected float | m_Wind = 0 |
protected float | m_Fog = 0 |
protected float | m_DayOrNight = 0 |
protected float | m_Clouds = 0 |
protected float | m_EnvironmentTemperature |
protected float | m_Time = 0 |
protected string | m_SurfaceType |
protected int | m_LiquidType |
protected float | m_ItemTemperatureCoef |
protected float | m_WaterLevel |
protected bool | m_IsUnderRoof |
private bool | m_IsUnderRoofBuilding |
protected bool | m_IsInWater |
protected bool | m_IsTempSet |
protected float | m_HeatBufferTimer |
protected float | m_HeatBufferCapPrevious |
reused as state toggle | |
protected ref array< int > | m_SlotIdsComplete |
protected ref array< int > | m_SlotIdsUpper |
protected ref array< int > | m_SlotIdsBottom |
protected ref array< int > | m_SlotIdsLower |
protected ref array< int > | m_HeadParts |
protected ref array< int > | m_BodyParts |
protected ref array< int > | m_FeetParts |
protected WorldData | m_WorldData |
protected bool | m_HasTemperatureSources |
protected float | m_UTSAverageTemperature |
protected ref array< UTemperatureSource > | m_UTemperatureSources |
protected ref SimpleMovingAverage< float > | m_UTSAverageTemperatureBuffer |
protected ref SimpleMovingAverage< float > | m_AverageHeatComfortBuffer |
protected int | m_HeatComfortBehaviorCategory |
private bool | m_Initialized |
protected float | m_HeatSourceTemp |
DEPRECATED. | |
protected ref SimpleMovingAverage< float > | m_WindAverageBuffer |
protected ref EnvironmentSnapshotData | m_EnvironmentSnapshot |
void AddToEnvironmentTemperature | ( | float | pTemperature | ) |
protected void ApplyDrynessToItem | ( | ItemBase | pItem | ) |
References ApplyDrynessToItemEx().
protected void ApplyDrynessToItemEx | ( | ItemBase | pItem, |
EnvironmentDrynessData | pDrynessData | ||
) |
adds wetness to item inside parent item containing liquid
adds wetness to item inside wet parent item
References ApplyDrynessToItemEx(), Class::CastTo(), GameConstants::ENVIRO_TICK_RATE, InventoryLocation::GetParent(), m_ItemsWetnessMax, m_Player, EnvironmentDrynessData::m_TemperatureSourceDistance, EnvironmentDrynessData::m_UseTemperatureSources, GameConstants::STATE_DAMP, and GameConstants::STATE_SOAKING_WET.
Referenced by ApplyDrynessToItem(), ApplyDrynessToItemEx(), and ProcessItemsDryness().
protected void ApplyWetnessToItem | ( | ItemBase | pItem | ) |
References ApplyWetnessToItem(), Class::CastTo(), GameConstants::ENVIRO_TICK_RATE, InventoryLocation::GetParent(), GetWetDelta(), m_ItemsWetnessMax, m_Player, and GameConstants::STATE_SOAKING_WET.
Referenced by ApplyWetnessToItem(), and ProcessItemsWetness().
protected void BodyPartHeatProperties | ( | array< int > | pBodyPartIds, |
float | pCoef, | ||
out float | pHeatComfort, | ||
out float | pHeat | ||
) |
returns weighted avg heat comfort for bodypart
go through all body parts we've defined for that zone (ex.: head, body, feet)
References EnumTools::EnumToString(), GameConstants::ENVIRO_HEATISOLATION_BACK_WEIGHT, GameConstants::ENVIRO_HEATISOLATION_VEST_WEIGHT, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, m_Player, and NormalizedTemperature().
protected void BodyPartHeatProperties | ( | int | pBodyPartId, |
float | pCoef, | ||
out float | pHeatComfort, | ||
out float | pHeat | ||
) |
Iterate through given body part and calculates heatcofort and item heat value.
pBodyPartIds | List of body parts to iterate through (see InventorySlots) | |
pCoef | Multiplier used for heatcomfort enhancing | |
[out] | pHeatComfort | overall heatcomfort from items of given body part |
[out] | pHeat | overall heat from items for given body part |
References EnumTools::EnumToString(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, m_Player, and NormalizedTemperature().
Referenced by ProcessHeatComfort().
float CalcTemperatureFromTemperatureSource | ( | notnull UTemperatureSource | uts | ) |
heat transfer through air to player (env temperature)
References vector::Distance(), Math::InverseLerp(), m_Player, and Math::Max().
Referenced by ProcessTemperatureSources().
protected void CheckUnderRoof | ( | ) |
Checks whether character is sheltered and sets the information.
if inside vehicle return immediatelly
References IsChildOfType(), m_IsUnderRoof, m_IsUnderRoofBuilding, m_Player, and DayZPhysics::RayCastBullet().
Referenced by Update().
protected void CheckWaterContact | ( | out float | pWaterLevel | ) |
Checks player's contanct with water.
[out] | pWaterLevel | water level height |
no valid surface under character
sync info about water contact to player
update active surface
References g_Game, DayZPlayer::GetCurrentWaterLevel(), IsChildOfType(), DayZPlayer::IsSwimming(), IsUnderRoofBuilding(), LIQUID_FRESHWATER, LIQUID_HOTWATER, LIQUID_RIVERWATER, LIQUID_SALTWATER, LIQUID_STILLWATER, LIQUID_WATER, HumanMovementState::m_iMovement, m_IsInWater, m_LiquidType, m_Player, m_SurfaceType, WATER_LEVEL_HIGH, and WATER_LEVEL_MID.
Referenced by Update().
protected void CollectAndSetEnvironmentData | ( | ) |
Sets actual weather related values for further use (rain, snow, wind, etc.)
References g_Game, WeatherPhenomenon::GetActual(), Weather::GetFog(), Weather::GetOvercast(), Weather::GetRain(), Weather::GetSnowfall(), Weather::GetWindMagnitude(), m_Clouds, m_DayOrNight, m_Fog, m_Rain, m_Snowfall, m_Wind, SetAreaGenericColdness(), and SetEnvironmentTemperature().
Referenced by Update().
protected void CollectAndSetPlayerData | ( | ) |
Sets character related value for furher use.
movement speed
References HumanCommandMove::GetCurrentMovementSpeed(), GetPlayerHeat(), m_Player, m_PlayerHeat, m_PlayerHeightPos, and m_PlayerSpeed.
Referenced by Update().
protected bool DetermineHeatcomfortBehavior | ( | ) |
Changes Heat Comfort curve behavior based on where the character is.
References IsChildOfType(), m_HeatComfortBehaviorCategory, and m_Player.
Referenced by Update().
void Environment | ( | PlayerBase | pPlayer | ) |
References m_Player.
Referenced by ManBase::Init().
References GameConstants::ENVIRO_PLAYER_COMFORT_TEMP, and GameConstants::ENVIRO_TEMP_EFFECT_ON_PLAYER.
Referenced by ProcessHeatComfort().
protected void GatherTemperatureSources | ( | ) |
Checks characters proximity for usable Universal Temperature Sources and register them.
skip - Temperature Source is not affecting player entities
skip - Temperature Source is too far
References DayZPlayerUtils(), vector::DistanceSq(), GameConstants::ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, m_Player, m_UTemperatureSources, Math::SqrFloat(), and Vector().
Referenced by PluginBase::SendDebug(), and Update().
protected float GetApplicableHeatbuffer | ( | ) |
References m_Player, and Math::Round().
Referenced by ProcessHeatBuffer().
float GetDayOrNight | ( | ) |
References m_DayOrNight.
string GetDebugMessage | ( | ) |
debug
References g_Game, WorldData::GetBaseEnvTemperature(), WorldData::GetBaseEnvTemperatureAtObject(), GetNextRoofCheck(), GetTargetHeatComfort(), GetWetDelta(), GetWindModifierPerSurface(), IsInsideBuilding(), IsWaterContact(), m_Clouds, m_DayOrNight, m_EnvironmentTemperature, m_Fog, m_HeatComfort, m_IsUnderRoof, m_Player, m_Rain, m_Snowfall, m_WaterLevel, m_Wind, m_WorldData, bool::ToString(), float::ToString(), WorldDataDaytime::ToString(), and WATER_LEVEL_NONE.
protected float GetEnvironmentTemperature | ( | ) |
Calculations of temperarute for different situations.
References Math::AbsFloat(), GameConstants::ENVIRO_TEMPERATURE_INSIDE_VEHICLE_COEF, GameConstants::ENVIRO_TEMPERATURE_UNDERROOF_COEF, WorldData::GetLiquidTypeEnviroTemperature(), WorldData::GetTemperature(), WorldData::GetTemperatureComponentValue(), GetWindModifierPerSurface(), IsChildOfType(), IsInsideBuilding(), IsUnderRoof(), IsWaterContact(), m_IsUnderRoofBuilding, m_LiquidType, m_Player, WorldData::m_TemperatureInsideBuildingsModifier, m_UTSAverageTemperature, WorldData::m_WaterContactTemperatureModifier, m_WorldData, and WindEffectTemperatureValue().
Referenced by GetWetDelta(), and SetEnvironmentTemperature().
int GetNextRoofCheck | ( | ) |
References GameConstants::ENVIRO_TICK_ROOF_RC_CHECK, and m_RoofCheckTimer.
Referenced by GetDebugMessage().
protected float GetPlayerHeat | ( | ) |
Character's heat (calculated from movement speed multiplied by constant)
References GameConstants::ENVIRO_DEFAULT_ENTITY_HEAT, and m_PlayerSpeed.
Referenced by CollectAndSetPlayerData(), and ProcessHeatComfort().
float GetTargetHeatComfort | ( | ) |
References m_TargetHeatComfort.
Referenced by GetDebugMessage().
float GetTemperature | ( | ) |
References m_EnvironmentTemperature.
Referenced by Entity::AddTemperature(), AddTemperatureToItemByFire(), AddWetnessToFireplace(), FilteringBottle::AffectLiquidContainerOnFill(), Bottle_Base::AffectLiquidContainerOnFill(), FilteringBottle::AffectLiquidContainerOnTransfer(), Bottle_Base::AffectLiquidContainerOnTransfer(), CanCookOnStick(), CanDismantleOven(), CanPutIntoHands(), Cooling(), InventoryItem::DoAmmoExplosion(), InventoryItem::EEKilled(), GetCookingTargetTemperature(), Entity::HandleFreezingProgression(), Heating(), Entity::InitTemperature(), Entity::InterpolateTempData(), Edible_Base::OnConsume(), OnVariablesSynchronized(), InventoryItem::ProcessItemTemperature(), Entity::ProcessVariables(), RefreshFireState(), Entity::SetTemperatureEx(), Entity::SetTemperatureMax(), and Entity::WriteVarsToCTX().
float GetTemperatureHeightCorrection | ( | ) |
float GetUniversalSourcesTemperageAverage | ( | ) |
References m_UTSAverageTemperature.
float GetWaterLevel | ( | ) |
References IsWaterContact(), m_WaterLevel, and WATER_LEVEL_NONE.
float GetWetDelta | ( | ) |
Calculates soaking/drying delta based on character's location and weather.
player is getting wet by movement/swimming in water (+differentiate wetDelta by water level)
player is drying
References GameConstants::ENVIRO_CLOUD_DRY_EFFECT, GameConstants::ENVIRO_DRY_INCREMENT, GameConstants::ENVIRO_FOG_DRY_EFFECT, GameConstants::ENVIRO_SNOW_WET_COEF, GameConstants::ENVIRO_TICKS_TO_WETNESS_CALCULATION, GameConstants::ENVIRO_WET_INCREMENT, GameConstants::ENVIRO_WIND_EFFECT, GetEnvironmentTemperature(), IsChildOfType(), IsInsideBuilding(), IsRaining(), IsSnowing(), IsUnderRoof(), IsWaterContact(), m_Clouds, m_Fog, m_PlayerHeat, m_Rain, m_Snowfall, m_WaterLevel, m_Wind, Math::Max(), SNOWFALL_LIMIT_LOW, SNOWFALL_WIND_COMBINED_THRESHOLD, WATER_LEVEL_HIGH, WATER_LEVEL_LOW, WATER_LEVEL_MID, and WATER_LEVEL_NONE.
Referenced by ApplyWetnessToItem(), and GetDebugMessage().
float GetWindModifierPerSurface | ( | ) |
Wind intensity (influence) modifier of temperature value.
References g_Game, IsUnderRoofBuilding(), and m_SurfaceType.
Referenced by GetDebugMessage(), and GetEnvironmentTemperature().
void Init | ( | ) |
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
whole body slots
upper body part slots
bottom body part slots
lower body part slots
heat comfort related slots
References g_Game, WorldData::GetBaseEnvTemperatureAtObject(), m_AverageHeatComfortBuffer, m_BodyParts, m_EnvironmentSnapshot, m_EnvironmentTemperature, m_FeetParts, m_HeadParts, m_HeatBufferTimer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_Initialized, m_IsInWater, m_IsUnderRoof, m_Player, m_PlayerSpeed, m_RoofCheckTimer, m_SlotIdsBottom, m_SlotIdsComplete, m_SlotIdsLower, m_SlotIdsUpper, m_SurfaceType, m_UTemperatureSources, m_UTSAverageTemperature, m_UTSAverageTemperatureBuffer, m_WaterLevel, m_WetDryTick, and m_WorldData.
void Init | ( | PlayerBase | pPlayer | ) |
used for calculations before the data modification
References Init().
Returns true if character is child of given parent type(s)
typenames | list of types to check against |
References m_Player.
Referenced by CheckUnderRoof(), CheckWaterContact(), DetermineHeatcomfortBehavior(), GetEnvironmentTemperature(), GetWetDelta(), IsInsideVehicle(), NakedBodyPartHeatComfortPenalty(), and Update().
bool IsInsideBuilding | ( | ) |
Is character inside building? (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK).
References m_Player.
Referenced by GetDebugMessage(), GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().
protected bool IsInsideVehicle | ( | ) |
References IsChildOfType().
private bool IsNeutralTemperature | ( | float | temperature, |
float | lowerLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT , |
||
float | upperLimit = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT |
||
) |
protected bool IsRaining | ( | ) |
Rain phenomenon actual value > RAIN_LIMIT_LOW.
References m_Rain, and RAIN_LIMIT_LOW.
Referenced by GetWetDelta(), and Update().
protected bool IsSnowing | ( | ) |
Snowfall phenomenon actual value > SNOWFALL_LIMIT_LOW.
References m_Snowfall, and SNOWFALL_LIMIT_LOW.
Referenced by GetWetDelta(), and Update().
bool IsTemperatureSet | ( | ) |
For safe-guards, waiting for the proper temperature to be set.
References m_IsTempSet.
bool IsUnderRoof | ( | ) |
Is character under roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). Runs when player is not inside of building.
References m_IsUnderRoof.
Referenced by GetEnvironmentTemperature(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().
private bool IsUnderRoofBuilding | ( | ) |
Is character under building's roof (periodically checked - GameConstants.ENVIRO_TICK_ROOF_RC_CHECK). There might be situations where the surface under is external, but character is inside building.
References m_IsUnderRoofBuilding.
Referenced by CheckWaterContact(), and GetWindModifierPerSurface().
protected bool IsWaterContact | ( | ) |
Is character in contact with water body? (periodically checked - GameConstants.ENVIRO_TICK_RATE).
References m_IsInWater.
Referenced by GetDebugMessage(), GetEnvironmentTemperature(), GetWaterLevel(), GetWetDelta(), NakedBodyPartHeatComfortPenalty(), and Update().
Calculates penalty value for heatcomfort - this simulates uncovered body part reaction.
pBodyPartSlotId | InventorySlot ID to check |
pCoef | external coefficient used for that slot |
References GameConstants::ENVIRO_ISOLATION_WETFACTOR_DRENCHED, GameConstants::ENVIRO_NAKED_BODY_PENALTY_RAIN_MIN_VALUE, GameConstants::ENVIRO_NAKED_BODY_PENALTY_SNOWFALL_MIN_VALUE, IsChildOfType(), IsInsideBuilding(), IsUnderRoof(), IsWaterContact(), m_Rain, and m_Snowfall.
Referenced by ProcessHeatComfort().
private float NormalizedTemperature | ( | float | temperature, |
float | lowerLimit = GameConstants.ENVIRO_LOW_TEMP_LIMIT , |
||
float | upperLimit = GameConstants.ENVIRO_HIGH_TEMP_LIMIT |
||
) |
protected void OnTemperatureSourcesEnter | ( | ) |
Event fired when characters enters into UTSource proximity.
Referenced by ProcessTemperatureSources().
protected void OnTemperatureSourcesLeft | ( | ) |
Event fired when characters leave the UTSource proximity.
Referenced by ProcessTemperatureSources().
protected void ProcessHeatBuffer | ( | EnvironmentSnapshotData | data | ) |
dynamic HB cap based on actual heatcomfort (from cloths)
deplete the heat buffer if there is difference in HB capacity (eg.: cloths were removed)
References GameConstants::ENVIRO_HEATCOMFORT_WEIGHT_SUMMARY, GameConstants::ENVIRO_PLAYER_HEATBUFFER_CAPACITY_MIN, GameConstants::ENVIRO_PLAYER_HEATBUFFER_DECREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_INCREASE, GameConstants::ENVIRO_PLAYER_HEATBUFFER_STAGE_RATELIMIT, GameConstants::ENVIRO_PLAYER_HEATBUFFER_TEMP_AFFECT, GameConstants::ENVIRO_PLAYER_HEATBUFFER_WATEREFFECT, GetApplicableHeatbuffer(), Math::InverseLerp(), Math::Lerp(), m_HasTemperatureSources, m_HeatBufferCapPrevious, m_HeatBufferTimer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_IsInWater, m_Player, m_UTSAverageTemperature, m_WaterLevel, HeatBufferMdfr::STAGE_THRESHOLDS, and PlayerConstants::THRESHOLD_HEAT_COMFORT_MINUS_WARNING.
Referenced by ProcessHeatBuffer(), and ProcessHeatComfort().
protected void ProcessHeatBuffer | ( | float | heatComfortCloths | ) |
backward compatibility [<1.27]
References m_EnvironmentSnapshot, m_TargetHeatComfort, and ProcessHeatBuffer().
protected void ProcessHeatComfort | ( | ) |
Calculates and process player's heatcomfort related to defined body parts.
Heat Comfort Penalty
heatcomfort body parts penalties
Stomach temperature influence to heatcomfort
uses the raw targetHeatComfort data
References Math::AbsFloat(), BodyPartHeatProperties(), Math::Clamp(), GameConstants::ENVIRO_HEATCOMFORT_BACK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_BODY_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_FEET_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_GLOVES_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HEADGEAR_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_HIPS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_LEGS_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MASK_WEIGHT, GameConstants::ENVIRO_HEATCOMFORT_MAX_STEP_SIZE, GameConstants::ENVIRO_HEATCOMFORT_VEST_WEIGHT, GameConstants::ENVIRO_STOMACH_WEIGHT, EnvTempToCoef(), GetPlayerHeat(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_LOWER_LIMIT, GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT, m_AverageHeatComfortBuffer, m_EnvironmentSnapshot, m_EnvironmentTemperature, m_HeatComfort, m_Player, NakedBodyPartHeatComfortPenalty(), ProcessHeatBuffer(), Math::Remap(), Math::Round(), and SetTargetHeatComfort().
Referenced by ProcessItemsHeat(), and Update().
protected void ProcessItemsDryness | ( | ) |
Dry items in player possession.
References ApplyDrynessToItemEx(), vector::Distance(), GameConstants::ENVIRO_TICK_RATE, GetPosition, m_HasTemperatureSources, m_Player, EnvironmentDrynessData::m_TemperatureSourceDistance, EnvironmentDrynessData::m_UseTemperatureSources, m_UTemperatureSources, and Math::Max().
Referenced by Update().
protected void ProcessItemsHeat | ( | ) |
References ProcessHeatComfort().
protected void ProcessItemsInHandsTemperature | ( | ) |
Process temperature of item in character hands and cool/warm it to neutral temparature.
References ItemBase::IsSelfAdjustingTemperature(), m_Player, ProcessItemHierarchyRecursive(), and SetProcessedItemTemperature().
Referenced by Update().
Iterate through items in player posession (by given body parts) and cool/warm them to neutral temparature.
pBodyPartIds | List of body parts to iterate through (see InventorySlots) |
go through all body parts we've defined for that zone (ex.: head, body, feet)
References ItemBase::IsSelfAdjustingTemperature(), m_Player, ProcessItemHierarchyRecursive(), and SetProcessedItemTemperature().
Referenced by Update().
Soak items at specific Slot ID(s)
pSlotIds | Inventory Slot IDs to process |
References ApplyWetnessToItem(), GameConstants::ENVIRO_TICK_RATE, and m_Player.
Referenced by ProcessWetnessByRain(), ProcessWetnessByWaterLevel(), and Update().
protected void ProcessTemperatureSources | ( | ) |
Processes registered UTSources and calculates resulting m_UTSAverageTemperature.
adds average of 2 most significat sources to buffer
References CalcTemperatureFromTemperatureSource(), m_HasTemperatureSources, m_UTemperatureSources, m_UTSAverageTemperature, m_UTSAverageTemperatureBuffer, OnTemperatureSourcesEnter(), OnTemperatureSourcesLeft(), SetItemHeatingCoef(), and GameConstants::TEMP_COEF_INVENTORY.
Referenced by Update().
protected void ProcessWetnessByRain | ( | ) |
References m_SlotIdsComplete, and ProcessItemsWetness().
protected void ProcessWetnessByWaterLevel | ( | float | pWaterLevel | ) |
Processes items wetness in player possession based on the current water level (the character is in)
pWaterLevel | Water level height |
References m_SlotIdsBottom, m_SlotIdsComplete, m_SlotIdsLower, m_SlotIdsUpper, ProcessItemsWetness(), WATER_LEVEL_HIGH, WATER_LEVEL_LOW, WATER_LEVEL_MID, and WATER_LEVEL_NONE.
Referenced by Update().
void SetAreaGenericColdness | ( | ) |
Determines whether player is in cold area which restricts use of some actions (digging)
References GameConstants::COLD_AREA_TEMPERATURE_THRESHOLD, WorldData::GetBaseEnvTemperatureAtObject(), m_Player, and m_WorldData.
Referenced by CollectAndSetEnvironmentData().
protected void SetEnvironmentSnapshotData | ( | ) |
References m_EnvironmentSnapshot, and m_TargetHeatComfort.
void SetEnvironmentTemperature | ( | ) |
References GetEnvironmentTemperature(), m_EnvironmentTemperature, and m_IsTempSet.
Referenced by CollectAndSetEnvironmentData().
protected void SetHeatcomfortDirectly | ( | ) |
References m_AverageHeatComfortBuffer, m_HeatComfort, m_HeatComfortBehaviorCategory, m_Player, and SetTargetHeatComfort().
Referenced by Update().
protected void SetItemHeatingCoef | ( | float | val | ) |
References m_ItemTemperatureCoef.
Referenced by ProcessTemperatureSources(), and SetProcessedItemTemperature().
swimming special behavior
References GameConstants::ENVIRO_TICK_RATE, WorldData::GetLiquidTypeEnviroTemperature(), DayZPlayer::IsSwimming(), GameConstants::ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE, m_ItemTemperatureCoef, m_LiquidType, m_Player, m_WorldData, SetItemHeatingCoef(), and GameConstants::TEMP_COEF_SWIMMING.
Referenced by ProcessItemHierarchyRecursive(), ProcessItemsInHandsTemperature(), and ProcessItemsTemperature().
protected void SetTargetHeatComfort | ( | float | value | ) |
References m_TargetHeatComfort.
Referenced by ProcessHeatComfort(), and SetHeatcomfortDirectly().
void Update | ( | float | pDelta | ) |
Main loop that runs calculations for various Environment parts (wetness, heatcomfort, watercontact, etc.)
check if player is under roof (only if the Building check is false)
Updates data
Process temperatures
heat comfort calculation
Process item wetness/dryness
setting of wetness/dryiness of player
reset item wetness counter;
References CheckUnderRoof(), CheckWaterContact(), CollectAndSetEnvironmentData(), CollectAndSetPlayerData(), DetermineHeatcomfortBehavior(), GameConstants::ENVIRO_TICK_RATE, GameConstants::ENVIRO_TICK_ROOF_RC_CHECK, GameConstants::ENVIRO_TICKS_TO_WETNESS_CALCULATION, GatherTemperatureSources(), IsChildOfType(), IsInsideBuilding(), IsRaining(), IsSnowing(), IsUnderRoof(), IsWaterContact(), m_BodyParts, m_FeetParts, m_HeadParts, m_Initialized, m_ItemsWetnessMax, m_Player, m_RoofCheckTimer, m_SlotIdsComplete, m_Time, m_WaterLevel, m_WetDryTick, ProcessHeatComfort(), ProcessItemsDryness(), ProcessItemsInHandsTemperature(), ProcessItemsTemperature(), ProcessItemsWetness(), ProcessTemperatureSources(), ProcessWetnessByWaterLevel(), SetHeatcomfortDirectly(), SNOWFALL_WIND_COMBINED_THRESHOLD, and GameConstants::STATE_WET.
backward compatibility [<1.28]
References GameConstants::ENVIRO_WIND_CHILL_LIMIT, GameConstants::ENVIRO_WIND_EFFECT_SLOPE, WorldData::GetWindCoef(), m_Wind, and m_WorldData.
Referenced by GetEnvironmentTemperature().
protected ref SimpleMovingAverage<float> m_AverageHeatComfortBuffer |
Referenced by Init(), ProcessHeatComfort(), and SetHeatcomfortDirectly().
enum EEnvironmentHeatcomfortBehaviorCategory m_ClothingHeatComfort |
protected float m_Clouds = 0 |
Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), and GetWetDelta().
protected float m_DayOrNight = 0 |
Referenced by CollectAndSetEnvironmentData(), GetDayOrNight(), and GetDebugMessage().
protected ref EnvironmentSnapshotData m_EnvironmentSnapshot |
Referenced by Init(), ProcessHeatBuffer(), ProcessHeatComfort(), and SetEnvironmentSnapshotData().
protected float m_EnvironmentTemperature |
Referenced by GetDebugMessage(), GetTemperature(), Init(), ProcessHeatComfort(), and SetEnvironmentTemperature().
protected float m_Fog = 0 |
Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), and GetWetDelta().
protected bool m_HasTemperatureSources |
Referenced by ProcessHeatBuffer(), ProcessItemsDryness(), and ProcessTemperatureSources().
protected float m_HeatBufferCapPrevious |
reused as state toggle
Referenced by ProcessHeatBuffer().
protected float m_HeatBufferTimer |
Referenced by Init(), and ProcessHeatBuffer().
protected float m_HeatComfort |
Referenced by GetDebugMessage(), Init(), ProcessHeatBuffer(), ProcessHeatComfort(), and SetHeatcomfortDirectly().
protected int m_HeatComfortBehaviorCategory |
Referenced by DetermineHeatcomfortBehavior(), Init(), ProcessHeatBuffer(), and SetHeatcomfortDirectly().
protected float m_HeatSourceTemp |
DEPRECATED.
private bool m_Initialized |
protected bool m_IsInWater |
Referenced by CheckWaterContact(), Init(), ManBase::IsInWater(), IsWaterContact(), ProcessHeatBuffer(), and ManBase::SetInWater().
protected bool m_IsTempSet |
Referenced by IsTemperatureSet(), and SetEnvironmentTemperature().
protected bool m_IsUnderRoof |
Referenced by CheckUnderRoof(), GetDebugMessage(), Init(), and IsUnderRoof().
private bool m_IsUnderRoofBuilding |
Referenced by CheckUnderRoof(), GetEnvironmentTemperature(), and IsUnderRoofBuilding().
protected float m_ItemsWetnessMax |
Referenced by ApplyDrynessToItemEx(), ApplyWetnessToItem(), and Update().
protected float m_ItemTemperatureCoef |
Referenced by SetItemHeatingCoef(), and SetProcessedItemTemperature().
protected int m_LiquidType |
protected PlayerBase m_Player |
protected float m_PlayerHeat |
Referenced by CollectAndSetPlayerData(), and GetWetDelta().
protected float m_PlayerHeightPos |
Referenced by CollectAndSetPlayerData(), and GetTemperatureHeightCorrection().
protected float m_PlayerSpeed |
Referenced by CollectAndSetPlayerData(), GetPlayerHeat(), and Init().
protected float m_PlayerTemperature |
protected float m_Rain = 0 |
target value of heatcomfort (non-buffered)
Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), GetWetDelta(), IsRaining(), and NakedBodyPartHeatComfortPenalty().
protected float m_RoofCheckTimer |
keeps wetness of most wet item in player's possesion
Referenced by GetNextRoofCheck(), Init(), and Update().
Referenced by Init(), and ProcessWetnessByWaterLevel().
Referenced by Init(), ProcessWetnessByRain(), ProcessWetnessByWaterLevel(), and Update().
Referenced by Init(), and ProcessWetnessByWaterLevel().
Referenced by Init(), and ProcessWetnessByWaterLevel().
protected float m_Snowfall = 0 |
Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), GetWetDelta(), IsSnowing(), and NakedBodyPartHeatComfortPenalty().
protected string m_SurfaceType |
Referenced by CheckWaterContact(), GetWindModifierPerSurface(), and Init().
protected float m_TargetHeatComfort |
player's heatcomfort (buffered, stored in player stats)
Referenced by GetTargetHeatComfort(), ProcessHeatBuffer(), SetEnvironmentSnapshotData(), and SetTargetHeatComfort().
protected float m_Time = 0 |
protected ref array<UTemperatureSource> m_UTemperatureSources |
Referenced by GatherTemperatureSources(), Init(), ProcessItemsDryness(), and ProcessTemperatureSources().
protected float m_UTSAverageTemperature |
protected ref SimpleMovingAverage<float> m_UTSAverageTemperatureBuffer |
Referenced by Init(), and ProcessTemperatureSources().
protected float m_WaterLevel |
Referenced by GetDebugMessage(), GetWaterLevel(), GetWetDelta(), Init(), ProcessHeatBuffer(), and Update().
protected float m_Wind = 0 |
Referenced by CollectAndSetEnvironmentData(), GetDebugMessage(), GetWetDelta(), and WindEffectTemperatureValue().
protected ref SimpleMovingAverage<float> m_WindAverageBuffer |
protected WorldData m_WorldData |
class EnvironmentDrynessData RAIN_LIMIT_LOW = 0.05 |
Simulates influence of environment to character Takes input data from WorldData, Weather system and entities simulating temperature and wetness.
Referenced by IsRaining().
protected const float SNOWFALL_LIMIT_LOW = 0.5 |
Referenced by GetWetDelta(), and IsSnowing().
protected const float SNOWFALL_WIND_COMBINED_THRESHOLD = 1.3 |
Referenced by GetWetDelta(), and Update().
const float WATER_LEVEL_HIGH = 1.5 |
Referenced by CheckWaterContact(), GetWetDelta(), and ProcessWetnessByWaterLevel().
const float WATER_LEVEL_LOW = 0.5 |
Referenced by GetWetDelta(), and ProcessWetnessByWaterLevel().
const float WATER_LEVEL_MID = 1.2 |
Referenced by CheckWaterContact(), GetWetDelta(), and ProcessWetnessByWaterLevel().
const float WATER_LEVEL_NONE = 0.15 |
Referenced by GetDebugMessage(), GetWaterLevel(), GetWetDelta(), and ProcessWetnessByWaterLevel().