private void HandleCalibrationComplete(HI5_Pose pose) { if (pose == HI5_Pose.BPose) { CheckDeviceBinded(m_Index); } }
//キャリブレーション中の処理 private IEnumerator CalibrationProgressCheckCoroutine(HI5_Pose hI5Pose) { var frame = -1; var calibrationProgress = 0; var scale = Vector3.one; while (calibrationProgress < 100) { //キャリブレーションの進行具合を取得 calibrationProgress = HI5_Calibration.GetCalibrationProgress(hI5Pose); scale.x = calibrationProgress / 100f; progressBar.localScale = scale; if (isOutputCalibrationProgress) { Debug.Log($"{hI5Pose}: {calibrationProgress}%"); } if (hI5Pose == HI5_Pose.BPose && _isPushExistingOpticalData) { frame = frame++ >= (_leftPos.Count - 1) ? 0 : frame; HI5_DataTransform.PushOpticalData("LHR-LEFT", OPTDeviceType.HTC_VIVE_Tracker, _leftPos[frame], _leftRot[frame]); HI5_DataTransform.PushOpticalData("LHR-RIGHT", OPTDeviceType.HTC_VIVE_Tracker, _rightPos[frame], _rightRot[frame]); } yield return(null); } HI5_Calibration.OnCalibrationComplete(hI5Pose); }
//キャリブレーション前の処理 private void AwakeCalibration() { if (!HI5_Manager.IsConnected || HI5_Manager.GetGloveStatus().Status != GloveStatus.BothGloveAvailable) { SetDebugMessage("Error! Please Connect Noitom Hi5!"); return; } //既存のOpticalDataを読み込む if (_isPushExistingOpticalData) { ResetOpticalDataList(ref _leftPos, ref _rightPos, ref _leftRot, ref _rightRot); var leftOd = GetExistingOpticalData("LEFT.csv", ref _leftPos, ref _leftRot); var rightOd = GetExistingOpticalData("RIGHT.csv", ref _rightPos, ref _rightRot); //ファイル読み込みに失敗したら弾く if (!leftOd || !rightOd) { SetDebugMessage("Error! Please Set OpticalData!"); return; } } //BPoseキャリブレーションを開始 State = HI5_Pose.BPose; }
public void StartCalibration(HI5_Pose posType) { mPercent = 0.0f; if (posType == HI5_Pose.BPose) { HI5_Manager.GetGloveStatus().BposErr = BPoseCalibrationErrors.BE_NotCalibrated; HI5_Calibration.ResetCalibration(); HI5_Manager.GetGloveStatus().StartCalibrationBpos(); } HI5_Calibration.StartCalibration(posType); mPos = posType; StartCoroutine(UpdateCalibrationProgress()); }
private void HandleCalibrationComplete(HI5_Pose pose) { if (pose == HI5_Pose.BPose) { //HI5_GloveStatus. m_CalibrationSM.State = CalibrationState.PPose; return; } if (pose == HI5_Pose.PPose) { m_CalibrationSM.State = CalibrationState.Finish; return; } }
//キャリブレーション成功時の処理 private void HandleCalibrationComplete(HI5_Pose hi5Pose) { switch (hi5Pose) { case HI5_Pose.BPose: //SetDebugMessage("BPose Calibration Complete!"); State = HI5_Pose.PPose; break; case HI5_Pose.PPose: //SetDebugMessage("PPose Calibration Complete!"); State = HI5_Pose.Unknown; break; } }