Replies: 7 comments 4 replies
-
Hi @Ram1508, thanks for reaching out. If you are working with the interactable, there are events firstSelectEntered/selectEntered or lastSelectExited/selectExited which are fired when an interactor starts or stops selecting an interactable. The args include the interactor responsible. If you are working the interactor, it has a selectEntered event, which you can add a listener to. Getting the position and rotation may depend on which interactor you are using. The MRTKRayInteractor and GazeInteractor inherit from XRRayInteractor, which provides some functions to get information about the raycast hit. You can use TryGetHitInfo to get the position of the ray hit and normal of the surface the ray hit or TryGetCurrent3DRaycastHit. The XRI docs should provide more info about this. Hope that this helps! |
Beta Was this translation helpful? Give feedback.
-
Thankyou @marlenaklein-msft for the reply. I am not able to receive events(postions) from the TryGetHitInfo()/TryGetCurrent3DRaycastHit(). Prerequistes: In a scene i have added a gameobject with component 'XRRayInteractor' which has the refrence for rayinteractor[in the above screen shot] rayinteractor.selectenter.addlistener(OnFirstselectEntered) -> not able to recieve position or normal from onfirstselectentered. For example I tried to hit a plane with layered as 'SpatialMapping' |
Beta Was this translation helpful? Give feedback.
-
@Ram1508, ah sorry I misinterpreted this, the selectEntered event is specific to an Interactor selecting an Interactable. If you are working with a plane for spatial mapping I would recommend looking at the MRTK3 TapToPlace sample scene and script. I believe this should provide a similar example. Specifically the RegisterPlacementAction and SolverUpdate methods. |
Beta Was this translation helpful? Give feedback.
-
@marlenaklein-msft, How should we get the Pose where a user has air tapped on the real world without the use of solvers? |
Beta Was this translation helpful? Give feedback.
-
@AMollis @marlenaklein-msft @mrtk-bld , Any update on the above? |
Beta Was this translation helpful? Give feedback.
-
@hemasree99s, you should be able to do this by querying information from Unity's interactors. Take a look at a MRTK3's Then take a look at how Using the For the select events to work on the spatial mesh, you'll have to add an interactable component to your spatial mesh prefab (see your As you know MRTK3 is based on XRI. I would also recommend taking a look at Unity's XRI samples given your scenario. |
Beta Was this translation helpful? Give feedback.
-
@AMollis, Thanks for the timely help. |
Beta Was this translation helpful? Give feedback.
-
@AMollis
In MRTKv2,OnPointerClicked(MixedRealityPointerEventData eventData) called when pointer is clicked, and one can get the position and rotation of pointer using eventData.
It is replaced by interactors in mrtk3, but can you tell me how to get the position and rotation of where the interactor is clicked?
Beta Was this translation helpful? Give feedback.
All reactions