22 vector m_vCoverTallestPos;
40 return m_vCoverPos != vector.Zero;
47 CoverManagerComponent coverMgr = GetCoverManager();
52 if (m_vCoverPos != vector.Zero)
53 coverMgr.SetOccupiedCover(m_iTileX, m_iTileY, m_iCoverId,
false);
56 m_vCoverPos = vector.Zero;
60 void SCR_AICoverLock(
int tilex,
int tiley,
int coverId, vector coverPos, vector coverTallestPos)
62 CoverManagerComponent coverMgr = GetCoverManager();
69 m_vCoverPos = coverPos;
70 m_vCoverTallestPos = coverTallestPos;
73 if (m_vCoverPos != vector.Zero)
74 coverMgr.SetOccupiedCover(m_iTileX, m_iTileY, m_iCoverId,
true);
77 vector coverDirXZ = m_vCoverTallestPos - m_vCoverPos;
79 coverDirXZ.Normalize();
80 m_vCoverDirXZ = coverDirXZ;
91 float CosAngleToThreat(vector threatPos)
93 vector dirCoverToThreatXZ = threatPos - m_vCoverPos;
94 dirCoverToThreatXZ[1] = 0;
95 dirCoverToThreatXZ.Normalize();
96 float cosAngleCoverDirThreatDir = vector.Dot(m_vCoverDirXZ, dirCoverToThreatXZ);
97 return cosAngleCoverDirThreatDir;
101 protected static CoverManagerComponent GetCoverManager()
103 AIWorld aiWorld =
GetGame().GetAIWorld();
106 CoverManagerComponent coverMgr = CoverManagerComponent.Cast(aiWorld.FindComponent(CoverManagerComponent));