public void Init(PmxBoneData data, PmxBones bones) { TargetBone = bones[data.IkTargetId]; Childs = new PmxIKChild[data.IkChilds.Length]; for (int i = 0; i < Childs.Length; i++) { var childData = data.IkChilds[i]; Childs[i] = new PmxIKChild(bones[childData.ChildId], childData.AngleMin, childData.AngleMax); } }
public void Init(PmxBoneData data, PmxBones bones) { if (0 <= data.ParentId && data.ParentId < bones.Count) { ParentBone = bones[data.ParentId]; OffsetPos = (Vector4)OffsetPos * ParentBone.InvInitMat; } if (Flag.HasFlag(BoneFlags.MOVE_LINK) | Flag.HasFlag(BoneFlags.ROTATE_LINK)) { LinkParent = bones[data.LinkParentId]; } if (Flag.HasFlag(BoneFlags.IK)) { IK.Init(data, bones); } }