Пример #1
0
        public static PmxSkinningFunction Parse(BinaryReader br, PmxDocument doc, PmxSkinningKind kind)
        {
            PmxSkinningFunction rt;

            switch (kind)
            {
            case PmxSkinningKind.LinearBlendDeforming1:
                rt = new PmxLinearBlendDeforming1();

                break;

            case PmxSkinningKind.LinearBlendDeforming2:
                rt = new PmxLinearBlendDeforming2();

                break;

            case PmxSkinningKind.LinearBlendDeforming4:
                rt = new PmxLinearBlendDeforming4();

                break;

            case PmxSkinningKind.SphericalDeforming:
                rt = new PmxSphericalDeforming();

                break;

            case PmxSkinningKind.DualQuaternionDeforming:
                rt = new PmxDualQuaternionDeforming();

                break;

            default:
                throw new NotSupportedException();
            }

            rt.Read(br, doc);

            return(rt);
        }
Пример #2
0
        public static PmxSkinningFunction Parse(BinaryReader br, PmxDocument doc, PmxSkinningKind kind)
        {
            PmxSkinningFunction rt;

            switch (kind)
            {
                case PmxSkinningKind.LinearBlendDeforming1:
                    rt = new PmxLinearBlendDeforming1();

                    break;
                case PmxSkinningKind.LinearBlendDeforming2:
                    rt = new PmxLinearBlendDeforming2();

                    break;
                case PmxSkinningKind.LinearBlendDeforming4:
                    rt = new PmxLinearBlendDeforming4();

                    break;
                case PmxSkinningKind.SphericalDeforming:
                    rt = new PmxSphericalDeforming();

                    break;
                case PmxSkinningKind.DualQuaternionDeforming:
                    rt = new PmxDualQuaternionDeforming();

                    break;
                default:
                    throw new NotSupportedException();
            }

            rt.Read(br, doc);

            return rt;
        }