Ejemplo n.º 1
0
        //每帧记录标定
        public void UpdateTracking(float dt)
        {
            trackingTime   += dt;
            trackingMissCnt = 0;
            Dictionary <SkeletonType, Vector3> boneWorldPosDict         = new Dictionary <SkeletonType, Vector3> ();
            Dictionary <SkeletonType, Vector3> boneScreenPercentPosDict = new Dictionary <SkeletonType, Vector3> ();

            foreach (KeyValuePair <SkeletonType, int> kv in OrbbecUtils.jointToIntDict)
            {
                if (kv.Key != SkeletonType.Invalid)
                {
                    boneWorldPosDict.Add(kv.Key, OrbbecUtils.GetWorldPos(bindUser, kv.Key));
                    boneScreenPercentPosDict.Add(kv.Key, OrbbecUtils.GetScreenPercentPos(bindUser, kv.Key));
                }
            }
            _trackingBoneWorldPosDictList.Add(boneWorldPosDict);
            _trackingBoneScreenPercentPosDictList.Add(boneScreenPercentPosDict);

            if (boneWorldPosDict != null && boneWorldPosDict.ContainsKey(SkeletonType.Torso))
            {
                torsoPos = boneWorldPosDict [SkeletonType.Torso];
            }
        }
Ejemplo n.º 2
0
 //得到当前的 镜像 转 正常 的骨架信息 屏幕百分比坐标
 public Vector3 GetScreenPercentPos(SkeletonType skeletonType)
 {
     return(OrbbecUtils.GetScreenPercentPos(bindUser, skeletonType));
 }