示例#1
0
文件: PmxIK.cs 项目: ZeusAFK/Keystone
 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(),
     });
 }
示例#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);
        }
示例#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;
        }