ExtendRealityLtd / VRTK

An example of how to use the Tilia packages to create great content with VRTK v4.
https://www.vrtk.io/
MIT License
3.69k stars 993 forks source link

fix(Interactions): allow interactor ungrab on untouched interactable - fixes #1988 #1989

Closed thestonefox closed 5 years ago

thestonefox commented 5 years ago

If the Interactable was grabbed with a toggle grab type then the Interactor was no longer colliding with the Interactable (but still grabbing) then the Interactor Grab publisher would be empty and when the force ungrab was called it would attempt to do a grab before ungrabbing to ensure the toggle state was set correctly.

However, it would not be able to perform the grab as the touched state did not exist to populate the grab publisher.

This fix ensures that if the grab publisher payload is empty then it forces the current interactable into the payload so the initial grab before ungrabbing can take place.