コード例 #1
0
ファイル: PmxSoftBody.cs プロジェクト: mfakane/Keystone
 public static PmxSoftBody Parse(BinaryReader br, PmxDocument doc)
 {
     return new PmxSoftBody
     {
         Name = doc.ReadString(br),
         EnglishName = doc.ReadString(br),
         Kind = (PmxSoftBodyKind)br.ReadByte(),
         RelatedMaterial = doc.ReadMaterial(br),
         Group = br.ReadByte(),
         CollidableGroups = (PmdRigidGroups)br.ReadUInt16(),
         Options = (PmxSoftBodyOptions)br.ReadByte(),
         BendingLinkDistance = br.ReadInt32(),
         ClusterCount = br.ReadInt32(),
         TotalMass = br.ReadSingle(),
         Margin = br.ReadSingle(),
         AeroModel = (PmxSoftBodyAeroModel)br.ReadInt32(),
         Configuration = Enum.GetValues(typeof(PmxConfigurationIndex)).Cast<PmxConfigurationIndex>().ToDictionary(_ => _, _ => br.ReadSingle()),
         VelocitySolverIteration = br.ReadInt32(),
         PositonSolverIteration = br.ReadInt32(),
         DriftSolverIteration = br.ReadInt32(),
         ClusterSolverIteration = br.ReadInt32(),
         LinearStiffnessCoefficient = br.ReadSingle(),
         AreaAngularStiffnessCoefficient = br.ReadSingle(),
         VolumeStiffnessCoefficient = br.ReadSingle(),
         Anchors = Enumerable.Range(0, br.ReadInt32()).Select(_ => PmxSoftBodyAnchor.Parse(br, doc)).ToList(),
         PinnedVertices = Enumerable.Range(0, br.ReadInt32()).Select(_ => doc.ReadVertex(br)).ToList(),
     };
 }