Пример #1
0
    public void GestureForReturnsAppropriateGestureForSide()
    {
        var gestures = new Gestures((Knobs)null);

        Assert.AreEqual(HandSide.Right, gestures.GestureFor(HandSide.Right).Side());
        Assert.AreEqual(HandSide.Left, gestures.GestureFor(HandSide.Left).Side());
    }
Пример #2
0
    public string OnHandUpdate(IHand hand)
    {
        // move up and out to text writer
        var side    = hand.Side();
        var gesture = gestures.GestureFor(side);


        // debug.Log("hand side: " + hand.Side());

        // yes this is a bit odd, around construction-time access to vrtk
        // instances - have a look sometime when on vive setup
        gesture.hand = hand;

        gesture.OnHandUpdate(hand);
        debug.Log("text: " + text + ", words: " + String.Join(", ", words.ToArray()));
        return(text);
    }
Пример #3
0
    public GesturesStrategy(Gestures gestures, KnobArranger knobArranger, IDebug debug)
    {
        this.knobArranger = knobArranger;
        this.debug        = debug;
        this.gestures     = gestures;

        // move up and out to text writer, use lister interface
        gestures.GestureFor(HandSide.Right).OnGrab    += OnGrab;
        gestures.GestureFor(HandSide.Left).OnGrab     += OnGrab;
        gestures.GestureFor(HandSide.Right).OnRelease += OnRelease;
        gestures.GestureFor(HandSide.Left).OnRelease  += OnRelease;
        gestures.GestureFor(HandSide.Right).OnTouch   += OnTouch;
        gestures.GestureFor(HandSide.Left).OnTouch    += OnTouch;
    }