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

◆ CalculatePositionData()

bool CalculatePositionData ( string namedSelection,
out vector position,
out float radius )
protected

False if no valid position found.

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

55 {
56 radius = 2.0; //UAMaxDistances.DEFAULT;
57
58 if (m_Parent.MemoryPointExists(namedSelection)) //first look for mem point
59 {
60 position = m_Parent.ModelToWorld(m_Parent.GetMemoryPointPos(namedSelection));
61 string memRadiusSelection = "" + namedSelection + "_radius";
62 if (m_Parent.MemoryPointExists(memRadiusSelection)) //if using mem point, look for radius point too
63 {
64 vector radiusPoint = m_Parent.ModelToWorld(m_Parent.GetMemoryPointPos(memRadiusSelection));
65 radius = vector.Distance(position,radiusPoint);
66 }
67
68 return true;
69 }
70 else //if not found, look for the named component center (building-specific solution, position possibly averaged from multiple components!)
71 {
72 TIntArray ost = new TIntArray();
73 m_Parent.GetActionComponentsForSelectionName(m_Parent.GetViewGeometryLevel(),namedSelection,ost);
74
75 if (ost.Count() == 0)
76 return false;
77
78 bool validPosFilled = false;
79 vector tmpPos;
80 foreach (int comp : ost)
81 {
82 if (!validPosFilled)
83 {
84 tmpPos = m_Parent.ModelToWorld(m_Parent.GetActionComponentCenter(m_Parent.GetViewGeometryLevel(),comp));
85 validPosFilled = true;
86 }
87 else
88 {
89 tmpPos = tmpPos + m_Parent.ModelToWorld(m_Parent.GetActionComponentCenter(m_Parent.GetViewGeometryLevel(),comp));
90 }
91 }
92
93 position = tmpPos * (1 / ost.Count());
94 return true;
95 }
96 }
Entity m_Parent
Определения CachedEquipmentStorageBase.c:17
vector position
Определения DustKickupEffects.c:20
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:119
array< int > TIntArray
Определения EnScript.c:733

Перекрестные ссылки vector::Distance(), m_Parent и position.

Используется в Init().