// protected methods

    /// Gesture initialization
    ///
    /// This method is responsible for initializing the gesture to work with a specific hand tracker
    /// @param hand the hand tracker to work with
    /// @return true on success, false on failure (e.g. if the hand tracker does not work with the gesture).
    protected override bool InternalInit(NIPointTracker hand)
    {
        NIHandTracker curHand = hand as NIHandTracker;

        if (curHand == null)
        {
            return(false);
        }
        return(curHand.AddListener(m_steadyDetector));
    }
Пример #2
0
    /// Release the gesture
    public override void ReleaseGesture()
    {
        NIHandTracker tracker = m_pointTracker as NIHandTracker;

        if (tracker == null)
        {
            return;
        }
        tracker.RemoveListener(m_pushDetector);
        m_pointTracker = null;
    }
Пример #3
0
    // protected methods

    /// Gesture initialization
    ///
    /// This method is responsible for initializing the gesture to work with a specific hand tracker
    /// @param hand the hand tracker to work with
    /// @return true on success, false on failure (e.g. if the hand tracker does not work with the gesture).
    protected override bool InternalInit(NIPointTracker hand)
    {
        NIHandTracker curHand = hand as NIHandTracker;

        if (curHand == null)
        {
            return(false);
        }
        if (curHand.AddListener(m_pushDetector) == false)
        {
            return(false);
        }
        m_immediateDuration = ((float)m_pushDetector.ImmediateDuration) / 1000.0f;
        return(true);
    }