DEPRECATED.
388{
390 {
391 float distanceToTemperatureSource;
392
393 foreach (
Object nearestObject : nearestObjects)
394 {
396
398 if (nearestItem && nearestItem.HasWetness() && nearestItem != pSettings.
m_Parent && !nearestItem.IsInherited(Man) && !nearestItem.IsUniversalTemperatureSource())
399 {
400 distanceToTemperatureSource =
vector.
Distance(nearestItem.GetPosition(), position);
401 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.3);
402
403 float dryModifier = 0;
404
406 {
407 dryModifier = (-1 * m_ExecuteInterval * nearestItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
408 Math.
Clamp(dryModifier, nearestItem.GetWetMin(), nearestItem.GetWetMax());
409 nearestItem.AddWet(dryModifier);
410 }
411
414 foreach (
EntityAI cargoEntity : cargoEntities)
415 {
417 if (cargoItem)
418 {
419 dryModifier = 0;
421 {
422 dryModifier = (-1 * m_ExecuteInterval * cargoItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
423 Math.
Clamp(dryModifier, cargoItem.GetWetMin(), cargoItem.GetWetMax());
424 cargoItem.AddWet(dryModifier);
425 }
426 }
427 }
428 }
429 }
430 }
431
433 {
434 float distanceToTemperatureSource;
437
438 foreach (
Object nearestObject : nearestObjects)
439 {
440 if (
Class.
CastTo(nearestEntity,nearestObject) && nearestEntity != pSettings.
m_Parent && !nearestEntity.IsSelfAdjustingTemperature())
441 {
442 float temperatureDifference = tempTarget - nearestEntity.GetTemperature();
443
444 distanceToTemperatureSource =
vector.
Distance(nearestEntity.GetPosition(), position);
445 distanceToTemperatureSource =
Math.
Max(distanceToTemperatureSource, 0.1);
446
447 float time = m_ExecuteInterval;
448 if (m_ExecuteInterval == -1)
449 time = 1;
450
451 float distFactor = 1;
453 {
455 distFactor =
Math.
Max(distFactor, 0.0);
456 }
457
459
460 if (nearestEntity.GetInventory())
461 {
463 }
464 else if (nearestEntity.CanHaveTemperature() && !nearestEntity.IsSelfAdjustingTemperature())
465 {
466 dta.m_HeatPermeabilityCoef = nearestEntity.GetHeatPermeabilityCoef();
467
469 nearestEntity.SetTemperatureEx(dta);
470 else
471 nearestEntity.RefreshTemperatureAccess(dta);
472 }
473 }
474 }
475 }
476
478 {
479 float heatPermCoef = heatPermeabilityCoef;
480 heatPermCoef *= ent.GetHeatPermeabilityCoef();
482
483
484 if (ent.CanHaveTemperature() && !ent.IsSelfAdjustingTemperature())
485 {
488 ent.SetTemperatureEx(dta);
489 else
490 ent.RefreshTemperatureAccess(dta);
491 }
492
493
494 int inventoryAttCount = ent.GetInventory().AttachmentCount();
495 if (inventoryAttCount > 0)
496 {
498 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
499 {
500 if (
Class.
CastTo(attachmentEnt,ent.GetInventory().GetAttachmentFromIndex(inAttIdx)))
501 {
503 }
504 }
505 }
506
507 if (ent.GetInventory().GetCargo())
508 {
509 int inventoryItemCount = ent.GetInventory().GetCargo().GetItemCount();
510 if (inventoryItemCount > 0)
511 {
513 for (int j = 0; j < inventoryItemCount; ++j)
514 {
515 if (
Class.
CastTo(cargoEnt,ent.GetInventory().GetCargo().GetItem(j)))
516 {
518 }
519 }
520 }
521 }
522 }
523
525 {
528
531 pos = pSettings.
m_Parent.GetPosition();
532
533
535
536
537 vector minPos = pos -
Vector(halfRange, halfRange / 2, halfRange);
538 vector maxPos = pos +
Vector(halfRange, halfRange / 2, halfRange);
539
542
543 for (int i = nearestObjects.Count() - 1; i >= 0; --i)
544 {
545 EntityAI entity = nearestObjects[i];
546 if (entity)
547 {
548 vector objPos = entity.GetPosition();
551 nearestObjects.Remove(i);
552 }
553 }
554
555 if (nearestObjects.Count() > 0)
556 {
559 }
560 }
561
564 {
567 pos = pSettings.
m_Parent.GetPosition();
568
569
571
572
573 vector minPos = pos -
Vector(halfRange, halfRange / 2, halfRange);
574 vector maxPos = pos +
Vector(halfRange, halfRange / 2, halfRange);
575
578
579 for (int i = nearestObjects.Count() - 1; i >= 0; --i)
580 {
581 EntityAI entity = nearestObjects[i];
582 if (entity)
583 {
584 vector objPos = entity.GetPosition();
587 nearestObjects.Remove(i);
588 }
589 }
590
592 }
593}
594
597{
599 {
600 m_AffectsPlayer = false;
601 }
602}
603
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)
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_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.