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

◆ DropAllItemsInInventoryInBounds()

static void DropAllItemsInInventoryInBounds ( ItemBase ib,
vector halfExtents )
staticprotected

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

1217 {
1218 if (!g_Game.IsServer())
1219 return;
1220 array<EntityAI> items = new array<EntityAI>;
1221 GameInventory ibInventory = ib.GetInventory();
1222 ibInventory.EnumerateInventory(InventoryTraversalType.LEVELORDER, items);
1223
1224 vector direction = ib.GetDirection();
1225 float dot = vector.Dot(direction, vector.Forward);
1226
1227 float angle = Math.Acos(dot);
1228 if (direction[0] < 0)
1229 angle = -angle;
1230
1231 float cos = Math.Cos(angle);
1232 float sin = Math.Sin(angle);
1233
1234 EntityAI item;
1235 int count = items.Count();
1236 for ( int i = 0; i < count; ++i )
1237 {
1238 item = items.Get(i);
1239 if ( item )
1240 ibInventory.DropEntityInBounds(InventoryMode.SERVER, ib, item, halfExtents, angle, cos, sin);
1241 }
1242 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:4074
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:305
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().