Babylon.js
Babylon.js copied to clipboard
TouchButton3D's getPressDepth(position) call has depth discrepancy
When the depth is calculated, the passed-in point is used to get the height off of the surface of the button. This height is then compared against a cached height from when the pointer down event was triggered, and the delta is returned as the press depth.
The problem I see is that the cached depth is based off of the touch mesh (finger tip) position, but queries to getPressDepth() are likely called as part of the onPointer* observable, which just gives the 3D position on the button. So while the touch event triggers when the finger touches the button, the finger itself is still floating a little above the button (just the tip of the finger is touching at this point).
The playground I use to test this is below. When using the Windows Mixed Reality Portal, and simulated controllers, the button appears just in front of the left controller's default position when loading into VR, making testing fairly straight-forwards. https://www.babylonjs-playground.com/#92K1DJ#4
Thanks for reporting, Could you provide a repro ?
Thanks for reporting, Could you provide a repro ?
Added it into the description.
@RaananW could you have a look ?