LocalJoost / BlogComments

This repo is solely used for comments on https://localjoost.github.io/
4 stars 0 forks source link

Comments on "MRTK2 to MRTK3 - a MUCH SIMPLER way to intercept a raw air tap like with IMixedRealityPointerHandler" #424

Open LocalJoost opened 1 year ago

LocalJoost commented 1 year ago

Original article: https://localjoost.github.io/MRTK2-to-MRTK3-a-MUCH-SIMPLER-way-to-intercept-a-raw-air-tap-like-with-IMixedRealityPointerHandler/

peSHIr commented 1 year ago

Nice to see this process in action, but also I am sort of glad that is not what I do (any more), even though something still "tickles" reading this. Just keep doing what you're doing. 👍🏻

astaikos316 commented 1 year ago

What I did actually was just track the Select Exited event in the XR Ray Interactors on each of the hand rigs to track if an air tap was done for one of my projects

LocalJoost commented 1 year ago

There are obviously more ways to Rome 😊

timothyt commented 1 year ago

Thanks, this was super helpful in getting a "tap to place" behavior working again

LocalJoost commented 1 year ago

You're welcome, but most thanks should go to Finn 😊

dahaideyu commented 8 months ago

How do I get position(x y z) when I click in air? include hand ray position and no hand ray position

look like MRTK2:

public void OnPointerClicked(MixedRealityPointerEventData eventData) { // 获取当前活动指针的命中结果 var result = eventData.Pointer.Result;

// 检查命中结果是否有效
if (result != null)
{
    // 获取命中点的位置
    var hitPosition = result.Details.Point;

    Debug.Log("Air tap position: " + hitPosition);
}

}

armengol commented 1 month ago

Hello! Thanks so much for your posts, I find them very helpful! I tried your air tap approach which works fine in the Unity editor using the MRTKInputSimulator, but it does not work when deployed to Hololens 2. Hand tracking is enabled and working because I can add an ObjectManipulator to an object and I can interact with it. However, your air tap detection approach is not working. Any suggestions about why this is happening?

LocalJoost commented 1 month ago

@armengol it very much works in HoloLens, that's what I use in HoloATC and various demo applications. Being unfortunately nor telepathic nor clairvoyant, I have no idea what is happening. I can only read code. I suggest downloading a sample and then trying to deploy that.

armengol commented 1 month ago

Cool, I'll try the sample. Thanks for your reply!

armengol commented 1 month ago

@LocalJoost I could not open the sample project in my Unity Editor version, a lot of broken stuff... I reproduced the DirectInputAirTapDisplayer script in my project (using also MRTK LeftHand/Select Value and so on) and as mentioned it works fine in the Editor. I even have a little debugging object to display the Value of the Air Tap gesture. However when deployed in Hololens the subscribed methods ( ProcessLeftHand, ProcessRightHand) are never triggered with the Air Tap event. It is confusing because the gesture is recognized since there is a response in the hand ray interactor, for example. I know this doesn't tell you much about my problem, but I wonder if there may be a specific detail I'm missing for it to work in the Hololens...

https://github.com/LocalJoost/BlogComments/assets/13226134/85f27ce2-ec56-4da6-a112-3f44f5608674

LocalJoost commented 1 month ago

@armengol "could not open the sample project in my Unity Editor version, a lot of broken stuff..." Please show me what is going wrong when you open the project in a Unity editor. Please use the same version as I used myself in the demo project.

armengol commented 1 month ago

@LocalJoost I downloaded the same Unity Editor version as in your demo project:

capture_PackageManagerError capture_CompilationErrors capture_SafeMode

LocalJoost commented 1 month ago

@armengol I see. Yeah, this happens sometimes with older samples. Unfortunately the RealityCollective folks have messed up the very first part of their openupm feed. As you can here here preview-2 does not exist anymore. I updated the branch using_inputreference to 1.0.0. This is not the latest version, but it should make this demo work again. I never got this error here, because Unity keeps a package cache locally. Meh. However, when I cleaned both the openupm cache and the project's cache, it works. Good luck. Be aware the project is a bit old, uses pre-releases versions of the MRTK3 and not the latest version of the RealityCollective stuff. You might also have a look at a newer branch, like this one https://github.com/LocalJoost/MRKTAirTap/tree/crossplatairtap-rayendposition which is based upon newer versions.

armengol commented 3 weeks ago

Great, thanks for your help!