private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #2
0
 /*****************************************************
 * DETECTED FIST GESTURE
 *
 * INFO:    Valide la détection du geste qui consiste
 *          à fermer la main (poing). La fonction
 *          communique directement avec le médiateur
 *          du contrôleur de gestes.
 *
 *****************************************************/
 public override bool IsDetectedGesture()
 {
     isFisting = false;
     if (DetectionController.GetInstance().IsHandDetected(hand))
     {
         DetectionController.HandController handController = DetectionController.GetInstance().GetHand(hand);
         isFisting = handController.IsFist(tolerance) && handController.IsAllFingersClosed() && !BothFistGesture.GetInstance().IsBothFisting();
     }
     DisplayDectedGesture(isFisting);
     return(isFisting);
 }
Example #3
0
    /*****************************************************
    * DETECTED BOTH PINCH GESTURE
    *
    * INFO:    Valide la détection du geste qui consiste à
    *          effectuer un pincement de doigts avec les
    *          deux mains. La fonction communique directement
    *          avec le médiateur du contrôleur de gestes.
    *          Pincement du pouce et de l'index.
    *
    *****************************************************/
    public override bool IsDetectedGesture()
    {
        isBothPinch = false;
        if (DetectionController.GetInstance().IsBothHandsDetected() && DetectionController.GetInstance().IsBothHandsVisible())
        {
            //Tolerence acceptable du pincement
            bool leftHandPinching  = DetectionController.GetInstance().GetHand(HandsE.gauche).IsHandPinching(tolerance);
            bool rightHandPinching = DetectionController.GetInstance().GetHand(HandsE.droite).IsHandPinching(tolerance);
            //Pincement avec l'index et le pouce
            bool leftIndexThumbPinch  = DetectionController.GetInstance().GetHand(HandsE.gauche).IsPinchDistance(distance);
            bool rightIndexThumbPinch = DetectionController.GetInstance().GetHand(HandsE.droite).IsPinchDistance(distance);

            isBothPinch = leftHandPinching && rightHandPinching && leftIndexThumbPinch && rightIndexThumbPinch && !BothFistGesture.GetInstance().IsBothFisting();
        }
        DisplayDectedGesture(isBothPinch);
        return(isBothPinch);
    }