UNPKG

macaw-threejs

Version:

Macaw Three.js is ready to use library to connect Three.js with your project.<br/> Under the hood is a fully optimized, clean Three.js set up to make it easy to implement effects for images (future text, etc.). With effects out of the box, you don't even

2 lines (1 loc) 450 B
class e{constructor(e){const{core:s}=e;this._core=s,this.instance=new IntersectionObserver(this._callback.bind(this))}cleanUp(){this.instance.disconnect()}_callback(e){e.forEach((e=>{const s=this._core.storage.meshImages.get(e.target.id);if(s){if(!s.mesh)throw new Error("Unable to observe img, mesh is undefined");s.mesh.visible=e.isIntersecting}else console.warn("Did you add image to the scene via Image(setter)?")}))}}export{e as MacawObserver};