コード例 #1
0
ファイル: PmxSoftBody.cs プロジェクト: ZeusAFK/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.ReadIndex(br, PmxIndexKind.Material),
         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.ReadIndex(br, PmxIndexKind.Vertex)).ToList(),
     });
 }
コード例 #2
0
 public static PmxSoftBodyAnchor Parse(BinaryReader br, PmxDocument doc)
 {
     return(new PmxSoftBodyAnchor
     {
         Rigid = doc.ReadIndex(br, PmxIndexKind.Rigid),
         Vertex = doc.ReadIndex(br, PmxIndexKind.Vertex),
         IsNearMode = br.ReadBoolean(),
     });
 }
コード例 #3
0
ファイル: PmxSoftBodyAnchor.cs プロジェクト: ZeusAFK/Keystone
 public static PmxSoftBodyAnchor Parse(BinaryReader br, PmxDocument doc)
 {
     return new PmxSoftBodyAnchor
     {
         Rigid = doc.ReadIndex(br, PmxIndexKind.Rigid),
         Vertex = doc.ReadIndex(br, PmxIndexKind.Vertex),
         IsNearMode = br.ReadBoolean(),
     };
 }
コード例 #4
0
ファイル: PmxSoftBody.cs プロジェクト: ZeusAFK/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.ReadIndex(br, PmxIndexKind.Material),
         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.ReadIndex(br, PmxIndexKind.Vertex)).ToList(),
     };
 }