New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Handtracking fix for near interaction #15023
base: master
Are you sure you want to change the base?
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just 2 comments and one question :-)
@@ -391,6 +399,14 @@ export class TouchHolographicButton extends TouchButton3D { | |||
this.collisionMesh = collisionMesh; | |||
this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way | |||
|
|||
this._pointerObserver = scene.onPointerObservable.add((pointerInfo) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be removed when the component is disposed. It's also the reason the build failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should be removed if this function is called again (or if already defined) - stay defensive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes! I must've missed it. I'll resolve it, thanks! :)
|
||
if (this.isActiveNearInteraction && pointerInfo.pickInfo) { | ||
if (pointerInfo.pickInfo.hit) | ||
this._isRay = (<PointerEvent><unknown>pointerInfo.event).pointerType === "xr"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for general XR and not near interaction, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe so. Previously I used
if ((<PointerEvent>pointerInfo.event).pointerType === "xr") {
this._isRay = true;
}
if ((<PointerEvent>pointerInfo.event).pointerType === "xr-near") {
this._isRay = false;
}
but since I really only want to know if it is an XR ray interaction going on I simplified it to the code committed in the PR.
So basically I wanted a way to differentiate between XR ray interactions and XR near interactions, but here's where my knowledge regarding the differentiation between XR and XR near interaction stops, so if you have any recommendations or think this doesn't fit with the XR/XR near interaction architecture, let me know and I can continue to debug it or change behavior based on your expertise.
The proposed fix I committed is imo a bit hacky, so if there's any more elegant way to resolve the bug I'm more than happy to implement it with some pointers on where to look! 😊
Any update on this one? |
Turns out I was using an older version of Babylon when testing, so I would like to try it out with the latest version to verify that the bug still exists there. I'll update the PR when I've confirmed that it's there - just need to submit my master thesis first! :) |
Master thesis? not THAT important! :-) Take your time, thanks a lot!!! |
Hi!
I've tested the
touchHolographicButton
with handtracking using the Quest 3, but it did only work with ray interactions and not with near interactions. This might have something to do with #14787 but I'm unsure.In order to mitigate this I implemented a kind of hacky solution, checking if the pointer is currently of type
xr
orxr-near
. I'm unsure whether this fix is suitable but I thought it be better to submit this and start a discussion rather than just leave it.Here's some videos showing the behavior.
Before fix:
before.webm
After fix:
after.webm
This doesn't change the current behavior with ray-interactions but fixes only the near interactions.
Co-authed with @moabjo