Beispiel #1
0
 //Increment through calibration positions
 void UpdateCalibration(GloveDataProcessor gloveDataProcessor)
 {
     if (Input.touchCount > 0 && lastTouch == 0)
     {
         gloveDataProcessor.captureDataAgainstTrainingPosition();
     }
     lastTouch = Input.touchCount;
 }
Beispiel #2
0
 //Update UI based on touch feedback
 void ManageTouchEvent(GloveDataProcessor gloveDataProcessor)
 {
     if (gloveDataProcessor.IsCalibrating)
     {
         UpdateCalibration(gloveDataProcessor);
     }
     else
     {
         RotateCharacter();
     }
 }
Beispiel #3
0
 //Get Calibration or Calibrated positions for avatar
 double[] GetPositionData(GloveDataProcessor gloveDataProcessor)
 {
     if (gloveDataProcessor.IsCalibrating)         //IF IS CALIBRATION GET TRAINING POSITIONS WHICH ARE DECLARED IN CALIBRATIONALGORITHM
     {
         return(gloveDataProcessor.getCurrentTrainingPosition());
     }
     else                                                //Running
     {
         return(gloveDataProcessor.getCalibratedData()); //ONCE CALIBRATION IS DONE GET REALDATA
     }
 }
Beispiel #4
0
    // Update is called once per frame
    void Update()
    {
        double[] Position = null;
        if (mainController != null)
        {
            gloveDataProcessor = mainController.GetComponent <GloveConnectionManager>().getGloveDataProcessor();

            if (btnStartCalibration != null && !eventAdded)
            {
                btnStartCalibration.onClick.AddListener(startCalibration);
                eventAdded = true;
            }
        }
        if (gloveDataProcessor != null)
        {
            ManageTouchEvent(gloveDataProcessor);
            Position = GetPositionData(gloveDataProcessor);

            if (Position != null && Position.Length > 0)
            {
                UpdateAvatar(Position);
            }
        }
    }