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

◆ AddArrow()

override void ManBase::AddArrow ( Object arrow,
int componentIndex,
vector closeBonePosWS,
vector closeBoneRotWS )
inlineprotected

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

9353 {
9354 CachedObjectsArrays.ARRAY_STRING.Clear();
9355 GetActionComponentNameList(componentIndex, CachedObjectsArrays.ARRAY_STRING, LOD.NAME_FIRE);
9356
9357 int pivot = componentIndex;
9358 int newPivot = -1;
9359 string compName;
9360 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count() && newPivot == -1; i++)
9361 {
9362 compName = CachedObjectsArrays.ARRAY_STRING.Get(i);
9363 newPivot = GetBoneIndexByName(compName);
9364
9365 }
9366
9367 if (newPivot != -1)
9368 {
9369 pivot = newPivot;
9370
9371 }
9372
9373 vector parentTransMat[4];
9374 vector arrowTransMat[4];
9375
9376 arrow.GetTransform(arrowTransMat);
9377
9378 if (pivot == -1)
9379 {
9380 GetTransformWS(parentTransMat);
9381 }
9382 else
9383 {
9384 vector rotMatrix[3];
9385 Math3D.YawPitchRollMatrix(closeBoneRotWS * Math.RAD2DEG,rotMatrix);
9386
9387 parentTransMat[0] = rotMatrix[0];
9388 parentTransMat[1] = rotMatrix[1];
9389 parentTransMat[2] = rotMatrix[2];
9390 parentTransMat[3] = closeBonePosWS;
9391 }
9392
9393 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
9394 Math3D.MatrixOrthogonalize4(arrowTransMat);
9395 arrow.SetTransform(arrowTransMat);
9396
9397 AddChild(arrow, pivot);
9398
9399 #ifdef SERVER
9400 // creating bleeding source
9401 BleedingSourcesManagerServer bleedingManager = GetBleedingManagerServer();
9402 if (bleedingManager)
9403 {
9404 if (!bleedingManager.AttemptAddBleedingSourceBySelection(compName))
9405 bleedingManager.AttemptAddBleedingSourceBySelection("Pelvis");//fallback, if we can't attach bleeding source to the fallback location because there already is another one, it's fine, we are just trying make sure there is at least one
9406 }
9407 #endif
9408 }
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
BleedingSourcesManagerServer GetBleedingManagerServer()
Определения PlayerBase.c:2653
proto string Get(int index)
Gets n-th character from string.
proto native void AddChild(Widget child, bool immedUpdate=true)

Перекрестные ссылки AddChild(), CachedObjectsArrays::ARRAY_STRING, GetBleedingManagerServer(), GetBoneIndexByName(), Math3D::MatrixInvMultiply4(), Math3D::MatrixOrthogonalize4(), LOD::NAME_FIRE, Math::RAD2DEG и Math3D::YawPitchRollMatrix().