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

◆ AttachOnMemoryPoint()

void EntityLightSource::AttachOnMemoryPoint ( Object parent,
string memory_point_start,
string memory_point_target = "" )
inlineprivate

Attaches this light on the parent entity's memory point, with optional direction target memory point.

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

166 {
167 if (parent.MemoryPointExists(memory_point_start))
168 {
169 m_LocalPos = parent.GetMemoryPointPos(memory_point_start);
170 vector local_ori;
171
172 if (memory_point_target != "" )
173 {
174 if (parent.MemoryPointExists(memory_point_target))
175 {
176 vector target_pos = parent.GetSelectionPositionLS(memory_point_target);
177 target_pos = vector.Direction(m_LocalPos, target_pos);
178 local_ori = target_pos.VectorToAngles();
179 }
180 else
181 {
182 ErrorEx("memory point 'memory_point_target' not found when attaching light");
183 }
184 }
185 AttachOnObject(parent, m_LocalPos, local_ori);
186 UpdateMode();
187 }
188 else
189 {
190 ErrorEx("memory point 'memory_point_start' not found when attaching light");
191 }
192 }
vector m_LocalPos
Определения ScriptedLightBase.c:37
void AttachOnObject(Object parent, vector local_pos=vector.Zero, vector local_ori=vector.Zero)
Attaches this light on the parent entity, with optional position and orientation offset.
Определения ScriptedLightBase.c:127
void UpdateMode()
Определения ScriptedLightBase.c:83
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Определения EnConvert.c:254
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
enum ShapeType ErrorEx

Перекрестные ссылки AttachOnObject(), vector::Direction(), ErrorEx, m_LocalPos, UpdateMode() и vector::VectorToAngles().