DayZ 1.28
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 vector randomPos;
1128 vector minmax[2];
1129 parent.GetCollisionBox(minmax);
1130
1131 Math3D.YawPitchRollMatrix( orientation, rotation_matrix );
1132 Math3D.MatrixToQuat( rotation_matrix, direction );
1133
1134 //gather entities first
1136 int count, i;
1137 //atts
1138 count = parent.GetInventory().AttachmentCount();
1139 for (i = 0; i < count; ++i)
1140 {
1141 ents.Insert(parent.GetInventory().GetAttachmentFromIndex(i));
1142 }
1143
1144 //cargo
1145 count = parent.GetInventory().GetCargo().GetItemCount();
1146 for (i = 0; i < count; ++i)
1147 {
1148 ents.Insert(parent.GetInventory().GetCargo().GetItem(i));
1149 }
1150
1151 //now throw them all
1152 foreach (EntityAI ent : ents)
1153 {
1154 randomPos = Vector(position[0] + Math.RandomFloat(minmax[0][0], minmax[1][0]),
1155 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
1156 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
1157 ThrowEntityFromInventory(ent, randomPos, direction, -GetVelocity(parent), ThrowEntityFlags.NONE);
1158 }
1159 }
ThrowEntityFlags
Определения MiscGameplayFunctions.c:208
static void ThrowEntityFromInventory(notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
Определения MiscGameplayFunctions.c:1161
Определения EnMath3D.c:28
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения 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().