Closed CharserHH closed 2 months ago
I might have a similar precision issue with the hand ray (using MRTK 3).
I work with complex industrial models. We have a scene with a bended sheet metal and a pipe hidden behind it. They have mesh colliders. Users can select models when pointing the ray on them. With a specific angle, the ray can go through the sheet metal and hit the pipe, even if it's not yet visible.
I don't have this issue with desktop mode, where we manually cast a Unity raycast under the mouse position (same 3D models).
Edit: I found that my issue is in the XRI XRRayInteractor, that has a limited number of raycast hits (10). My ray was hitting more than 10 objects and the sheet metal wasn't in the first 10 hits. I don't think it's related to your precision issue.
I think in MRTK 2 the default pointer "ray" is in fact a cone (or a sphere cast), to help user select small far objects without needing them to point them precisely.
In your hand ray prefab, be sure to set the ray settings to a simple raycast. If you use a ShellHandRayPointer
, try set the "Sphere Cast Radius" to 0 (instead of default 0.1).
I think in MRTK 2 the default pointer "ray" is in fact a cone (or a sphere cast), to help user select small far objects without needing them to point them precisely.
In your hand ray prefab, be sure to set the ray settings to a simple raycast. If you use a , try set the "Sphere Cast Radius" to 0 (instead of default 0.1).
ShellHandRayPointer
Thanks but the ray that innacurate is cast completely by the HoloLens device(To be honest I'm not 100% sure about this). I can only get the return eventData but can't alter it. So I decide to let the eventData only privide the time point and the hit, and I cast a normal ray with these information and get the final result instead of the hand ray.
Hi @CharserHH , this is an issue with MRTK2. Please open MRTK2 issues at
https://github.com/microsoft/MixedRealityToolkit-Unity/issues
Describe the bug
When I use "eventData.Pointer.Result.Details.Point" to get the hit point on a moving ball, it's going to be very innacurate.
I store the distance between the center of the ball and the hitpoint as "Radius", and I cast a normal ray that original in Unity, also store the data as "Another Radius". As the image show, the Radiuses are very wrong(it should be '0.5').
And it happends only on my mixed reality device, the data in Unity editor is correct.
To reproduce
I get the hitpoint like this:
And I cast another ray by this function
This script is added to the ball.
My setup
Target platform