/// method to release a previous received tracker.
 /// @note it it the responsibility of the caller of @ref GetGestureTracker to call this method.
 /// 
 /// @param tracker the tracker to release.
 public void ReleaseTracker(NIGestureTracker tracker)
 {
     for (int i = 0; i < m_trackersList.Count; i++)
     {
         if(m_trackersList[i]!=tracker)
             continue; // not the one
         // now we have in 'i' the relevant tracker, remove it.
         for (int j = i + 1; j < m_trackersList.Count; j++)
             m_trackersList[j - 1] = m_trackersList[j];
         m_trackersList.RemoveAt(m_trackersList.Count - 1);
         return;
     }
 }
Exemple #2
0
    /// This method is called by the GestureManager to create the the tracker
    /// @note it it the responsibility of the caller to later call @ref ReleaseTracker on this object
    /// @param hand the hand tracker to work with
    /// @return The relevant tracker class @note INIGestureTracker is NOT mono-behavior.
    public virtual NIGestureTracker GetGestureTracker(NIPointTracker hand)
    {
        NIGestureTracker obj = GetNewTrackerObject();

        if (obj == null)
        {
            return(null); // we failed.
        }
        if (obj.Init(hand) == false)
        {
            return(null); // we failed to initialize
        }
        m_trackersList.Add(obj);
        return(obj);
    }
Exemple #3
0
 /// method to release a previous received tracker.
 /// @note it it the responsibility of the caller of @ref GetGestureTracker to call this method.
 ///
 /// @param tracker the tracker to release.
 public void ReleaseTracker(NIGestureTracker tracker)
 {
     for (int i = 0; i < m_trackersList.Count; i++)
     {
         if (m_trackersList[i] != tracker)
         {
             continue; // not the one
         }
         // now we have in 'i' the relevant tracker, remove it.
         for (int j = i + 1; j < m_trackersList.Count; j++)
         {
             m_trackersList[j - 1] = m_trackersList[j];
         }
         m_trackersList.RemoveAt(m_trackersList.Count - 1);
         return;
     }
 }
Exemple #4
0
 public NIAxis()
 {
     m_axisName            = "New Axis";
     m_descriptiveName     = "";
     m_gestureIndex        = 0;
     m_deadZone            = m_minDeadZone;
     m_sensitivity         = m_minSensitivity;
     m_invert              = false;
     m_Type                = NIInputTypes.HandMovement;
     m_maxMovement         = -1.0f;
     m_axisUsed            = AxesList.xAxis;
     m_sourceTrackerIndex  = 0;
     m_sourceTrackerString = "none";
     m_sourceTracker       = null;
     m_sourceGesture       = null;
     m_NIInputAxisOnly     = true;
 }
 /// This method allows us to unregister a callback previously registered using @ref RegisterCallbackForGesture
 /// @param eventDelegate the delegate to be called
 public abstract void UnRegisterCallbackForGesture(NIGestureTracker.GestureEventHandler eventDelegate);
 /// This method allows us to unregister a callback previously registered using @ref RegisterCallbackForGesture
 /// @param eventDelegate the delegate to be called
 /// @param axisName the axis name we want to check the gesture on
 public void UnRegisterCallbackForGesture(NIGestureTracker.GestureEventHandler eventDelegate, string axisName)
 {
     foreach (NIAxis axis in m_axisList)
     {
         if (axis.m_axisName.CompareTo(axisName) != 0)
             continue;
         if (axis.m_sourceGesture == null)
             continue;
         axis.m_sourceGesture.m_gestureEventHandler -= eventDelegate;
     }
 }
 /// This method allows us to register for a callback for the clicking
 /// @note it is the responsibility of the caller to unregister using @ref UnRegisterCallbackForGesture
 /// @param eventDelegate the delegate to be called
 public override void RegisterCallbackForGesture(NIGestureTracker.GestureEventHandler eventDelegate)
 {
     m_input.RegisterCallbackForGesture(eventDelegate, "NIGUI_CLICK");
 }
Exemple #8
0
 public NIAxis()
 {
     m_axisName="New Axis";
     m_descriptiveName="";
     m_gestureIndex = 0;
     m_deadZone=m_minDeadZone;
     m_sensitivity=m_minSensitivity;
     m_invert=false;
     m_Type=NIInputTypes.HandMovement;
     m_maxMovement=-1.0f;
     m_axisUsed=AxesList.xAxis;
     m_sourceTrackerIndex=0;
     m_sourceTrackerString = "none";
     m_sourceTracker = null;
     m_sourceGesture = null;
     m_NIInputAxisOnly=true;
 }