예제 #1
0
        public static void DecodeInteractionData(string data, out HandPointer handPointer)
        {
            var tokens = data.Split(' ');

            handPointer               = new HandPointer();
            handPointer.UserId        = int.Parse(tokens[0], CultureInfo.InvariantCulture);
            handPointer.HandEventType = (HandEventType)Enum.Parse(typeof(HandEventType), tokens[1]);
            handPointer.HandType      = (HandType)Enum.Parse(typeof(HandType), tokens[2]);
            handPointer.X             = float.Parse(tokens[3], CultureInfo.InvariantCulture);
            handPointer.Y             = float.Parse(tokens[4], CultureInfo.InvariantCulture);
            handPointer.PressExtent   = float.Parse(tokens[5], CultureInfo.InvariantCulture);
            handPointer.IsActive      = bool.Parse(tokens[6]);
            handPointer.IsInteractive = bool.Parse(tokens[7]);
            handPointer.IsPressed     = bool.Parse(tokens[8]);
            handPointer.IsTracked     = bool.Parse(tokens[9]);
        }
        public static void DecodeInteractionData(string data, out HandPointer handPointer)
        {
            var tokens = data.Split(' ');

            handPointer = new HandPointer();
            handPointer.UserId = int.Parse(tokens[0], CultureInfo.InvariantCulture);
            handPointer.HandEventType = (HandEventType)Enum.Parse(typeof(HandEventType), tokens[1]);
            handPointer.HandType = (HandType)Enum.Parse(typeof(HandType), tokens[2]);
            handPointer.X = float.Parse(tokens[3], CultureInfo.InvariantCulture);
            handPointer.Y = float.Parse(tokens[4], CultureInfo.InvariantCulture);
            handPointer.PressExtent = float.Parse(tokens[5], CultureInfo.InvariantCulture);
            handPointer.IsActive = bool.Parse(tokens[6]);
            handPointer.IsInteractive = bool.Parse(tokens[7]);
            handPointer.IsPressed = bool.Parse(tokens[8]);
            handPointer.IsTracked = bool.Parse(tokens[9]);

        }