function showObjectControlButtons() { if (areButtonsHidden === false && areObjectButtonsHidden === false && isOnWalktroughMode === false) { deleteButton.style.display = ""; copyButton.style.display = ""; transformMode.style.display = ""; infoButton.style.display = ""; mirrorButton.style.display = ""; } else if(isOnWalktroughMode === true){ walkthroughBanner.style.display = "flex"; } } function hideObjectControlButtons() { deleteButton.style.display = "none"; copyButton.style.display = "none"; transformMode.style.display = "none"; infoButton.style.display = "none"; mirrorButton.style.display = "none"; angleInputContainer.style.display = "none"; walkthroughBanner.style.display = "none"; } function showRotationButtons(){ angleInputContainer.style.display = ""; } function hideRotationButtons(){ angleInputContainer.style.display = "none"; } function setButtonVisibility(isVisible) { if(isOnWalktroughMode === false){ const displayStyle = isVisible ? "" : "none"; deleteButton.style.display = isVisible && isSelected ? "" : "none"; copyButton.style.display = isVisible && isSelected ? "" : "none"; transformMode.style.display = isVisible && isSelected ? "" : "none"; infoButton.style.display = isVisible && isSelected ? "" : "none"; mirrorButton.style.display = isVisible && isSelected ? "" : "none"; walkButton.style.display = displayStyle; togglePanning.style.display = displayStyle; focusButton.style.display = displayStyle; measurementsButton.style.display = displayStyle; sidebar.style.display = displayStyle; zoomInfo.style.display = displayStyle; fullscreenButton.style.display = displayStyle; deselectButton.style.display = displayStyle; zoomMinus.style.display = displayStyle; zoomPlus.style.display = displayStyle; toggleContainer.style.display = displayStyle; multiSelectButton.style.display = displayStyle; groupButton.style.display = displayStyle; toggleGroupIndividualButton.style.display = displayStyle; undoButton.style.display = displayStyle; redoButton.style.display = displayStyle; switchCollidersButton.style.display = displayStyle; saveButton.style.display = displayStyle; loadButton.style.display = displayStyle; localSaveButton.style.display = displayStyle; localLoadButton.style.display = displayStyle; logoutButton.style.display = displayStyle; inputJsonContainer.style.display = displayStyle; inputUrlContainer.style.display = displayStyle; textureInputUrlContainer.style.display = displayStyle; resizeRoomTextContainer.style.display = displayStyle; createTestContainer.style.display = displayStyle; highlightContainer.style.display = displayStyle; } else { const displayStyle = walkthroughBanner.style.display === "none" ? "flex" : "none"; walkthroughBanner.style.display = displayStyle; } } function toggleButtonsVisibility() { setButtonVisibility(areButtonsHidden); areButtonsHidden = !areButtonsHidden; } function setCoordsControlButtons(x, y) { let formattedX = Math.floor(x); let formattedY = Math.floor(y); const rect = canvas.getBoundingClientRect(); const scale = window.devicePixelRatio || 1; const canvasX = ((formattedX + rect.left) / scale); const canvasY = ((formattedY + rect.top) / scale); const radius = 100; const downIndent = 80; const leftIndent = 140; const buttons = [ { element: deleteButton, angle: 25 * (Math.PI / 180) }, { element: copyButton, angle: 70 * (Math.PI / 180) }, { element: transformMode, angle: 125 * (Math.PI / 180) }, { element: infoButton, angle: 165 * (Math.PI / 180) }, { element: mirrorButton, angle: 205 * (Math.PI / 180) } ]; angleInputContainer.style.left = `${canvasX - leftIndent}px`; angleInputContainer.style.bottom = `${canvasY - downIndent}px`; buttons.forEach(button => { const buttonX = canvasX + radius * Math.cos(button.angle) - button.element.offsetWidth / 2; const buttonY = canvasY + radius * Math.sin(button.angle) - button.element.offsetHeight / 2; button.element.style.left = `${buttonX}px`; button.element.style.bottom = `${buttonY}px`; }); } angleInputContainer.onclick = () =>{ disableUnityKeyboardListening(); } toggle.addEventListener('change', () => { is3DMode = toggle.checked; if (is3DMode) { applicationInstance.SendMessage('ApplicationAPI', 'ThreeD'); } else { applicationInstance.SendMessage('ApplicationAPI', 'TwoD'); } });