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

◆ GatherTemperatureSources()

void GatherTemperatureSources ( )
protected

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

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

1470 {
1471 m_UTemperatureSources.Clear();
1472
1473 // Calculate min and max positions of the box
1474 vector pos = m_Player.GetPosition();
1477
1478 array<EntityAI> nearestObjects = {};
1479 DayZPlayerUtils.SceneGetEntitiesInBox(minPos, maxPos, nearestObjects, QueryFlags.STATIC|QueryFlags.DYNAMIC); //STATIC catches area effects and other static (or 'static') sources
1480
1481 foreach (EntityAI nearestEntity : nearestObjects)
1482 {
1483 if (nearestEntity.IsUniversalTemperatureSource() && nearestEntity != m_Player)
1484 {
1486 if (!nearestEntity.GetUniversalTemperatureSource().GetLambda().AffectsPlayer())
1487 continue;
1488
1490 if (vector.DistanceSq(pos, nearestEntity.GetPosition()) > Math.SqrFloat(nearestEntity.GetUniversalTemperatureSource().GetMaxRange()))
1491 continue;
1492
1493 m_UTemperatureSources.Insert(nearestEntity.GetUniversalTemperatureSource());
1494 }
1495 }
1496
1497 if (m_Player.GetItemInHands() && m_Player.GetItemInHands().IsUniversalTemperatureSource())
1498 m_UTemperatureSources.Insert(m_Player.GetItemInHands().GetUniversalTemperatureSource());
1499 }
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
QueryFlags
Определения DayZPlayerUtils.c:2
ref array< UTemperatureSource > m_UTemperatureSources
Определения Environment.c:89
DayZPlayer m_Player
Определения Hand_Events.c:42
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106
const float ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS
Определения 3_Game/constants.c:785
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float SqrFloat(float f)
Returns squared value.

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), GameConstants::ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS, m_Player, m_UTemperatureSources, Math::SqrFloat() и Vector().

Используется в PluginBase::SendDebug() и Update().