Forum Discussion
cloud_canvas
7 years agoExpert Protege
[Feature Request] Integrated Cylindrical Hit Testing if OVROverlay.currentOverlayShape == Cylinder
I've been in the process of trying to retrofit an existing UI using OVROverlay, and I've hit a lot of unnecessary friction dealing with the fact that the cylindrical warping applied to a Render Texture still hit-tests against the original flat plane that the texture was generated from.
Ideally, this would just be handled automagically, like with the popular CurvedUI package from the Unity Asset Store. I create my UI using standard Canvas elements in World Space, maybe use an alternate Input Module or add some extra components to the Canvas, and my hit testing script can just send raycasts straight from its forward vector and everything works exactly the same.
Presently, I'm copying the CylinderRayTransfer() function from OverlayUIDemo.cs, which is simplistic and assumes it will be used with Physics.Raycast, which allows me to manually specify an origin point, a direction, a distance, a LayerMask, etc. It's being shoehorned into existing hit testing code that uses EventSystem.RaycastAll so that it can call ExecuteEvents.ExecuteHierarchy events like PointerEnter, PointerDrag and PointerClick. This means that it's expecting to simply receive a PointerEventData structure.
I'm only a little ways off from completing this, but I really shouldn't need to build a completely separate PointerEventData structure just to hit test cylindrically-warped UI elements vs. other ones. I should just be able to shoot a Ray out from the controller's forward vector and it hits whatever it hits normally in World Space. I shouldn't need to pass in a reference to the cylinder's Transform to perform these calculations. I shouldn't need to be mathematically performing these calculations at all. These operations should be moved directly into OVROverlay and be totally abstracted from me from an end-user's standpoint.
Ideally, this would just be handled automagically, like with the popular CurvedUI package from the Unity Asset Store. I create my UI using standard Canvas elements in World Space, maybe use an alternate Input Module or add some extra components to the Canvas, and my hit testing script can just send raycasts straight from its forward vector and everything works exactly the same.
Presently, I'm copying the CylinderRayTransfer() function from OverlayUIDemo.cs, which is simplistic and assumes it will be used with Physics.Raycast, which allows me to manually specify an origin point, a direction, a distance, a LayerMask, etc. It's being shoehorned into existing hit testing code that uses EventSystem.RaycastAll so that it can call ExecuteEvents.ExecuteHierarchy events like PointerEnter, PointerDrag and PointerClick. This means that it's expecting to simply receive a PointerEventData structure.
I'm only a little ways off from completing this, but I really shouldn't need to build a completely separate PointerEventData structure just to hit test cylindrically-warped UI elements vs. other ones. I should just be able to shoot a Ray out from the controller's forward vector and it hits whatever it hits normally in World Space. I shouldn't need to pass in a reference to the cylinder's Transform to perform these calculations. I shouldn't need to be mathematically performing these calculations at all. These operations should be moved directly into OVROverlay and be totally abstracted from me from an end-user's standpoint.
1 Reply
Replies have been turned off for this discussion
- cloud_canvasExpert ProtegeThanks @imperativity , I appreciate it.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago
- 6 years ago