viro: ViroARImageMarker: onAnchorRemoved never fires
in a simple example like the following, onAnchorRemoved
never gets called when i move the camera away from the anchor. likewise, onAnchorFound
only get’s called the first time the anchor is found.
working around this with onHover
is not a good solution as it still fires with isHovering == true
if i hover of the spot the anchor initially was at, even if the anchor isn’t visible anymore.
think of turning a page in a brochure. if i scan a ViroARTrackingTarget
on page 1 and then turn the page, my wrapped component (ViroVideo
is my example) would still be visible if i hover over the spot the anchor was at before.
<ViroARScene>
<ViroARImageMarker
target={'targetOne'}
onAnchorFound={this.onAnchorFound}
onAnchorRemoved={this.onAnchorRemoved}
>
<ViroVideo
source={require('./res/test.mp4')}
height={0.06}
width={0.08}
rotation={[270,0,0]}
/>
</ViroARImageMarker>
</ViroARScene>
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 15
@Tamiyadd do you have found a solution about that? I’m trying to remove a content when
ViroArImageMarker
doesn’t track a target but there is no callback to use… I have to load a content whenViroArImageMarker
detect a marker and remove when it’s not longer in the scene.A solution would be to set an interval that remove all objects when timeout and resetting when
onAnchorUpdate
is called but if the user does not move the camera and the ancor does not move,onAnchorUpdate
never called. The result is that the medias will be removed though the target is on the scene…Thanks
Seems like ARKit 2.0 fixes with problem. https://stackoverflow.com/questions/49997025/check-whether-the-arreferenceimage-is-no-longer-visible-in-the-cameras-view
Waiting for a new release with ARKit 2.0 !