alvr-org / alvr-visionos

Experimental visionOS client for ALVR - SteamVR on Apple Vision Pro!
MIT License
433 stars 31 forks source link

Send VisionOS Digital Crown information to ALVR Server #124

Open marcgeeklaberge opened 2 months ago

marcgeeklaberge commented 2 months ago

Hi y'all, we are looking into a way get digital crown values from vision pro and then send it back to server and VRChat.

We've noticed that it was possible to get digital crown values from views like this:


ImmersiveSpace(id: "MetalClient") {
   MyView()
            .onImmersionChange { _, newImmersion in
                guard let amount = newImmersion.amount else {
                    return
                }
                print(amount: "\(amount)");
            }
   }
.immersionStyle(selection: $clientImmersionStyle, in: .progressive)

but onImmersionChange is not available to use with


ImmersiveSpace(id: "MetalClient") {
            CompositorLayer(configuration: ContentStageConfiguration()) { layerRenderer in
                let system = MetalClientSystem(layerRenderer)
                system.startRenderLoop()
            }
            // .howToGetImmersionChangeValue?
        }
        .immersionStyle(selection: $clientImmersionStyle, in: .progressive)

Once this problem solved or alternative, how can we send back a value to the server? Note that in case the vision pro crown value is not accessible no matter what, we are thinking of alternative like getting values from gestures or from the apple watch crown and then communicate it back to the server.

Thank you 🙏