internal void CreateRotationSets(RelMove move, double progress, ref int type, ref List <string> rotCenterNameSet, ref List <Matrix> rotCenterSet, ref List <Matrix> rotationSet) { type = 6; var fullProgress = 1 - progress < 0.001; if (!String.IsNullOrEmpty(move.CenterEmpty) && (move.RotAroundCenter.x > 0 || move.RotAroundCenter.y > 0 || move.RotAroundCenter.z > 0 || move.RotAroundCenter.x < 0 || move.RotAroundCenter.y < 0 || move.RotAroundCenter.z < 0)) { rotCenterNameSet.Add(move.CenterEmpty); var xPerTick = move.RotAroundCenter.x / move.TicksToMove; var newX = fullProgress ? MathHelper.Lerp(0, move.RotAroundCenter.x / move.TicksToMove, progress) : xPerTick; var yPerTick = move.RotAroundCenter.y / move.TicksToMove; var newY = fullProgress ? MathHelper.Lerp(0, move.RotAroundCenter.y / move.TicksToMove, progress) : yPerTick; var zPerTick = move.RotAroundCenter.z / move.TicksToMove; var newZ = fullProgress ? MathHelper.Lerp(0, move.RotAroundCenter.z / move.TicksToMove, progress) : zPerTick; rotCenterSet.Add(CreateRotation(newX, newY, newZ)); type = 0; } else { rotCenterNameSet.Add(null); rotCenterSet.Add(Matrix.Zero); } if (move.Rotation.x > 0 || move.Rotation.y > 0 || move.Rotation.z > 0 || move.Rotation.x < 0 || move.Rotation.y < 0 || move.Rotation.z < 0) { var xPerTick = move.Rotation.x / move.TicksToMove; var newX = fullProgress ? MathHelper.Lerp(0, move.Rotation.x / move.TicksToMove, progress) : xPerTick; var yPerTick = move.Rotation.y / move.TicksToMove; var newY = fullProgress ? MathHelper.Lerp(0, move.Rotation.y / move.TicksToMove, progress) : yPerTick; var zPerTick = move.Rotation.z / move.TicksToMove; var newZ = fullProgress ? MathHelper.Lerp(0, move.Rotation.z / move.TicksToMove, progress) : zPerTick; rotationSet.Add(CreateRotation(newX, newY, newZ)); type = 0; } else { rotationSet.Add(Matrix.Zero); } }
public static void Initialize() { nameToRelMap = new Dictionary <string, Rel>(); relTM = new RelTM(); nameToRelMap.Add(relTM.GetName(), relTM); relMI = new RelMI(); nameToRelMap.Add(relMI.GetName(), relMI); relVirtIM = new RelVirtIM(); nameToRelMap.Add(relVirtIM.GetName(), relVirtIM); relStatIM = new RelStatIM(); nameToRelMap.Add(relStatIM.GetName(), relStatIM); relMM = new RelMM(); nameToRelMap.Add(relMM.GetName(), relMM); relMMove = new RelMMove(); nameToRelMap.Add(relMMove.GetName(), relMMove); relMAlloc = new RelMAlloc(); nameToRelMap.Add(relMAlloc.GetName(), relMAlloc); relMInstFldRead = new RelMInstFldRead(); nameToRelMap.Add(relMInstFldRead.GetName(), relMInstFldRead); relMStatFldRead = new RelMStatFldRead(); nameToRelMap.Add(relMStatFldRead.GetName(), relMStatFldRead); relMInstFldWrite = new RelMInstFldWrite(); nameToRelMap.Add(relMInstFldWrite.GetName(), relMInstFldWrite); relMStatFldWrite = new RelMStatFldWrite(); nameToRelMap.Add(relMStatFldWrite.GetName(), relMStatFldWrite); relHT = new RelHT(); nameToRelMap.Add(relHT.GetName(), relHT); relIinvkArg0 = new RelIinvkArg0(); nameToRelMap.Add(relIinvkArg0.GetName(), relIinvkArg0); relIinvkArg = new RelIinvkArg(); nameToRelMap.Add(relIinvkArg.GetName(), relIinvkArg); relIinvkRet = new RelIinvkRet(); nameToRelMap.Add(relIinvkRet.GetName(), relIinvkRet); relMmethArg = new RelMmethArg(); nameToRelMap.Add(relMmethArg.GetName(), relMmethArg); relMmethRet = new RelMmethRet(); nameToRelMap.Add(relMmethRet.GetName(), relMmethRet); relClassT = new RelClassT(); nameToRelMap.Add(relClassT.GetName(), relClassT); relSub = new RelSub(); nameToRelMap.Add(relSub.GetName(), relSub); relEntryPtM = new RelEntryPtM(); nameToRelMap.Add(relEntryPtM.GetName(), relEntryPtM); relCha = new RelCha(); nameToRelMap.Add(relCha.GetName(), relCha); relStaticTM = new RelStaticTM(); nameToRelMap.Add(relStaticTM.GetName(), relStaticTM); relStaticTF = new RelStaticTF(); nameToRelMap.Add(relStaticTF.GetName(), relStaticTF); relClinitTM = new RelClinitTM(); nameToRelMap.Add(relClinitTM.GetName(), relClinitTM); relVT = new RelVT(); nameToRelMap.Add(relVT.GetName(), relVT); relReachableT = new RelReachableT(); nameToRelMap.Add(relReachableT.GetName(), relReachableT); relReachableI = new RelReachableI(); nameToRelMap.Add(relReachableI.GetName(), relReachableI); relReachableM = new RelReachableM(); nameToRelMap.Add(relReachableM.GetName(), relReachableM); relRootM = new RelRootM(); nameToRelMap.Add(relRootM.GetName(), relRootM); relVH = new RelVH(); nameToRelMap.Add(relVH.GetName(), relVH); relFH = new RelFH(); nameToRelMap.Add(relFH.GetName(), relFH); relHFH = new RelHFH(); nameToRelMap.Add(relHFH.GetName(), relHFH); relIM = new RelIM(); nameToRelMap.Add(relIM.GetName(), relIM); relVX = new RelVX(); nameToRelMap.Add(relVX.GetName(), relVX); relFX = new RelFX(); nameToRelMap.Add(relFX.GetName(), relFX); relHFX = new RelHFX(); nameToRelMap.Add(relHFX.GetName(), relHFX); relAddrOfVX = new RelAddrOfVX(); nameToRelMap.Add(relAddrOfVX.GetName(), relAddrOfVX); relAddrOfFX = new RelAddrOfFX(); nameToRelMap.Add(relAddrOfFX.GetName(), relAddrOfFX); relAddrOfHFX = new RelAddrOfHFX(); nameToRelMap.Add(relAddrOfHFX.GetName(), relAddrOfHFX); relAddrOfMX = new RelAddrOfMX(); nameToRelMap.Add(relAddrOfMX.GetName(), relAddrOfMX); relMAddrTakenLocal = new RelMAddrTakenLocal(); nameToRelMap.Add(relMAddrTakenLocal.GetName(), relMAddrTakenLocal); relMAddrTakenFunc = new RelMAddrTakenFunc(); nameToRelMap.Add(relMAddrTakenFunc.GetName(), relMAddrTakenFunc); relMAddrTakenInstFld = new RelMAddrTakenInstFld(); nameToRelMap.Add(relMAddrTakenInstFld.GetName(), relMAddrTakenInstFld); relMAddrTakenStatFld = new RelMAddrTakenStatFld(); nameToRelMap.Add(relMAddrTakenStatFld.GetName(), relMAddrTakenStatFld); relMDerefRight = new RelMDerefRight(); nameToRelMap.Add(relMDerefRight.GetName(), relMDerefRight); relMDerefLeft = new RelMDerefLeft(); nameToRelMap.Add(relMDerefLeft.GetName(), relMDerefLeft); relDelegateIV = new RelDelegateIV(); nameToRelMap.Add(relDelegateIV.GetName(), relDelegateIV); relStructV = new RelStructV(); nameToRelMap.Add(relStructV.GetName(), relStructV); relStructH = new RelStructH(); nameToRelMap.Add(relStructH.GetName(), relStructH); relStrMove = new RelStrMove(); nameToRelMap.Add(relStrMove.GetName(), relStrMove); relMove = new RelMove(); nameToRelMap.Add(relMove.GetName(), relMove); relVHfilter = new RelVHfilter(); nameToRelMap.Add(relVHfilter.GetName(), relVHfilter); relVarEH = new RelVarEH(); nameToRelMap.Add(relVarEH.GetName(), relVarEH); relThrowPV = new RelThrowPV(); nameToRelMap.Add(relThrowPV.GetName(), relThrowPV); relInRange = new RelInRange(); nameToRelMap.Add(relInRange.GetName(), relInRange); relPrevEH = new RelPrevEH(); nameToRelMap.Add(relPrevEH.GetName(), relPrevEH); relTypeEH = new RelTypeEH(); nameToRelMap.Add(relTypeEH.GetName(), relTypeEH); relFinalEH = new RelFinalEH(); nameToRelMap.Add(relFinalEH.GetName(), relFinalEH); relPI = new RelPI(); nameToRelMap.Add(relPI.GetName(), relPI); relCallAt = new RelCallAt(); nameToRelMap.Add(relCallAt.GetName(), relCallAt); relMEH = new RelMEH(); nameToRelMap.Add(relMEH.GetName(), relMEH); relExceptionType = new RelExceptionType(); nameToRelMap.Add(relExceptionType.GetName(), relExceptionType); relEscapeMTP = new RelEscapeMTP(); nameToRelMap.Add(relEscapeMTP.GetName(), relEscapeMTP); relFinalMTP = new RelFinalMTP(); nameToRelMap.Add(relFinalMTP.GetName(), relFinalMTP); relMStructHFH = new RelMStructHFH(); nameToRelMap.Add(relMStructHFH.GetName(), relMStructHFH); relStructRefV = new RelStructRefV(); nameToRelMap.Add(relStructRefV.GetName(), relStructRefV); relThisIVH = new RelThisIVH(); nameToRelMap.Add(relThisIVH.GetName(), relThisIVH); relThisRefV = new RelThisRefV(); nameToRelMap.Add(relThisRefV.GetName(), relThisRefV); relTStructFH = new RelTStructFH(); nameToRelMap.Add(relTStructFH.GetName(), relTStructFH); relStructHFH = new RelStructHFH(); nameToRelMap.Add(relStructHFH.GetName(), relStructHFH); relMV = new RelMV(); nameToRelMap.Add(relMV.GetName(), relMV); relFT = new RelFT(); nameToRelMap.Add(relFT.GetName(), relFT); }