microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

ManipulationHandler does not handle click (No clear difference between click and drag) #6145

Closed yaqinh closed 9 months ago

yaqinh commented 5 years ago

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)

Target Platform (please complete the following information)

Additional context

Thank you!

yaqinh commented 5 years ago

Is there a workaround?

yaqinh commented 5 years ago

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

julenka commented 4 years ago

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.

stale[bot] commented 4 years ago

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.

stale[bot] commented 4 years ago

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.

julenka commented 4 years ago

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.

fcagnetta commented 3 years ago

Hello, any news on this precious topic?

stale[bot] commented 2 years ago

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.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visithttps://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!