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

◆ ThrowAllItemsInInventory()

static void ThrowAllItemsInInventory ( notnull EntityAI parent,
int flags )
staticprotected

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

1122 {
1123 vector position = parent.GetPosition();
1124 vector orientation = parent.GetOrientation();
1125 vector rotation_matrix[3];
1126 float direction[4];
1127
1128 vector minmax[2];
1129 parent.GetCollisionBox(minmax);
1130
1131 Math3D.YawPitchRollMatrix( orientation, rotation_matrix );
1132 Math3D.MatrixToQuat( rotation_matrix, direction );
1133
1134 vector randomPos;
1135 for ( int i = 0; i < parent.GetInventory().AttachmentCount(); ++i )
1136 {
1137 randomPos = Vector(position[0] + Math.RandomFloat(minmax[0][0], minmax[1][0]),
1138 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
1139 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
1140
1141 ThrowEntityFromInventory(parent.GetInventory().GetAttachmentFromIndex( i ), randomPos, direction, -GetVelocity(parent), ThrowEntityFlags.NONE);
1142 }
1143
1144 for ( int j = 0; j < parent.GetInventory().GetCargo().GetItemCount(); ++j )
1145 {
1146 randomPos = Vector(position[0] + Math.RandomFloat(minmax[0][0], minmax[1][0]),
1147 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
1148 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
1149
1150 ThrowEntityFromInventory(parent.GetInventory().GetCargo().GetItem( j ), randomPos, direction, -GetVelocity(parent), ThrowEntityFlags.NONE);
1151 }
1152 }
ThrowEntityFlags
Определения MiscGameplayFunctions.c:208
static void ThrowEntityFromInventory(notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
Определения MiscGameplayFunctions.c:1154
Определения EnMath3D.c:28
Определения EnMath.c:7
Определения EnConvert.c:106
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки GetVelocity(), Math3D::MatrixToQuat(), Math::RandomFloat(), ThrowEntityFromInventory(), Vector() и Math3D::YawPitchRollMatrix().