Exemplo n.º 1
0
    private void ApplyConfiguration(int index)
    {
        SkeletonTrackingAnimation sta = target as SkeletonTrackingAnimation;

        foreach (SkeletonTrackingAnimation.TransformWrapper tw in sta.m_hierarchyList)
        {
            tw.m_transform = SearchRendererOrHeirarchy(sta.transform, m_knowenConfigurations[index][(Omek.JointID)tw.m_jointID]);
        }

        foreach (SkeletonTrackingAnimation.RollJointWrapper rjw in sta.m_rollJointsList)
        {
            rjw.m_transform = SearchRendererOrHeirarchy(sta.transform, m_knowenRollJointsConfigurations[index][rjw.m_name]);
        }

        FixHips(sta);
    }
Exemplo n.º 2
0
 private void FixHips(SkeletonTrackingAnimation sta)
 {
     SkeletonTrackingAnimation.TransformWrapper hipsWrapper = sta.m_hierarchyList.Find((a) => { return(a.m_jointID == Omek.JointID.hips); });
     if (hipsWrapper != null && hipsWrapper.m_transform == null)
     {
         SkeletonTrackingAnimation.TransformWrapper headWrapper = sta.m_hierarchyList.Find((a) => { return(a.m_jointID == Omek.JointID.head); });
         if (headWrapper != null && headWrapper.m_transform != null)
         {
             string hipsName;
             if (headWrapper.m_transform.name.Contains(" "))
             {
                 hipsName = headWrapper.m_transform.name.Split(' ')[0];
             }
             else
             {
                 hipsName = headWrapper.m_transform.name.Split('_')[0];
             }
             if (!string.IsNullOrEmpty(hipsName))
             {
                 hipsWrapper.m_transform = SearchRendererOrHeirarchy(sta.transform, hipsName);
             }
         }
     }
 }