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

◆ Hologram()

void Hologram::Hologram ( PlayerBase player,
vector pos,
ItemBase item )
inlineprotected

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

69 {
70 m_Player = player;
71 m_Parent = item;
72 m_Projection = null;
73
75 m_UpdatePosition = true;
77
78 m_Rotation = "0 0 0";
79 m_FromAdjusted = "0 0 0";
80
81 // If the static names are empty, generate the needed names
82 // Refer to their definitions to see why these are required
83 if (m_WatchtowerIgnoreComponentNames.Count() == 0)
84 {
85 string baseStringBegin = Watchtower.BASE_VIEW_NAME;
86 string baseIgnoreStringEnd = Watchtower.BASE_WALL_NAME;
87
88 int floors = Watchtower.MAX_WATCHTOWER_FLOORS;
89 int walls = Watchtower.MAX_WATCHTOWER_WALLS;
90
91 string compName;
92 for (int i = 1; i < floors + 1; ++i)
93 {
94 compName = baseStringBegin + i.ToString();
95 for (int j = 1; j < walls + 1; ++j)
96 m_WatchtowerIgnoreComponentNames.Insert(compName + baseIgnoreStringEnd + j.ToString());
97
98 if (i != 1)
99 m_WatchtowerBlockedComponentNames.Insert(compName);
100 else
101 m_WatchtowerIgnoreComponentNames.Insert(compName);
102 }
103 }
104
105 string configPathProjectionTypename = string.Format("CfgVehicles %1 projectionTypename", m_Parent.GetType());
106 if (g_Game.ConfigIsExisting(configPathProjectionTypename))
107 {
108 m_ProjectionTypename = g_Game.ConfigGetTextOut(configPathProjectionTypename);
109 }
110
111 EntityAI projectionEntity;
112 if (g_Game.IsMultiplayer() && g_Game.IsServer())
113 {
114 projectionEntity = EntityAI.Cast(g_Game.CreateObjectEx(ProjectionBasedOnParent(), pos, ECE_PLACE_ON_SURFACE));
115 projectionEntity.SetAllowDamage(false);
116 SetProjectionEntity(projectionEntity);
118 }
119 else
120 {
121 projectionEntity = EntityAI.Cast(g_Game.CreateObjectEx(ProjectionBasedOnParent(), pos, ECE_TRACE|ECE_LOCAL));
122 if (projectionEntity == null)
123 {
124 ErrorEx(string.Format("Cannot create hologram entity from config class %1", ProjectionBasedOnParent()), ErrorExSeverity.WARNING);
125 return;
126 }
127
128 SetProjectionEntity(projectionEntity);
132 }
133
134 if (ItemBase.Cast(projectionEntity))
135 {
136 ItemBase.Cast(GetProjectionEntity()).SetIsHologram(true);
137 }
138
139 string configPathSlope = string.Format("CfgVehicles %1 slopeTolerance", GetProjectionEntity().GetType());
140 if (g_Game.ConfigIsExisting(configPathSlope))
141 {
142 m_SlopeTolerance = g_Game.ConfigGetFloat(configPathSlope);
143 }
144
145 string configPathAlign = string.Format("CfgVehicles %1 alignHologramToTerain", GetProjectionEntity().GetType());
146 if (g_Game.ConfigIsExisting(configPathAlign))
147 {
148 m_AlignToTerrain = g_Game.ConfigGetInt(configPathAlign);
149 }
150
151 string configPathOrientationLimit = string.Format("CfgVehicles %1 yawPitchRollLimit", GetProjectionEntity().GetType());
152 if (g_Game.ConfigIsExisting(configPathOrientationLimit))
153 {
154 m_YawPitchRollLimit = g_Game.ConfigGetVector(configPathOrientationLimit);
155 }
156 }
class LogManager EntityAI
eBleedingSourceType GetType()
const int ECE_LOCAL
Определения CentralEconomy.c:24
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int ECE_TRACE
Определения CentralEconomy.c:10
DayZGame g_Game
Определения DayZGame.c:3942
class GP5GasMask extends MaskBase ItemBase
void SetProjectionEntity(EntityAI projection)
Определения Hologram.c:1327
void SetAnimations()
Определения Hologram.c:178
EntityAI m_Projection
Определения Hologram.c:22
vector m_YawPitchRollLimit
Определения Hologram.c:56
ItemBase m_Parent
Определения Hologram.c:21
void CreateTrigger()
Определения Hologram.c:375
float m_SlopeTolerance
Определения Hologram.c:54
int m_ContactComponent
Определения Hologram.c:57
ref array< string > m_WatchtowerBlockedComponentNames
Определения Hologram.c:66
string m_ProjectionTypename
Определения Hologram.c:25
vector m_Rotation
Определения Hologram.c:36
PlayerBase m_Player
Определения Hologram.c:23
void RefreshTrigger()
Определения Hologram.c:386
bool m_UpdatePosition
Определения Hologram.c:32
vector m_FromAdjusted
Определения Hologram.c:39
bool m_AlignToTerrain
Определения Hologram.c:55
ProjectionTrigger m_ProjectionTrigger
Определения Hologram.c:24
EntityAI GetProjectionEntity()
Определения Hologram.c:1332
string ProjectionBasedOnParent()
Определения Hologram.c:217
ref array< string > m_WatchtowerIgnoreComponentNames
Определения Hologram.c:63
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.

Перекрестные ссылки CreateTrigger(), ECE_LOCAL, ECE_PLACE_ON_SURFACE, ECE_TRACE, ErrorEx, g_Game, GetProjectionEntity(), GetType(), m_AlignToTerrain, m_ContactComponent, m_FromAdjusted, m_Parent, m_Player, m_Projection, m_ProjectionTrigger, m_ProjectionTypename, m_Rotation, m_SlopeTolerance, m_UpdatePosition, m_WatchtowerBlockedComponentNames, m_WatchtowerIgnoreComponentNames, m_YawPitchRollLimit, ProjectionBasedOnParent(), RefreshTrigger(), SetAnimations(), SetProjectionEntity() и string::ToString().