//placeholder, may be removed // Use this for initialization void Start() { if (MhGestureManager.gestures.Count == 0) { MhGestureManager.LoadGestures(); } // consider changing MhGestureManager.distanceConstant in case of diferent resolution than 1920x1080 //current ratio is compromise which should do good result in most cases pointCapturingDistance = (Screen.width * Screen.height) / MhGestureManager.distanceConstant; //remove when working with Test Grid Scene //attackScript = GameObject.Find("AltPlayer").GetComponent<PlayerAttack2D>(); }
public void DrawSymbol() { ClearSymbol(); if (dropDownList.options.Count > 0) { string symbolName = dropDownList.options[dropDownList.value].text; MhGesture gest = MhGestureManager.FindGesture(symbolName); if (gest == null) { Debug.LogError("Symbol with name " + symbolName + " was not found"); return; } gestureInput.DrawSymbol(gest); } }
public KeyValuePair <MhGesture, float> CompareGesture() { MhGesture currentGesture = GetCurrentgesture(); var results = MhGestureManager.analyzer.GetPointPatternMatchResults(currentGesture.Points); var results2 = MhGestureManager.analyzer.GetPointPatternMatchResultsAdv(currentGesture.Points); if (results.Length == 0) { return(new KeyValuePair <MhGesture, float>()); } var topResult = results[0]; Debug.Log("Best Match: " + topResult.Name + " , Probability: " + topResult.Probability); Debug.Log("Advance Comparison Best Match: " + results2[0].Name + " , Probability: " + results2[0].Probability); return(new KeyValuePair <MhGesture, float>(MhGestureManager.FindGesture(topResult.Name), (float)topResult.Probability)); }