예제 #1
0
        public void WriteAnimationParams(BinaryWriter writer, OMFEditor editor, short motion_version)
        {
            editor.WriteSuperString(writer, Name);
            writer.Write(Flags);
            writer.Write(BoneOrPart);
            writer.Write(MotionID);
            writer.Write(Speed);
            writer.Write(Power);
            writer.Write(Accrue);
            writer.Write(Falloff);

            if (motion_version != 4)
            {
                return;
            }

            writer.Write(MarksCount);

            if (MarksCount != 0 && m_marks != null)
            {
                foreach (MotionMark mark in m_marks)
                {
                    mark.WriteMotionMark(writer, editor);
                }
            }
        }
예제 #2
0
        public BoneContainer(BinaryReader reader, OMFEditor editor)
        {
            SectionId   = reader.ReadInt32();
            SectionSize = reader.ReadUInt32();
            OGF_V       = reader.ReadInt16();
            Count       = reader.ReadInt16();

            for (int i = 0; i < Count; i++)
            {
                BoneParts bonesparts = new BoneParts
                {
                    Name  = editor.ReadSuperString(reader),
                    Count = reader.ReadInt16()
                };

                for (int n = 0; n < bonesparts.Count; n++)
                {
                    BoneVector sbone = new BoneVector
                    {
                        Name = editor.ReadSuperString(reader),
                        ID   = reader.ReadUInt32()
                    };
                    bonesparts.bones.Add(sbone);
                }

                parts.Add(bonesparts);
            }
        }
예제 #3
0
        public List <MotionMark> m_marks; // = new List<MotionMark>();

        public AnimationParams(BinaryReader reader, OMFEditor editor, short motion_version)
        {
            Name       = editor.ReadSuperString(reader);
            Flags      = reader.ReadInt32();
            BoneOrPart = reader.ReadInt16();
            MotionID   = reader.ReadInt16();
            Speed      = reader.ReadSingle();
            Power      = reader.ReadSingle();
            Accrue     = reader.ReadSingle();
            Falloff    = reader.ReadSingle();
            MarksCount = 0;

            if (motion_version == 4)
            {
                MarksCount = reader.ReadInt32();

                if (MarksCount > 0)
                {
                    m_marks = new List <MotionMark>();

                    for (int i = 0; i < MarksCount; i++)
                    {
                        MotionMark newmark = new MotionMark(reader, editor);
                        m_marks.Add(newmark);
                    }
                }
            }
        }
예제 #4
0
        public AnimationsContainer(BinaryReader reader, OMFEditor editor)
        {
            SectionId   = reader.ReadInt32();
            SectionSize = reader.ReadUInt32();

            SectionId2   = reader.ReadInt32();
            SectionSize2 = reader.ReadUInt32();

            AnimsCount = reader.ReadInt32();

            int count = AnimsCount;

            for (int i = 0; i < count; i++)
            {
                AnimVector vector = new AnimVector
                {
                    SectionId   = reader.ReadInt32(),
                    SectionSize = reader.ReadUInt32(),
                    Name        = editor.ReadSuperString(reader)
                };

                int size = (int)vector.SectionSize - (vector.Name.Length + 1);

                vector.data = reader.ReadBytes(size);

                AddAnim(vector);
            }
        }
예제 #5
0
        public void WriteMotionMark(BinaryWriter writer, OMFEditor editor)
        {
            editor.WriteMarkString(writer, Name);
            writer.Write(Count);

            foreach (MotionMarkParams param in m_params)
            {
                writer.Write(param.t0);
                writer.Write(param.t1);
            }
        }
예제 #6
0
        public MotionMark(BinaryReader reader, OMFEditor editor)
        {
            Name  = editor.ReadMotionMarkString(reader);
            Count = reader.ReadInt32();

            for (int n = 0; n < Count; n++)
            {
                MotionMarkParams param = new MotionMarkParams(reader);
                m_params.Add(param);
            }
        }
예제 #7
0
        public void WriteAnimationContainer(BinaryWriter writer, OMFEditor editor)
        {
            writer.Write(SectionId);
            writer.Write(SectionSize);

            writer.Write(SectionId2);
            writer.Write(SectionSize2);

            writer.Write(AnimsCount);

            foreach (AnimVector anim in Anims)
            {
                writer.Write(anim.SectionId);
                writer.Write(anim.SectionSize);
                editor.WriteSuperString(writer, anim.Name);
                writer.Write(anim.data);
            }
        }
예제 #8
0
        public void WriteBoneCont(BinaryWriter writer, OMFEditor editor)
        {
            writer.Write(SectionId);
            writer.Write(SectionSize);
            writer.Write(OGF_V);
            writer.Write(Count);

            foreach (BoneParts bone in parts)
            {
                editor.WriteSuperString(writer, bone.Name);
                writer.Write(bone.Count);

                foreach (BoneVector sbone in bone.bones)
                {
                    editor.WriteSuperString(writer, sbone.Name);
                    writer.Write(sbone.ID);
                }
            }
        }