Beispiel #1
0
 public override void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.ToStreamEx(s, f);
     PmxStreamHelper.WriteElement_Int32(s, Index, f.VertexSize, signed: false);
     V4_BytesConvert.ToStream(s, Offset);
 }
Beispiel #2
0
        // Token: 0x0600022A RID: 554 RVA: 0x00011DDC File Offset: 0x0000FFDC
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Name     = PmxStreamHelper.ReadString(s, f);
            this.NameE    = PmxStreamHelper.ReadString(s, f);
            this.Shape    = (PmxSoftBody.ShapeKind)PmxStreamHelper.ReadElement_Int32(s, 1, true);
            this.Material = PmxStreamHelper.ReadElement_Int32(s, f.MaterialSize, true);
            this.Group    = PmxStreamHelper.ReadElement_Int32(s, 1, true);
            ushort bits = (ushort)PmxStreamHelper.ReadElement_Int32(s, 2, false);

            this.PassGroup.FromFlagBits(bits);
            this.Flags = (PmxSoftBody.SoftBodyFlags)PmxStreamHelper.ReadElement_Int32(s, 1, true);
            this.BendingLinkDistance = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.ClusterCount        = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.TotalMass           = PmxStreamHelper.ReadElement_Float(s);
            this.Margin             = PmxStreamHelper.ReadElement_Float(s);
            this.Config.AeroModel   = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Config.VCF         = PmxStreamHelper.ReadElement_Float(s);
            this.Config.DP          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.DG          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.LF          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.PR          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.VC          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.DF          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.MT          = PmxStreamHelper.ReadElement_Float(s);
            this.Config.CHR         = PmxStreamHelper.ReadElement_Float(s);
            this.Config.KHR         = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SHR         = PmxStreamHelper.ReadElement_Float(s);
            this.Config.AHR         = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SRHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SKHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SSHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SR_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SK_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            this.Config.SS_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            this.Config.V_IT        = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Config.P_IT        = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Config.D_IT        = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Config.C_IT        = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.MaterialConfig.LST = PmxStreamHelper.ReadElement_Float(s);
            this.MaterialConfig.AST = PmxStreamHelper.ReadElement_Float(s);
            this.MaterialConfig.VST = PmxStreamHelper.ReadElement_Float(s);
            int num = PmxStreamHelper.ReadElement_Int32(s, 4, true);

            this.BodyAnchorList.Clear();
            this.BodyAnchorList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                int body   = PmxStreamHelper.ReadElement_Int32(s, f.BodySize, true);
                int vertex = PmxStreamHelper.ReadElement_Int32(s, f.VertexSize, true);
                int num2   = PmxStreamHelper.ReadElement_Int32(s, 1, true);
                this.BodyAnchorList.Add(new PmxSoftBody.BodyAnchor
                {
                    Body   = body,
                    Vertex = vertex,
                    IsNear = (num2 != 0)
                });
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.VertexPinList.Clear();
            this.VertexPinList.Capacity = num;
            for (int j = 0; j < num; j++)
            {
                int vertex2 = PmxStreamHelper.ReadElement_Int32(s, f.VertexSize, true);
                this.VertexPinList.Add(new PmxSoftBody.VertexPin
                {
                    Vertex = vertex2
                });
            }
            this.NormalizeBodyAnchorList();
            this.NormalizeVertexPinList();
        }
Beispiel #3
0
 public override void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.FromStreamEx(s, f);
     Index  = PmxStreamHelper.ReadElement_Int32(s, f.VertexSize, signed: false);
     Offset = V4_BytesConvert.FromStream(s);
 }
 // Token: 0x0600028F RID: 655 RVA: 0x0001451B File Offset: 0x0001271B
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.VertexSize, false);
     V3_BytesConvert.ToStream(s, this.Offset);
 }
Beispiel #5
0
        public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            Name     = PmxStreamHelper.ReadString(s, f);
            NameE    = PmxStreamHelper.ReadString(s, f);
            Shape    = (ShapeKind)PmxStreamHelper.ReadElement_Int32(s, 1);
            Material = PmxStreamHelper.ReadElement_Int32(s, f.MaterialSize);
            Group    = PmxStreamHelper.ReadElement_Int32(s, 1);
            ushort bits = (ushort)PmxStreamHelper.ReadElement_Int32(s, 2, signed: false);

            PassGroup.FromFlagBits(bits);
            Flags = (SoftBodyFlags)PmxStreamHelper.ReadElement_Int32(s, 1);
            BendingLinkDistance = PmxStreamHelper.ReadElement_Int32(s);
            ClusterCount        = PmxStreamHelper.ReadElement_Int32(s);
            TotalMass           = PmxStreamHelper.ReadElement_Float(s);
            Margin             = PmxStreamHelper.ReadElement_Float(s);
            Config.AeroModel   = PmxStreamHelper.ReadElement_Int32(s);
            Config.VCF         = PmxStreamHelper.ReadElement_Float(s);
            Config.DP          = PmxStreamHelper.ReadElement_Float(s);
            Config.DG          = PmxStreamHelper.ReadElement_Float(s);
            Config.LF          = PmxStreamHelper.ReadElement_Float(s);
            Config.PR          = PmxStreamHelper.ReadElement_Float(s);
            Config.VC          = PmxStreamHelper.ReadElement_Float(s);
            Config.DF          = PmxStreamHelper.ReadElement_Float(s);
            Config.MT          = PmxStreamHelper.ReadElement_Float(s);
            Config.CHR         = PmxStreamHelper.ReadElement_Float(s);
            Config.KHR         = PmxStreamHelper.ReadElement_Float(s);
            Config.SHR         = PmxStreamHelper.ReadElement_Float(s);
            Config.AHR         = PmxStreamHelper.ReadElement_Float(s);
            Config.SRHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            Config.SKHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            Config.SSHR_CL     = PmxStreamHelper.ReadElement_Float(s);
            Config.SR_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            Config.SK_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            Config.SS_SPLT_CL  = PmxStreamHelper.ReadElement_Float(s);
            Config.V_IT        = PmxStreamHelper.ReadElement_Int32(s);
            Config.P_IT        = PmxStreamHelper.ReadElement_Int32(s);
            Config.D_IT        = PmxStreamHelper.ReadElement_Int32(s);
            Config.C_IT        = PmxStreamHelper.ReadElement_Int32(s);
            MaterialConfig.LST = PmxStreamHelper.ReadElement_Float(s);
            MaterialConfig.AST = PmxStreamHelper.ReadElement_Float(s);
            MaterialConfig.VST = PmxStreamHelper.ReadElement_Float(s);
            int num = PmxStreamHelper.ReadElement_Int32(s);

            BodyAnchorList.Clear();
            BodyAnchorList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                int body   = PmxStreamHelper.ReadElement_Int32(s, f.BodySize);
                int vertex = PmxStreamHelper.ReadElement_Int32(s, f.VertexSize);
                int num2   = PmxStreamHelper.ReadElement_Int32(s, 1);
                BodyAnchorList.Add(new BodyAnchor
                {
                    Body   = body,
                    Vertex = vertex,
                    IsNear = (num2 != 0)
                });
            }
            num = PmxStreamHelper.ReadElement_Int32(s);
            VertexPinList.Clear();
            VertexPinList.Capacity = num;
            for (int j = 0; j < num; j++)
            {
                int vertex2 = PmxStreamHelper.ReadElement_Int32(s, f.VertexSize);
                VertexPinList.Add(new VertexPin
                {
                    Vertex = vertex2
                });
            }
            NormalizeBodyAnchorList();
            NormalizeVertexPinList();
            if (f.WithID)
            {
                base.UID = PmxStreamHelper.ReadElement_UInt(s);
                base.CID = PmxStreamHelper.ReadElement_UInt(s);
            }
        }
Beispiel #6
0
        // Token: 0x060000B2 RID: 178 RVA: 0x0000CC80 File Offset: 0x0000AE80
        public virtual void FromStreamEx(Stream s, PmxElementFormat f)
        {
            PmxHeader pmxHeader = new PmxHeader(2.1f);

            pmxHeader.FromStreamEx(s, null);
            this.Header.FromHeader(pmxHeader);
            this.ModelInfo.FromStreamEx(s, pmxHeader.ElementFormat);
            int num = PmxStreamHelper.ReadElement_Int32(s, 4, true);

            this.VertexList.Clear();
            this.VertexList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                PmxVertex pmxVertex = new PmxVertex();
                pmxVertex.FromStreamEx(s, pmxHeader.ElementFormat);
                this.VertexList.Add(pmxVertex);
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.FaceList.Clear();
            this.FaceList.Capacity = num;
            for (int j = 0; j < num; j++)
            {
                int item = PmxStreamHelper.ReadElement_Int32(s, pmxHeader.ElementFormat.VertexSize, false);
                this.FaceList.Add(item);
            }
            PmxTextureTable pmxTextureTable = new PmxTextureTable();

            pmxTextureTable.FromStreamEx(s, pmxHeader.ElementFormat);
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.MaterialList.Clear();
            this.MaterialList.Capacity = num;
            for (int k = 0; k < num; k++)
            {
                PmxMaterial pmxMaterial = new PmxMaterial();
                pmxMaterial.FromStreamEx_TexTable(s, pmxTextureTable, pmxHeader.ElementFormat);
                this.MaterialList.Add(pmxMaterial);
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.BoneList.Clear();
            this.BoneList.Capacity = num;
            for (int l = 0; l < num; l++)
            {
                PmxBone pmxBone = new PmxBone();
                pmxBone.FromStreamEx(s, pmxHeader.ElementFormat);
                this.BoneList.Add(pmxBone);
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.MorphList.Clear();
            this.MorphList.Capacity = num;
            for (int m = 0; m < num; m++)
            {
                PmxMorph pmxMorph = new PmxMorph();
                pmxMorph.FromStreamEx(s, pmxHeader.ElementFormat);
                this.MorphList.Add(pmxMorph);
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.NodeList.Clear();
            this.NodeList.Capacity = num;
            for (int n = 0; n < num; n++)
            {
                PmxNode pmxNode = new PmxNode();
                pmxNode.FromStreamEx(s, pmxHeader.ElementFormat);
                this.NodeList.Add(pmxNode);
                bool systemNode = this.NodeList[n].SystemNode;
                if (systemNode)
                {
                    bool flag = this.NodeList[n].Name == "Root";
                    if (flag)
                    {
                        this.RootNode = this.NodeList[n];
                    }
                    else
                    {
                        bool flag2 = this.NodeList[n].Name == "表情";
                        if (flag2)
                        {
                            this.ExpNode = this.NodeList[n];
                        }
                    }
                }
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.BodyList.Clear();
            this.BodyList.Capacity = num;
            for (int num2 = 0; num2 < num; num2++)
            {
                PmxBody pmxBody = new PmxBody();
                pmxBody.FromStreamEx(s, pmxHeader.ElementFormat);
                this.BodyList.Add(pmxBody);
            }
            num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.JointList.Clear();
            this.JointList.Capacity = num;
            for (int num3 = 0; num3 < num; num3++)
            {
                PmxJoint pmxJoint = new PmxJoint();
                pmxJoint.FromStreamEx(s, pmxHeader.ElementFormat);
                this.JointList.Add(pmxJoint);
            }
            bool flag3 = pmxHeader.Ver >= 2.1f;

            if (flag3)
            {
                num = PmxStreamHelper.ReadElement_Int32(s, 4, true);
                this.SoftBodyList.Clear();
                this.SoftBodyList.Capacity = num;
                for (int num4 = 0; num4 < num; num4++)
                {
                    PmxSoftBody pmxSoftBody = new PmxSoftBody();
                    pmxSoftBody.FromStreamEx(s, pmxHeader.ElementFormat);
                    this.SoftBodyList.Add(pmxSoftBody);
                }
            }
        }
 // Token: 0x0600028E RID: 654 RVA: 0x000144F9 File Offset: 0x000126F9
 public override void FromStreamEx(Stream s, PmxElementFormat size)
 {
     this.Index  = PmxStreamHelper.ReadElement_Int32(s, size.VertexSize, false);
     this.Offset = V3_BytesConvert.FromStream(s);
 }
 // Token: 0x06000148 RID: 328 RVA: 0x0000EFD9 File Offset: 0x0000D1D9
 public override void FromStreamEx(Stream s, PmxElementFormat size)
 {
     this.Index = PmxStreamHelper.ReadElement_Int32(s, size.MorphSize, true);
     this.Ratio = PmxStreamHelper.ReadElement_Float(s);
 }
 // Token: 0x06000149 RID: 329 RVA: 0x0000EFFB File Offset: 0x0000D1FB
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.MorphSize, true);
     PmxStreamHelper.WriteElement_Float(s, this.Ratio);
 }
 public PmxElementFormat(PmxElementFormat f)
 {
     FromElementFormat(f);
 }
 public void FromElementFormat(PmxElementFormat f)
 {
     ElementFormat = f;
 }
 public PmxHeader(float ver)
 {
     ElementFormat = new PmxElementFormat(ver);
 }
 public PmxHeader()
 {
     ElementFormat = new PmxElementFormat();
 }
 // Token: 0x06000115 RID: 277 RVA: 0x0000E978 File Offset: 0x0000CB78
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.BoneSize, true);
     V3_BytesConvert.ToStream(s, this.Translation);
     V4_BytesConvert.ToStream(s, new Vector4(this.Rotaion.x, this.Rotaion.y, this.Rotaion.z, this.Rotaion.w));
 }