Mixedrealitytoolkit-unity: ManipulationHandler does not handle click (No clear difference between click and drag)

Created on 30 Sep 2019  路  6Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Describe the bug

ManipulationHandler has OnManipulationStarted/OnManipulationEnded for user manipulating the model. But there is no difference between the user dragging the object or clicking the object. If the user drags/clicks the object, OnManipulationStarted/OnManipulationEnded will be triggered. But for our app, we need to separate dragging and clicking. For example, we want to hide the MRTK bounding box when the user clicks the object. Using current ManipulationHandler, when the user drags the object, it also hides the bbox, which is the wrong behavior. I want to separate dragging and clicking for ManipulationHandler.

To reproduce

  1. Create a scene
  2. Create an object, and add MRTK Boundingbox and ManipulationHandler to it
  3. Create your own script and attach to it
  4. In your own script, add the listener to manipulationHandler.OnManipulationStarted and manipulationHandler.OnManipulationEnded
  5. Run the scene, try dragging/clicking the model. Both dragging and clicking fire the manipulationHandler.OnManipulationStarted and manipulationHandler.OnManipulationEnded events

Expected behavior

ManipulationHandler should be able to handle drag and click differently. There may be another ManipulationEvent for click so that I could listen to it. And when user drags the object, this new ManipulationEvent is not triggered. It is only triggered when the object is clicked (near/far interaction).

Screenshots

None

Your Setup (please complete the following information)

  • Unity Version 2018.4.8f1 LTS
  • MRTK Version v2.0.0

Target Platform (please complete the following information)

  • HoloLens 2

Additional context

Thank you!

Bug

All 6 comments

Is there a workaround?

Also, I think click/tap is not a manipulation, drag/rotate/scale/move is. So if possible, click/tap should not fire OnManipulationStarted/OnManipulationEnded. Thanks

It's possible to have this implementation using the following code (although manipulation started / ended are still fired): https://gist.github.com/julenka/a49e6cb40c8d8fab406645d3407c7966 Look for everything inside of tags for the code that I changed. To get this into 2.2 release may not happen because we need to add tests and discuss if there's a better long term way, but this can unblock folks at least.

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.

Re-opening, as it would still be useful to have an on click even for ManipulationHandler, in the case where a user releases hand without dragging the object far.

Was this page helpful?
0 / 5 - 0 ratings