Пример #1
0
    public override void UpdateAlways()
    {
        if (!this.InitEnd || this.dictSrc.Count == 0)
        {
            return;
        }
        ShapeInfoBase.BoneInfo boneInfo = (ShapeInfoBase.BoneInfo)null;
        if ((this.updateMask & 1) != 0)
        {
            int num1 = 0;
            int num2 = 14;
            for (int key = num1; key <= num2; ++key)
            {
                if (this.dictDst.TryGetValue(key, out boneInfo))
                {
                    boneInfo.trfBone.SetLocalRotation((float)this.dictSrc[key].vctRot.x, (float)this.dictSrc[key].vctRot.y, (float)this.dictSrc[key].vctRot.z);
                }
            }
        }
        if ((this.updateMask & 2) == 0)
        {
            return;
        }
        int num3 = 15;
        int num4 = 29;

        for (int key = num3; key <= num4; ++key)
        {
            if (this.dictDst.TryGetValue(key, out boneInfo))
            {
                boneInfo.trfBone.SetLocalRotation((float)this.dictSrc[key].vctRot.x, (float)this.dictSrc[key].vctRot.y, (float)this.dictSrc[key].vctRot.z);
            }
        }
    }
Пример #2
0
 private void GetSrcBoneInfo()
 {
     this.dictSrc.Clear();
     foreach (KeyValuePair <int, List <ShapeInfoBase.CategoryInfo> > keyValuePair in this.dictCategory)
     {
         int count = keyValuePair.Value.Count;
         for (int index = 0; index < count; ++index)
         {
             ShapeInfoBase.BoneInfo boneInfo1 = (ShapeInfoBase.BoneInfo)null;
             if (!this.dictSrc.TryGetValue(keyValuePair.Value[index].id, out boneInfo1))
             {
                 ShapeInfoBase.BoneInfo boneInfo2 = new ShapeInfoBase.BoneInfo();
                 this.dictSrc[keyValuePair.Value[index].id] = boneInfo2;
             }
         }
     }
 }
Пример #3
0
    public bool ChangeValue(int category, int key01, int key02, float blend)
    {
        List <ShapeInfoBase.CategoryInfo> categoryInfoList;

        if (this.anmKeyInfo == null || !this.dictCategory.TryGetValue(category, out categoryInfoList))
        {
            return(false);
        }
        int    count = categoryInfoList.Count;
        string empty = string.Empty;

        for (int index1 = 0; index1 < count; ++index1)
        {
            ShapeInfoBase.BoneInfo boneInfo = (ShapeInfoBase.BoneInfo)null;
            int    id   = categoryInfoList[index1].id;
            string name = categoryInfoList[index1].name;
            if (this.dictSrc.TryGetValue(id, out boneInfo))
            {
                Vector3[] vector3Array1 = new Vector3[3];
                for (int index2 = 0; index2 < 3; ++index2)
                {
                    vector3Array1[index2] = Vector3.get_zero();
                }
                Vector3[] vector3Array2 = new Vector3[3];
                for (int index2 = 0; index2 < 3; ++index2)
                {
                    vector3Array2[index2] = Vector3.get_zero();
                }
                bool[] flag = new bool[3];
                for (int index2 = 0; index2 < 3; ++index2)
                {
                    flag[index2] = categoryInfoList[index1].getflag[index2];
                }
                if (!this.anmKeyInfo.GetInfo(name, key01, ref vector3Array1, flag) || !this.anmKeyInfo.GetInfo(name, key02, ref vector3Array2, flag))
                {
                    return(false);
                }
                Vector3 vector3 = Vector3.Lerp(vector3Array1[0], vector3Array2[0], blend);
                if (categoryInfoList[index1].use[0][0])
                {
                    boneInfo.vctPos.x = vector3.x;
                }
                if (categoryInfoList[index1].use[0][1])
                {
                    boneInfo.vctPos.y = vector3.y;
                }
                if (categoryInfoList[index1].use[0][2])
                {
                    boneInfo.vctPos.z = vector3.z;
                }
                vector3.x = (__Null)(double)Mathf.LerpAngle((float)vector3Array1[1].x, (float)vector3Array2[1].x, blend);
                vector3.y = (__Null)(double)Mathf.LerpAngle((float)vector3Array1[1].y, (float)vector3Array2[1].y, blend);
                vector3.z = (__Null)(double)Mathf.LerpAngle((float)vector3Array1[1].z, (float)vector3Array2[1].z, blend);
                if (categoryInfoList[index1].use[1][0])
                {
                    boneInfo.vctRot.x = vector3.x;
                }
                if (categoryInfoList[index1].use[1][1])
                {
                    boneInfo.vctRot.y = vector3.y;
                }
                if (categoryInfoList[index1].use[1][2])
                {
                    boneInfo.vctRot.z = vector3.z;
                }
                vector3 = Vector3.Lerp(vector3Array1[2], vector3Array2[2], blend);
                if (categoryInfoList[index1].use[2][0])
                {
                    boneInfo.vctScl.x = vector3.x;
                }
                if (categoryInfoList[index1].use[2][1])
                {
                    boneInfo.vctScl.y = vector3.y;
                }
                if (categoryInfoList[index1].use[2][2])
                {
                    boneInfo.vctScl.z = vector3.z;
                }
            }
        }
        return(true);
    }
Пример #4
0
    public bool ChangeValue(int category, float value)
    {
        List <ShapeInfoBase.CategoryInfo> categoryInfoList;

        if (this.anmKeyInfo == null || !this.dictCategory.TryGetValue(category, out categoryInfoList))
        {
            return(false);
        }
        int    count = categoryInfoList.Count;
        string empty = string.Empty;

        for (int index1 = 0; index1 < count; ++index1)
        {
            ShapeInfoBase.BoneInfo boneInfo = (ShapeInfoBase.BoneInfo)null;
            int    id   = categoryInfoList[index1].id;
            string name = categoryInfoList[index1].name;
            if (this.dictSrc.TryGetValue(id, out boneInfo))
            {
                Vector3[] vector3Array = new Vector3[3];
                for (int index2 = 0; index2 < 3; ++index2)
                {
                    vector3Array[index2] = Vector3.get_zero();
                }
                bool[] flag = new bool[3];
                for (int index2 = 0; index2 < 3; ++index2)
                {
                    flag[index2] = categoryInfoList[index1].getflag[index2];
                }
                this.anmKeyInfo.GetInfo(name, value, ref vector3Array, flag);
                if (categoryInfoList[index1].use[0][0])
                {
                    boneInfo.vctPos.x = vector3Array[0].x;
                }
                if (categoryInfoList[index1].use[0][1])
                {
                    boneInfo.vctPos.y = vector3Array[0].y;
                }
                if (categoryInfoList[index1].use[0][2])
                {
                    boneInfo.vctPos.z = vector3Array[0].z;
                }
                if (categoryInfoList[index1].use[1][0])
                {
                    boneInfo.vctRot.x = vector3Array[1].x;
                }
                if (categoryInfoList[index1].use[1][1])
                {
                    boneInfo.vctRot.y = vector3Array[1].y;
                }
                if (categoryInfoList[index1].use[1][2])
                {
                    boneInfo.vctRot.z = vector3Array[1].z;
                }
                if (categoryInfoList[index1].use[2][0])
                {
                    boneInfo.vctScl.x = vector3Array[2].x;
                }
                if (categoryInfoList[index1].use[2][1])
                {
                    boneInfo.vctScl.y = vector3Array[2].y;
                }
                if (categoryInfoList[index1].use[2][2])
                {
                    boneInfo.vctScl.z = vector3Array[2].z;
                }
            }
        }
        return(true);
    }