Closed Cchumi closed 5 years ago
iOS Only
Call this function to reset the ARSession with a combination of the two flags:resetTracking - if true, the scene will realign with the camera's position and orientation.removeAnchors - if true, the anchors will all be removed (onAnchorRemoved will be called on the ViroARScene). It's recommended to also set removeAnchor to true if resetTracking is also set to true.
Hi thanks I see this function but my app is divided in 2 files.
App.js which contain arscenenavigator and 2D button ui. And another js file which contain all my Arscene imagetarget and viromarker.
If I call this function in my app.js on the on press callback from my touchhighlight it don’t erase the scene.
Perhaps I don’t use it the right way ..?
How can I use this method in my parent class.
What I understand in the doc is I need to call this method from my scene which is located in my child class.
Hi @Cchumi,
Because of how react-native
works, there's not a great way to do this, but one way you can do it is to pass a new prop into your ViroARSceneNavigator
and check for it in your scene. If the prop is changed, then you invoke the function. You can also use state management frameworks like Redux or Flux to help with this (and respond appropriately to the state changes).
You can pass props like this: https://docs.viromedia.com/docs/scene-navigation#passing-props-from-scene-to-scene
Thanks,
Hey sorry for the late answer but a great thanks really :).
I don"t know how to use it before but now I understand the concept.
Did you ever figure out how to implement this?
Environment
Please provide the following information about your environment:
Description
I need to reset the ARscene. I have a 2d ui button and when I click on it I want to clear all existing AR element to start a new AR capture
Reproducible Demo