Post

Replies

Boosts

Views

Activity

Reply to Best Practice to Add Objects at Eye Level in Reality Kit
I worked out a solution. Maybe not the best, but here's what I did. Needs to be in Immersive Space. Enable world tracking via WorldTrackingProvider. Create an entity (I parented mine to the main scene) and I called it "user". Subscribe to SceneEvents.Update events. When the update happens, use queryDeviceAnchor to get the position of the device (ie, the user). Update the user entity position: let transform = deviceAnchor.originFromAnchorTransform user?.transform = Transform(matrix: transform) Now when you place your new entity into the scene, just do this: child.setPosition([0, -0.32, -0.53], relativeTo: user) child.setOrientation(.init(.init(angle: .zero, axis: .y)), relativeTo: user) First position the new child (of the scene) slightly ahead of the user and slightly down (or wherever you want to put it). The (0,0,0) position is inside the user's head, effectively. Then change the orientation to 0º so it faces the user. The new child is where I want it, but a little "wonky" in the X and Z axis - it has to do with the user's head tilt and I haven't figured out how to correct it.
Jun ’24
Reply to Best Practice to Add Objects at Eye Level in Reality Kit
I worked out a solution. Maybe not the best, but here's what I did. Needs to be in Immersive Space. Enable world tracking via WorldTrackingProvider. Create an entity (I parented mine to the main scene) and I called it "user". Subscribe to SceneEvents.Update events. When the update happens, use queryDeviceAnchor to get the position of the device (ie, the user). Update the user entity position: let transform = deviceAnchor.originFromAnchorTransform user?.transform = Transform(matrix: transform) Now when you place your new entity into the scene, just do this: child.setPosition([0, -0.32, -0.53], relativeTo: user) child.setOrientation(.init(.init(angle: .zero, axis: .y)), relativeTo: user) First position the new child (of the scene) slightly ahead of the user and slightly down (or wherever you want to put it). The (0,0,0) position is inside the user's head, effectively. Then change the orientation to 0º so it faces the user. The new child is where I want it, but a little "wonky" in the X and Z axis - it has to do with the user's head tilt and I haven't figured out how to correct it.
Replies
Boosts
Views
Activity
Jun ’24
Reply to Incorrect Attachment bounds VisionOS 1.1
Updated to visionOS 1.2 and have the same issue. I create a blank attachment (well, it has some buttons on the bottom) and use it as an anchor to place entities loaded from USD files. Knowing the size of this attachment would let me build a grid rather than doing it by trial and error.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Connecting xcode with real my visionpro
Matt Cox - Nothing I tried worked UNTIL I went to Remote Devices on my AVP. Nothing was there, BUT I left the AVP displaying that screen THEN I went to Xcode Devices & Simulators and tried to add the AVP and suddenly IT WAS THERE!! Thank You!
Replies
Boosts
Views
Activity
Jan ’25
Reply to LLDB RPC server crash in Xcode 16.3
I have been having this same problem for several weeks. One day it suddenly started working again and as of yesterday, started crashing - same message as reported. I'm not filing a new bug since it has now been reported here. macOS: 15.4 Xcode: 16.2 MacBook Pro, M3 Max, 64 GB
Replies
Boosts
Views
Activity
May ’25