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: 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 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);
            }
        }
        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);
            }
        }
        // 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);
        }
        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);
            }
        }
Beispiel #7
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: 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);
        }
Beispiel #9
0
        public override void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            base.FromStreamEx(s, f);
            Index       = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
            Translation = V3_BytesConvert.FromStream(s);
            Vector4 vector = V4_BytesConvert.FromStream(s);

            Rotaion = new Quaternion(vector.X, vector.Y, vector.Z, vector.W);
        }
        public void ToStreamEx(Stream s, PmxElementFormat f = null)
        {
            V3_BytesConvert.ToStream(s, Position);
            V3_BytesConvert.ToStream(s, Normal);
            V2_BytesConvert.ToStream(s, UV);
            for (int i = 0; i < f.UVACount; i++)
            {
                V4_BytesConvert.ToStream(s, UVA[i]);
            }
            if (Deform == DeformType.QDEF && f.Ver < 2.1f)
            {
                s.WriteByte(2);
            }
            else
            {
                s.WriteByte((byte)Deform);
            }
            switch (Deform)
            {
            case DeformType.BDEF1:
                PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize);
                break;

            case DeformType.BDEF2:
                PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize);
                PmxStreamHelper.WriteElement_Int32(s, Weight[1].Bone, f.BoneSize);
                PmxStreamHelper.WriteElement_Float(s, Weight[0].Value);
                break;

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

            case DeformType.SDEF:
                PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize);
                PmxStreamHelper.WriteElement_Int32(s, Weight[1].Bone, f.BoneSize);
                PmxStreamHelper.WriteElement_Float(s, Weight[0].Value);
                V3_BytesConvert.ToStream(s, C0);
                V3_BytesConvert.ToStream(s, R0);
                V3_BytesConvert.ToStream(s, R1);
                break;
            }
            PmxStreamHelper.WriteElement_Float(s, EdgeScale);
            if (f.WithID)
            {
                PmxStreamHelper.WriteElement_UInt(s, base.UID);
                PmxStreamHelper.WriteElement_UInt(s, base.CID);
            }
        }
        // Token: 0x06000281 RID: 641 RVA: 0x00013E78 File Offset: 0x00012078
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Position = V3_BytesConvert.FromStream(s);
            this.Normal   = V3_BytesConvert.FromStream(s);
            this.UV       = V2_BytesConvert.FromStream(s);
            for (int i = 0; i < f.UVACount; i++)
            {
                Vector4 vector = V4_BytesConvert.FromStream(s);
                bool    flag   = 0 <= i && i < this.UVA.Length;
                if (flag)
                {
                    this.UVA[i] = vector;
                }
            }
            this.Deform = (PmxVertex.DeformType)s.ReadByte();
            this.SDEF   = false;
            switch (this.Deform)
            {
            case PmxVertex.DeformType.BDEF1:
                this.Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
                this.Weight[0].Value = 1f;
                break;

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

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

            case PmxVertex.DeformType.SDEF:
                this.Weight[0].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
                this.Weight[1].Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
                this.Weight[0].Value = PmxStreamHelper.ReadElement_Float(s);
                this.Weight[1].Value = 1f - this.Weight[0].Value;
                this.C0 = V3_BytesConvert.FromStream(s);
                this.R0 = V3_BytesConvert.FromStream(s);
                this.R1 = V3_BytesConvert.FromStream(s);
                this.CalcSDEF_RW();
                this.SDEF = true;
                break;
            }
            this.EdgeScale = PmxStreamHelper.ReadElement_Float(s);
        }
        // Token: 0x06000282 RID: 642 RVA: 0x0001417C File Offset: 0x0001237C
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            V3_BytesConvert.ToStream(s, this.Position);
            V3_BytesConvert.ToStream(s, this.Normal);
            V2_BytesConvert.ToStream(s, this.UV);
            for (int i = 0; i < f.UVACount; i++)
            {
                V4_BytesConvert.ToStream(s, this.UVA[i]);
            }
            bool flag = this.Deform == PmxVertex.DeformType.QDEF && f.Ver < 2.1f;

            if (flag)
            {
                s.WriteByte(2);
            }
            else
            {
                s.WriteByte((byte)this.Deform);
            }
            switch (this.Deform)
            {
            case PmxVertex.DeformType.BDEF1:
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true);
                break;

            case PmxVertex.DeformType.BDEF2:
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value);
                break;

            case PmxVertex.DeformType.BDEF4:
            case PmxVertex.DeformType.QDEF:
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[2].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[3].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[1].Value);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[2].Value);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[3].Value);
                break;

            case PmxVertex.DeformType.SDEF:
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value);
                V3_BytesConvert.ToStream(s, this.C0);
                V3_BytesConvert.ToStream(s, this.R0);
                V3_BytesConvert.ToStream(s, this.R1);
                break;
            }
            PmxStreamHelper.WriteElement_Float(s, this.EdgeScale);
        }
 // Token: 0x060001CD RID: 461 RVA: 0x000109A8 File Offset: 0x0000EBA8
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.MaterialSize, true);
     s.WriteByte((byte)this.Op);
     V4_BytesConvert.ToStream(s, this.Data.Diffuse);
     V4_BytesConvert.ToStream(s, this.Data.Specular);
     V3_BytesConvert.ToStream(s, this.Data.Ambient);
     V4_BytesConvert.ToStream(s, this.Data.EdgeColor);
     PmxStreamHelper.WriteElement_Float(s, this.Data.EdgeSize);
     V4_BytesConvert.ToStream(s, this.Data.Tex);
     V4_BytesConvert.ToStream(s, this.Data.Sphere);
     V4_BytesConvert.ToStream(s, this.Data.Toon);
 }
 // Token: 0x060001CC RID: 460 RVA: 0x000108F0 File Offset: 0x0000EAF0
 public override void FromStreamEx(Stream s, PmxElementFormat size)
 {
     this.Index          = PmxStreamHelper.ReadElement_Int32(s, size.MaterialSize, true);
     this.Op             = (PmxMaterialMorph.OpType)s.ReadByte();
     this.Data.Diffuse   = V4_BytesConvert.FromStream(s);
     this.Data.Specular  = V4_BytesConvert.FromStream(s);
     this.Data.Ambient   = V3_BytesConvert.FromStream(s);
     this.Data.EdgeColor = V4_BytesConvert.FromStream(s);
     this.Data.EdgeSize  = PmxStreamHelper.ReadElement_Float(s);
     this.Data.Tex       = V4_BytesConvert.FromStream(s);
     this.Data.Sphere    = V4_BytesConvert.FromStream(s);
     this.Data.Toon      = V4_BytesConvert.FromStream(s);
 }
 public override void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.ToStreamEx(s, f);
     PmxStreamHelper.WriteElement_Int32(s, Index, f.MaterialSize);
     s.WriteByte((byte)Op);
     V4_BytesConvert.ToStream(s, Data.Diffuse);
     V4_BytesConvert.ToStream(s, Data.Specular);
     V3_BytesConvert.ToStream(s, Data.Ambient);
     V4_BytesConvert.ToStream(s, Data.EdgeColor);
     PmxStreamHelper.WriteElement_Float(s, Data.EdgeSize);
     V4_BytesConvert.ToStream(s, Data.Tex);
     V4_BytesConvert.ToStream(s, Data.Sphere);
     V4_BytesConvert.ToStream(s, Data.Toon);
 }
 public override void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.FromStreamEx(s, f);
     Index          = PmxStreamHelper.ReadElement_Int32(s, f.MaterialSize);
     Op             = (OpType)s.ReadByte();
     Data.Diffuse   = V4_BytesConvert.FromStream(s);
     Data.Specular  = V4_BytesConvert.FromStream(s);
     Data.Ambient   = V3_BytesConvert.FromStream(s);
     Data.EdgeColor = V4_BytesConvert.FromStream(s);
     Data.EdgeSize  = PmxStreamHelper.ReadElement_Float(s);
     Data.Tex       = V4_BytesConvert.FromStream(s);
     Data.Sphere    = V4_BytesConvert.FromStream(s);
     Data.Toon      = V4_BytesConvert.FromStream(s);
 }
 // Token: 0x060000DE RID: 222 RVA: 0x0000DE5C File Offset: 0x0000C05C
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.Name, f);
     PmxStreamHelper.WriteString(s, this.NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, this.Bone, f.BoneSize, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Group, 1, true);
     PmxStreamHelper.WriteElement_Int32(s, (int)this.PassGroup.ToFlagBits(), 2, false);
     s.WriteByte((byte)this.BoxType);
     V3_BytesConvert.ToStream(s, this.BoxSize);
     V3_BytesConvert.ToStream(s, this.Position);
     V3_BytesConvert.ToStream(s, this.Rotation);
     PmxStreamHelper.WriteElement_Float(s, this.Mass);
     V4_BytesConvert.ToStream(s, new Vector4(this.PositionDamping, this.RotationDamping, this.Restitution, this.Friction));
     s.WriteByte((byte)this.Mode);
 }
 public void ToStreamEx(Stream s, 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.WriteString(s, Tex, f);
     PmxStreamHelper.WriteString(s, Sphere, f);
     s.WriteByte((byte)SphereMode);
     PmxStreamHelper.WriteString(s, Toon, f);
     PmxStreamHelper.WriteString(s, Memo, f);
     PmxStreamHelper.WriteElement_Int32(s, FaceCount);
 }
 public void FromStreamEx(Stream s, 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        = PmxStreamHelper.ReadString(s, f);
     Sphere     = PmxStreamHelper.ReadString(s, f);
     SphereMode = (SphereModeType)s.ReadByte();
     Toon       = PmxStreamHelper.ReadString(s, f);
     Memo       = PmxStreamHelper.ReadString(s, f);
     FaceCount  = PmxStreamHelper.ReadElement_Int32(s);
 }
 // Token: 0x060001A9 RID: 425 RVA: 0x000100B0 File Offset: 0x0000E2B0
 public void ToStreamEx(Stream s, 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.WriteString(s, this.Tex, f);
     PmxStreamHelper.WriteString(s, this.Sphere, f);
     s.WriteByte((byte)this.SphereMode);
     PmxStreamHelper.WriteString(s, this.Toon, f);
     PmxStreamHelper.WriteString(s, this.Memo, f);
     PmxStreamHelper.WriteElement_Int32(s, this.FaceCount, 4, true);
 }
 // Token: 0x060001A8 RID: 424 RVA: 0x0000FFCC File Offset: 0x0000E1CC
 public void FromStreamEx(Stream s, 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   = V3_BytesConvert.Vector3ToColor(V3_BytesConvert.FromStream(s));
     this.Power      = PmxStreamHelper.ReadElement_Float(s);
     this.Ambient    = V3_BytesConvert.Vector3ToColor(V3_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        = PmxStreamHelper.ReadString(s, f);
     this.Sphere     = PmxStreamHelper.ReadString(s, f);
     this.SphereMode = (PmxMaterial.SphereModeType)s.ReadByte();
     this.Toon       = PmxStreamHelper.ReadString(s, f);
     this.Memo       = PmxStreamHelper.ReadString(s, f);
     this.FaceCount  = PmxStreamHelper.ReadElement_Int32(s, 4, true);
 }
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, Bone, f.BoneSize);
     PmxStreamHelper.WriteElement_Int32(s, Group, 1);
     PmxStreamHelper.WriteElement_Int32(s, PassGroup.ToFlagBits(), 2, signed: false);
     s.WriteByte((byte)BoxType);
     V3_BytesConvert.ToStream(s, BoxSize);
     V3_BytesConvert.ToStream(s, Position);
     V3_BytesConvert.ToStream(s, Rotation);
     PmxStreamHelper.WriteElement_Float(s, Mass);
     V4_BytesConvert.ToStream(s, new Vector4(PositionDamping, RotationDamping, Restitution, Friction));
     s.WriteByte((byte)Mode);
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
        // Token: 0x060000DD RID: 221 RVA: 0x0000DD78 File Offset: 0x0000BF78
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Name  = PmxStreamHelper.ReadString(s, f);
            this.NameE = PmxStreamHelper.ReadString(s, f);
            this.Bone  = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
            this.Group = PmxStreamHelper.ReadElement_Int32(s, 1, true);
            ushort bits = (ushort)PmxStreamHelper.ReadElement_Int32(s, 2, false);

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

            this.PositionDamping = vector.x;
            this.RotationDamping = vector.y;
            this.Restitution     = vector.z;
            this.Friction        = vector.w;
            this.Mode            = (PmxBody.ModeType)s.ReadByte();
        }
Beispiel #24
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: 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));
 }
Beispiel #26
0
 // Token: 0x06000269 RID: 617 RVA: 0x00013347 File Offset: 0x00011547
 public override void ToStreamEx(Stream s, PmxElementFormat size)
 {
     PmxStreamHelper.WriteElement_Int32(s, this.Index, size.VertexSize, false);
     V4_BytesConvert.ToStream(s, this.Offset);
 }
Beispiel #27
0
 // Token: 0x06000268 RID: 616 RVA: 0x00013325 File Offset: 0x00011525
 public override void FromStreamEx(Stream s, PmxElementFormat size)
 {
     this.Index  = PmxStreamHelper.ReadElement_Int32(s, size.VertexSize, false);
     this.Offset = V4_BytesConvert.FromStream(s);
 }
Beispiel #28
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);
 }