Skip to content

Commit

Permalink
Merge pull request #112 from HippoAR/fix-configuration-bug
Browse files Browse the repository at this point in the history
fix configuration bug
  • Loading branch information
macrozone authored Nov 15, 2017
2 parents 390151d + c2e9825 commit aaddf2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions ios/RCTARKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -151,7 +151,7 @@ - (void)setPlaneDetection:(BOOL)planeDetection {
}

- (BOOL)lightEstimationEnabled {
ARConfiguration *configuration = self.session.configuration;
ARConfiguration *configuration = self.configuration;
return configuration.lightEstimationEnabled;
}

Expand All @@ -170,7 +170,7 @@ - (BOOL)autoenablesDefaultLighting {
}

- (ARWorldAlignment)worldAlignment {
ARConfiguration *configuration = self.session.configuration;
ARConfiguration *configuration = self.configuration;
return configuration.worldAlignment;
}

Expand Down
8 changes: 3 additions & 5 deletions ios/RCTARKitNodes.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit aaddf2a

Please sign in to comment.