DayZ 1.29
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 строка 1476

1477 {
1478 m_UTemperatureSources.Clear();
1479
1480 // Calculate min and max positions of the box
1481 vector pos = m_Player.GetPosition();
1484
1485 array<EntityAI> nearestObjects = {};
1486 DayZPlayerUtils.SceneGetEntitiesInBox(minPos, maxPos, nearestObjects, QueryFlags.STATIC|QueryFlags.DYNAMIC); //STATIC catches area effects and other static (or 'static') sources
1487
1488 foreach (EntityAI nearestEntity : nearestObjects)
1489 {
1490 if (nearestEntity.IsUniversalTemperatureSource() && nearestEntity != m_Player)
1491 {
1493 if (!nearestEntity.GetUniversalTemperatureSource().GetLambda().AffectsPlayer())
1494 continue;
1495
1497 if (vector.DistanceSq(pos, nearestEntity.GetPosition()) > Math.SqrFloat(nearestEntity.GetUniversalTemperatureSource().GetMaxRange()))
1498 continue;
1499
1500 m_UTemperatureSources.Insert(nearestEntity.GetUniversalTemperatureSource());
1501 }
1502 }
1503
1504 if (m_Player.GetItemInHands() && m_Player.GetItemInHands().IsUniversalTemperatureSource())
1505 m_UTemperatureSources.Insert(m_Player.GetItemInHands().GetUniversalTemperatureSource());
1506 }
map m_Player
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
QueryFlags
Определения DayZPlayerUtils.c:2
ref array< UTemperatureSource > m_UTemperatureSources
Определения Environment.c:89
Определения 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:119
const float ENVIRO_TEMP_SOURCES_LOOKUP_RADIUS
Определения 3_Game/DayZ/constants.c:788
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_UTemperatureSources, Math::SqrFloat() и Vector().

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