public bool setFrameInfo(CFrameInfo _Info, Transform _transFrame) { if (Object.op_Equality((Object)null, (Object)_transFrame)) { return(false); } _Info.transFrame = _transFrame; _Info.transParent = _transFrame.get_parent(); return(true); }
private bool CalcBlendMatrixT( FakeTransform _ftransBlend, CBoneData _Bone, bool _bWorld, CSwayParamDetail _Detail) { CFrameInfo cframeInfo1 = _Bone.listLocater[(int)_Bone.anLocaterTIdx[0]]; CFrameInfo cframeInfo2 = _Bone.listLocater[(int)_Bone.anLocaterTIdx[1]]; FakeTransform target = new FakeTransform(); FakeTransform fakeTransform1 = new FakeTransform(); FakeTransform fakeTransform2 = new FakeTransform(); target.Pos = cframeInfo1.transFrame.get_localPosition(); target.Rot = cframeInfo1.transFrame.get_localRotation(); target.Scale = cframeInfo1.transFrame.get_localScale(); fakeTransform1.Pos = cframeInfo2.transFrame.get_localPosition(); fakeTransform1.Rot = cframeInfo2.transFrame.get_localRotation(); fakeTransform1.Scale = cframeInfo2.transFrame.get_localScale(); if (this.m_bLR) { ((Vector3) ref fakeTransform2.Pos).Set((float)-_Detail.vAddT.x, (float)_Detail.vAddT.y, (float)_Detail.vAddT.z); } else { ((Vector3) ref fakeTransform2.Pos).Set((float)_Detail.vAddT.x, (float)_Detail.vAddT.y, (float)_Detail.vAddT.z); } FakeTransform fakeTransform3 = target; fakeTransform3.Pos = Vector3.op_Addition(fakeTransform3.Pos, fakeTransform2.Pos); FakeTransform fakeTransform4 = fakeTransform1; fakeTransform4.Pos = Vector3.op_Addition(fakeTransform4.Pos, fakeTransform2.Pos); if (_bWorld) { target.Pos = cframeInfo1.transParent.TransformPoint(target.Pos); target.Rot = cframeInfo1.transFrame.get_rotation(); fakeTransform1.Pos = cframeInfo2.transParent.TransformPoint(fakeTransform1.Pos); fakeTransform1.Rot = cframeInfo2.transFrame.get_rotation(); } if ((int)_Bone.anLocaterTIdx[0] == (int)_Bone.anLocaterTIdx[1]) { _ftransBlend = (FakeTransform)target.DeepCopy(); return(true); } _ftransBlend.Pos = Vector3.Lerp(target.Pos, fakeTransform1.Pos, _Bone.fLerp); _ftransBlend.Rot = Quaternion.Slerp(target.Rot, fakeTransform1.Rot, _Bone.fLerp); _ftransBlend.Scale = Vector3.Lerp(target.Scale, fakeTransform1.Scale, _Bone.fLerp); return(true); }
private bool CalcBlendMatrixR( FakeTransform _ftransBlend, CBoneData _Bone, bool _bWorld, CSwayParamDetail _Detail, bool _bAddRot, bool _bRot) { CFrameInfo cframeInfo1 = _Bone.listLocater[(int)_Bone.anLocaterRIdx[0]]; CFrameInfo cframeInfo2 = _Bone.listLocater[(int)_Bone.anLocaterRIdx[1]]; CFrameInfo reference = _Bone.Reference; FakeTransform fakeTransform1 = new FakeTransform(); FakeTransform fakeTransform2 = new FakeTransform(); FakeTransform fakeTransform3 = new FakeTransform(); FakeTransform fakeTransform4 = new FakeTransform(); fakeTransform1.Pos = cframeInfo1.transFrame.get_localPosition(); fakeTransform1.Rot = cframeInfo1.transFrame.get_localRotation(); fakeTransform1.Scale = cframeInfo1.transFrame.get_localScale(); fakeTransform2.Pos = cframeInfo2.transFrame.get_localPosition(); fakeTransform2.Rot = cframeInfo2.transFrame.get_localRotation(); fakeTransform2.Scale = cframeInfo2.transFrame.get_localScale(); if (this.m_bLR) { ((Vector3) ref fakeTransform3.Pos).Set((float)-_Detail.vAddT.x, (float)_Detail.vAddT.y, (float)_Detail.vAddT.z); } else { ((Vector3) ref fakeTransform3.Pos).Set((float)_Detail.vAddT.x, (float)_Detail.vAddT.y, (float)_Detail.vAddT.z); } FakeTransform fakeTransform5 = fakeTransform1; fakeTransform5.Pos = Vector3.op_Addition(fakeTransform5.Pos, fakeTransform3.Pos); FakeTransform fakeTransform6 = fakeTransform2; fakeTransform6.Pos = Vector3.op_Addition(fakeTransform6.Pos, fakeTransform3.Pos); if (_bWorld) { fakeTransform1.Pos = cframeInfo1.transParent.TransformPoint(fakeTransform1.Pos); fakeTransform1.Rot = cframeInfo1.transFrame.get_rotation(); fakeTransform2.Pos = cframeInfo2.transParent.TransformPoint(fakeTransform2.Pos); fakeTransform2.Rot = cframeInfo2.transFrame.get_rotation(); } if ((int)_Bone.anLocaterRIdx[0] == (int)_Bone.anLocaterRIdx[1]) { fakeTransform4.Rot = _bAddRot ? (!this.m_bLR ? Quaternion.Euler((float)_Detail.vAddR.x, (float)_Detail.vAddR.y, (float)_Detail.vAddR.z) : Quaternion.Euler((float)_Detail.vAddR.x, (float)-_Detail.vAddR.y, (float)_Detail.vAddR.z)) : Quaternion.get_identity(); FakeTransform fakeTransform7 = fakeTransform4; fakeTransform7.Rot = Quaternion.op_Multiply(fakeTransform7.Rot, fakeTransform1.Rot); fakeTransform4.Pos = fakeTransform1.Pos; fakeTransform4.Scale = fakeTransform1.Scale; if (!_bRot || Object.op_Equality((Object)reference.transFrame, (Object)null)) { _ftransBlend = (FakeTransform)fakeTransform4.DeepCopy(); } else { this.CalcAutoRotation(_ftransBlend, fakeTransform4, reference.transFrame, _Detail); } return(true); } _ftransBlend.Pos = Vector3.Lerp(fakeTransform1.Pos, fakeTransform2.Pos, _Bone.fLerp); _ftransBlend.Rot = Quaternion.Slerp(fakeTransform1.Rot, fakeTransform2.Rot, _Bone.fLerp); _ftransBlend.Scale = Vector3.Lerp(fakeTransform1.Scale, fakeTransform2.Scale, _Bone.fLerp); fakeTransform4.Rot = _bAddRot ? (!this.m_bLR ? Quaternion.Euler((float)_Detail.vAddR.x, (float)_Detail.vAddR.y, (float)_Detail.vAddR.z) : Quaternion.Euler((float)_Detail.vAddR.x, (float)-_Detail.vAddR.y, (float)_Detail.vAddR.z)) : Quaternion.get_identity(); FakeTransform fakeTransform8 = _ftransBlend; fakeTransform8.Rot = Quaternion.op_Multiply(fakeTransform8.Rot, fakeTransform4.Rot); if (_bRot && Object.op_Inequality((Object)reference.transFrame, (Object)null)) { this.CalcAutoRotation(_ftransBlend, _ftransBlend, reference.transFrame, _Detail); } return(true); }