Posts

Post marked as solved
7 Replies
765 Views
I'm running into a confusing difference in the way SpatialTapGesture locations are handled when the targeted entities are children of AnchorEntities. Context: I'm wanting to create entities at points on interactable entities where the user taps. The following code snippet works fine with non-anchored entities, but produces incorrect coordinates. func convertLocation(_ value: EntityTargetValue<SpatialTapGesture.Value>) -> SIMD3<Float> { return value.convert(value.location3D, from: .local, to: .scene) } func handleTap(_ value: EntityTargetValue<SpatialTapGesture.Value>, material: SimpleMaterial) { let location3D = convertLocation(value) let tap = createSphereEntity(0.01, material: material, interactable: false) tap.position = location3D value.entity.addChild(tap, preservingWorldTransform: true) } and, for reference, this is the gesture modifier attached to my RealityView: .gesture(SpatialTapGesture().targetedToAnyEntity().onEnded({ value in let material = SimpleMaterial(color: .systemPink, roughness: 0.1, isMetallic: true) handleTap(value, material: material) })) I've tried numerous combinations... .local, .global, .named for CoordinateSpace, .scene, anchor name, entity name etc for SceneRealityCoordinateSpace... preserving world transform and not, adding the new entity to the tapped entity, directly to the anchor, etc. anyone have any ideas? also, i noticed that in the docs for NamedCoordinateSpace it mentions static var immersiveSpace: NamedCoordinateSpace but no such static property exists for me? cheers, Mike
Posted
by ziggmike.
Last updated
.
Post marked as solved
2 Replies
732 Views
hi there, one thing i'm working on for the vision pro requires knowing the user's heading relative to north (magnetic or true). basically it's working with objects located using geo coordinates, and getting an angle of the direction the user is facing relative to them. on iOS and watchOS, i can use CMMotionManager's CMDeviceMotion heading property. looking at the docs it says this heading is there for visionOS, as is the xMagneticNorthZVertical reference frame.. however it seems like there is no magnetometer? it's a bit hard to tell in the simulator since isDeviceMotionAvailable, isAccelerometerAvailable and isGyroAvailable all return false. while isMagnetometerAvailable is a compile error (unavailable in visionOS). is there - or will there be - a way i can get the user's heading relative to north?
Posted
by ziggmike.
Last updated
.
Post not yet marked as solved
1 Replies
625 Views
hi there, i'm not sure if i'm missing something, but i've tried passing a variety of CGImages into SCSensitivityAnalyzer, incl ones which should be flagged as sensitive, and it always returns false. it doesn't throw an exception, and i have the Sensitive Content Warning enabled in settings (confirmed by checking the analysisPolicy at run time). i've tried both the async and callback versions of analyzeImage. this is with Xcode 15 beta 5. i'm primarily testing on iOS/iPad simulators - is that a known issue? cheers, Mike
Posted
by ziggmike.
Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
hi there, one of the features I'm most looking forward to as a developer and a user is the journaling app. I'm assuming the app won't make the initial iOS17 launch next week, but I was wondering if there was an idea on when the APIs might be available to start working with? “Journaling Suggestions API” means the Documented API that enables a display of journaling suggestions. (from https://developer.apple.com/support/terms/apple-developer-program-license-agreement/) cheers, Mike
Posted
by ziggmike.
Last updated
.
Post not yet marked as solved
0 Replies
446 Views
hi there, i'm running into issues when creating occluders from arbitrary MDLMeshes (i.e. 3d models i create in app and then turn into MDLMeshes, rather than MDLMesh.newBox() etc). some meshes work fine, others hit an assert deep in the PHASE c++ code. i've tested on simulator and iPhone 12 (iOS16 and now iOS17 beta 3). i've tried to figure out if there's some kind of pattern to which meshes work and which don't, but haven't been able to find one. note that using the build in MDLMesh primitives works fine. the assert is: Assertion failed: (voxelIndex < level.mVoxels.Count()), function AddBuilderVoxelToSubtree, file GeoVoxelTree.cpp, line 188. the code is: func createOccluder(from meshes: [MDLMesh], at transform: Transform, preset: PHASEMaterialPreset) throws -> PHASEOccluder { guard let engine else { throw "No engine" } print("audio meshes: \(meshes)") let material = PHASEMaterial(engine: engine, preset: preset) var shapes: [PHASEShape] = [] for (_, mesh) in meshes.enumerated() { let meshShape = PHASEShape(engine: engine, mesh: mesh) for element in meshShape.elements { element.material = material } shapes.append(meshShape) } let occluder = PHASEOccluder(engine: engine, shapes: shapes) occluder.worldTransform = transform.matrix try engine.rootObject.addChild(occluder) return occluder } the assert happens with: let occluder = PHASEOccluder(engine: engine, shapes: shapes) any ideas on what could be going on here? cheers, Mike screenshots of callstack etc:
Posted
by ziggmike.
Last updated
.
Post not yet marked as solved
3 Replies
1.3k Views
hi there, i've just started digging into developing for HomeKit, so it's quite possible i'm missing something (or this is expected?), but calling addAndSetupAccessories always fails instantly (no UI appears) when running in the simulator. the error is: addAndSetupAccessories got error Optional(Error Domain=HMErrorDomain Code=79 "Failed to add the accessory." UserInfo={NSLocalizedDescription=Failed to add the accessory.}) i'm running the HomeKit simulator with a home created + one standard lightbulb accessory added. if i run on device it works as expected (using my real homekit accessories) xcode: Version 12.0 beta 4 (12A8179i) homekit accessory simulator: Version 4.0 (135.3)
Posted
by ziggmike.
Last updated
.
Post not yet marked as solved
2 Replies
772 Views
just wondering.. whenever i call readValueWithCompletionHandler on a HMCharacteristic, i get log messages like: [-[HMCharacteristic readValueWithCompletionHandler:], /Library/Caches/com.apple.xbs/Sources/HomeKit/HomeKit-714.0.4.1.1/Sources/HomeKit/HMCharacteristic.m:513 (DBEA6EA4-BD3B-4673-BB61-934AF9480EB0)] Thread left active (1): <NSThread: 0x282534680>{number = 1, name = (null)} I've tried various things like changing when I call it, making sure I call it on the main thread etc but always with the same result. Is this expected? bad? I'm using Xcode 12.0.1 (12A7300), running on iPadOS 14.0
Posted
by ziggmike.
Last updated
.