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

◆ DropAllItemsInInventoryInBounds()

static void DropAllItemsInInventoryInBounds ( ItemBase ib,
vector halfExtents )
staticprotected

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

1095 {
1096 if (!g_Game.IsServer())
1097 return;
1098 array<EntityAI> items = new array<EntityAI>;
1099 GameInventory ibInventory = ib.GetInventory();
1100 ibInventory.EnumerateInventory(InventoryTraversalType.LEVELORDER, items);
1101
1102 vector direction = ib.GetDirection();
1103 float dot = vector.Dot(direction, vector.Forward);
1104
1105 float angle = Math.Acos(dot);
1106 if (direction[0] < 0)
1107 angle = -angle;
1108
1109 float cos = Math.Cos(angle);
1110 float sin = Math.Sin(angle);
1111
1112 EntityAI item;
1113 int count = items.Count();
1114 for ( int i = 0; i < count; ++i )
1115 {
1116 item = items.Get(i);
1117 if ( item )
1118 ibInventory.DropEntityInBounds(InventoryMode.SERVER, ib, item, halfExtents, angle, cos, sin);
1119 }
1120 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:3942
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
bool DropEntityInBounds(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
script counterpart to engine's class Inventory
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:284
static const vector Forward
Определения EnConvert.c:122
Определения EnConvert.c:119
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Определения gameplay.c:6
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.

Перекрестные ссылки Math::Acos(), Math::Cos(), vector::Dot(), GameInventory::DropEntityInBounds(), GameInventory::EnumerateInventory(), vector::Forward, g_Game и Math::Sin().