From 4ea6fbdc057af6a77841bfd838b60a375577569b Mon Sep 17 00:00:00 2001 From: Rahel Koch Date: Wed, 17 Aug 2022 21:17:43 +0200 Subject: [PATCH] update tracking state --- src/image-target/controller.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/image-target/controller.js b/src/image-target/controller.js index 7ff39760..9d2ef477 100644 --- a/src/image-target/controller.js +++ b/src/image-target/controller.js @@ -249,7 +249,21 @@ class Controller { } stopProcessVideo() { - this.processingVideo = false; + this.processingVideo = false; + + setTimeout( () => { + if (!this.processingVideo) { + for (let i = 0; i < this.trackingStates.length; i++) { + const trackingState = this.trackingStates[i]; + + if (trackingState.showing) { + trackingState.showing = false; + trackingState.trackingMatrix = null; + this.onUpdate && this.onUpdate({type: 'updateMatrix', targetIndex: i, worldMatrix: null}); + } + } + } + }, 10) } async detect(input) {