Post

Replies

Boosts

Views

Activity

Reply to What happened to cp_drawable_get_ar_pose(), and what is its replacement?
I can't speak to CompositorServices, but ARPose seems to have been eradicated from ARKit completely. I'm using the Swift API, but the equivalent C API replacements would be: ar_world_tracking_provider_query_pose_at_timestamp -> ar_world_tracking_provider_query_device_anchor_at_timestamp and with ar_device_anchor being a subclass of ar_trackable_anchor being a subclass of ar_anchor ar_pose_get_origin_from_device_transform -> ar_anchor_get_origin_from_anchor_transform
Sep ’23
Reply to How can I pinch to open a menu in VisionOS simulator?
SwiftUI views in visionOS can be presented as windows via the openWindow enviroment action and as RealityView attachments. Your VideoView is presented as neither. An ImmersiveSpace doesn't know where to put a SwiftUI view on its own in the unbounded full space. Note that if you go for an attachment, be wary of the recent API changes which seem to be currently undocumented.
Sep ’23
Reply to Trying RealityKit immersionStyle
Figured it out. According to the docs, there are two entries that apparently both must be added to Info.plist. Xcode's error message is not helpful in making that understood, since it doesn't reflect the actual error and the missing immersion style can also be set in code. UIApplicationPreferredDefaultSceneSessionRoleKey: UISceneSessionRoleImmersiveSpaceApplication UISceneInitialImmersionStyle: UIImmersionStyleMixed / UIImmersionStyleFull / UIImmersionStyleProgressive nested in the scene configurations dictionary under UISceneSessionRoleImmersiveSpaceApplication. Note: There's also UISceneSessionRoleImmersiveApplication without the Space part. Make sure to use the right one in both places. I used Xcode's GUI to set it up, but here's the working Info.plist as of Xcode 15.0 beta 8 (15A5229m): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationPreferredDefaultSceneSessionRole</key> <string>UISceneSessionRoleImmersiveSpaceApplication</string> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UISceneSessionRoleImmersiveSpaceApplication</key> <array> <dict> <key>UISceneInitialImmersionStyle</key> <string>UIImmersionStyleProgressive</string> </dict> </array> </dict> </dict> </dict> </plist>
Sep ’23
Reply to visionOS RealityView attachment SwiftUI controls don't always respond to user interaction
Since I needed to find a workaround for this issue myself, I played around a little more. As suspected, this definitely is a race condition during the initial RealityView setup. I have a test project set up that adds two buttons and a toggle to the ImmersiveView in Xcode's template project. When I add try! await Task.sleep(nanoseconds: 100 * NSEC_PER_MSEC) at the end of the view’s make closure, all three UI elements are always active in the visionOS simulator on my MBP M2 Pro, 8+4 cores, 16 GB. When I go down to 50 * NSEC_PER_MSEC, all of the UI elements work (most of the time - I’ve had a case where two of the three were active, but the third one, that is added last, wasn’t). When I go down to 30 * NSEC_PER_MSEC, all of the UI elements sometimes work. When I go down to 20 * NSEC_PER_MSEC, none of the UI elements work.
Sep ’23
Reply to Diorama Demo Issues -
Also let cameraTransform = Transform(matrix: pose.originFromDeviceTransform) needs to become let cameraTransform = Transform(matrix: pose.originFromAnchorTransform) Attachments work differently now, as well, so that for example } attachments: { Text("Preview") .font(.system(size: 100)) .background(.pink) .tag("previewTag") } needs to become } attachments: { Attachment(id: "previewTag") { Text("Preview") .font(.system(size: 100)) .background(.pink) } }
Sep ’23