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

◆ SpawnItemOnCrosshair()

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

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

462 {
463 vector from, to, dir;
464 GetCameraDirections(player, true, from, dir);
465 to = from + (dir * maxDist);
466
467 float hitFraction;
468 vector start, end;
469 vector direction;
470
471 vector hitPos, hitNormal;
472 Object obj;
473
475 DayZPhysics.RayCastBullet(from, to, hitMask, player, obj, hitPos, hitNormal, hitFraction);
476
477 // something is hit
478 if (hitPos != vector.Zero)
479 {
480 SpawnEntityOnGroundPos(player, itemName, health, quantity, hitPos, special, withPhysics);
481 }
482 }
PhxInteractionLayers
Определения DayZPhysics.c:2
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string object_name, vector pos)
Определения PluginDeveloper.c:429
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
Определения PluginDeveloper.c:410
class LOD Object

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

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