Gesture Interactor GetValidTargets has issues

Hi,

The GetValidTargets method on the Gesture Interactor is not accurate. There’s even a comment saying that if the camera is directly over/under object it will fail.

Right now if the camera is up and close to the interactable, it won’t add it to the valid targets even though it’s fully visible in the camera frustum.

Also, it only adds an interactable to the list of valid targets if the CENTER is in the frustum which is incorrect. As soon as an interactable is even remotely visible to the camera, it should be added to the valid targets list since the user still sees it visually.

Also the GestureInteractor is using an internal property of the InteractionManager called interactionManager.interactables but it should be using the public method called GetRegisteredInteractables.

I wouldn’t assume you have access to the internal methods in any of your interactable/interactor scripts. Otherwise it becomes hard for people just like me to extend those scripts…

Cheers,

Thank you for the bug report, issue 1354009 has been created to track this.

As a workaround, you can override the ARGestureInteractor.GetValidTargets method to include all registered interactables of type ARBaseGestureInteractable rather than doing the filtering it is doing now. That behavior no longer uses an internal property in newer versions of the package, it uses the public GetRegisteredInteractables method to iterate the interactables.