Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

didAdd does not seem to be firing for planeDetection #286

Open
linusb212 opened this issue Feb 12, 2021 · 0 comments
Open

didAdd does not seem to be firing for planeDetection #286

linusb212 opened this issue Feb 12, 2021 · 0 comments

Comments

@linusb212
Copy link

linusb212 commented Feb 12, 2021

I'm a very new coder just a few months in so I'm hoping I'm not breaking some protocol here...and also please forgive me if my lingo is bad. I'm just a hobbyist coder.

I'm building an app using this SDK and it's really fantastic. But I'm running into one spot of trouble where the plane detection 'didadd' method does not seem to be firing.

I think I've declared the appropriate protocol and also set the proper delegate. And I've used some other ARSCN delegate methods and they fire off ok - so I think I have everything structured ok.

Is there another way to set the planeDetection property within this SDK somewhere other than through the ARWorldTrackingConfiguration class?

`class ViewController: UIViewController, FetchNodesProtocol, PickedImageProtocol, UIImagePickerControllerDelegate, UINavigationControllerDelegate, ARSCNViewDelegate {

  let configuration = ARWorldTrackingConfiguration()


   @IBAction func buttonActionStart(_ sender: Any) {

    sceneLocationView.run()
    sceneLocationView.autoenablesDefaultLighting = true
    sceneLocationView.debugOptions = [ARSCNDebugOptions.showFeaturePoints, ARSCNDebugOptions.showWorldOrigin]
    
    sceneLocationView.arViewDelegate = self
    configuration.planeDetection = .horizontal
    sceneLocationView.orientToTrueNorth = false
    view.addSubview(sceneLocationView)

    model.fetchNodes(location!.coordinate.latitude, location!.coordinate.longitude)
}

    func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
    
    DispatchQueue.main.async {
        self.labelStatus.text = "Plane Detected"
    }

    DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
        self.labelStatus.text = "scanning for Planes"
    }
}

`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant