Post

Replies

Boosts

Views

Created

wwdc2023-10113 Video's manipulationState variable
Question 1: The manipulationState variable has been used many times in the 3D gestures part of wwdc2023-10113 Video. What do I need to use Expected Type for this variable? I tried to use the following code: @State private var manipulationState: GestureState Xcode error Reference to generic type 'GestureState' requires arguments in <... > Insert '<Any>' But I don't know what parameter to refer to in <Any> Question 2: If you have all the code snippets (or similar) of the 3D gestures part in this tutorial, please send it to me. Thank you.
0
0
380
Dec ’23
Spatial Audio
How does visionOS play an MP4 audio to Spatial Audio through SwiftUI or RealityKit? Note: Since I can only test the App through Simulator, in order to ensure that my Spatial Audio is played correctly in the space, please tell me how to display the location of Spatial Audio in the space. Ew and how to delete this View after the test, thank you!
0
0
635
Dec ’23
Play Spatial Audio
I want to play RealityKitContent USDA model's Spatial Audio, I use this code: RealityView{ content in do { let entity = try await Entity(named: "isWateringBasin", in: RealityKitContent.realityKitContentBundle) let audio = entity.spatialAudio entity.playAudio(audio) content.add(entity) } catch { print("Entity encountered an error while loading the model.") return } } entity.playAudio(audio) this code need add a 'AudioResource' back of audio, Excuse me, what should AudioResource be?
0
0
553
Dec ’23
ARKit and Simulator
I developed a Plane-detection using ARKit in the visionOS app: import SwiftUI import RealityKit import ARKit struct ContentView: View { @State private var ok = false let session = ARKitSession() let planeData = PlaneDetectionProvider(alignments: [.horizontal, .vertical]) var body: some View { Group { if !ok { TabelView() } else { SwiftUIView() } } .onAppear{ Task { try await session.run([planeData]) for await update in planeData.anchorUpdates { if update.anchor.classification == .table { continue } switch update.event { case .added, .updated: ok = true case .removed: ok = false } } } } } } When I ran it, I found that Xcode told me that it does not support Simulator, so how can I test this program? If there is no other way other than applying for VisionPro DevKit and participating in Lab, I hope you can tell me that this View is Can the following functions be realized: When there is no table in the user's sight, SwiftUIView() will be displayed in the coordinates of x:0,y:0,z:0. If there is a table in the user's sight, TabbelView() will be displayed on the table. If you can't realize the above functions, I hope you can give me some advice. Thank you!
1
0
1.1k
Jan ’24
Can't play Audio in RealityComposerPro
I hope to be able to display the USDA model in RealityComposerPro and play the Spatial Audio. I used RealityView to implement these contents: RealityView{ content in do { let entity = try await Entity(named: "isWateringBasin", in: RealityKitContent.realityKitContentBundle) content.add(entity) guard let entity = entity.findEntity(named: "SpatialAudio"), let resource = try? await AudioFileResource(named: "/Root/isWateringBasinAudio_m4a", from: "isWateringBasin.usda", in: RealityKitContent.realityKitContentBundle) else { return } let audioPlaybackController = entity.prepareAudio(resource) audioPlaybackController.play() } catch { print("Entity encountered an error while loading the model.") return } } but when I ran it, I found that although can displayed the model normally, Spatial Audio failed to play normally. I hope to get guidance, thank you!
1
0
635
Jan ’24
Strange visionOS Simulator
I found that my visionOS Simulator is very strange. Many functions and features are missing. For example, I learned from the Internet that the immersive scenes of Environments in their visionOS Simulator can be opened, but I click There was no response after the attack. There are not only these, but also many system features. I saw on the Internet that other developers have them, and I am missing. I'm worried that this will have an impact on me when testing my app. May I ask why? Some information: My updated Xcode version is the latest Xcode15.1Beta. Device: iMac (2021) Simulator system number: 21N305
1
0
777
Jan ’24