Esempio n. 1
0
    public void Update(Vector3 oLeft, Vector3 aLeft, Vector3 oRight, Vector3 aRight)
    {
        if (leftState == GloveState.Awaiting)
        {
            leftState = DetermineTransition(refrenceOrientationLeft, oLeft, aLeft, Hand.Left);
        }

        if (rightState == GloveState.Awaiting)
        {
            rightState = DetermineTransition(refrenceOrientationRight, oRight, aRight, Hand.Right);
        }

        if (!areInBoundsCustom2(oLeft, refrenceOrientationLeft, lowerBoundry, upperBoundry))
        {
            if (!areInBoundsCustom2(oRight, refrenceOrientationRight, lowerBoundry, upperBoundry))
            {
                Responder_Exercise.BeepBoth();
            }
            else
            {
                Responder_Exercise.BeepLeft();
            }
        }
        else if (!areInBoundsCustom2(oRight, refrenceOrientationRight, lowerBoundry, upperBoundry))
        {
            Responder_Exercise.BeepRight();
        }

        if (isReadyToTransition())
        {
            currentStage = Transition();
        }
    }
Esempio n. 2
0
    Stage Transition()
    {
        switch (currentStage)
        {
        case Stage.Exodus:
            rightState = GloveState.Awaiting;
            leftState  = GloveState.Awaiting;
            return(Stage.Return);

        case Stage.Return:
            Repitition++;
            AudioSource.PlayClipAtPoint(Responder_Exercise.RepComplete, Camera.main.transform.position);
            rightState = GloveState.Awaiting;
            leftState  = GloveState.Awaiting;
            return(Stage.Exodus);
        }

        return(Stage.Exodus);
    }
Esempio n. 3
0
 public GloveInfo(GloveState state)
 {
     this.state      = state;
     this.handedness = GloveLaterality.UNKNOWN;
 }