예제 #1
0
        public static bool IsJointTracked(IRISJoints.Joints joint, int userIndex = 0)
        {
            if (!AreDatasAvailable())
            {
                return(false);
            }
            ulong uid = KinectManager.Instance.GetUserIdByIndex(userIndex);

            return(KinectManager.Instance.IsJointTracked(uid, IRISJoints.GetKinectJoint(joint)));
        }
예제 #2
0
        public static Vector3 GetJointRot3D(IRISJoints.Joints joint, int userIndex = 0)
        {
            if (AreDatasAvailable())
            {
                ulong uid = KinectManager.Instance.GetUserIdByIndex(userIndex);

                Vector3 rot;
                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    rot = KinectManager.Instance.GetJointOrientation(uid, IRISJoints.GetInvertedKinectJoint(joint), true).eulerAngles;
                }
                else
                {
                    rot = KinectManager.Instance.GetJointOrientation(uid, IRISJoints.GetInvertedKinectJoint(joint), true).eulerAngles;
                }

                return(rot);
            }
            return(Vector3.zero);
        }
예제 #3
0
        public static Vector3 GetJointPos3D(IRISJoints.Joints joint, int userIndex = 0)
        {
            if (AreDatasAvailable())
            {
                ulong uid = KinectManager.Instance.GetUserIdByIndex(userIndex);

                Vector3 pos;
                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    pos    = KinectManager.Instance.GetJointPosition(uid, IRISJoints.GetInvertedKinectJoint(joint));
                    pos.x *= -1f;
                }
                else
                {
                    pos = KinectManager.Instance.GetJointPosition(uid, IRISJoints.GetKinectJoint(joint));
                }
                //Debug.Log(joint + "/" + userIndex);
                return(pos);
            }
            return(Vector3.zero);
        }