public bool InsertBone(BoneMatrix bone) { if (this.bone.id == bone.parent) { children.Add(new Skeleton(bone)); return(true); } bool found = false; foreach (Skeleton skel in children) { found = skel.InsertBone(bone); if (found) { break; } } return(found); }
/// <summary> /// Creates a new skeleton with a root node. Use this function once and use InsertBone to construct the skeleton. /// </summary> public Skeleton(BoneMatrix root) { bone = root; children = new List <Skeleton>(); }