コード例 #1
0
ファイル: Action.cs プロジェクト: damian-666/ReignSDK
        public static void Write(BinaryWriter writer, SoftwareAction softwareAction)
        {
            writer.Write(softwareAction.Name);
            writer.Write(softwareAction.FrameStart);
            writer.Write(softwareAction.FrameEnd);

            writer.Write(softwareAction.FCurves.Count);
            foreach (var curve in softwareAction.FCurves)
            {
                FCurve.Write(writer, curve);
            }
        }
コード例 #2
0
ファイル: Action.cs プロジェクト: damian-666/ReignSDK
        public Action(BinaryReader reader)
        {
            Name       = reader.ReadString();
            FrameStart = reader.ReadSingle();
            FrameEnd   = reader.ReadSingle();

            FCurves = new FCurve[reader.ReadInt32()];
            for (int i = 0; i != FCurves.Length; ++i)
            {
                FCurves[i] = new FCurve(reader);
            }

            calculatedValues = new float[FCurves.Length];
        }
コード例 #3
0
ファイル: Action.cs プロジェクト: reignstudios/ReignSDK
        public Action(BinaryReader reader)
        {
            Name = reader.ReadString();
            FrameStart = reader.ReadSingle();
            FrameEnd = reader.ReadSingle();

            FCurves = new FCurve[reader.ReadInt32()];
            for (int i = 0; i != FCurves.Length; ++i)
            {
                FCurves[i] = new FCurve(reader);
            }

            calculatedValues = new float[FCurves.Length];
        }
コード例 #4
0
        protected override void linkObjects(string dataPath, FCurve curve, int i)
        {
            bool pass = false;

            for (int bi = 0; bi != Armature.Bones.Length; ++bi)
            {
                if (dataPath == Armature.Bones[bi].Name)
                {
                    boneIndices[i] = bi;

                    if (curve.Index == 0)
                    {
                        bindActionDatas[i] = bindBoneRotationX;
                    }
                    else if (curve.Index == 1)
                    {
                        bindActionDatas[i] = bindBoneRotationY;
                    }
                    else if (curve.Index == 2)
                    {
                        bindActionDatas[i] = bindBoneRotationZ;
                    }
                    else if (curve.Index == 3)
                    {
                        bindActionDatas[i] = bindBoneRotationW;
                    }

                    pass = true;
                    break;
                }
            }
            if (!pass)
            {
                Debug.ThrowError("InstanceObjectArmature", "Failed to find Armature Bone: " + dataPath);
            }

            // link bones
            foreach (var bone in Bones)
            {
                bone.linkObjects(Bones);
            }

            // link bone childeren
            foreach (var bone in Bones)
            {
                bone.linkChilderen(Bones);
            }
        }
コード例 #5
0
 protected virtual void linkObjects(string dataPath, FCurve curve, int i)
 {
     // place holder...
 }
コード例 #6
0
        protected override void linkObjects(string dataPath, FCurve curve, int i)
        {
            bool pass = false;
            for (int bi = 0; bi != Armature.Bones.Length; ++bi)
            {
                if (dataPath == Armature.Bones[bi].Name)
                {
                    boneIndices[i] = bi;

                    if (curve.Index == 0) bindActionDatas[i] = bindBoneRotationX;
                    else if (curve.Index == 1) bindActionDatas[i] = bindBoneRotationY;
                    else if (curve.Index == 2) bindActionDatas[i] = bindBoneRotationZ;
                    else if (curve.Index == 3) bindActionDatas[i] = bindBoneRotationW;

                    pass = true;
                    break;
                }
            }
            if (!pass) Debug.ThrowError("InstanceObjectArmature", "Failed to find Armature Bone: " + dataPath);

            // link bones
            foreach (var bone in Bones)
            {
                bone.linkObjects(Bones);
            }

            // link bone childeren
            foreach (var bone in Bones)
            {
                bone.linkChilderen(Bones);
            }
        }
コード例 #7
0
 protected virtual void linkObjects(string dataPath, FCurve curve, int i)
 {
     // place holder...
 }