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

◆ AddArrow()

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

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

9603 {
9604 CachedObjectsArrays.ARRAY_STRING.Clear();
9605 GetActionComponentNameList(componentIndex, CachedObjectsArrays.ARRAY_STRING, LOD.NAME_FIRE);
9606
9607 int pivot = componentIndex;
9608 int newPivot = -1;
9609 string compName;
9610 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count() && newPivot == -1; i++)
9611 {
9612 compName = CachedObjectsArrays.ARRAY_STRING.Get(i);
9613 newPivot = GetBoneIndexByName(compName);
9614
9615 }
9616
9617 if (newPivot != -1)
9618 {
9619 pivot = newPivot;
9620
9621 }
9622
9623 vector parentTransMat[4];
9624 vector arrowTransMat[4];
9625
9626 arrow.GetTransform(arrowTransMat);
9627
9628 if (pivot == -1)
9629 {
9630 GetTransformWS(parentTransMat);
9631 }
9632 else
9633 {
9634 vector rotMatrix[3];
9635 Math3D.YawPitchRollMatrix(closeBoneRotWS * Math.RAD2DEG,rotMatrix);
9636
9637 parentTransMat[0] = rotMatrix[0];
9638 parentTransMat[1] = rotMatrix[1];
9639 parentTransMat[2] = rotMatrix[2];
9640 parentTransMat[3] = closeBonePosWS;
9641 }
9642
9643 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
9644 Math3D.MatrixOrthogonalize4(arrowTransMat);
9645 arrow.SetTransform(arrowTransMat);
9646
9647 AddChild(arrow, pivot);
9648
9649 #ifdef SERVER
9650 // creating bleeding source
9651 BleedingSourcesManagerServer bleedingManager = GetBleedingManagerServer();
9652 if (bleedingManager)
9653 {
9654 if (!bleedingManager.AttemptAddBleedingSourceBySelection(compName))
9655 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
9656 }
9657 #endif
9658 }
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
BleedingSourcesManagerServer GetBleedingManagerServer()
Определения PlayerBase.c:2773
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().