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

◆ SpawnItemOnCrosshair()

void PluginBase::SpawnItemOnCrosshair ( notnull PlayerBase player,
string itemName,
float health,
float quantity,
float maxDist = 100,
bool allowFreeflight = false,
bool special = false,
bool withPhysics = false )
inlineprotected

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

390 {
391 vector from, to;
392 if (allowFreeflight && FreeDebugCamera.GetInstance().IsActive())
393 {
394 from = FreeDebugCamera.GetInstance().GetPosition();
395 to = from + FreeDebugCamera.GetInstance().GetDirection() * maxDist;
396 }
397 else
398 {
400 to = from + GetGame().GetCurrentCameraDirection() * maxDist;
401 }
402
403 float hitFraction;
404 vector start, end;
405 vector direction;
406
407 vector hitPos, hitNormal;
408 Object obj;
409
411 DayZPhysics.RayCastBullet(from, to, hitMask, player, obj, hitPos, hitNormal, hitFraction);
412
413 // something is hit
414 if (hitPos != vector.Zero)
415 {
416 SpawnEntityOnGroundPos(player, itemName, health, quantity, hitPos, special, withPhysics);
417 }
418 }
PhxInteractionLayers
Определения DayZPhysics.c:2
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string item_name, float health, float quantity, vector pos, bool special=false, bool withPhysics=false)
spawns entity on exact position
Определения PluginDeveloper.c:428
class LOD Object
proto native CGame GetGame()

Перекрестные ссылки CGame::GetCurrentCameraDirection(), CGame::GetCurrentCameraPosition(), GetGame(), DayZPhysics::RayCastBullet(), SpawnEntityOnGroundPos() и vector::Zero.

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