Esempio n. 1
0
 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(),
     });
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }