Пример #1
0
    private string GetDescription(HandsInput.HandStateRaw state)
    {
        string result = "";

        result += "\n B:Valide: " + state.valid;
        result += "\n UI:ID: " + state.id;
        result += "\n B:isTappingDown: " + state.isTappingDown;
        result += "\n F:tapPRessedTime: " + state.tapPressedStartTime;
        result += "\n V3:StartPos: " + state.latestTapStartPosition;
        result += "\n V3:LastPos: " + state.latestObservedPosition;
        return(result);
    }
    private void RefreshDataWith(HandsInput.HandStateRaw rawHand, int index)
    {
        bool wasTracked = m_hands[index].m_isTracked, isTracked = rawHand.valid;


        if (rawHand.valid)
        {
            m_hands[index].m_isTracked = rawHand.valid;
            m_hands[index].m_isTapping = rawHand.isTappingDown;
            m_hands[index].m_startTappingPositionDetected = ConvertedRawPositionToUnityPosition(rawHand.latestTapStartPosition);
            m_hands[index].m_lastPositionDetected         = ConvertedRawPositionToUnityPosition(rawHand.latestObservedPosition);
            m_hands[index].m_firstDetectedPosition        = ConvertedRawPositionToUnityPosition(rawHand.firstObservedPosition);
            m_hands[index].m_handType = m_hands[index].GuessHandType();
            if (m_hands[index].m_handType == HandSideType.Left)
            {
                m_left = m_hands[index];
            }
            if (m_hands[index].m_handType == HandSideType.Right)
            {
                m_right = m_hands[index];
            }
        }
        else
        {
            m_hands[index].Reset();
        }



        if (!wasTracked && isTracked)
        {
            NotifyStartTracking(m_hands[index]);
        }
        if (wasTracked && !isTracked)
        {
            NotifyStopTracking(m_hands[index]);
        }
    }