MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Custom Input Device and MRTK 2.4 (GrabPointer doesn't work)

Open N0RAIR opened this issue 6 years ago • 2 comments

Describe the bug

After upgrading from MRTK 2.3 to MRTK 2.4, my custom input device is not fully working as expected. The SpherePointer(aka GrabPointer) is not working anymore. The Ray and Poke Pointers of my custom input device are working fine. I have also adopted the changes regarding SetupDefaultInteractions ...

To reproduce

Steps to reproduce the behavior:

  1. Create a new Unity Project
  2. Import MRTK 2.4
  3. Import my minimal reproduceable example package (see attachment)
  4. Open the BugScene and move the Custom Pointer inside the Box to "Grab"

The Custom Input Device is simulated with the Mouse (Left Click = Action Button; Right Click = Back Button) For moving it forward/backward, press "Z"/"H"

Expected behavior

When moving my Custom Pointer inside the GameObject (with BoundingBox and ObjectManipulator) and click with the left mouse to grab it, I should be able to grab, or interact with the Scale/Rotate Handles in NearInteraction.

Screenshots

BugScreenshot1 The Object has a BoxCollider and works with the GrabPointer from the Articulated Hand.

My Setup

  • Unity Version 2018.4.21f1 (but also with 2019.4.X)
  • MRTK Version 2.4

Target platform

  • HoloLens 2

Additional context

I am writing a custom controller plugin which should work with MRTK. With MRTK 2.3 it was all working fine. Now we wanted to support also MRTK 2.4, but are having problems with getting all pointers work as expected. The Controller gets its pose change like this:

CoreServices.InputSystem.RaisePoseInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, controllerPose);

And the Buttons Presses like this:


CoreServices.InputSystem?.RaiseOnInputDown(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);
CoreServices.InputSystem?.RaiseOnInputUp(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction);

MinimalCustomInput.zip

N0RAIR avatar Jul 14 '20 13:07 N0RAIR

SpherePointer.cs MRTK2 4SpherePointer As you can see in the picture, the if statement was always false for me. I never assigned IsPositionAvailable to true. Now inside my Controller I added such a line:

                IsPositionAvailable = myControllerPosition != Vector3.zero; 

That line fixed my problem.

N0RAIR avatar Jul 29 '20 09:07 N0RAIR

@N0RAIR looks like this got fixed. Closing issue!

Zee2 avatar Aug 06 '21 22:08 Zee2