From 6806dc8dcf840fdc32095ceebabac3fef9f9e5e9 Mon Sep 17 00:00:00 2001 From: Rik de Leeuw Date: Mon, 3 Jun 2024 17:43:35 +0200 Subject: [PATCH] - optimized placement of tools by parenting them to the world object - implemented visibility component to make open and close tool work --- tools/gltfExample/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/gltfExample/index.js b/tools/gltfExample/index.js index fe16e65..00a876b 100644 --- a/tools/gltfExample/index.js +++ b/tools/gltfExample/index.js @@ -39,8 +39,10 @@ class GLTFExample2 { const rootWhenClosed = document.querySelector('#rootWhenClosed'); this.#envelope = new Envelope(this.#spatialInterface, [], rootWhenOpened, rootWhenClosed, isStackable, areFramesOrdered, isFullscreenFull2D, opensWhenAdded); this.#envelope.onOpen(() => { + this.#baseTool.setVisible(true); }); this.#envelope.onClose(() => { + this.#baseTool.setVisible(false); }); this.#envelope.onBlur(() => { });