public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            Name  = PmxStreamHelper.ReadString(s, f);
            NameE = PmxStreamHelper.ReadString(s, f);
            Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
            Group = PmxStreamHelper.ReadElement_Int32(s, 1);
            ushort bits = (ushort)PmxStreamHelper.ReadElement_Int32(s, 2, signed: false);

            PassGroup.FromFlagBits(bits);
            BoxType  = (BoxKind)s.ReadByte();
            BoxSize  = V3_BytesConvert.FromStream(s);
            Position = V3_BytesConvert.FromStream(s);
            Rotation = V3_BytesConvert.FromStream(s);
            Mass     = PmxStreamHelper.ReadElement_Float(s);
            Vector4 vector = V4_BytesConvert.FromStream(s);

            PositionDamping = vector.X;
            RotationDamping = vector.Y;
            Restitution     = vector.Z;
            Friction        = vector.W;
            Mode            = (ModeType)s.ReadByte();
            if (f.WithID)
            {
                base.UID = PmxStreamHelper.ReadElement_UInt(s);
                base.CID = PmxStreamHelper.ReadElement_UInt(s);
            }
        }
Esempio n. 2
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     if (Kind != 0 && f.Ver < 2.1f)
     {
         s.WriteByte(0);
     }
     else
     {
         s.WriteByte((byte)Kind);
     }
     PmxStreamHelper.WriteElement_Int32(s, BodyA, f.BodySize);
     PmxStreamHelper.WriteElement_Int32(s, BodyB, f.BodySize);
     V3_BytesConvert.ToStream(s, Position);
     V3_BytesConvert.ToStream(s, Rotation);
     V3_BytesConvert.ToStream(s, Limit_MoveLow);
     V3_BytesConvert.ToStream(s, Limit_MoveHigh);
     V3_BytesConvert.ToStream(s, Limit_AngleLow);
     V3_BytesConvert.ToStream(s, Limit_AngleHigh);
     V3_BytesConvert.ToStream(s, SpConst_Move);
     V3_BytesConvert.ToStream(s, SpConst_Rotate);
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
Esempio n. 3
0
        // Token: 0x06000188 RID: 392 RVA: 0x0000FA90 File Offset: 0x0000DC90
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            PmxStreamHelper.WriteString(s, this.Name, f);
            PmxStreamHelper.WriteString(s, this.NameE, f);
            bool flag = this.Kind != PmxJoint.JointKind.Sp6DOF && f.Ver < 2.1f;

            if (flag)
            {
                s.WriteByte(0);
            }
            else
            {
                s.WriteByte((byte)this.Kind);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.BodyA, f.BodySize, true);
            PmxStreamHelper.WriteElement_Int32(s, this.BodyB, f.BodySize, true);
            V3_BytesConvert.ToStream(s, this.Position);
            V3_BytesConvert.ToStream(s, this.Rotation);
            V3_BytesConvert.ToStream(s, this.Limit_MoveLow);
            V3_BytesConvert.ToStream(s, this.Limit_MoveHigh);
            V3_BytesConvert.ToStream(s, this.Limit_AngleLow);
            V3_BytesConvert.ToStream(s, this.Limit_AngleHigh);
            V3_BytesConvert.ToStream(s, this.SpConst_Move);
            V3_BytesConvert.ToStream(s, this.SpConst_Rotate);
        }
Esempio n. 4
0
 // Token: 0x06000174 RID: 372 RVA: 0x0000F688 File Offset: 0x0000D888
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.BodySize, true);
     s.WriteByte(this.Local ? 1 : 0);
     V3_BytesConvert.ToStream(s, this.Velocity);
     V3_BytesConvert.ToStream(s, this.Torque);
 }
 public void FromStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f = null)
 {
     Name       = PmxStreamHelper.ReadString(s, f);
     NameE      = PmxStreamHelper.ReadString(s, f);
     Diffuse    = V4_BytesConvert.FromStream(s);
     Specular   = V3_BytesConvert.FromStream(s);
     Power      = PmxStreamHelper.ReadElement_Float(s);
     Ambient    = V3_BytesConvert.FromStream(s);
     Flags      = (MaterialFlags)s.ReadByte();
     EdgeColor  = V4_BytesConvert.FromStream(s);
     EdgeSize   = PmxStreamHelper.ReadElement_Float(s);
     Tex        = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     Sphere     = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     SphereMode = (SphereModeType)s.ReadByte();
     if (s.ReadByte() == 0)
     {
         Toon = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     }
     else
     {
         int n = s.ReadByte();
         Toon = SystemToon.GetToonName(n);
     }
     Memo = PmxStreamHelper.ReadString(s, f);
     UpdateAttributeFromMemo();
     FaceCount = PmxStreamHelper.ReadElement_Int32(s);
     if (f.WithID)
     {
         base.UID = PmxStreamHelper.ReadElement_UInt(s);
         base.CID = PmxStreamHelper.ReadElement_UInt(s);
     }
 }
 // Token: 0x060001DE RID: 478 RVA: 0x00010B88 File Offset: 0x0000ED88
 public void FromStreamEx(Stream s, PmxElementFormat f)
 {
     this.ModelName  = PmxStreamHelper.ReadString(s, f);
     this.ModelNameE = PmxStreamHelper.ReadString(s, f);
     this.Comment    = PmxStreamHelper.ReadString(s, f);
     this.CommentE   = PmxStreamHelper.ReadString(s, f);
 }
 // Token: 0x060001DF RID: 479 RVA: 0x00010BC3 File Offset: 0x0000EDC3
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.ModelName, f);
     PmxStreamHelper.WriteString(s, this.ModelNameE, f);
     PmxStreamHelper.WriteString(s, this.Comment, f);
     PmxStreamHelper.WriteString(s, this.CommentE, f);
 }
        // Token: 0x06000130 RID: 304 RVA: 0x0000ED30 File Offset: 0x0000CF30
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            byte[] array = new byte[8];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = 0;
            }
            int  num  = 0;
            bool flag = this.Ver <= 1f;

            if (flag)
            {
                array[num++] = (byte)this.VertexSize;
                array[num++] = (byte)this.BoneSize;
                array[num++] = (byte)this.MorphSize;
                array[num++] = (byte)this.MaterialSize;
                array[num++] = (byte)this.BodySize;
            }
            else
            {
                array[num++] = (byte)this.StringEnc;
                array[num++] = (byte)this.UVACount;
                array[num++] = (byte)this.VertexSize;
                array[num++] = (byte)this.TexSize;
                array[num++] = (byte)this.MaterialSize;
                array[num++] = (byte)this.BoneSize;
                array[num++] = (byte)this.MorphSize;
                array[num++] = (byte)this.BodySize;
            }
            PmxStreamHelper.WriteElement_Int32(s, array.Length, 1, true);
            s.Write(array, 0, array.Length);
        }
Esempio n. 9
0
 // Token: 0x06000242 RID: 578 RVA: 0x00012AB9 File Offset: 0x00010CB9
 public static void WriteElement_Vector4(Stream s, Vector4 data)
 {
     PmxStreamHelper.WriteElement_Float(s, data.X);
     PmxStreamHelper.WriteElement_Float(s, data.Y);
     PmxStreamHelper.WriteElement_Float(s, data.Z);
     PmxStreamHelper.WriteElement_Float(s, data.W);
 }
        // Token: 0x060001AB RID: 427 RVA: 0x000102D8 File Offset: 0x0000E4D8
        public void ToStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f)
        {
            PmxStreamHelper.WriteString(s, this.Name, f);
            PmxStreamHelper.WriteString(s, this.NameE, f);
            V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.Diffuse));
            V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Specular));
            PmxStreamHelper.WriteElement_Float(s, this.Power);
            V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Ambient));
            s.WriteByte((byte)this.Flags);
            V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.EdgeColor));
            PmxStreamHelper.WriteElement_Float(s, this.EdgeSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Tex), f.TexSize, true);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Sphere), f.TexSize, true);
            s.WriteByte((byte)this.SphereMode);
            int  toonIndex = SystemToon.GetToonIndex(this.Toon);
            bool flag      = toonIndex < 0;

            if (flag)
            {
                s.WriteByte(0);
                PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Toon), f.TexSize, true);
            }
            else
            {
                s.WriteByte(1);
                s.WriteByte((byte)toonIndex);
            }
            PmxStreamHelper.WriteString(s, this.Memo, f);
            PmxStreamHelper.WriteElement_Int32(s, this.FaceCount, 4, true);
        }
Esempio n. 11
0
 // Token: 0x06000173 RID: 371 RVA: 0x0000F649 File Offset: 0x0000D849
 public override void FromStreamEx(Stream s, PmxElementFormat size)
 {
     this.Index    = PmxStreamHelper.ReadElement_Int32(s, size.BodySize, true);
     this.Local    = (s.ReadByte() != 0);
     this.Velocity = V3_BytesConvert.FromStream(s);
     this.Torque   = V3_BytesConvert.FromStream(s);
 }
        public void ToStreamEx(Stream s, PmxElementFormat f = null)
        {
            byte[] array = new byte[8];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = 0;
            }
            int num = 0;

            if (Ver <= 1f)
            {
                array[num++] = (byte)VertexSize;
                array[num++] = (byte)BoneSize;
                array[num++] = (byte)MorphSize;
                array[num++] = (byte)MaterialSize;
                array[num++] = (byte)BodySize;
            }
            else
            {
                array[num++] = (byte)StringEnc;
                array[num++] = (byte)UVACount;
                array[num++] = (byte)VertexSize;
                array[num++] = (byte)TexSize;
                array[num++] = (byte)MaterialSize;
                array[num++] = (byte)BoneSize;
                array[num++] = (byte)MorphSize;
                array[num++] = (byte)BodySize;
            }
            PmxStreamHelper.WriteElement_Int32(s, array.Length, 1);
            s.Write(array, 0, array.Length);
        }
Esempio n. 13
0
        // Token: 0x060000B4 RID: 180 RVA: 0x0000D190 File Offset: 0x0000B390
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            PmxHeader       header          = this.Header;
            PmxTextureTable pmxTextureTable = new PmxTextureTable(this.MaterialList);

            this.UpdateElementFormatSize(header.ElementFormat, pmxTextureTable);
            header.ToStreamEx(s, null);
            this.ModelInfo.ToStreamEx(s, header.ElementFormat);
            PmxStreamHelper.WriteElement_Int32(s, this.VertexList.Count, 4, true);
            for (int i = 0; i < this.VertexList.Count; i++)
            {
                this.VertexList[i].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.FaceList.Count, 4, true);
            for (int j = 0; j < this.FaceList.Count; j++)
            {
                PmxStreamHelper.WriteElement_Int32(s, this.FaceList[j], header.ElementFormat.VertexSize, false);
            }
            pmxTextureTable.ToStreamEx(s, header.ElementFormat);
            PmxStreamHelper.WriteElement_Int32(s, this.MaterialList.Count, 4, true);
            for (int k = 0; k < this.MaterialList.Count; k++)
            {
                this.MaterialList[k].ToStreamEx_TexTable(s, pmxTextureTable, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.BoneList.Count, 4, true);
            for (int l = 0; l < this.BoneList.Count; l++)
            {
                this.BoneList[l].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.MorphList.Count, 4, true);
            for (int m = 0; m < this.MorphList.Count; m++)
            {
                this.MorphList[m].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.NodeList.Count, 4, true);
            for (int n = 0; n < this.NodeList.Count; n++)
            {
                this.NodeList[n].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.BodyList.Count, 4, true);
            for (int num = 0; num < this.BodyList.Count; num++)
            {
                this.BodyList[num].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.JointList.Count, 4, true);
            for (int num2 = 0; num2 < this.JointList.Count; num2++)
            {
                this.JointList[num2].ToStreamEx(s, header.ElementFormat);
            }
            bool flag = header.Ver >= 2.1f;

            if (flag)
            {
                PmxStreamHelper.WriteElement_Int32(s, this.SoftBodyList.Count, 4, true);
                for (int num3 = 0; num3 < this.SoftBodyList.Count; num3++)
                {
                    this.SoftBodyList[num3].ToStreamEx(s, header.ElementFormat);
                }
            }
        }
Esempio n. 14
0
        // Token: 0x06000231 RID: 561 RVA: 0x00012604 File Offset: 0x00010804
        public static string ReadString(Stream s, PmxElementFormat f)
        {
            bool flag = f == null;

            if (flag)
            {
                f = new PmxElementFormat(2.1f);
            }
            string result = "";
            bool   flag2  = f.Ver <= 1f;

            if (flag2)
            {
                result = PmxStreamHelper.ReadString_v1(s);
            }
            else
            {
                bool flag3 = f.Ver <= 2.1f;
                if (flag3)
                {
                    bool flag4 = f.StringEnc == PmxElementFormat.StringEncType.UTF8;
                    if (flag4)
                    {
                        result = PmxStreamHelper.ReadString_v2(s, Encoding.UTF8);
                    }
                    else
                    {
                        result = PmxStreamHelper.ReadString_v2(s, Encoding.Unicode);
                    }
                }
            }
            return(result);
        }
        public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            byte[] array = new byte[PmxStreamHelper.ReadElement_Int32(s, 1)];
            s.Read(array, 0, array.Length);
            int num = 0;

            if (Ver <= 1f)
            {
                VertexSize   = array[num++];
                BoneSize     = array[num++];
                MorphSize    = array[num++];
                MaterialSize = array[num++];
                BodySize     = array[num++];
            }
            else
            {
                StringEnc    = (StringEncType)array[num++];
                UVACount     = array[num++];
                VertexSize   = array[num++];
                TexSize      = array[num++];
                MaterialSize = array[num++];
                BoneSize     = array[num++];
                MorphSize    = array[num++];
                BodySize     = array[num++];
            }
        }
Esempio n. 16
0
        // Token: 0x06000230 RID: 560 RVA: 0x00012578 File Offset: 0x00010778
        public static void WriteString(Stream s, string str, PmxElementFormat f)
        {
            bool flag = f == null;

            if (flag)
            {
                f = new PmxElementFormat(2.1f);
            }
            bool flag2 = f.Ver <= 1f;

            if (flag2)
            {
                PmxStreamHelper.WriteString_v1(s, str);
            }
            else
            {
                bool flag3 = f.Ver <= 2.1f;
                if (flag3)
                {
                    bool flag4 = f.StringEnc == PmxElementFormat.StringEncType.UTF8;
                    if (flag4)
                    {
                        PmxStreamHelper.WriteString_v2(s, str, Encoding.UTF8);
                    }
                    else
                    {
                        PmxStreamHelper.WriteString_v2(s, str, Encoding.Unicode);
                    }
                }
            }
        }
Esempio n. 17
0
 // Token: 0x06000246 RID: 582 RVA: 0x00012BD8 File Offset: 0x00010DD8
 public static void WriteElement_Matrix(Stream s, Matrix m)
 {
     foreach (float data in m.ToArray())
     {
         PmxStreamHelper.WriteElement_Float(s, data);
     }
 }
Esempio n. 18
0
 // Token: 0x06000244 RID: 580 RVA: 0x00012B47 File Offset: 0x00010D47
 public static void WriteElement_Quaternion(Stream s, Quaternion data)
 {
     PmxStreamHelper.WriteElement_Float(s, data.X);
     PmxStreamHelper.WriteElement_Float(s, data.Y);
     PmxStreamHelper.WriteElement_Float(s, data.Z);
     PmxStreamHelper.WriteElement_Float(s, data.W);
 }
        public void ToStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f = null)
        {
            PmxStreamHelper.WriteString(s, Name, f);
            PmxStreamHelper.WriteString(s, NameE, f);
            V4_BytesConvert.ToStream(s, Diffuse);
            V3_BytesConvert.ToStream(s, Specular);
            PmxStreamHelper.WriteElement_Float(s, Power);
            V3_BytesConvert.ToStream(s, Ambient);
            s.WriteByte((byte)Flags);
            V4_BytesConvert.ToStream(s, EdgeColor);
            PmxStreamHelper.WriteElement_Float(s, EdgeSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Tex), f.TexSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Sphere), f.TexSize);
            s.WriteByte((byte)SphereMode);
            int toonIndex = SystemToon.GetToonIndex(Toon);

            if (toonIndex < 0)
            {
                s.WriteByte(0);
                PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Toon), f.TexSize);
            }
            else
            {
                s.WriteByte(1);
                s.WriteByte((byte)toonIndex);
            }
            PmxStreamHelper.WriteString(s, Memo, f);
            PmxStreamHelper.WriteElement_Int32(s, FaceCount);
            if (f.WithID)
            {
                PmxStreamHelper.WriteElement_UInt(s, base.UID);
                PmxStreamHelper.WriteElement_UInt(s, base.CID);
            }
        }
Esempio n. 20
0
 public override void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.ToStreamEx(s, f);
     PmxStreamHelper.WriteElement_Int32(s, Index, f.BoneSize);
     V3_BytesConvert.ToStream(s, Translation);
     V4_BytesConvert.ToStream(s, new Vector4(Rotaion.X, Rotaion.Y, Rotaion.Z, Rotaion.W));
 }
        // Token: 0x060001AA RID: 426 RVA: 0x000101A0 File Offset: 0x0000E3A0
        public void FromStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f)
        {
            this.Name       = PmxStreamHelper.ReadString(s, f);
            this.NameE      = PmxStreamHelper.ReadString(s, f);
            this.Diffuse    = V4_BytesConvert.Vector4ToColor(V4_BytesConvert.FromStream(s));
            this.Specular   = V4_BytesConvert.Vector4ToColor(V4_BytesConvert.FromStream(s));
            this.Power      = PmxStreamHelper.ReadElement_Float(s);
            this.Ambient    = V4_BytesConvert.Vector4ToColor(V4_BytesConvert.FromStream(s));
            this.Flags      = (PmxMaterial.MaterialFlags)s.ReadByte();
            this.EdgeColor  = V4_BytesConvert.Vector4ToColor(V4_BytesConvert.FromStream(s));
            this.EdgeSize   = PmxStreamHelper.ReadElement_Float(s);
            this.Tex        = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize, true));
            this.Sphere     = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize, true));
            this.SphereMode = (PmxMaterial.SphereModeType)s.ReadByte();
            bool flag = s.ReadByte() == 0;

            if (flag)
            {
                this.Toon = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize, true));
            }
            else
            {
                int n = s.ReadByte();
                this.Toon = SystemToon.GetToonName(n);
            }
            this.Memo = PmxStreamHelper.ReadString(s, f);
            this.UpdateAttributeFromMemo();
            this.FaceCount = PmxStreamHelper.ReadElement_Int32(s, 4, true);
        }
 public void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     ModelName  = PmxStreamHelper.ReadString(s, f);
     ModelNameE = PmxStreamHelper.ReadString(s, f);
     Comment    = PmxStreamHelper.ReadString(s, f);
     CommentE   = PmxStreamHelper.ReadString(s, f);
 }
        // Token: 0x0600012F RID: 303 RVA: 0x0000EC34 File Offset: 0x0000CE34
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            int num = PmxStreamHelper.ReadElement_Int32(s, 1, true);

            byte[] array = new byte[num];
            s.Read(array, 0, array.Length);
            int  num2 = 0;
            bool flag = this.Ver <= 1f;

            if (flag)
            {
                this.VertexSize   = (int)array[num2++];
                this.BoneSize     = (int)array[num2++];
                this.MorphSize    = (int)array[num2++];
                this.MaterialSize = (int)array[num2++];
                this.BodySize     = (int)array[num2++];
            }
            else
            {
                this.StringEnc    = (PmxElementFormat.StringEncType)array[num2++];
                this.UVACount     = (int)array[num2++];
                this.VertexSize   = (int)array[num2++];
                this.TexSize      = (int)array[num2++];
                this.MaterialSize = (int)array[num2++];
                this.BoneSize     = (int)array[num2++];
                this.MorphSize    = (int)array[num2++];
                this.BodySize     = (int)array[num2++];
            }
        }
        public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            Position = V3_BytesConvert.FromStream(s);
            Normal   = V3_BytesConvert.FromStream(s);
            UV       = V2_BytesConvert.FromStream(s);
            for (int i = 0; i < f.UVACount; i++)
            {
                Vector4 vector = V4_BytesConvert.FromStream(s);
                if (0 <= i && i < UVA.Length)
                {
                    UVA[i] = vector;
                }
            }
            Deform = (DeformType)s.ReadByte();
            SDEF   = false;
            switch (Deform)
            {
            case DeformType.BDEF1:
                Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[0].Value = 1f;
                break;

            case DeformType.BDEF2:
                Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[1].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[0].Value = PmxStreamHelper.ReadElement_Float(s);
                Weight[1].Value = 1f - Weight[0].Value;
                break;

            case DeformType.BDEF4:
            case DeformType.QDEF:
                Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[1].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[2].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[3].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[0].Value = PmxStreamHelper.ReadElement_Float(s);
                Weight[1].Value = PmxStreamHelper.ReadElement_Float(s);
                Weight[2].Value = PmxStreamHelper.ReadElement_Float(s);
                Weight[3].Value = PmxStreamHelper.ReadElement_Float(s);
                break;

            case DeformType.SDEF:
                Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[1].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
                Weight[0].Value = PmxStreamHelper.ReadElement_Float(s);
                Weight[1].Value = 1f - Weight[0].Value;
                C0 = V3_BytesConvert.FromStream(s);
                R0 = V3_BytesConvert.FromStream(s);
                R1 = V3_BytesConvert.FromStream(s);
                CalcSDEF_RW();
                SDEF = true;
                break;
            }
            EdgeScale = PmxStreamHelper.ReadElement_Float(s);
            if (f.WithID)
            {
                base.UID = PmxStreamHelper.ReadElement_UInt(s);
                base.CID = PmxStreamHelper.ReadElement_UInt(s);
            }
        }
 public virtual void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
 public virtual void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     if (f.WithID)
     {
         base.UID = PmxStreamHelper.ReadElement_UInt(s);
         base.CID = PmxStreamHelper.ReadElement_UInt(s);
     }
 }
 public override void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.ToStreamEx(s, f);
     PmxStreamHelper.WriteElement_Int32(s, Index, f.BodySize);
     s.WriteByte((byte)(Local ? 1u : 0u));
     V3_BytesConvert.ToStream(s, Velocity);
     V3_BytesConvert.ToStream(s, Torque);
 }
Esempio n. 28
0
 // Token: 0x0600023F RID: 575 RVA: 0x00012A10 File Offset: 0x00010C10
 public static Vector2 ReadElement_Vector2(Stream s)
 {
     return(new Vector2
     {
         X = PmxStreamHelper.ReadElement_Float(s),
         Y = PmxStreamHelper.ReadElement_Float(s)
     });
 }
 public override void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.FromStreamEx(s, f);
     Index    = PmxStreamHelper.ReadElement_Int32(s, f.BodySize);
     Local    = (s.ReadByte() != 0);
     Velocity = V3_BytesConvert.FromStream(s);
     Torque   = V3_BytesConvert.FromStream(s);
 }
        // Token: 0x06000114 RID: 276 RVA: 0x0000E920 File Offset: 0x0000CB20
        public override void FromStreamEx(Stream s, PmxElementFormat size)
        {
            this.Index       = PmxStreamHelper.ReadElement_Int32(s, size.BoneSize, true);
            this.Translation = V3_BytesConvert.FromStream(s);
            Vector4 vector = V4_BytesConvert.FromStream(s);

            this.Rotaion = new Quaternion(vector.x, vector.y, vector.z, vector.w);
        }