Post

Replies

Boosts

Views

Activity

Accessing NotificationTriggers in URL loaded Reality Composer scenes
I'm trying to access .notifications.allNotifications of a scene I'm loading via a UIDocumentPicker.If i'm doing it with a known scene in the XCode bundle it's really straight forward (code snippet below), because I can store them in a global var of type TestScene.NotificationTrigger. As this is defined in TestScene.swift (that XCode creates when you import the Reality Composer scene into the project) it's not obvious if there's a generic type of RealityComposerScene.NotificationTrigger I can cast these to when loading programatically?var allNotificationTriggers: [TestScene.NotificationTrigger]! override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let testAnchor = try! TestScene.loadScene() allNotificationTriggers = testAnchor.notifications.allNotifications )
0
0
480
Apr ’20
RealityKit - installGestures - .rotation not responding?
I've been experimenting with creating interactions on RealityKit scenes i've created in RealityComposer.Based on samples i've got this working:// Setup AR Session let arConfiguration = ARWorldTrackingConfiguration() arConfiguration.planeDetection = .horizontal arView.session.run(arConfiguration) // Load the "Box" scene from the "Experience" Reality File let boxScene = try! Experience.loadBox() boxScene.generateCollisionShapes(recursive: true) let box = boxScene.greybox as? Entity & HasCollision arView.installGestures(for: box!) However, Rotation doesn't seem to do anything. I've tried :arView.installGestures([.scale], for: box!)andarView.installGestures([.translation], for: box!)individually and they both work fine but even if I assert .rotation there appears to be no action on the obvious multi-finger rotate gestures. Do I need to provide a method to handle this or have I mis-understood how this is supposed to work?
0
0
930
Jul ’19