Ejemplo n.º 1
0
        private static BoneMotion GetBoneMotion(ByteReader io)
        {
            // ?
            var motion=new BoneMotion();

            motion.BoneName=io.GetSJIS(15);
            motion.FrameNum=io.GetUInt();
            motion.Position=io.GetVector3();
            motion.Rotation=io.GetVector4();

            var bezierParams=new byte[64];
            io.GetBytes(ref bezierParams);

            return motion;
        }
Ejemplo n.º 2
0
        public static Model loadFromPath(string path)
        {
            var io=new ByteReader(File.ReadAllBytes(path));

            var model=new Model();

            model.Magic=io.GetAscii(30);
            model.ModelName=io.GetSJIS(20);

            int boneMotionCount=io.GetInt();
            model.BoneMotions=Enumerable.Range(1, boneMotionCount).Select(_
                    =>GetBoneMotion(io)).ToArray();

            return model;
        }