[Spatial SDK, Bug] 2D HitInfo from PointerEvents is wrong when interacting with 2D curved panels
Hi,
I am using the Meta Spatial SDK to interact with Webviews and UIs within curved panels.
While the cursor is correctly rendered by the IsdkDefaultCursorSystem, UI and web interactions do not intersect correctly leading to not being able to interact with curved panels since the HitInfo.textureCoordinate does not take in account the curvature of the panel clamping values erroneously.
How to test and validate the issue:
Use the AnimationsSample of the Meta SDK Samples, place UI buttons on corners of the main panel, switch to a curve panel and try to use the buttons.
Expected behaviour:
Independently of the curved panel curvature, reachable buttons should be usable when the cursor overlays it.
Current behaviour:
UI elements are non interactable when the curvature of the panels differs from flatness significantly.
Source of the problem
PointerEvent.HitInfo.textureCoordinate provided by the IsdkSystemNative.tick function are incorrect leading to misbehaviour for any subcomponent that rely on 2D coordinates such as the ones providing input to the Android View system and any UI element (i.e. IsdkSystem, IsdkInputListenerSystem).
Note: SDK Systems such as the IsdkDefaultCursorSystem that rely directly on PointerEvent.HitInfo.position and PointerEvent.HitInfo.normal will present 2D information such as the Cursor correctly.
Current workaround
Override IsdkSystemNativeApi tick method and fix hitInfo.textureCoordinate computation when curved panel entities are detected