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 Project can not run in Xcode 12.4
Determined the problem: WiFi. No, not my home WiFi as I have checked that from multiple sources including speediest.net right on my MacBook Pro. The WiFi itself is not the problem. When WiFi is turned on, Xcode spins the beachball for seemingly random tasks. I noticed this as it tried to do a code completion which is when I switched on WiFi. Lo and behold: no problems with Xcode. As soon as I switched WiFi back on: spinning beachball.
Mar ’21
Reply to Project can not run in Xcode 12.4
I created a new empty project. Had no problems until I opened the Add New File dialog. Then get the beach ball cursor. Xcode has been running fine for weeks now. How could it possible just do this? What changed? It has not loaded any of my previous projects when it does this as its a new project.
Mar ’21