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

◆ AddArrow()

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

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

9956 {
9957 CachedObjectsArrays.ARRAY_STRING.Clear();
9958 GetActionComponentNameList(componentIndex, CachedObjectsArrays.ARRAY_STRING, LOD.NAME_FIRE);
9959
9960 int pivot = componentIndex;
9961 int newPivot = -1;
9962 string compName;
9963 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count() && newPivot == -1; i++)
9964 {
9965 compName = CachedObjectsArrays.ARRAY_STRING.Get(i);
9966 newPivot = GetBoneIndexByName(compName);
9967
9968 }
9969
9970 if (newPivot != -1)
9971 {
9972 pivot = newPivot;
9973
9974 }
9975
9976 vector parentTransMat[4];
9977 vector arrowTransMat[4];
9978
9979 arrow.GetTransform(arrowTransMat);
9980
9981 if (pivot == -1)
9982 {
9983 GetTransformWS(parentTransMat);
9984 }
9985 else
9986 {
9987 vector rotMatrix[3];
9988 Math3D.YawPitchRollMatrix(closeBoneRotWS * Math.RAD2DEG,rotMatrix);
9989
9990 parentTransMat[0] = rotMatrix[0];
9991 parentTransMat[1] = rotMatrix[1];
9992 parentTransMat[2] = rotMatrix[2];
9993 parentTransMat[3] = closeBonePosWS;
9994 }
9995
9996 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
9997 Math3D.MatrixOrthogonalize4(arrowTransMat);
9998 arrow.SetTransform(arrowTransMat);
9999
10000 AddChild(arrow, pivot);
10001
10002 #ifdef SERVER
10003 // creating bleeding source
10004 BleedingSourcesManagerServer bleedingManager = GetBleedingManagerServer();
10005 if (bleedingManager)
10006 {
10007 if (!bleedingManager.AttemptAddBleedingSourceBySelection(compName))
10008 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
10009 }
10010 #endif
10011 }
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
BleedingSourcesManagerServer GetBleedingManagerServer()
Определения PlayerBase.c:2973
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().