public static PmxIK Parse(BinaryReader br, PmxDocument doc) { return(new PmxIK { TargetBone = doc.ReadIndex(br, PmxIndexKind.Bone), LoopCount = br.ReadInt32(), AngleLimitUnit = br.ReadSingle(), BindedBones = Enumerable.Range(0, br.ReadInt32()).Select(_ => PmxIKBinding.Parse(br, doc)).ToList(), }); }
public static PmxIKBinding Parse(BinaryReader br, PmxDocument doc) { var rt = new PmxIKBinding { Bone = doc.ReadIndex(br, PmxIndexKind.Bone), IsAngleLimitEnabled = br.ReadBoolean(), }; if (rt.IsAngleLimitEnabled) { rt.LowerAngleLimit = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; rt.HigherAngleLimit = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; } return(rt); }
public static PmxIKBinding Parse(BinaryReader br, PmxDocument doc) { var rt = new PmxIKBinding { Bone = doc.ReadIndex(br, PmxIndexKind.Bone), IsAngleLimitEnabled = br.ReadBoolean(), }; if (rt.IsAngleLimitEnabled) { rt.LowerAngleLimit = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; rt.HigherAngleLimit = new[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; } return rt; }