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);
            }
        }
 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 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);
            }
        }
示例#5
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)
     });
 }
        // 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);
        }
示例#7
0
 // Token: 0x06000245 RID: 581 RVA: 0x00012B84 File Offset: 0x00010D84
 public static Quaternion ReadElement_Quaternion(Stream s)
 {
     return(new Quaternion
     {
         X = PmxStreamHelper.ReadElement_Float(s),
         Y = PmxStreamHelper.ReadElement_Float(s),
         Z = PmxStreamHelper.ReadElement_Float(s),
         W = PmxStreamHelper.ReadElement_Float(s)
     });
 }
示例#8
0
 // Token: 0x06000243 RID: 579 RVA: 0x00012AF4 File Offset: 0x00010CF4
 public static Vector4 ReadElement_Vector4(Stream s)
 {
     return(new Vector4
     {
         X = PmxStreamHelper.ReadElement_Float(s),
         Y = PmxStreamHelper.ReadElement_Float(s),
         Z = PmxStreamHelper.ReadElement_Float(s),
         W = PmxStreamHelper.ReadElement_Float(s)
     });
 }
示例#9
0
        // Token: 0x06000106 RID: 262 RVA: 0x0000E550 File Offset: 0x0000C750
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Name     = PmxStreamHelper.ReadString(s, f);
            this.NameE    = PmxStreamHelper.ReadString(s, f);
            this.Position = V3_BytesConvert.FromStream(s);
            this.Parent   = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
            this.Level    = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Flags    = (PmxBone.BoneFlags)PmxStreamHelper.ReadElement_Int32(s, 2, false);
            bool flag = this.GetFlag(PmxBone.BoneFlags.ToBone);

            if (flag)
            {
                this.To_Bone = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
            }
            else
            {
                this.To_Offset = V3_BytesConvert.FromStream(s);
            }
            bool flag2 = this.GetFlag(PmxBone.BoneFlags.AppendRotation) || this.GetFlag(PmxBone.BoneFlags.AppendTranslation);

            if (flag2)
            {
                this.AppendParent = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
                this.AppendRatio  = PmxStreamHelper.ReadElement_Float(s);
            }
            bool flag3 = this.GetFlag(PmxBone.BoneFlags.FixAxis);

            if (flag3)
            {
                this.Axis = V3_BytesConvert.FromStream(s);
            }
            bool flag4 = this.GetFlag(PmxBone.BoneFlags.LocalFrame);

            if (flag4)
            {
                this.LocalX = V3_BytesConvert.FromStream(s);
                this.LocalZ = V3_BytesConvert.FromStream(s);
                this.NormalizeLocal();
            }
            bool flag5 = this.GetFlag(PmxBone.BoneFlags.ExtParent);

            if (flag5)
            {
                this.ExtKey = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            }
            bool flag6 = this.GetFlag(PmxBone.BoneFlags.IK);

            if (flag6)
            {
                this.IK.FromStreamEx(s, f);
            }
        }
 // 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 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);
 }
示例#12
0
 public void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     Name     = PmxStreamHelper.ReadString(s, f);
     NameE    = PmxStreamHelper.ReadString(s, f);
     Position = V3_BytesConvert.FromStream(s);
     Parent   = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
     Level    = PmxStreamHelper.ReadElement_Int32(s);
     Flags    = (BoneFlags)PmxStreamHelper.ReadElement_Int32(s, 2, signed: false);
     if (GetFlag(BoneFlags.ToBone))
     {
         To_Bone = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
     }
     else
     {
         To_Offset = V3_BytesConvert.FromStream(s);
     }
     if (GetFlag(BoneFlags.AddRotation) || GetFlag(BoneFlags.AddTranslation))
     {
         AddParent = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
         AddRatio  = PmxStreamHelper.ReadElement_Float(s);
     }
     if (GetFlag(BoneFlags.FixAxis))
     {
         Axis = V3_BytesConvert.FromStream(s);
     }
     if (GetFlag(BoneFlags.LocalFrame))
     {
         LocalX = V3_BytesConvert.FromStream(s);
         LocalZ = V3_BytesConvert.FromStream(s);
         if (!f.WithID)
         {
             NormalizeLocal();
         }
     }
     if (GetFlag(BoneFlags.ExtParent))
     {
         ExtKey = PmxStreamHelper.ReadElement_Int32(s);
     }
     if (GetFlag(BoneFlags.IK))
     {
         IK.FromStreamEx(s, f);
     }
     if (f.WithID)
     {
         base.UID = PmxStreamHelper.ReadElement_UInt(s);
         base.CID = PmxStreamHelper.ReadElement_UInt(s);
     }
 }
示例#13
0
        // Token: 0x06000162 RID: 354 RVA: 0x0000F3B4 File Offset: 0x0000D5B4
        public void FromStreamEx(Stream s, PmxElementFormat f)
        {
            this.Target    = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize, true);
            this.LoopCount = PmxStreamHelper.ReadElement_Int32(s, 4, true);
            this.Angle     = PmxStreamHelper.ReadElement_Float(s);
            int num = PmxStreamHelper.ReadElement_Int32(s, 4, true);

            this.LinkList.Clear();
            this.LinkList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                PmxIK.IKLink iklink = new PmxIK.IKLink();
                iklink.FromStreamEx(s, f);
                this.LinkList.Add(iklink);
            }
        }
示例#14
0
        public void FromStreamEx(Stream s, PmxElementFormat f = null)
        {
            Target    = PmxStreamHelper.ReadElement_Int32(s, f.BoneSize);
            LoopCount = PmxStreamHelper.ReadElement_Int32(s);
            Angle     = PmxStreamHelper.ReadElement_Float(s);
            int num = PmxStreamHelper.ReadElement_Int32(s);

            LinkList.Clear();
            LinkList.Capacity = num;
            for (int i = 0; i < num; i++)
            {
                IKLink iKLink = new IKLink();
                iKLink.FromStreamEx(s, f);
                LinkList.Add(iKLink);
            }
        }
 // 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 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);
 }
示例#17
0
        // Token: 0x06000247 RID: 583 RVA: 0x00012C10 File Offset: 0x00010E10
        public static Matrix ReadElement_Matrix(Stream s)
        {
            Matrix result;

            result.M11 = PmxStreamHelper.ReadElement_Float(s);
            result.M12 = PmxStreamHelper.ReadElement_Float(s);
            result.M13 = PmxStreamHelper.ReadElement_Float(s);
            result.M14 = PmxStreamHelper.ReadElement_Float(s);
            result.M21 = PmxStreamHelper.ReadElement_Float(s);
            result.M22 = PmxStreamHelper.ReadElement_Float(s);
            result.M23 = PmxStreamHelper.ReadElement_Float(s);
            result.M24 = PmxStreamHelper.ReadElement_Float(s);
            result.M31 = PmxStreamHelper.ReadElement_Float(s);
            result.M32 = PmxStreamHelper.ReadElement_Float(s);
            result.M33 = PmxStreamHelper.ReadElement_Float(s);
            result.M34 = PmxStreamHelper.ReadElement_Float(s);
            result.M41 = PmxStreamHelper.ReadElement_Float(s);
            result.M42 = PmxStreamHelper.ReadElement_Float(s);
            result.M43 = PmxStreamHelper.ReadElement_Float(s);
            result.M44 = PmxStreamHelper.ReadElement_Float(s);
            return(result);
        }
示例#18
0
        // 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();
        }
 public override void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     base.FromStreamEx(s, f);
     Index = PmxStreamHelper.ReadElement_Int32(s, f.MorphSize);
     Ratio = PmxStreamHelper.ReadElement_Float(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);
 }
示例#21
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);
            }
        }
示例#22
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();
        }