/// <summary>
            /// Initializes a new instance of the <see cref="KeyposeManager" /> class.
            /// </summary>
            /// <param name="leftHand">Left hand to which KeyPoseManager will subscribe for events.</param>
            /// <param name="rightHand">Right hand to which KeyPoseManager will subscribe for events.</param>
            public KeyposeManager(Hand leftHand, Hand rightHand)
            {
                // Array length excludes [NoHand], since we do not allow it to be disabled.
                this.config.KeyposeConfig = new byte[(int)MLHandTracking.HandKeyPose.NoHand];

                this.hands[(int)MLHandTracking.HandType.Left]  = leftHand;
                this.hands[(int)MLHandTracking.HandType.Right] = rightHand;

                // Start the Unity gesture subsystem.s
                MLDevice.RegisterGestureSubsystem();
                if (MLDevice.GestureSubsystem != null)
                {
                    MLDevice.GestureSubsystem.onKeyPoseGestureChanged += this.HandleOnKeyPoseChanged;
                }
            }
Exemplo n.º 2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="Controller"/> class.
            /// </summary>
            /// <param name="inputTrackerHandle">The input tracker handle.</param>
            /// <param name="controllerId">The controller id.</param>
            /// <param name="inputHand">The hand that should be assigned.</param>
            public Controller(ulong inputTrackerHandle, byte controllerId, MLInput.Hand inputHand)
            {
                // InputTracker is still required, for LED Patterns & Control Vibrations.
                this.inputTrackerHandle = inputTrackerHandle;
                this.controllerId       = controllerId;

                this.Hand = inputHand;
                this.CurrentTouchpadGesture = new MLInput.Controller.TouchpadGesture();

                // Start the Unity gesture subsystem.
                MLDevice.RegisterGestureSubsystem();
                if (MLDevice.GestureSubsystem != null)
                {
                    MLDevice.GestureSubsystem.onTouchpadGestureChanged += this.HandleOnTouchpadGestureChanged;
                }
            }