I will try to look at this this week but have quite a lot on at moment.
Can you make a small reproducible project for this please? That would really help us. Or is this with the project that Moka posted in the first post?
I will try to look at this this week but have quite a lot on at moment.
Can you make a small reproducible project for this please? That would really help us. Or is this with the project that Moka posted in the first post?
This project should help you. In fact, I just forked the project of Moka and added an error handler to see where the problem is coming from.
I did tried different variations of parameters with HitTest like the ones from the official documentation.
Still, I received different kind of error in the console while testing with Chrome Mobile on device.
The profile āgeneric-touchscreenā is the one that interested me because I want to use AR with my mobile. It is like āHit-testā is a feature not asked when we start the XR session from the API.
I think that it didnāt pass the step 2 of this documentation of the WebXR API:
@yaustar Did you have time last week to check on this? I canāt find a workaround with the current state.
No, Iām afraid not. Iām hoping to get some time today
I had a look at this and for whatever reason, it works fine in the WebXR extension but not on device. I think I found the reason why but will require an engine change. Will keep you posted.
Hereās my fix: https://github.com/playcanvas/engine/pull/2381
While waiting for the next engine release, you can use my latest built engine files here with local engine param.
So it was simply the absence of the optional parameter āhit-testā for a WebXR session.
Also, I didnāt know about that url param āuse_local_engineā. This is interesting.
Thank you for your help!
Yeah, you hit the nail on the head here. Very surprised this worked without the fix in the WebXR emulator which is frustrating.
Hello,
I was trying to to make a simple AR hit test project, where I could place simple objects on the ground and when searching for help/solutions I stumbled upon this thread.
I am facing the same problem as:
Even when I try this link below, I still cannot place any grass when Iām using my phone. I can only do so when using webXR emulator in chrome (on my personal computer).
Am I missing something or is this feature not yet available in PlayCanvas?
/edit:
Also, do I understand this correctly that:
Does this sound right? Iām just trying to look at the bigger picture here.
That fix is in the current version of PlayCanvas.
Thatās correct. Itās still a draft but the API is mostly stable.
It depends if WebXR implementations change before PlayCanvas is updated.
The demo I posted earlier works without the local engine Param. IE PlayCanvas | HTML5 Game Engine
Project: PlayCanvas | HTML5 Game Engine
Thank you. Turns out the previous link with the params worked as well but I just didnāt move the phone enough to detect a surface.
Iāve updated the Hit Test example with better UX: https://playcanvas.com/project/672464/overview/ar-hit-test
There are couple of ways to start hit test session, previously Iāve used input source that created when user touches the screen. This would lead to a delay until underlying system would pickup input source ray and start generating hit test results.
So Iāve changed the demo, now it starts hit test session using VIEWER reference space, which basically a ray from middle of the screen (position of camera). So it is more apparent when hit test is happening, and it allows to see the target where it is pointing. Then with touch it places the object on that target.
There is real-world-geometry
API in development, which would allow to get actual geometry and then do ray picking on PlayCanvas side. But for now we have to rely on Hit Test API which is dependant on underlying APIs.