DEPRECATED.
384{
386 {
387 float distanceToTemperatureSource;
388
389 foreach (
Object nearestObject : nearestObjects)
390 {
393
395 if (nearestItem && nearestItem.HasWetness() && nearestItem != pSettings.
m_Parent && !nearestItem.IsInherited(Man) && !nearestItem.IsUniversalTemperatureSource())
396 {
397 distanceToTemperatureSource =
vector.
Distance(nearestItem.GetPosition(), position);
398 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.001);
399 distanceToTemperatureSource = 1 / distanceToTemperatureSource;
400 distanceToTemperatureSource =
Math.
Clamp(distanceToTemperatureSource, 0.0, 1.0);
401
402 float dryValue = 0;
403
405 {
406 dryValue = (-1 * m_ExecuteInterval * nearestItem.GetDryingIncrement(
"groundHeatSource")) * pSettings.
m_ItemDryModifier * distanceToTemperatureSource;
407 Math.
Clamp(dryValue, nearestItem.GetWetMin(), nearestItem.GetWetMax());
408 nearestItem.AddWet(dryValue);
409 }
410
413 foreach (
EntityAI cargoEntity : cargoEntities)
414 {
416 if (cargoItem)
417 {
418 dryValue = 0;
420 {
421 dryValue = (-1 * m_ExecuteInterval * cargoItem.GetDryingIncrement(
"groundHeatSource")) * pSettings.
m_ItemDryModifier * distanceToTemperatureSource;
422 Math.
Clamp(dryValue, cargoItem.GetWetMin(), cargoItem.GetWetMax());
423 cargoItem.AddWet(dryValue);
424 }
425 }
426 }
427 }
428 }
429 }
430
432 {
433 float distanceToTemperatureSource;
436
437 foreach (
Object nearestObject : nearestObjects)
438 {
439 if (
Class.
CastTo(nearestEntity,nearestObject) && nearestEntity != pSettings.
m_Parent && !nearestEntity.IsSelfAdjustingTemperature())
440 {
441 float temperatureDifference = tempTarget - nearestEntity.GetTemperature();
442
443 distanceToTemperatureSource =
vector.
Distance(nearestEntity.GetPosition(), position);
444 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.1);
445
446 float time = m_ExecuteInterval;
447 if (m_ExecuteInterval == -1)
448 time = 1;
449
450 float distFactor = 1;
452 {
454 distFactor =
Math.
Max(distFactor, 0.0);
455 }
456
458
459 if (nearestEntity.GetInventory())
460 {
462 }
463 else if (nearestEntity.CanHaveTemperature() && !nearestEntity.IsSelfAdjustingTemperature())
464 {
465 dta.m_HeatPermeabilityCoef = nearestEntity.GetHeatPermeabilityCoef();
466
468 nearestEntity.SetTemperatureEx(dta);
469 else
470 nearestEntity.RefreshTemperatureAccess(dta);
471 }
472 }
473 }
474 }
475
477 {
478 float heatPermCoef = heatPermeabilityCoef;
479 heatPermCoef *= ent.GetHeatPermeabilityCoef();
481
482
483 if (ent.CanHaveTemperature() && !ent.IsSelfAdjustingTemperature())
484 {
487 ent.SetTemperatureEx(dta);
488 else
489 ent.RefreshTemperatureAccess(dta);
490 }
491
492
493 int inventoryAttCount = ent.GetInventory().AttachmentCount();
494 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
495 {
497 if (
Class.
CastTo(attachmentEnt,ent.GetInventory().GetAttachmentFromIndex(inAttIdx)))
498 {
500 }
501 }
502
503 CargoBase cargo = ent.GetInventory().GetCargo();
504 if (cargo)
505 {
507 for (int j = 0; j < inventoryItemCount; ++j)
508 {
511 {
513 }
514 }
515 }
516 }
517
519 {
522
525 pos = pSettings.
m_Parent.GetPosition();
526
527
529
530
531 vector minPos = pos -
Vector(halfRange, halfRange / 2, halfRange);
532 vector maxPos = pos +
Vector(halfRange, halfRange / 2, halfRange);
533
536
537 for (int i = nearestObjects.Count() - 1; i >= 0; --i)
538 {
539 EntityAI entity = nearestObjects[i];
540 if (entity)
541 {
542 vector objPos = entity.GetPosition();
545 nearestObjects.Remove(i);
546 }
547 }
548
549 if (nearestObjects.Count() > 0)
550 {
553 }
554 }
555
558 {
561 pos = pSettings.
m_Parent.GetPosition();
562
563
565
566
567 vector minPos = pos -
Vector(halfRange, halfRange / 2, halfRange);
568 vector maxPos = pos +
Vector(halfRange, halfRange / 2, halfRange);
569
572
573 for (int i = nearestObjects.Count() - 1; i >= 0; --i)
574 {
575 EntityAI entity = nearestObjects[i];
576 if (entity)
577 {
578 vector objPos = entity.GetPosition();
581 nearestObjects.Remove(i);
582 }
583 }
584
586 }
587}
588
591{
593 {
594 m_AffectsPlayer = false;
595 }
596}
597
void DayZPlayerUtils()
cannot be instantiated
override void WarmAndCoolItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< EntityAI > nearestObjects)
override void DryItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< EntityAI > nearestObjects)
void UpdateVicinityTemperatureRecursive(EntityAI ent, TemperatureData dta, float heatPermeabilityCoef=1.0)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
override void Execute(UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Super root of all classes in Enforce script.
float m_HeatPermeabilityCoef
vector m_Position
if the stats can be overriden by coefficient/variables from WorldData (currently TemperatureCap only)
float m_RangeFull
temperature cap that will limit the return value from GetTemperature method
float m_TemperatureCap
used to determine speed of temperature change, and some temperature subsystems
float m_ItemDryModifier
maximum range where the receiver can get some temperature
float m_TemperatureItemCoef
max temperature 'non-IsSelfAdjustingTemperature' entity in vicinity will get per update (cap);
float m_RangeMax
range where the full temperature is given to receiver
float m_TemperatureItemCap
how often the Update is ticking
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float TEMPERATURE_SENSITIVITY_THRESHOLD
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Max(float x, float y)
Returns bigger 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,...
static proto float AbsFloat(float f)
Returns absolute value.