Possible Bug - Hover Effects/Spatial Event Compatibilty with PSVR2 Controllers?

Hi,

I would like clarification on whether the new hover effects feature introduced in vision os 26 supported pinch gestures through the psvr 2 controllers.

In your sample application, I found that this was not working. Pulling the trigger on the controller whilst looking at the 3d object did not activate the hover effect spatial event in the sample application. (The object is showing the highlight though), only pinch clicking with my fingers seem to be registering/triggering the spatial event.

I am using Vision OS 26.3

This is inconsistent with how the psvr2 controller behaves on swift ui views and ui view elements, where the trigger press does count as a button click.

The sample I used was this one:

https://developer.apple.com/documentation/compositorservices/rendering_hover_effects_in_metal_immersive_apps

The hover effects feature introduced in visionOS 26 represents a significant enhancement for creating immersive experiences, allowing users to interact with virtual objects using spatial gestures. However, the behavior of these gestures, particularly with the PSVR 2 controllers, can indeed vary based on how they are integrated into different types of views and applications.

Clarification on Hover Effects and PSVR 2 Controllers

Hover Effects in VisionOS: Hover effects are designed to provide feedback when a user's gaze is directed towards a virtual object. This is akin to a mouse hover on a desktop and can trigger spatial events or visual highlights. Controller Gestures: On the PSVR 2, traditional button presses (like pulling the trigger) are well-supported across various interfaces, including SwiftUI. However, gaze-based interactions like hover effects require additional handling to map spatial gestures to these events.

Discrepancies in Behavior

Sample Application Behavior: The sample you referenced likely relies on Compositor Services and Metal for rendering, which might not directly map the trigger press to hover events as SwiftUI does for button clicks. Instead, it may expect pinch gestures or explicit gaze-based input to trigger spatial events. SwiftUI Views: SwiftUI abstracts much of the complexity involved in handling different input methods, providing a more consistent interface for gestures like trigger presses. This is why you observe trigger presses being recognized as button clicks in SwiftUI views.

Possible Explanations and Solutions

Gesture Mapping: Ensure that your sample application correctly maps hover events to the appropriate PSVR 2 controller gestures. This might involve customizing gesture recognizers to handle gaze-based input and trigger presses separately. Compositor Services API: Dive deeper into the Compositor Services API documentation to understand how hover events are triggered and how they can be customized for different input devices. You may need to handle spatial events manually and map them to the desired actions. Event Handling Updates: Check for any updates or patches to visionOS or the Compositor Services framework that might address discrepancies in gesture handling. Apple frequently updates its APIs to improve compatibility and functionality. Community and Support: Engage with the Apple Developer forums or reach out to Apple Support for specific guidance on implementing hover effects with PSVR 2 controllers. They may provide insights or workarounds tailored to your application's needs. Custom Implementations: Consider implementing custom gesture recognizers that combine gaze tracking with controller input to achieve the desired hover effect behavior. This might offer more flexibility and control over how interactions are handled.

In summary, while hover effects and PSVR 2 controller gestures are designed to work together, discrepancies can arise due to differences in how input is processed in various frameworks. By carefully mapping gestures and leveraging the latest API features, you can create a more seamless and intuitive user experience in your visionOS application.

Possible Bug - Hover Effects/Spatial Event Compatibilty with PSVR2 Controllers?
 
 
Q