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

◆ SpawnStorageBox()

EntityAI SpawnStorageBox ( )
private

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

306 {
307 if (!MemoryPointExists(CRATE_SPAWN_POSITION_MEM_NAME))
308 return null;
309
310 vector positionModel = GetMemoryPointPos(CRATE_SPAWN_POSITION_MEM_NAME);
311 vector positionWorld = ModelToWorld(positionModel);
312
314 if (storageBox)
315 {
316 vector directionModel = GetMemoryPointPos("storagecratedir");
317 vector directionWorld = ModelToWorld(directionModel);
318
319 vector forward = vector.Direction(positionWorld, directionWorld); // normalized vector
320
321 float yaw = Math.Atan2(forward[0], forward[2]) * Math.RAD2DEG;
322 vector orientation = Vector(yaw, 0.0, 0.0);
323
324 storageBox.SetOrientation(orientation);
325 }
326
327 return storageBox;
328 }
const string STORAGE_BOX_CLASSNAME
Определения Bunker.c:176
const string CRATE_SPAWN_POSITION_MEM_NAME
Определения Bunker.c:175
const int ECE_EQUIP_CARGO
Определения CentralEconomy.c:22
const int ECE_UPDATEPATHGRAPH
Определения CentralEconomy.c:13
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:28
const int ECE_CREATEPHYSICS
Определения CentralEconomy.c:17
DayZGame g_Game
Определения DayZGame.c:4074
vector orientation
Определения DustKickupEffects.c:21
Определения EnMath.c:7
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Определения EnConvert.c:254
Определения EnConvert.c:119
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static const float RAD2DEG
Определения EnMath.c:16

Перекрестные ссылки Math::Atan2(), CRATE_SPAWN_POSITION_MEM_NAME, vector::Direction(), ECE_CREATEPHYSICS, ECE_EQUIP_CARGO, ECE_KEEPHEIGHT, ECE_UPDATEPATHGRAPH, g_Game, orientation, Math::RAD2DEG, STORAGE_BOX_CLASSNAME и Vector().

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