public void UpdateLowHz(NewDummyPolyManager manager) { var curBladePos = GetCurrentBladePos(manager); curBladePos.Opacity = Opacity; if (Keyframes.Count > 0) { //var posLowHzToLive = (CurrentPosLive.End - CurrentPos.End); //var rotLowHzToLive = Matrix.CreateFromQuaternion(XnaExtensions.GetQuatOfBladePosDelta(CurrentPos, CurrentPosLive)); //var sampledFrames = GetPosFrames(rotLowHzToLive, posLowHzToLive, addTheShit: false); PushCurrentFrame(); //BakeKeyframesToLiveMod(sampledFrames); CurrentPos = curBladePos; } else { CurrentPos = curBladePos; PushCurrentFrame(); } }
public void UpdateLive(NewDummyPolyManager manager) { IsAlive = CheckIfAliveFunc?.Invoke() ?? true; var curBladePos = GetCurrentBladePos(manager); curBladePos.Opacity = Opacity; CurrentPosLive = curBladePos; }
private Model() { DummyPolyMan = new NewDummyPolyManager(this); DbgPrimDrawer = new DBG.DbgPrimDrawer(this); for (int i = 0; i < DRAW_MASK_LENGTH; i++) { DefaultDrawMask[i] = DrawMask[i] = true; } }
public DummyPolyBladePos GetCurrentBladePos(NewDummyPolyManager manager) { var dmyPoly1 = StartDummyPolyID; var dmyPoly2 = EndDummyPolyID; DummyPolyBladePos GetPosFatcat(NewDummyPolyManager dpm, Matrix modelMatrix) { var pos1 = Vector3.Transform(Vector3.Zero, dpm.DummyPolyByRefID[dmyPoly1][0].CurrentMatrix * modelMatrix); var pos2 = Vector3.Transform(Vector3.Zero, dpm.DummyPolyByRefID[dmyPoly2][0].CurrentMatrix * modelMatrix); // Get REAL pos1 var bladeLength = (pos1 - pos2).Length(); var pos2ExtendedOutward = Vector3.Transform(Vector3.Forward, dpm.DummyPolyByRefID[dmyPoly2][0].CurrentMatrix * modelMatrix); var actualDirection = Vector3.Normalize(pos2ExtendedOutward - pos2); pos1 = pos2 + (actualDirection * bladeLength); return(new DummyPolyBladePos() { Start = pos1, End = pos2, Opacity = Opacity, }); } //if (DmyPolySource == ParamData.AtkParam.DummyPolySource.Body) //{ // return GetPosFatcat(manager, manager.MODEL.CurrentTransform.WorldMatrix); //} //else if (DmyPolySource == ParamData.AtkParam.DummyPolySource.RightWeapon && // manager.MODEL.ChrAsm != null && // manager.MODEL.ChrAsm.RightWeaponModel != null) //{ // return GetPosFatcat(manager.MODEL.ChrAsm.RightWeaponModel.DummyPolyMan, manager.MODEL.ChrAsm.RightWeaponModel.CurrentTransform.WorldMatrix); //} //else if (DmyPolySource == ParamData.AtkParam.DummyPolySource.LeftWeapon && // manager.MODEL.ChrAsm != null && // manager.MODEL.ChrAsm.LeftWeaponModel != null) //{ // return GetPosFatcat(manager.MODEL.ChrAsm.LeftWeaponModel.DummyPolyMan, manager.MODEL.ChrAsm.LeftWeaponModel.CurrentTransform.WorldMatrix); //} //else //{ // return new DummyPolyBladePos(); //} return(new DummyPolyBladePos()); }