示例#1
0
        public void Deserialize(Stream stream, MotHeader header, int boneEnd, bool bFMode)
        {
            stream.Position = header.InfoOffset;
            var serializer = new BinarySerializer();

            Info            = serializer.Deserialize <MotInfo>(stream);
            stream.Position = header.UnkDataOffset;
            while (stream.Position < header.DataOffset)
            {
                Settings.Add(DataStream.ReadUInt32(stream));
            }

            for (var i = 0; i < MotFile.MaxData; ++i)
            {
                var flagCount = MotFile.FrameValueOffset.ContainsKey(i) ? MotFile.FrameValueOffset[i] : 0;

                var motion = MotData.Deserialize(stream, flagCount, bFMode);

                Data.Add(motion);
            }

            Skeleton = new MotSkeleton(Data);

            stream.Position = header.BoneOffset;
            Bones           = new MotBones();
            Bones.GetIds(stream, boneEnd);
        }
示例#2
0
        public MotFile()
        {
            Header = new MotHeader();

            SubHeaders = new List <MotHeader>();

            Animations = new List <MotAnim>();
        }
示例#3
0
        public void Initilize()
        {
            Header = new MotHeader
            {
                InfoOffset    = 32,
                UnkDataOffset = 36,
                DataOffset    = 168
            };

            SubHeaders = new List <MotHeader> {
                new MotHeader()
            };

            Animations = new List <MotAnim> {
                new MotAnim()
            };
        }