From c2e982540d7da9ca55e81748045943d7cb9e9211 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 15 Nov 2017 17:47:20 +0100 Subject: [PATCH] fix configuration bug --- ios/RCTARKit.m | 8 ++++---- ios/RCTARKitNodes.m | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ios/RCTARKit.m b/ios/RCTARKit.m index 2f614c1..e82e14f 100644 --- a/ios/RCTARKit.m +++ b/ios/RCTARKit.m @@ -136,12 +136,12 @@ - (void)setDebug:(BOOL)debug { } - (BOOL)planeDetection { - ARWorldTrackingConfiguration *configuration = (ARWorldTrackingConfiguration *) self.session.configuration; + ARWorldTrackingConfiguration *configuration = (ARWorldTrackingConfiguration *) self.configuration; return configuration.planeDetection == ARPlaneDetectionHorizontal; } - (void)setPlaneDetection:(BOOL)planeDetection { - ARWorldTrackingConfiguration *configuration = (ARWorldTrackingConfiguration *) self.session.configuration; + ARWorldTrackingConfiguration *configuration = (ARWorldTrackingConfiguration *) self.configuration; if (planeDetection) { configuration.planeDetection = ARPlaneDetectionHorizontal; } else { @@ -151,7 +151,7 @@ - (void)setPlaneDetection:(BOOL)planeDetection { } - (BOOL)lightEstimationEnabled { - ARConfiguration *configuration = self.session.configuration; + ARConfiguration *configuration = self.configuration; return configuration.lightEstimationEnabled; } @@ -170,7 +170,7 @@ - (BOOL)autoenablesDefaultLighting { } - (ARWorldAlignment)worldAlignment { - ARConfiguration *configuration = self.session.configuration; + ARConfiguration *configuration = self.configuration; return configuration.worldAlignment; } diff --git a/ios/RCTARKitNodes.m b/ios/RCTARKitNodes.m index 1e3f6c4..3051c04 100644 --- a/ios/RCTARKitNodes.m +++ b/ios/RCTARKitNodes.m @@ -223,16 +223,14 @@ - (void)removeNodeForKey:(NSString *)key { SCNNode *node = [self.nodes objectForKey:key]; if (node) { - // NSLog(@"removing node %@", key); + [self.nodes removeObjectForKey:key]; if(node.light) { // see https://stackoverflow.com/questions/47270056/how-to-remove-a-light-with-shadowmode-deferred-in-scenekit-arkit?noredirect=1#comment81491270_47270056 node.hidden = YES; - - [node removeFromParentNode]; + [node removeFromParentNode]; } else { - [node removeFromParentNode]; + [node removeFromParentNode]; } - [self.nodes removeObjectForKey:key]; } }