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

◆ DropAllItemsInInventoryInBounds()

static void DropAllItemsInInventoryInBounds ( ItemBase ib,
vector halfExtents )
staticprotected

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

1095 {
1096 if (!GetGame().IsServer())
1097 return;
1098 array<EntityAI> items = new array<EntityAI>;
1099 ib.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, items);
1100
1101 vector direction = ib.GetDirection();
1102 float dot = vector.Dot(direction, vector.Forward);
1103
1104 float angle = Math.Acos(dot);
1105 if (direction[0] < 0)
1106 angle = -angle;
1107
1108 float cos = Math.Cos(angle);
1109 float sin = Math.Sin(angle);
1110
1111 EntityAI item;
1112 int count = items.Count();
1113 for ( int i = 0; i < count; ++i )
1114 {
1115 item = items.Get(i);
1116 if ( item )
1117 ib.GetInventory().DropEntityInBounds(InventoryMode.SERVER, ib, item, halfExtents, angle, cos, sin);
1118 }
1119 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
Определения Building.c:6
Определения 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:271
static const vector Forward
Определения EnConvert.c:109
Определения EnConvert.c:106
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Определения gameplay.c:6
proto native CGame GetGame()
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(), vector::Forward, GetGame() и Math::Sin().