void ParentLegToLeg(Leg parent, Leg child)
 {
     InsertBoneParent(child.upperLeg.bone, parent.upperLeg.bone);
     InsertBoneParent(child.lowerLeg.bone, parent.lowerLeg.bone);
     InsertBoneParent(child.foot.bone, parent.foot.bone);
     if (child.toes?.bone != null)
     {
         InsertBoneParent(child.toes.bone, parent.toes.bone);
     }
     if (child.toesEnd?.bone != null)
     {
         InsertBoneParent(child.toesEnd.bone, parent.toesEnd.bone);
     }
 }
 private void ReparentLeg(Leg leg, Body body)
 {
     leg.upperLeg.bone.SetParent(body.hip.bone);
     leg.lowerLeg.bone.SetParent(leg.upperLeg.bone);
     leg.foot.bone.SetParent(leg.lowerLeg.bone);
     if (leg.toes?.bone != null)
     {
         leg.toes.bone.SetParent(leg.foot.bone);
     }
     if (leg.toesEnd?.bone != null && leg.toes?.bone != null)
     {
         leg.toesEnd.bone.SetParent(leg.toes.bone);
     }
 }
Exemple #3
0
        private void DrawLeg(Leg leg, Body body)
        {
            // Draw Skeleton
            ConnectBones(body.hip, leg.upperLeg);
            ConnectBones(leg.upperLeg, leg.lowerLeg);
            ConnectBones(leg.lowerLeg, leg.foot);
            ConnectBones(leg.foot, leg.toes);
            ConnectBones(leg.toes, leg.toesEnd);

            // Draw Bones
            DrawBone(leg.upperLeg, size);
            DrawBone(leg.lowerLeg, size);
            DrawBone(leg.foot, size);
            DrawBone(leg.toes, size);
            DrawBone(leg.toesEnd, size);
        }