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

[bug report] targetFound is not triggered if you call start when the phone already points at tracking #300

Open
marcusx2 opened this issue Nov 26, 2022 · 3 comments

Comments

@marcusx2
Copy link

marcusx2 commented Nov 26, 2022

@hiukim If autostart is set to false, and you call start manually with the phone already pointing at the tracking, the targetFound event is fired the very first time. However, if you then call stop, and with the phone still pointing at the tracking, you call start again, the targetFound event is not fired. The same problem happens with pause/unpause. Currently targetFound can't be relied on to make the content visible/invisible because of this issue.

@marcusx2
Copy link
Author

Temporary workaround: After pause or stop, make entity invisible. This will trigger targetFound after it's unpaused/started again.

[...document.querySelectorAll('[mindar-image-target]')].forEach(target => target.object3D.visible = false);

@marcusx2
Copy link
Author

marcusx2 commented Nov 28, 2022

@hiukim Not sure if I explained the issue well, did you understand? The problem is that I can't rely on the targetFound event to show and hide content because if the ar engine is paused or stopped and the user unpauses or starts the ar engine while already pointing at the image tracking, the targetFound event is not fired, so the content never shows up. That is because I don't place the content under the image tracking entity, but instead check for its transform for placement, and only do so on the target found event (once the target is found I continuously check for the image's position, scale and rotation).

Right now the workaround is to manually set the target to invisible once the ar engine is paused or stopped. This forces the targetFound to trigger even if the user is already pointing at the image target right after the ar engine is unpaused/started.

@jessicachrist
Copy link

Maybe this helps? #241

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

2 participants