@xviewer.js/debug 1.0.0-beta.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var three = require('three');
4
3
  var core = require('@xviewer.js/core');
4
+ var three = require('three');
5
5
 
6
6
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
7
7
 
8
- var css = "@charset \"UTF-8\";\n.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n background-color: var(--background-color);\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 40%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean .widget {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: \" \";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid rgba(255, 255, 255, 0.6);\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: \"lil-gui\";\n content: \"↕\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background-color: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background-color: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background-color: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n.lil-gui .controller.image img {\n max-width: 100%;\n}\n.lil-gui .controller.image canvas {\n max-width: 100%;\n min-height: 1px;\n}\n.lil-gui .controller.vector input {\n color: var(--number-color);\n}\n.lil-gui .controller.vector .fill {\n height: 100%;\n margin-left: var(--spacing);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: \"lil-gui\";\n content: \"▾\";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: \"▸\";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: \"Empty\";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui input {\n -webkit-tap-highlight-color: transparent;\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input::-webkit-outer-spin-button,\n.lil-gui input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.lil-gui input[type=number] {\n -moz-appearance: textfield;\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n -webkit-appearance: none;\n height: var(--checkbox-size);\n width: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: \"lil-gui\";\n content: \"✓\";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n -webkit-tap-highlight-color: transparent;\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: 1px solid var(--widget-color);\n text-align: center;\n line-height: calc(var(--widget-height) - 4px);\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n border-color: var(--hover-color);\n }\n .lil-gui button:focus {\n border-color: var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: \"lil-gui\";\n src: url(\"data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==\") format(\"woff\");\n}\n.curve-editor {\n display: flex;\n flex-direction: column;\n gap: 5px;\n background-color: #303030;\n outline: 1px solid #000000;\n padding: 5px;\n width: 100%;\n}\n.curve-editor .button-medium {\n background-color: #545454;\n min-width: var(--widget-height);\n min-height: var(--widget-height);\n height: 100%;\n outline: 1px solid #3c3c3c;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: var(--input-font-size, 11px);\n}\n.curve-editor .button-medium.selected {\n background-color: #4772b3;\n pointer-events: none;\n}\n.curve-editor .button-medium:hover {\n background-color: #656565;\n cursor: default;\n}\n.curve-editor .curve-top {\n display: flex;\n width: 100%;\n}\n.curve-editor .curve-panel {\n width: 100%;\n height: 90px;\n outline: 1px solid #646464;\n}\n.curve-editor .curve-point-panel {\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--widget-height);\n}\n.curve-editor .curve-point-panel input {\n background-color: #545454;\n height: 100%;\n width: 100%;\n color: #fff;\n border: 0;\n outline: 1px solid #3c3c3c;\n text-align: center;\n font-size: var(--input-font-size, 11px);\n}";
8
+ var css = "@charset \"UTF-8\";\n.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n background-color: var(--background-color);\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n Arial,\n sans-serif;\n --font-family-mono: Menlo,\n Monaco,\n Consolas,\n \"Droid Sans Mono\",\n monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 40%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean .widget {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: \" \";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid rgba(255, 255, 255, 0.6);\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: \"lil-gui\";\n content: \"↕\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background-color: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background-color: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background-color: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n.lil-gui .controller.image img {\n max-width: 100%;\n}\n.lil-gui .controller.image canvas {\n max-width: 100%;\n min-height: 1px;\n}\n.lil-gui .controller.vector input {\n color: var(--number-color);\n}\n.lil-gui .controller.vector .fill {\n height: 100%;\n margin-left: var(--spacing);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: \"lil-gui\";\n content: \"▾\";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: \"▸\";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: \"Empty\";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui input {\n -webkit-tap-highlight-color: transparent;\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input::-webkit-outer-spin-button,\n.lil-gui input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.lil-gui input[type=number] {\n -moz-appearance: textfield;\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n -webkit-appearance: none;\n height: var(--checkbox-size);\n width: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: \"lil-gui\";\n content: \"✓\";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n -webkit-tap-highlight-color: transparent;\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: 1px solid var(--widget-color);\n text-align: center;\n line-height: calc(var(--widget-height) - 4px);\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n border-color: var(--hover-color);\n }\n .lil-gui button:focus {\n border-color: var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: \"lil-gui\";\n src: url(\"data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==\") format(\"woff\");\n}\n.curve-editor {\n display: flex;\n flex-direction: column;\n gap: 5px;\n background-color: #303030;\n outline: 1px solid #000000;\n padding: 5px;\n width: 100%;\n}\n.curve-editor .button-medium {\n background-color: #545454;\n min-width: var(--widget-height);\n min-height: var(--widget-height);\n height: 100%;\n outline: 1px solid #3c3c3c;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: var(--input-font-size, 11px);\n}\n.curve-editor .button-medium.selected {\n background-color: #4772b3;\n pointer-events: none;\n}\n.curve-editor .button-medium:hover {\n background-color: #656565;\n cursor: default;\n}\n.curve-editor .curve-top {\n display: flex;\n width: 100%;\n}\n.curve-editor .curve-panel {\n width: 100%;\n height: 90px;\n outline: 1px solid #646464;\n}\n.curve-editor .curve-point-panel {\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--widget-height);\n}\n.curve-editor .curve-point-panel input {\n background-color: #545454;\n height: 100%;\n width: 100%;\n color: #fff;\n border: 0;\n outline: 1px solid #3c3c3c;\n text-align: center;\n font-size: var(--input-font-size, 11px);\n}";
9
9
  n(css,{});
10
10
 
11
11
  class Controller {
@@ -422,6 +422,18 @@ function getPrecision(value) {
422
422
  function hasDecimal(value) {
423
423
  return value % 1 !== 0;
424
424
  }
425
+ let renderer;
426
+ let material = new three.MeshBasicMaterial();
427
+ function renderToCanvas(texture) {
428
+ if (renderer === undefined) {
429
+ renderer = new three.WebGLRenderer();
430
+ }
431
+ const image = texture.image;
432
+ material.map = texture;
433
+ renderer.setSize(image.width, image.height, false);
434
+ core.Viewer.Blit(renderer, null, material);
435
+ return renderer.domElement;
436
+ }
425
437
 
426
438
  class NumberController extends Controller {
427
439
  min(min) {
@@ -451,14 +463,14 @@ class NumberController extends Controller {
451
463
  return false;
452
464
  }
453
465
  updateDisplay() {
454
- const value = this.getValue();
466
+ const value = this._snap(this.getValue());
455
467
  if (this._hasSlider) {
456
468
  let percent = (value - this._min) / (this._max - this._min);
457
469
  percent = Math.max(0, Math.min(percent, 1));
458
470
  this.$fill.style.width = percent * 100 + '%';
459
471
  }
460
472
  if (!this._inputFocused) {
461
- this.$input.value = value;
473
+ this.$input.value = "" + value;
462
474
  }
463
475
  return this;
464
476
  }
@@ -863,8 +875,7 @@ class ColorController extends Controller {
863
875
  this.setValue(newValue);
864
876
  } else {
865
877
  this._format.fromHexString(value, this.getValue(), this._rgbScale);
866
- this._callOnChange();
867
- this.updateDisplay();
878
+ this.setValue(this.getValue());
868
879
  }
869
880
  }
870
881
  save() {
@@ -931,82 +942,6 @@ class ColorController extends Controller {
931
942
  }
932
943
  }
933
944
 
934
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
935
- try {
936
- var info = gen[key](arg);
937
- var value = info.value;
938
- } catch (error) {
939
- reject(error);
940
- return;
941
- }
942
- if (info.done) resolve(value);
943
- else Promise.resolve(value).then(_next, _throw);
944
- }
945
- function _async_to_generator(fn) {
946
- return function() {
947
- var self = this, args = arguments;
948
-
949
- return new Promise(function(resolve, reject) {
950
- var gen = fn.apply(self, args);
951
-
952
- function _next(value) {
953
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
954
- }
955
-
956
- function _throw(err) {
957
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
958
- }
959
-
960
- _next(undefined);
961
- });
962
- };
963
- }
964
-
965
- class ImageController extends Controller {
966
- static toDataURL(img) {
967
- return _async_to_generator(function*() {
968
- if (img instanceof HTMLImageElement) {
969
- return img.src;
970
- } else {
971
- if (img) {
972
- let url = ImageController._imageMap.get(img);
973
- if (url) return url;
974
- const w = Math.min(img.width, 256);
975
- const h = Math.min(img.height, 256);
976
- if (ImageController._context == null) {
977
- ImageController._context = document.createElement('canvas').getContext("2d");
978
- }
979
- ImageController._context.canvas.width = w;
980
- ImageController._context.canvas.height = h;
981
- if (img.data) {
982
- let imageData = ImageController._context.createImageData(img.width, img.height);
983
- imageData.data.set(img.data);
984
- img = yield createImageBitmap(imageData);
985
- }
986
- if (img instanceof ImageBitmap) {
987
- ImageController._context.drawImage(img, 0, 0, img.width, img.height, 0, 0, w, h);
988
- ImageController._imageMap.set(img, url = ImageController._context.canvas.toDataURL());
989
- return url;
990
- }
991
- }
992
- return "";
993
- }
994
- })();
995
- }
996
- updateDisplay() {
997
- ImageController.toDataURL(this.getValue()).then((url)=>this.$img.src = url);
998
- return this;
999
- }
1000
- constructor(parent, object, property){
1001
- super(parent, object, property, "image");
1002
- this.$img = document.createElement("img");
1003
- this.$widget.appendChild(this.$img);
1004
- this.updateDisplay();
1005
- }
1006
- }
1007
- ImageController._context = null;
1008
- ImageController._imageMap = new WeakMap();
1009
-
1010
945
  class UIElement {
1011
946
  add(...args) {
1012
947
  for(let i = 0; i < args.length; i++){
@@ -1094,8 +1029,8 @@ class UINumber extends UIElement {
1094
1029
  return this;
1095
1030
  }
1096
1031
  updateDisplay() {
1097
- let value = this.getValue();
1098
- this.dom.value = "" + this._snap(value);
1032
+ let value = this._snap(this.getValue());
1033
+ this.dom.value = "" + value;
1099
1034
  if (this.unit !== '') this.dom.value += ' ' + this.unit;
1100
1035
  }
1101
1036
  _getImplicitStep(value) {
@@ -1769,57 +1704,46 @@ class CurveController extends Controller {
1769
1704
  }
1770
1705
 
1771
1706
  class TextureController extends Controller {
1772
- needsUpdateDisplay() {
1773
- if (this.parent._closed) {
1774
- return false;
1775
- }
1776
- let texture = this.getValue();
1777
- if (texture && this._version !== texture.version) {
1778
- this._version = texture.version;
1779
- return true;
1780
- }
1781
- return false;
1782
- }
1783
1707
  updateDisplay() {
1784
1708
  const canvas = this.$canvas;
1785
1709
  const context = canvas.getContext("2d");
1786
- const texture = this.getValue();
1787
- const image = texture.image;
1788
- // Seems like context can be null if the canvas is not visible
1789
1710
  if (context) {
1790
- // Always clear the context before set new texture, because new texture may has transparency
1791
1711
  context.clearRect(0, 0, canvas.width, canvas.height);
1792
1712
  }
1793
- if (image && image.width > 0) {
1794
- const scale = canvas.width / image.width;
1795
- canvas.height = Math.max(2, image.height / image.width * canvas.width);
1796
- const width = Math.max(image.width * scale, 2);
1797
- const height = Math.max(image.height * scale, 2);
1798
- if (texture.__getImage) {
1799
- context.drawImage(texture.__getImage(), 0, 0, width, height);
1713
+ let texture = this.getValue();
1714
+ if (texture) {
1715
+ let image = texture.image;
1716
+ if (image && image.width > 0) {
1717
+ this.$label.textContent = `${image.width}x${image.height}`;
1718
+ canvas.title = texture.sourceFile;
1719
+ let scale = canvas.width / image.width;
1720
+ if (texture.isDataTexture || texture.isCompressedTexture) {
1721
+ context.drawImage(renderToCanvas(texture), 0, 0, image.width * scale, image.height * scale);
1722
+ } else if (image.depth) ; else {
1723
+ context.drawImage(image, 0, 0, image.width * scale, image.height * scale);
1724
+ }
1800
1725
  } else {
1801
- context.drawImage(image, 0, 0, width, height);
1726
+ canvas.title = texture.sourceFile + ' (error)';
1802
1727
  }
1728
+ } else {
1729
+ canvas.title = 'empty';
1803
1730
  }
1804
1731
  return this;
1805
1732
  }
1806
1733
  constructor(parent, object, property){
1807
1734
  super(parent, object, property, "image");
1808
- this._version = 0;
1809
- let group = document.createElement("div");
1735
+ const group = this.$widget.appendChild(document.createElement("div"));
1810
1736
  group.style.display = "flex";
1811
1737
  group.style.flexDirection = "column";
1812
1738
  group.style.width = "100%";
1813
- this.$widget.appendChild(group);
1814
- this.$canvas = document.createElement("canvas");
1815
- group.appendChild(this.$canvas);
1816
- const texture = this.getValue();
1817
- if (texture.isRenderTargetTexture) {
1818
- let button = document.createElement("button");
1819
- button.textContent = "capture";
1820
- button.onclick = ()=>this.updateDisplay();
1821
- group.appendChild(button);
1822
- }
1739
+ this.$canvas = group.appendChild(document.createElement("canvas"));
1740
+ const label = document.createElement("div");
1741
+ label.style.position = "absolute";
1742
+ label.style.display = "flex";
1743
+ label.style.backgroundColor = "black";
1744
+ this.$label = group.appendChild(label);
1745
+ group.onpointerover = (e)=>this.onpointerover && this.onpointerover(e);
1746
+ group.onpointerout = (e)=>this.onpointerout && this.onpointerout(e);
1823
1747
  }
1824
1748
  }
1825
1749
 
@@ -1880,14 +1804,6 @@ class GUI {
1880
1804
  */ addColor(object, property, rgbScale = 1) {
1881
1805
  return new ColorController(this, object, property, rgbScale);
1882
1806
  }
1883
- /**
1884
- *
1885
- * @param {object} object
1886
- * @param {string} property Name of the property to control.
1887
- * @returns {Controller}
1888
- */ addImage(object, property) {
1889
- return new ImageController(this, object, property);
1890
- }
1891
1807
  addTexture(object, property) {
1892
1808
  return new TextureController(this, object, property);
1893
1809
  }
@@ -2231,7 +2147,9 @@ class GUI {
2231
2147
  this.$title.setAttribute('role', 'button');
2232
2148
  this.$title.setAttribute('aria-expanded', "true");
2233
2149
  this.$title.setAttribute('tabindex', "0");
2234
- this.$title.addEventListener('click', ()=>this.openAnimated(this._closed));
2150
+ this.$title.addEventListener('click', ()=>{
2151
+ this.openAnimated(this._closed);
2152
+ });
2235
2153
  this.$title.addEventListener('keydown', (e)=>{
2236
2154
  if (e.code === 'Enter' || e.code === 'Space') {
2237
2155
  e.preventDefault();
@@ -2303,38 +2221,214 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
2303
2221
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2304
2222
  };
2305
2223
 
2306
- class InspectorPlugin extends core.Plugin {
2307
- static _getTargetName(target) {
2308
- return target.name || target.constructor.name || target.type;
2224
+ class ViewerHelper extends core.ObjectInstance {
2225
+ get outputColorSpace() {
2226
+ return this._renderer.outputColorSpace;
2227
+ }
2228
+ set outputColorSpace(v) {
2229
+ this._renderer.outputColorSpace = v;
2230
+ }
2231
+ get toneMapping() {
2232
+ return this._renderer.toneMapping;
2233
+ }
2234
+ set toneMapping(v) {
2235
+ this._renderer.toneMapping = v;
2236
+ }
2237
+ get toneMappingExposure() {
2238
+ return this._renderer.toneMappingExposure;
2239
+ }
2240
+ set toneMappingExposure(v) {
2241
+ this._renderer.toneMappingExposure = v;
2242
+ }
2243
+ get shadows() {
2244
+ return this._renderer.shadowMap.enabled;
2245
+ }
2246
+ set shadows(v) {
2247
+ this._renderer.shadowMap.enabled = v;
2248
+ }
2249
+ get backgroundBlurriness() {
2250
+ return this._scene.backgroundBlurriness;
2251
+ }
2252
+ set backgroundBlurriness(v) {
2253
+ this._scene.backgroundBlurriness = v;
2254
+ }
2255
+ get environment() {
2256
+ return this._scene.environment;
2257
+ }
2258
+ set environment(v) {
2259
+ this._scene.environment = v;
2309
2260
  }
2310
- onUpdate(dt) {
2261
+ get environmentIntensity() {
2262
+ return this._scene.environmentIntensity;
2263
+ }
2264
+ set environmentIntensity(v) {
2265
+ this._scene.environmentIntensity = v;
2266
+ }
2267
+ get environmentRotation() {
2268
+ return this._scene.environmentRotation;
2269
+ }
2270
+ set environmentRotation(v) {
2271
+ this._scene.environmentRotation.copy(v);
2272
+ }
2273
+ get backgroundRotation() {
2274
+ return this._scene.backgroundRotation;
2275
+ }
2276
+ set backgroundRotation(v) {
2277
+ this._scene.backgroundRotation.copy(v);
2278
+ }
2279
+ get targetFrameRate() {
2280
+ return this._viewer.targetFrameRate;
2281
+ }
2282
+ set targetFrameRate(v) {
2283
+ this._viewer.targetFrameRate = v;
2284
+ }
2285
+ constructor(viewer){
2286
+ super();
2287
+ this._viewer = viewer;
2288
+ this._scene = viewer.scene;
2289
+ this._renderer = viewer.renderer;
2290
+ }
2291
+ }
2292
+ __decorate([
2293
+ core.property({
2294
+ value: {
2295
+ SRGBColorSpace: "srgb",
2296
+ LinearSRGBColorSpace: "srgb-linear",
2297
+ DisplayP3ColorSpace: "display-p3",
2298
+ LinearDisplayP3ColorSpace: "display-p3-linear"
2299
+ }
2300
+ })
2301
+ ], ViewerHelper.prototype, "outputColorSpace", null);
2302
+ __decorate([
2303
+ core.property({
2304
+ value: {
2305
+ NoToneMapping: 0,
2306
+ LinearToneMapping: 1,
2307
+ ReinhardToneMapping: 2,
2308
+ CineonToneMapping: 3,
2309
+ ACESFilmicToneMapping: 4
2310
+ }
2311
+ })
2312
+ ], ViewerHelper.prototype, "toneMapping", null);
2313
+ __decorate([
2314
+ core.property({
2315
+ min: 0,
2316
+ max: 10,
2317
+ step: 0.01
2318
+ })
2319
+ ], ViewerHelper.prototype, "toneMappingExposure", null);
2320
+ __decorate([
2321
+ core.property
2322
+ ], ViewerHelper.prototype, "shadows", null);
2323
+ __decorate([
2324
+ core.property({
2325
+ min: 0,
2326
+ max: 1,
2327
+ step: 0.01
2328
+ })
2329
+ ], ViewerHelper.prototype, "backgroundBlurriness", null);
2330
+ __decorate([
2331
+ core.property
2332
+ ], ViewerHelper.prototype, "environment", null);
2333
+ __decorate([
2334
+ core.property({
2335
+ min: 0,
2336
+ max: 1,
2337
+ step: 0.01
2338
+ })
2339
+ ], ViewerHelper.prototype, "environmentIntensity", null);
2340
+ __decorate([
2341
+ core.property({
2342
+ step: 0.01
2343
+ })
2344
+ ], ViewerHelper.prototype, "environmentRotation", null);
2345
+ __decorate([
2346
+ core.property({
2347
+ step: 0.01
2348
+ })
2349
+ ], ViewerHelper.prototype, "backgroundRotation", null);
2350
+ __decorate([
2351
+ core.property({
2352
+ min: 1,
2353
+ max: 120,
2354
+ step: 1
2355
+ })
2356
+ ], ViewerHelper.prototype, "targetFrameRate", null);
2357
+
2358
+ class Inspector extends core.Mount {
2359
+ onLoad() {
2360
+ this._scene = new three.Scene();
2361
+ this._camera = new three.OrthographicCamera(0, window.innerWidth, window.innerHeight, 0, -1, 1);
2362
+ this._gui = new GUI({
2363
+ width: 310,
2364
+ title: "Inspector"
2365
+ }).close();
2366
+ this._gui.addFolder("Viewer").close().hide();
2367
+ this._gui.addFolder("Component").close().hide();
2368
+ this._gui.addFolder("Material").close().hide();
2369
+ this._gui.addFolder("Other").close().hide();
2370
+ this._rect = this._gui.domElement.getBoundingClientRect();
2371
+ this._inspect(new ViewerHelper(this.viewer));
2372
+ this._addSprite();
2373
+ }
2374
+ onDestroy() {
2375
+ this._gui.destroy();
2376
+ this._refCntMap.clear();
2377
+ this._targetMap.clear();
2378
+ }
2379
+ update(dt) {
2311
2380
  this._gui.update();
2312
2381
  this._updateFolders();
2313
2382
  }
2314
- _initFolders() {
2315
- const gui = this._gui;
2316
- gui.addFolder("Viewer").close().hide();
2317
- gui.addFolder("Plugin").close().hide();
2318
- gui.addFolder("Component").close().hide();
2319
- gui.addFolder("Material").close().hide();
2320
- gui.addFolder("Other").close().hide();
2321
- }
2322
- _initViewer() {
2323
- this.inspect(new ViewerExtension(this.viewer));
2383
+ resize(width, height) {
2384
+ this._camera.left = 0;
2385
+ this._camera.right = width;
2386
+ this._camera.top = height;
2387
+ this._camera.bottom = 0;
2388
+ this._camera.updateProjectionMatrix();
2389
+ this._rect = this._gui.domElement.getBoundingClientRect();
2390
+ }
2391
+ render(dt) {
2392
+ const { renderer } = this.viewer;
2393
+ const autoClearDepth = renderer.autoClearDepth;
2394
+ const autoClearColor = renderer.autoClearColor;
2395
+ renderer.autoClearDepth = true;
2396
+ renderer.autoClearColor = false;
2397
+ renderer.render(this._scene, this._camera);
2398
+ renderer.autoClearDepth = autoClearDepth;
2399
+ renderer.autoClearColor = autoClearColor;
2400
+ }
2401
+ _addSprite() {
2402
+ const viewer = this.viewer;
2403
+ this._tween = viewer.tween();
2404
+ this._background = viewer.add(three.Sprite, {
2405
+ parent: this._scene,
2406
+ scale: new three.Vector3(258, 258, 1),
2407
+ position: new three.Vector3(viewer.width / 2, viewer.height / 2)
2408
+ });
2409
+ this._background.material.opacity = 0;
2410
+ this._sprite = viewer.add(three.Sprite, {
2411
+ parent: this._scene,
2412
+ scale: new three.Vector3(256, 256, 1),
2413
+ position: new three.Vector3(viewer.width / 2, viewer.height / 2)
2414
+ });
2415
+ this._sprite.material.opacity = 0;
2324
2416
  }
2325
2417
  _updateFolders() {
2326
- const statesMap = this._statesMap;
2327
- const setState = (v)=>statesMap.set(v, statesMap.has(v) ? 0 : 1);
2328
- statesMap.forEach((_, k, map)=>map.set(k, -1));
2329
- this.viewer.traversePlugins(setState);
2418
+ const refCntMap = this._refCntMap;
2419
+ const setState = (v)=>{
2420
+ if (refCntMap.get(v) === -1) refCntMap.set(v, 0);
2421
+ if (refCntMap.get(v) === undefined) refCntMap.set(v, 1);
2422
+ };
2423
+ refCntMap.forEach((_, k, map)=>map.set(k, -1));
2330
2424
  this.viewer.traverseComponents(setState);
2331
2425
  this.viewer.traverseMaterials(setState);
2332
- statesMap.forEach((v, k, map)=>{
2426
+ refCntMap.forEach((v, k, map)=>{
2333
2427
  if (v === 1) {
2334
- this.inspect(k);
2428
+ this._inspect(k);
2335
2429
  }
2336
2430
  if (v === -1) {
2337
- this.uninspect(k);
2431
+ this._uninspect(k);
2338
2432
  map.delete(k);
2339
2433
  }
2340
2434
  });
@@ -2343,15 +2437,14 @@ class InspectorPlugin extends core.Plugin {
2343
2437
  const list = [];
2344
2438
  let props = core.PropertyManager._getMergedProperties(target.constructor);
2345
2439
  if (props) {
2346
- list.push(props);
2347
- this._targetMap.set(props, target);
2440
+ const values = propsSort(props);
2441
+ list.push(values);
2442
+ this._targetMap.set(values, target);
2348
2443
  }
2349
2444
  if (target instanceof three.ShaderMaterial) {
2350
2445
  props = Object.create(null);
2351
2446
  const uniforms = Object.create(null);
2352
- this._targetMap.set(props, uniforms);
2353
- const entries = Object.entries(target.uniforms);
2354
- entries.forEach(([name])=>{
2447
+ Object.keys(target.uniforms).forEach((name)=>{
2355
2448
  Object.defineProperty(uniforms, name, {
2356
2449
  get: ()=>target.uniforms[name].value,
2357
2450
  set: (v)=>target.uniforms[name].value = v
@@ -2360,18 +2453,18 @@ class InspectorPlugin extends core.Plugin {
2360
2453
  dir: "uniforms"
2361
2454
  };
2362
2455
  });
2363
- list.push(props);
2456
+ const values = propsSort(props);
2457
+ list.push(values);
2458
+ this._targetMap.set(values, uniforms);
2364
2459
  }
2365
2460
  return list;
2366
2461
  }
2367
- inspect(target) {
2462
+ _inspect(target) {
2368
2463
  let propsList = this._getPropertiesList(target);
2369
2464
  if (propsList.length === 0) return;
2370
2465
  let gui = this._gui;
2371
- if (target instanceof ViewerExtension) {
2466
+ if (target instanceof ViewerHelper) {
2372
2467
  gui = gui.getFolder("Viewer").show();
2373
- } else if (target instanceof core.Plugin) {
2374
- gui = gui.getFolder("Plugin").show();
2375
2468
  } else if (target instanceof core.Component) {
2376
2469
  gui = gui.getFolder("Component").show();
2377
2470
  } else if (target instanceof three.Material) {
@@ -2380,28 +2473,29 @@ class InspectorPlugin extends core.Plugin {
2380
2473
  gui = gui.getFolder("Other").show();
2381
2474
  }
2382
2475
  if (gui._title !== "Viewer") {
2383
- gui = gui.getFolder(target.uuid) || gui.addFolder(InspectorPlugin._getTargetName(target), target.uuid).close();
2476
+ gui = gui.getFolder(target.uuid) || gui.addFolder(targetName(target), target.uuid).close();
2384
2477
  }
2385
- this._addPropsListGUI(gui, propsList, target);
2478
+ this._addGUI(gui, propsList, target);
2386
2479
  return target;
2387
2480
  }
2388
- _addPropsListGUI(gui, list, target, dir = "") {
2389
- let source = target;
2390
- for (let props of list){
2391
- if (dir) {
2392
- gui = gui.getFolder(dir) || gui.addFolder(dir).close();
2393
- }
2481
+ _addGUI(gui, list, target, dir = "") {
2482
+ if (dir) {
2483
+ gui = gui.getFolder(dir) || gui.addFolder(dir).close();
2484
+ }
2485
+ const source = target;
2486
+ for (const props of list){
2394
2487
  target = this._targetMap.get(props) || source;
2395
- for(let k in props){
2488
+ for (const [k, prop] of props){
2396
2489
  let value = target[k];
2397
- if (value == null) continue;
2398
- const prop = props[k];
2490
+ if (value == null || prop.parent && target[prop.parent] == null) {
2491
+ continue;
2492
+ }
2399
2493
  let folder = gui;
2400
2494
  if (prop.dir) {
2401
2495
  folder = folder.getFolder(prop.dir) || folder.addFolder(prop.dir).close();
2402
2496
  }
2403
2497
  if (core.PropertyManager._hasProperties(value.constructor)) {
2404
- this._addPropsListGUI(folder, this._getPropertiesList(value), target, k);
2498
+ this._addGUI(folder, this._getPropertiesList(value), target, k);
2405
2499
  }
2406
2500
  const type = typeof value;
2407
2501
  let ins = null;
@@ -2411,7 +2505,34 @@ class InspectorPlugin extends core.Plugin {
2411
2505
  ins = folder.addCurve(target, k);
2412
2506
  } else if (value.isVector2 || value.isVector3 || value.isVector4 || value.isEuler) {
2413
2507
  ins = folder.addVector(target, k, prop.min, prop.max, prop.step);
2414
- } else if (value.isTexture) ; else if (type === "number" || type === "boolean" || type === "string" || type === "function") {
2508
+ } else if (value.isTexture) {
2509
+ ins = folder.addTexture(target, k);
2510
+ ins.onpointerover = ()=>{
2511
+ const image = value.image;
2512
+ const w = image.width * 256 / image.height, h = 256;
2513
+ const x = this._rect.x - w / 2 - 10;
2514
+ this._background.scale.set(w + 2, h + 2, 1);
2515
+ this._background.position.x = x;
2516
+ this._sprite.scale.set(w, h, 1);
2517
+ this._sprite.position.x = x;
2518
+ this._sprite.material.map = value;
2519
+ this._sprite.material.needsUpdate = true;
2520
+ this._tween.timeline(this._sprite.material).to({
2521
+ opacity: 1
2522
+ }, 0.3).start();
2523
+ this._tween.timeline(this._background.material).to({
2524
+ opacity: 1
2525
+ }, 0.3).start();
2526
+ };
2527
+ ins.onpointerout = ()=>{
2528
+ this._tween.timeline(this._background.material).to({
2529
+ opacity: 0
2530
+ }, 0.3).start();
2531
+ this._tween.timeline(this._sprite.material).to({
2532
+ opacity: 0
2533
+ }, 0.3).start();
2534
+ };
2535
+ } else if (type === "number" || type === "boolean" || type === "string" || type === "function") {
2415
2536
  ins = folder.add(target, k, prop.value || prop.min, prop.max, prop.step);
2416
2537
  } else ;
2417
2538
  if (ins && prop.name) {
@@ -2420,11 +2541,9 @@ class InspectorPlugin extends core.Plugin {
2420
2541
  }
2421
2542
  }
2422
2543
  }
2423
- uninspect(target) {
2544
+ _uninspect(target) {
2424
2545
  let gui = this._gui;
2425
- if (target instanceof core.Plugin) {
2426
- gui = gui.getFolder("Plugin");
2427
- } else if (target instanceof core.Component) {
2546
+ if (target instanceof core.Component) {
2428
2547
  gui = gui.getFolder("Component");
2429
2548
  } else if (target instanceof three.Material) {
2430
2549
  gui = gui.getFolder("Material");
@@ -2436,100 +2555,52 @@ class InspectorPlugin extends core.Plugin {
2436
2555
  gui.hide();
2437
2556
  }
2438
2557
  }
2439
- constructor(){
2440
- super();
2441
- this._statesMap = new Map();
2558
+ constructor(...args){
2559
+ super(...args);
2560
+ this._refCntMap = new Map();
2442
2561
  this._targetMap = new Map();
2443
- this.install = ()=>{
2444
- this._gui = new GUI({
2445
- width: 310,
2446
- title: "Inspector"
2447
- }).close();
2448
- this._initFolders();
2449
- this._initViewer();
2450
- };
2451
- this.uninstall = ()=>{
2452
- this._gui.destroy();
2453
- this._statesMap.clear();
2454
- this._targetMap.clear();
2455
- };
2456
2562
  }
2457
2563
  }
2458
- class ViewerExtension extends core.ObjectInstance {
2459
- get outputColorSpace() {
2460
- return this._renderer.outputColorSpace;
2461
- }
2462
- set outputColorSpace(v) {
2463
- this._renderer.outputColorSpace = v;
2464
- }
2465
- get toneMapping() {
2466
- return this._renderer.toneMapping;
2467
- }
2468
- set toneMapping(v) {
2469
- this._renderer.toneMapping = v;
2470
- }
2471
- get toneMappingExposure() {
2472
- return this._renderer.toneMappingExposure;
2473
- }
2474
- set toneMappingExposure(v) {
2475
- this._renderer.toneMappingExposure = v;
2476
- }
2477
- get shadows() {
2478
- return this._renderer.shadowMap.enabled;
2479
- }
2480
- set shadows(v) {
2481
- this._renderer.shadowMap.enabled = v;
2482
- }
2483
- get backgroundBlurriness() {
2484
- return this._scene.backgroundBlurriness;
2485
- }
2486
- set backgroundBlurriness(v) {
2487
- this._scene.backgroundBlurriness = v;
2488
- }
2489
- constructor(viewer){
2490
- super();
2491
- this._scene = viewer.scene;
2492
- this._renderer = viewer.renderer;
2493
- }
2564
+ function targetName(target) {
2565
+ return target.name || target.constructor.name || target.type;
2494
2566
  }
2495
- __decorate([
2496
- core.property({
2497
- value: {
2498
- SRGBColorSpace: "srgb",
2499
- LinearSRGBColorSpace: "srgb-linear",
2500
- DisplayP3ColorSpace: "display-p3",
2501
- LinearDisplayP3ColorSpace: "display-p3-linear"
2502
- }
2503
- })
2504
- ], ViewerExtension.prototype, "outputColorSpace", null);
2505
- __decorate([
2506
- core.property({
2567
+ function propsSort(props) {
2568
+ const order = (v)=>v.order || 10000;
2569
+ const values = Object.entries(props);
2570
+ const array0 = values.filter((v)=>!v[1].dir).sort((a, b)=>order(a[1]) - order(b[1]));
2571
+ const array1 = values.filter((v)=>v[1].dir).sort((a, b)=>order(a[1]) - order(b[1]));
2572
+ return array0.concat(array1);
2573
+ }
2574
+ const materialProperties = {
2575
+ visible: {
2576
+ order: 1
2577
+ },
2578
+ transparent: {
2579
+ order: 2
2580
+ },
2581
+ side: {
2582
+ order: 3,
2507
2583
  value: {
2508
- NoToneMapping: 0,
2509
- LinearToneMapping: 1,
2510
- ReinhardToneMapping: 2,
2511
- CineonToneMapping: 3,
2512
- ACESFilmicToneMapping: 4
2584
+ FrontSide: 0,
2585
+ BackSide: 1,
2586
+ DoubleSide: 2
2513
2587
  }
2514
- })
2515
- ], ViewerExtension.prototype, "toneMapping", null);
2516
- __decorate([
2517
- core.property({
2518
- min: 0,
2519
- max: 10,
2520
- step: 0.01
2521
- })
2522
- ], ViewerExtension.prototype, "toneMappingExposure", null);
2523
- __decorate([
2524
- core.property
2525
- ], ViewerExtension.prototype, "shadows", null);
2526
- __decorate([
2527
- core.property({
2588
+ },
2589
+ color: {
2590
+ order: 4,
2591
+ dir: "diffuse"
2592
+ },
2593
+ opacity: {
2594
+ order: 5,
2595
+ dir: "diffuse",
2528
2596
  min: 0,
2529
2597
  max: 1,
2530
2598
  step: 0.01
2531
- })
2532
- ], ViewerExtension.prototype, "backgroundBlurriness", null);
2599
+ }
2600
+ };
2601
+ for(let k in materialProperties){
2602
+ core.property(materialProperties[k])(three.Material.prototype, k);
2603
+ }
2533
2604
  const meshBasicMaterislProperties = {
2534
2605
  map: {
2535
2606
  dir: "diffuse"
@@ -2562,24 +2633,6 @@ for(let k in meshBasicMaterislProperties){
2562
2633
  core.property(meshBasicMaterislProperties[k])(three.MeshBasicMaterial.prototype, k);
2563
2634
  }
2564
2635
  const meshStandardMaterialProperties = {
2565
- visible: {},
2566
- transparent: {},
2567
- side: {
2568
- value: {
2569
- FrontSide: 0,
2570
- BackSide: 1,
2571
- DoubleSide: 2
2572
- }
2573
- },
2574
- color: {
2575
- dir: "diffuse"
2576
- },
2577
- opacity: {
2578
- dir: "diffuse",
2579
- min: 0,
2580
- max: 1,
2581
- step: 0.01
2582
- },
2583
2636
  map: {
2584
2637
  dir: "diffuse"
2585
2638
  },
@@ -2629,7 +2682,8 @@ const meshStandardMaterialProperties = {
2629
2682
  },
2630
2683
  normalScale: {
2631
2684
  dir: "normal",
2632
- parent: "normalMap"
2685
+ step: 0.01,
2686
+ parent: "normalMap "
2633
2687
  },
2634
2688
  displacementScale: {
2635
2689
  dir: "displacement",
@@ -2649,7 +2703,8 @@ const meshStandardMaterialProperties = {
2649
2703
  dir: "envMap",
2650
2704
  min: 0,
2651
2705
  max: 1,
2652
- step: 0.01
2706
+ step: 0.01,
2707
+ parent: "envMap"
2653
2708
  },
2654
2709
  lightMap: {
2655
2710
  dir: "lightMap"
@@ -2665,6 +2720,116 @@ const meshStandardMaterialProperties = {
2665
2720
  for(let k in meshStandardMaterialProperties){
2666
2721
  core.property(meshStandardMaterialProperties[k])(three.MeshStandardMaterial.prototype, k);
2667
2722
  }
2723
+ const meshPhysicalMaterialProperties = {
2724
+ ior: {
2725
+ min: 0,
2726
+ max: 10,
2727
+ step: 0.01
2728
+ },
2729
+ anisotropy: {
2730
+ min: 0,
2731
+ max: 10,
2732
+ step: 0.01
2733
+ },
2734
+ clearcoat: {
2735
+ dir: "clearcoat"
2736
+ },
2737
+ clearcoatMap: {
2738
+ dir: "clearcoat",
2739
+ min: 0,
2740
+ max: 1,
2741
+ step: 0.01
2742
+ },
2743
+ clearcoatRoughness: {
2744
+ dir: "clearcoat",
2745
+ min: 0,
2746
+ max: 1,
2747
+ step: 0.01
2748
+ },
2749
+ clearcoatNormalScale: {
2750
+ dir: "clearcoat",
2751
+ step: 0.01
2752
+ },
2753
+ clearcoatNormalMap: {
2754
+ dir: "clearcoat"
2755
+ },
2756
+ iridescence: {
2757
+ dir: "iridescence",
2758
+ min: 0,
2759
+ max: 1,
2760
+ step: 0.01
2761
+ },
2762
+ iridescenceMap: {
2763
+ dir: "iridescence"
2764
+ },
2765
+ iridescenceIOR: {
2766
+ dir: "iridescence",
2767
+ step: 0.01
2768
+ },
2769
+ iridescenceThicknessRange: {
2770
+ dir: "iridescence"
2771
+ },
2772
+ iridescenceThicknessMap: {
2773
+ dir: "iridescence"
2774
+ },
2775
+ sheen: {
2776
+ dir: "sheen"
2777
+ },
2778
+ sheenColor: {
2779
+ dir: "sheen"
2780
+ },
2781
+ sheenColorMap: {
2782
+ dir: "sheen"
2783
+ },
2784
+ sheenRoughness: {
2785
+ dir: "sheen",
2786
+ min: 0,
2787
+ max: 1,
2788
+ step: 0.01
2789
+ },
2790
+ sheenRoughnessMap: {
2791
+ dir: "sheen"
2792
+ },
2793
+ transmission: {
2794
+ dir: "transmission"
2795
+ },
2796
+ transmissionMap: {
2797
+ dir: "transmission"
2798
+ },
2799
+ thickness: {
2800
+ dir: "thickness",
2801
+ min: 0,
2802
+ max: 1,
2803
+ step: 0.01
2804
+ },
2805
+ thicknessMap: {
2806
+ dir: "thickness"
2807
+ },
2808
+ attenuationDistance: {
2809
+ dir: "attenuation"
2810
+ },
2811
+ attenuationColor: {
2812
+ dir: "attenuation"
2813
+ },
2814
+ specularIntensity: {
2815
+ dir: "specular",
2816
+ min: 0,
2817
+ max: 1,
2818
+ step: 0.01
2819
+ },
2820
+ specularIntensityMap: {
2821
+ dir: "specular"
2822
+ },
2823
+ specularColor: {
2824
+ dir: "specular"
2825
+ },
2826
+ specularColorMap: {
2827
+ dir: "specular"
2828
+ }
2829
+ };
2830
+ for(let k in meshPhysicalMaterialProperties){
2831
+ core.property(meshPhysicalMaterialProperties[k])(three.MeshPhysicalMaterial.prototype, k);
2832
+ }
2668
2833
 
2669
2834
  /**
2670
2835
  * @author mrdoob / http://mrdoob.com/
@@ -2714,7 +2879,7 @@ var Panel = function(name, fg, bg) {
2714
2879
  }
2715
2880
  };
2716
2881
  };
2717
- var Stats = function() {
2882
+ var Stats$1 = function() {
2718
2883
  var mode = 0;
2719
2884
  var container = document.createElement('div');
2720
2885
  container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
@@ -2773,8 +2938,19 @@ var Stats = function() {
2773
2938
  };
2774
2939
  };
2775
2940
 
2776
- class StatsPlugin extends core.Plugin {
2777
- onUpdate(dt) {
2941
+ class Stats extends core.Mount {
2942
+ onLoad() {
2943
+ this._stats.addPanel(this._dcPanel);
2944
+ this._stats.addPanel(this._texPanel);
2945
+ this._stats.addPanel(this._triPanel);
2946
+ this._stats.addPanel(this._prgPanel);
2947
+ this._stats.showPanel(0);
2948
+ document.body.appendChild(this._stats.dom);
2949
+ }
2950
+ onDestroy() {
2951
+ document.body.removeChild(this._stats.dom);
2952
+ }
2953
+ update(dt) {
2778
2954
  const info = this.viewer.renderer.info;
2779
2955
  this._dcPanel.update(info.render.calls, 300);
2780
2956
  this._triPanel.update(info.render.triangles, 500000);
@@ -2782,28 +2958,38 @@ class StatsPlugin extends core.Plugin {
2782
2958
  this._prgPanel.update(info.programs.length, 50);
2783
2959
  this._stats.update();
2784
2960
  }
2785
- constructor(){
2786
- super();
2787
- this._stats = new Stats();
2961
+ constructor(...args){
2962
+ super(...args);
2963
+ this._stats = new Stats$1();
2788
2964
  this._dcPanel = new Panel('DC', '#ff8', '#221');
2789
2965
  this._triPanel = new Panel("TRI", '#ff8', '#221');
2790
2966
  this._texPanel = new Panel('TEX', '#ff8', '#221');
2791
2967
  this._prgPanel = new Panel('PRG', '#ff8', '#221');
2792
- this.install = ()=>{
2793
- this._stats.addPanel(this._dcPanel);
2794
- this._stats.addPanel(this._texPanel);
2795
- this._stats.addPanel(this._triPanel);
2796
- this._stats.addPanel(this._prgPanel);
2797
- this._stats.showPanel(0);
2798
- document.body.appendChild(this._stats.dom);
2799
- };
2800
- this.uninstall = ()=>{
2801
- document.body.removeChild(this._stats.dom);
2802
- };
2803
2968
  }
2804
2969
  }
2805
2970
 
2971
+ class BoxProjectionHelper extends core.Mount {
2972
+ onLoad() {
2973
+ this._box3 = new three.Box3();
2974
+ this._target = this.viewer.mount(core.BoxProjection);
2975
+ this._helper = this.viewer.add(new three.Box3Helper(this._box3));
2976
+ }
2977
+ onEnable() {
2978
+ this._helper.visible = true;
2979
+ }
2980
+ onDisable() {
2981
+ this._helper.visible = false;
2982
+ }
2983
+ update(dt) {
2984
+ const { center, boxMin, boxMax } = this._target;
2985
+ this._box3.min.copy(center).add(boxMin);
2986
+ this._box3.max.copy(center).add(boxMax);
2987
+ this._helper.updateMatrixWorld();
2988
+ }
2989
+ }
2990
+
2991
+ exports.BoxProjectionHelper = BoxProjectionHelper;
2806
2992
  exports.GUI = GUI;
2807
- exports.InspectorPlugin = InspectorPlugin;
2808
- exports.StatsPlugin = StatsPlugin;
2993
+ exports.Inspector = Inspector;
2994
+ exports.Stats = Stats;
2809
2995
  //# sourceMappingURL=main.js.map