webarkit / ARnft

A small javascript library for WebAR with NFT
GNU Lesser General Public License v3.0
219 stars 53 forks source link

Two instance of ARToolkitNFT.js created during init #145

Closed kalwalt closed 3 years ago

kalwalt commented 3 years ago

This happens because in the Worker.js we import ARToolkiNFT.js: https://github.com/webarkit/ARnft/blob/69207041bbacd2fd19f67599e334fc9bb23bb88b/src/utils/Worker.js#L2-L3

and we init it here:

https://github.com/webarkit/ARnft/blob/69207041bbacd2fd19f67599e334fc9bb23bb88b/src/utils/Worker.js#L86-L92

probably it is not necessary.

kalwalt commented 3 years ago

See this log:

ARnft  0.8.0
ARnft.js:1 ARnft init() start...
ARToolkitNFT  0.8.0
Base path: http://localhost:5500
Loading camera at: http://localhost:5500/examples/Data/camera_para.dat
ARToolkitNFT  0.8.0
[ARControllerNFT] ARToolkitNFT initialized
[ARControllerNFT] Camera params loaded with ID 0
kalwalt commented 3 years ago

fixed with https://github.com/webarkit/ARnft/commit/5e55fbf06ce67edf8d8d400f0dce138fe287a37d