Exemplo n.º 1
0
        public Result Recognize(MultiStrokeLibrary multiStrokeLibrary)
        {
            Result result = new Result();

            result.Score = float.MaxValue;
            result.Name  = "";

            foreach (MultiStroke multiStroke in multiStrokeLibrary.Library)
            {
                float distance = GreedyCloudMatch(this.Points, multiStroke.Points);

                if (distance < result.Score)
                {
                    result.Score = distance;
                    result.Name  = multiStroke.Name;
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        public Result Recognize(MultiStrokeLibrary multiStrokeLibrary)
        {
            Result result = new Result();
            result.Score = float.MaxValue;
            result.Name = "";

            foreach (MultiStroke multiStroke in multiStrokeLibrary.Library) {
                float distance = GreedyCloudMatch(this.Points, multiStroke.Points);

                if (distance < result.Score) {
                    result.Score = distance;
                    result.Name = multiStroke.Name;
                }

            }

            return result;
        }
 // Load the library.
 void Start()
 {
     ml = new MultiStrokeLibrary(libraryToLoad, forceCopy);
     strokes = new List<GameObject>();
     multiStrokePoints = new List<MultiStrokePoint>();
 }
    // Load the library.
    void Start()
    {
        ml = new MultiStrokeLibrary(libraryToLoad, forceCopy);
        strokes = new List<GameObject>();

        if (gestureLimitType == GestureLimitType.RectBoundsClamp) {
            parentCanvas = gestureLimitRectBounds.GetComponentInParent<Canvas>();
            gestureLimitRect = RectTransformUtility.PixelAdjustRect(gestureLimitRectBounds, parentCanvas);
            gestureLimitRect.position += new Vector2(gestureLimitRectBounds.position.x, gestureLimitRectBounds.position.y);
        }
    }
Exemplo n.º 5
0
 // Load the library.
 void Start()
 {
     ml = new MultiStrokeLibrary(libraryToLoad, forceCopy);
     strokes = new List<GameObject>();
     drawArea = new Rect(0, 0, Screen.width - 370, Screen.height);
     multiStrokePoints = new List<MultiStrokePoint>();
 }