wacki / Unity-VRInputModule

MIT License
89 stars 33 forks source link

Adding controller event messaging #7

Open paulhayes opened 7 years ago

paulhayes commented 7 years ago

I've been experimenting with a flexible simple to understand system for both interactive elements in a scene, and scripts attached to the controllers themselves, getting notification of pointer events.

By having a LaserPointerEventData which inherits from PointerEventData, but adds the current object, we can execute the event on both the controller and the raycast target hit. Here's a UML sequence diagram, the change is in red.

https://docs.google.com/drawings/d/1PJHluA771l2r_YbolvIAVGECPJEEyEGNa29X97QOlWg/edit?usp=sharing

wacki commented 7 years ago

I like this idea and am in full support of adding it to the project. It's definitely needed if we want to have proper support for non UI elements.

paulhayes commented 7 years ago

Okay, I've added this into my fork, and I've issues a pull request. Hope you like it.

I've also been thinking of adding a parabola raycaster, for teleport systems. Whatcha think?