From 9b6959585da4fa832a19a66146007b1faa804563 Mon Sep 17 00:00:00 2001
From: yuding <1023798085@qq.com>
Date: Thu, 25 Dec 2025 15:47:57 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dist/bim-engine-sdk.es.js | 8615 +++++++++--------
dist/bim-engine-sdk.es.js.map | 2 +-
dist/bim-engine-sdk.umd.js | 160 +-
dist/bim-engine-sdk.umd.js.map | 2 +-
dist/index.d.ts | 206 +
src/bim-engine.ts | 12 +
.../toolbar/buttons/fullscreen/index.ts | 91 +
.../button-group/toolbar/buttons/map/index.ts | 34 +
.../toolbar/buttons/property/index.ts | 20 +
.../toolbar/buttons/walk/walk-menu/index.ts | 12 +-
src/components/button-group/toolbar/index.ts | 12 +-
src/components/map-panel/index.ts | 49 +
src/components/section-box-panel/index.css | 21 -
src/components/walk-control-panel/index.css | 186 +
src/components/walk-control-panel/index.ts | 459 +
src/components/walk-control-panel/types.ts | 69 +
src/components/walk-path-panel/index.ts | 54 +
src/components/walk-plan-view-panel/index.ts | 54 +
src/locales/en-US.ts | 25 +
src/locales/types.ts | 25 +
src/locales/zh-CN.ts | 25 +
src/managers/map-dialog-manager.ts | 107 +
src/managers/property-panel-manager.ts | 34 +-
src/managers/toolbar-manager.ts | 25 +
src/managers/walk-control-manager.ts | 151 +
src/managers/walk-path-dialog-manager.ts | 97 +
src/managers/walk-plan-view-dialog-manager.ts | 97 +
src/types/events.ts | 17 +-
28 files changed, 6464 insertions(+), 4197 deletions(-)
create mode 100644 src/components/button-group/toolbar/buttons/fullscreen/index.ts
create mode 100644 src/components/button-group/toolbar/buttons/map/index.ts
create mode 100644 src/components/button-group/toolbar/buttons/property/index.ts
create mode 100644 src/components/map-panel/index.ts
create mode 100644 src/components/walk-control-panel/index.css
create mode 100644 src/components/walk-control-panel/index.ts
create mode 100644 src/components/walk-control-panel/types.ts
create mode 100644 src/components/walk-path-panel/index.ts
create mode 100644 src/components/walk-plan-view-panel/index.ts
create mode 100644 src/managers/map-dialog-manager.ts
create mode 100644 src/managers/walk-control-manager.ts
create mode 100644 src/managers/walk-path-dialog-manager.ts
create mode 100644 src/managers/walk-plan-view-dialog-manager.ts
diff --git a/dist/bim-engine-sdk.es.js b/dist/bim-engine-sdk.es.js
index 94f923b..2a46473 100644
--- a/dist/bim-engine-sdk.es.js
+++ b/dist/bim-engine-sdk.es.js
@@ -1,4 +1,4 @@
-(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;color:#bf1d1d;box-sizing:border-box;overflow:hidden}.bim-engine-opt-btn-container{position:absolute;bottom:20px;left:50%;transform:translate(-50%);z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}:root{--bim-dialog-bg: rgba(17, 17, 17, .95);--bim-dialog-header-bg: #2a2a2a;--bim-dialog-title-color: #fff;--bim-dialog-text-color: #ccc;--bim-dialog-border-color: #444}.bim-dialog{position:absolute;background-color:var(--bim-dialog-bg);border:1px solid var(--bim-dialog-border-color);border-radius:6px;box-shadow:0 4px 12px #0000004d;display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-title-color);overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{height:32px;background-color:var(--bim-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:0 10px;cursor:default;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--bim-dialog-border-color);flex-shrink:0}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color)}.bim-dialog-close{cursor:pointer;font-size:18px;color:#999;line-height:1;margin-left:8px}.bim-dialog-close:hover{color:#fff}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color)}.bim-dialog-resize-handle{position:absolute;width:10px;height:10px;bottom:0;right:0;cursor:se-resize;z-index:10}.bim-dialog-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:6px;height:6px;border-right:2px solid #666;border-bottom:2px solid #666}.bim-dialog-resize-handle:hover:after{border-color:#fff}.bim-info-dialog-content{padding:16px;font-family:sans-serif;color:#333}.bim-info-dialog-content h3{margin-top:0;margin-bottom:12px;border-bottom:1px solid #eee;padding-bottom:8px;color:#0078d4}.bim-info-dialog-content ul{list-style:none;padding:0;margin:0}.bim-info-dialog-content li{margin-bottom:8px;font-size:14px;display:flex}.bim-info-dialog-content li strong{width:80px;color:#555}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-ui_bg_color, #2b2d30);border-radius:4px;padding:4px 0;margin:0;list-style:none;min-width:160px;box-shadow:0 4px 12px #0003;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-ui_text_primary, #ffffff)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-ui_border_color, #3e4145);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;transition:background-color .2s;font-size:13px;position:relative;color:var(--bim-ui_text_primary, #ffffff)}.bim-menu-item:hover{background-color:var(--bim-ui_bg_hover, #3e4145)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-ui_text_primary, #333);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-ui_text_secondary, #999);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-ui_border_color, #d9d9d9);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-ui_bg_color, #fff);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary_color, #1890ff);box-shadow:0 0 0 2px #1890ff33}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-ui_bg_color, #fff);border:1px solid var(--bim-ui_border_color, #eee);box-shadow:0 4px 12px #00000026;border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-ui_bg_hover, #f5f5f5)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-ui_text_secondary, #999);margin-top:2px;display:block}.bim-tree-content{flex:1;overflow-y:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px}.bim-tree-node-content:hover{background-color:var(--bim-ui_bg_hover, rgba(0, 0, 0, .05))}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-ui_text_secondary, #999);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-ui_border_color, #d9d9d9);border-radius:2px;margin-right:8px;background-color:var(--bim-ui_bg_color, #fff);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary_color, #1890ff);border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-ui_bg_color, #fff);border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary_color, #1890ff)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:#d9d9d9}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-ui_text_disabled, #ccc);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-ui_bg_selected, rgba(24, 144, 255, .2));color:var(--bim-primary_color, #1890ff)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:fit-content;min-width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:fit-content;min-width:100%;box-sizing:border-box}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-tab-text, #e6e6e6)}.bim-tab__nav{display:flex;align-items:center;justify-content:center;background:transparent}.bim-tab__item{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:4px 0;border:none;border-radius:0;background:transparent;color:var(--bim-tab-text, #e6e6e6);cursor:pointer;transition:all .2s ease;font-size:14px;border-bottom:4px solid transparent}.bim-tab__item:hover{color:var(--bim-tab-text, #e6e6e6);background-color:var(--bim-tab-hover-bg, rgba(255, 255, 255, .05));border-bottom-color:var(--bim-tab-hover-bg, rgba(255, 255, 255, .15))}.bim-tab__item.is-active{color:var(--bim-tab-text-active, #4da3ff);border-bottom-color:var(--bim-tab-text-active, #4da3ff)}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}.bim-collapse{background-color:var(--bim-bg-color, #ffffff);border:1px solid var(--bim-border-color, #d9d9d9);border-radius:4px;font-size:14px;color:var(--bim-text-color, rgba(0, 0, 0, .88))}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:transparent;padding-left:0;padding-right:0}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-color, #d9d9d9)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-disabled-color, rgba(0, 0, 0, .25));cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-header-bg-color, rgba(0, 0, 0, .02));cursor:pointer;transition:all .3s;position:relative}.bim-collapse-header:hover{background-color:var(--bim-header-hover-bg-color, rgba(0, 0, 0, .05))}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-content-bg-color, #ffffff);border-top:1px solid var(--bim-border-color, #d9d9d9);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-description{display:flex;flex-direction:column;width:100%;font-size:var(--bim-desc-font-size, 14px);color:var(--bim-text-color, #333);padding:0}.bim-description-item{display:flex;align-items:stretch;padding:0;line-height:1.5}.bim-description.is-bordered{border-bottom:none}.bim-description.is-bordered .bim-description-item{border-bottom:1px solid var(--bim-border-color, #eee)}.bim-description-label{color:var(--bim-desc-label-color, var(--bim-label-color, #666));flex-shrink:0;padding:var(--bim-desc-label-padding, 4px 4px);display:flex;align-items:center}.bim-description.is-bordered .bim-description-label{border-right:1px solid var(--bim-border-color, #eee)}.bim-description-value{color:var(--bim-desc-value-color, var(--bim-value-color, #333));flex:1;word-break:break-all;padding:var(--bim-desc-value-padding, 4px 4px);display:flex;align-items:center}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:4px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:#0000001f;color:var(--bim-dialog-text-color, #ccc);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-measure-primary, #0078d4);color:#fff}.bim-measure-settings-cancel{border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:transparent;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-measure-primary-hover, #0063b1)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:var(--bim-measure-btn-bg, rgba(255, 255, 255, .06));cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .15s ease,border-color .15s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-measure-btn-hover-bg, rgba(255, 255, 255, .1))}.bim-measure-tool-btn.is-active{border-color:var(--bim-measure-active-border, rgba(255, 255, 255, .3));background:var(--bim-measure-btn-active-bg, rgba(255, 255, 255, .14))}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-measure-icon-color, #ddd)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:var(--bim-measure-btn-bg, rgba(255, 255, 255, .06));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background-color .15s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-measure-btn-hover-bg, rgba(255, 255, 255, .1))}.bim-measure-toggle-text{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7))}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-measure-icon-color, #ddd);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-measure-divider, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));min-width:84px}.bim-measure-row .value{color:var(--bim-measure-value-color, rgba(255, 255, 255, .9));flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-measure-value-color, rgba(255, 255, 255, .9))}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-measure-divider, rgba(255, 255, 255, .1));display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-measure-danger, white);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-measure-icon-color, #ddd)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px solid transparent;background:var(--bim-section-btn-bg, rgba(255, 255, 255, .06));border-radius:4px;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease;min-width:60px;outline:none;color:var(--bim-text-color, rgba(255, 255, 255, .9))}.section-plane-btn:hover{background:var(--bim-section-btn-hover, rgba(255, 255, 255, .1))}.section-plane-btn:active{background:var(--bim-section-btn-active, rgba(255, 255, 255, .14));border-color:var(--bim-text-active-color, #fff);color:var(--bim-text-active-color, #fff)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.1)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-section-axis-btn-bg, rgba(255, 255, 255, .06));border:1px solid transparent;border-radius:4px;cursor:pointer;transition:all .2s;outline:none;color:var(--bim-text-color, rgba(255, 255, 255, .9));min-height:48px}.section-axis-btn:hover{background:var(--bim-section-axis-btn-hover, rgba(255, 255, 255, .1))}.section-axis-btn.active{background:var(--bim-section-axis-btn-active, rgba(255, 255, 255, .14));border-color:var(--bim-text-active-color, #fff);color:var(--bim-text-active-color, #fff)}.section-axis-btn-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.1)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-section-box-btn-bg);border:1px solid transparent;border-radius:4px;cursor:pointer;color:var(--bim-text-color);min-height:44px;transition:all .2s}.section-box-btn:hover{background:var(--bim-section-box-btn-hover)}.section-box-btn.active{background:var(--bim-section-box-btn-active);border-color:var(--bim-text-active-color);color:var(--bim-text-active-color)}.section-box-btn-icon{width:18px;height:18px;color:var(--bim-icon-color)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-color);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:#ffffff1a;border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary-color);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:#fff;border:2px solid var(--bim-primary-color);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px #1890ff33}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary-color)}.section-box-slider-handle:after{content:attr(data-value);position:absolute;top:-22px;left:50%;transform:translate(-50%);background:#000c;color:#fff;padding:2px 5px;border-radius:3px;font-size:10px;opacity:0;pointer-events:none;transition:opacity .2s}.section-box-slider-handle:hover:after,.section-box-slider-handle.dragging:after{opacity:1}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
+(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;color:#bf1d1d;box-sizing:border-box;overflow:hidden}.bim-engine-opt-btn-container{position:absolute;bottom:20px;left:50%;transform:translate(-50%);z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}:root{--bim-dialog-bg: rgba(17, 17, 17, .95);--bim-dialog-header-bg: #2a2a2a;--bim-dialog-title-color: #fff;--bim-dialog-text-color: #ccc;--bim-dialog-border-color: #444}.bim-dialog{position:absolute;background-color:var(--bim-dialog-bg);border:1px solid var(--bim-dialog-border-color);border-radius:6px;box-shadow:0 4px 12px #0000004d;display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-title-color);overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{height:32px;background-color:var(--bim-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:0 10px;cursor:default;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--bim-dialog-border-color);flex-shrink:0}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color)}.bim-dialog-close{cursor:pointer;font-size:18px;color:#999;line-height:1;margin-left:8px}.bim-dialog-close:hover{color:#fff}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color)}.bim-dialog-resize-handle{position:absolute;width:10px;height:10px;bottom:0;right:0;cursor:se-resize;z-index:10}.bim-dialog-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:6px;height:6px;border-right:2px solid #666;border-bottom:2px solid #666}.bim-dialog-resize-handle:hover:after{border-color:#fff}.bim-info-dialog-content{padding:16px;font-family:sans-serif;color:#333}.bim-info-dialog-content h3{margin-top:0;margin-bottom:12px;border-bottom:1px solid #eee;padding-bottom:8px;color:#0078d4}.bim-info-dialog-content ul{list-style:none;padding:0;margin:0}.bim-info-dialog-content li{margin-bottom:8px;font-size:14px;display:flex}.bim-info-dialog-content li strong{width:80px;color:#555}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-ui_bg_color, #2b2d30);border-radius:4px;padding:4px 0;margin:0;list-style:none;min-width:160px;box-shadow:0 4px 12px #0003;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-ui_text_primary, #ffffff)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-ui_border_color, #3e4145);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;transition:background-color .2s;font-size:13px;position:relative;color:var(--bim-ui_text_primary, #ffffff)}.bim-menu-item:hover{background-color:var(--bim-ui_bg_hover, #3e4145)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-ui_text_primary, #333);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-ui_text_secondary, #999);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-ui_border_color, #d9d9d9);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-ui_bg_color, #fff);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary_color, #1890ff);box-shadow:0 0 0 2px #1890ff33}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-ui_bg_color, #fff);border:1px solid var(--bim-ui_border_color, #eee);box-shadow:0 4px 12px #00000026;border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-ui_bg_hover, #f5f5f5)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-ui_text_secondary, #999);margin-top:2px;display:block}.bim-tree-content{flex:1;overflow-y:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px}.bim-tree-node-content:hover{background-color:var(--bim-ui_bg_hover, rgba(0, 0, 0, .05))}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-ui_text_secondary, #999);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-ui_border_color, #d9d9d9);border-radius:2px;margin-right:8px;background-color:var(--bim-ui_bg_color, #fff);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary_color, #1890ff);border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid #fff;border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-ui_bg_color, #fff);border-color:var(--bim-primary_color, #1890ff)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary_color, #1890ff)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:#d9d9d9}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-ui_text_disabled, #ccc);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-ui_bg_selected, rgba(24, 144, 255, .2));color:var(--bim-primary_color, #1890ff)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:fit-content;min-width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:fit-content;min-width:100%;box-sizing:border-box}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-tab-text, #e6e6e6)}.bim-tab__nav{display:flex;align-items:center;justify-content:center;background:transparent}.bim-tab__item{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:4px 0;border:none;border-radius:0;background:transparent;color:var(--bim-tab-text, #e6e6e6);cursor:pointer;transition:all .2s ease;font-size:14px;border-bottom:4px solid transparent}.bim-tab__item:hover{color:var(--bim-tab-text, #e6e6e6);background-color:var(--bim-tab-hover-bg, rgba(255, 255, 255, .05));border-bottom-color:var(--bim-tab-hover-bg, rgba(255, 255, 255, .15))}.bim-tab__item.is-active{color:var(--bim-tab-text-active, #4da3ff);border-bottom-color:var(--bim-tab-text-active, #4da3ff)}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}.bim-collapse{background-color:var(--bim-bg-color, #ffffff);border:1px solid var(--bim-border-color, #d9d9d9);border-radius:4px;font-size:14px;color:var(--bim-text-color, rgba(0, 0, 0, .88))}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:transparent;padding-left:0;padding-right:0}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-color, #d9d9d9)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-disabled-color, rgba(0, 0, 0, .25));cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-header-bg-color, rgba(0, 0, 0, .02));cursor:pointer;transition:all .3s;position:relative}.bim-collapse-header:hover{background-color:var(--bim-header-hover-bg-color, rgba(0, 0, 0, .05))}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-content-bg-color, #ffffff);border-top:1px solid var(--bim-border-color, #d9d9d9);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-description{display:flex;flex-direction:column;width:100%;font-size:var(--bim-desc-font-size, 14px);color:var(--bim-text-color, #333);padding:0}.bim-description-item{display:flex;align-items:stretch;padding:0;line-height:1.5}.bim-description.is-bordered{border-bottom:none}.bim-description.is-bordered .bim-description-item{border-bottom:1px solid var(--bim-border-color, #eee)}.bim-description-label{color:var(--bim-desc-label-color, var(--bim-label-color, #666));flex-shrink:0;padding:var(--bim-desc-label-padding, 4px 4px);display:flex;align-items:center}.bim-description.is-bordered .bim-description-label{border-right:1px solid var(--bim-border-color, #eee)}.bim-description-value{color:var(--bim-desc-value-color, var(--bim-value-color, #333));flex:1;word-break:break-all;padding:var(--bim-desc-value-padding, 4px 4px);display:flex;align-items:center}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:4px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:#0000001f;color:var(--bim-dialog-text-color, #ccc);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-measure-primary, #0078d4);color:#fff}.bim-measure-settings-cancel{border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:transparent;color:var(--bim-dialog-text-color, #ccc)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-measure-primary-hover, #0063b1)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:var(--bim-measure-btn-bg, rgba(255, 255, 255, .06));cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .15s ease,border-color .15s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-measure-btn-hover-bg, rgba(255, 255, 255, .1))}.bim-measure-tool-btn.is-active{border-color:var(--bim-measure-active-border, rgba(255, 255, 255, .3));background:var(--bim-measure-btn-active-bg, rgba(255, 255, 255, .14))}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-measure-icon-color, #ddd)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-measure-border, rgba(255, 255, 255, .12));background:var(--bim-measure-btn-bg, rgba(255, 255, 255, .06));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background-color .15s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-measure-btn-hover-bg, rgba(255, 255, 255, .1))}.bim-measure-toggle-text{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7))}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-measure-icon-color, #ddd);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-measure-divider, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-measure-label-color, rgba(255, 255, 255, .7));min-width:84px}.bim-measure-row .value{color:var(--bim-measure-value-color, rgba(255, 255, 255, .9));flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-measure-value-color, rgba(255, 255, 255, .9))}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-measure-divider, rgba(255, 255, 255, .1));display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-measure-danger, white);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-measure-icon-color, #ddd)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px solid transparent;background:var(--bim-section-btn-bg, rgba(255, 255, 255, .06));border-radius:4px;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease;min-width:60px;outline:none;color:var(--bim-text-color, rgba(255, 255, 255, .9))}.section-plane-btn:hover{background:var(--bim-section-btn-hover, rgba(255, 255, 255, .1))}.section-plane-btn:active{background:var(--bim-section-btn-active, rgba(255, 255, 255, .14));border-color:var(--bim-text-active-color, #fff);color:var(--bim-text-active-color, #fff)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.1)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-section-axis-btn-bg, rgba(255, 255, 255, .06));border:1px solid transparent;border-radius:4px;cursor:pointer;transition:all .2s;outline:none;color:var(--bim-text-color, rgba(255, 255, 255, .9));min-height:48px}.section-axis-btn:hover{background:var(--bim-section-axis-btn-hover, rgba(255, 255, 255, .1))}.section-axis-btn.active{background:var(--bim-section-axis-btn-active, rgba(255, 255, 255, .14));border-color:var(--bim-text-active-color, #fff);color:var(--bim-text-active-color, #fff)}.section-axis-btn-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.1)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-section-box-btn-bg);border:1px solid transparent;border-radius:4px;cursor:pointer;color:var(--bim-text-color);min-height:44px;transition:all .2s}.section-box-btn:hover{background:var(--bim-section-box-btn-hover)}.section-box-btn.active{background:var(--bim-section-box-btn-active);border-color:var(--bim-text-active-color);color:var(--bim-text-active-color)}.section-box-btn-icon{width:18px;height:18px;color:var(--bim-icon-color)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-color);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:#ffffff1a;border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary-color);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:#fff;border:2px solid var(--bim-primary-color);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px #1890ff33}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary-color)}.walk-control-panel{display:flex;align-items:center;gap:20px;padding:8px 16px;background:var(--bim-walk-control-bg, rgba(0, 0, 0, .8));border-radius:8px;-webkit-user-select:none;user-select:none}.walk-divider{width:1px;height:40px;background:var(--bim-divider-color, rgba(255, 255, 255, .2));flex-shrink:0}.walk-control-left{display:flex;gap:8px}.walk-icon-btn{width:48px;height:48px;display:flex;align-items:center;justify-content:center;background:transparent;border:2px solid transparent;border-radius:6px;cursor:pointer;transition:all .2s;color:var(--bim-icon-color, #ccc)}.walk-icon-btn:hover{background:var(--bim-walk-btn-hover, rgba(255, 255, 255, .15))}.walk-icon-btn.active{background:var(--bim-walk-btn-active, rgba(255, 255, 255, .3))}.walk-icon-btn svg{width:24px;height:24px}.walk-control-settings{display:flex;align-items:center;gap:16px;flex:1}.walk-speed-control{display:flex;align-items:center;gap:12px}.walk-speed-label{color:var(--bim-text-color, #fff);font-size:14px;white-space:nowrap}.walk-speed-group{display:flex;align-items:center;gap:8px;background:var(--bim-speed-group-bg, rgba(255, 255, 255, .1));border-radius:4px;padding:4px}.walk-speed-btn{width:32px;height:32px;background:var(--bim-speed-btn-bg, rgba(255, 255, 255, .1));border:none;border-radius:4px;color:var(--bim-text-color, #fff);font-size:18px;cursor:pointer;transition:background .2s}.walk-speed-btn:hover{background:var(--bim-speed-btn-hover, rgba(255, 255, 255, .2))}.walk-speed-btn:disabled{opacity:.5;cursor:not-allowed}.walk-speed-display{min-width:40px;text-align:center;color:var(--bim-text-color, #fff);font-size:14px;font-weight:700}.walk-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer}.walk-checkbox{width:18px;height:18px;cursor:pointer}.walk-checkbox:disabled{opacity:.5;cursor:not-allowed}.walk-checkbox-label{color:var(--bim-text-color, #fff);font-size:14px;white-space:nowrap}.walk-checkbox-wrapper input:disabled+.walk-checkbox-label{opacity:.5}.walk-select-wrapper{display:flex;align-items:center;gap:8px}.walk-select-label{color:var(--bim-text-color, #fff);font-size:14px;white-space:nowrap}.walk-select{padding:6px 12px;background:var(--bim-select-bg, rgba(255, 255, 255, .1));border:1px solid var(--bim-select-border, rgba(255, 255, 255, .2));border-radius:4px;color:var(--bim-text-color, #fff);font-size:14px;cursor:pointer;min-width:120px}.walk-select option{background:var(--bim-select-option-bg, #333);color:var(--bim-text-color, #fff)}.walk-exit-btn{padding:10px 24px;background:var(--bim-primary-color, #1890ff);border:none;border-radius:6px;color:#fff;font-size:14px;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap}.walk-exit-btn:hover{background:var(--bim-primary-hover, #40a9ff)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
const Zh = {
common: {
title: "BimEngine",
@@ -14,6 +14,9 @@ const Zh = {
location: "定位",
setting: "设置",
walk: "漫游",
+ map: "地图",
+ property: "构件详情",
+ fullscreen: "全屏",
walkMenu: "漫游菜单",
walkPerson: "第一人称",
walkBird: "第三人称",
@@ -138,6 +141,28 @@ const Zh = {
y: "Y",
z: "Z"
}
+ },
+ walkControl: {
+ speed: "移动速度:",
+ gravity: "重力",
+ collision: "碰撞",
+ characterModel: {
+ label: "建筑工人",
+ constructionWorker: "建筑工人",
+ officeMale: "办公室男性"
+ },
+ walkMode: {
+ label: "行走模式",
+ walk: "行走模式",
+ run: "奔跑模式"
+ },
+ exit: "退出",
+ path: {
+ dialogTitle: "路径漫游"
+ }
+ },
+ map: {
+ dialogTitle: "地图"
}
}, $h = {
common: {
@@ -154,6 +179,9 @@ const Zh = {
location: "Location",
setting: "Settings",
walk: "Walk",
+ map: "Map",
+ property: "Property",
+ fullscreen: "Fullscreen",
walkPerson: "Person",
walkBird: "Bird Eye",
walkMenu: "Menu",
@@ -278,6 +306,28 @@ const Zh = {
y: "Y",
z: "Z"
}
+ },
+ walkControl: {
+ speed: "Speed:",
+ gravity: "Gravity",
+ collision: "Collision",
+ characterModel: {
+ label: "Construction Worker",
+ constructionWorker: "Construction Worker",
+ officeMale: "Office Male"
+ },
+ walkMode: {
+ label: "Walk Mode",
+ walk: "Walk",
+ run: "Run"
+ },
+ exit: "Exit",
+ path: {
+ dialogTitle: "Path Walk"
+ }
+ },
+ map: {
+ dialogTitle: "Map"
}
};
class Jh {
@@ -327,7 +377,7 @@ class Jh {
this.listeners.forEach((e) => e(this.currentLocale));
}
}
-const qt = new Jh(), me = (r) => qt.t(r), hl = {
+const Ut = new Jh(), le = (n) => Ut.t(n), hl = {
name: "dark",
primary: "#0078d4",
primaryHover: "#0063b1",
@@ -401,7 +451,7 @@ class eu {
this.listeners.forEach((e) => e(this.currentTheme));
}
}
-const lt = new eu();
+const Ze = new eu();
class Ao {
container;
options;
@@ -557,8 +607,8 @@ class Ao {
textActiveColor: e.textPrimary
};
Object.entries(t).forEach(([i, s]) => {
- const n = i;
- this.customColors.has(n) || (this.options[n] = s);
+ const r = i;
+ this.customColors.has(r) || (this.options[r] = s);
}), this.applyStyles(), this.setPrimaryColor(e.primary);
}
/**
@@ -571,9 +621,9 @@ class Ao {
}), this.applyStyles();
}
async init() {
- this.render(), this.unsubscribeLocale = qt.subscribe(() => {
+ this.render(), this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
});
}
@@ -584,7 +634,7 @@ class Ao {
if (this.groups.some((s) => s.id === e)) return;
const i = { id: e, buttons: [] };
if (t) {
- const s = this.groups.findIndex((n) => n.id === t);
+ const s = this.groups.findIndex((r) => r.id === t);
s !== -1 ? this.groups.splice(s, 0, i) : this.groups.push(i);
} else
this.groups.push(i);
@@ -592,12 +642,12 @@ class Ao {
addButton(e) {
const { groupId: t, parentId: i } = e, s = this.groups.find((a) => a.id === t);
if (!s) return;
- const n = { ...e, children: e.children || [] };
+ const r = { ...e, children: e.children || [] };
if (i) {
const a = this.findButton(s.buttons, i);
- a && (a.children || (a.children = []), a.children.push(n));
+ a && (a.children || (a.children = []), a.children.push(r));
} else
- s.buttons.push(n);
+ s.buttons.push(r);
}
findButton(e, t) {
for (const i of e) {
@@ -616,9 +666,9 @@ class Ao {
}
renderGroup(e, t, i) {
const s = document.createElement("div");
- return s.className = "bim-btn-group-section", t < i - 1 && s.classList.add("has-divider"), e.buttons.forEach((n) => {
- if (this.isVisible(n.id)) {
- const a = this.renderButton(n);
+ return s.className = "bim-btn-group-section", t < i - 1 && s.classList.add("has-divider"), e.buttons.forEach((r) => {
+ if (this.isVisible(r.id)) {
+ const a = this.renderButton(r);
s.appendChild(a);
}
}), s;
@@ -627,7 +677,7 @@ class Ao {
const t = document.createElement("div");
t.className = "opt-btn-wrapper";
const i = document.createElement("div");
- i.className = "opt-btn", e.isActive && this.activeBtnIds.add(e.id), (e.align || this.options.align || "vertical") === "horizontal" ? i.classList.add("align-horizontal") : i.classList.add("align-vertical"), this.activeBtnIds.has(e.id) && i.classList.add("active"), e.disabled && i.classList.add("disabled"), this.options.showLabel && e.label || (i.classList.add("no-label"), e.label && (i.title = me(e.label)));
+ i.className = "opt-btn", e.isActive && this.activeBtnIds.add(e.id), (e.align || this.options.align || "vertical") === "horizontal" ? i.classList.add("align-horizontal") : i.classList.add("align-vertical"), this.activeBtnIds.has(e.id) && i.classList.add("active"), e.disabled && i.classList.add("disabled"), this.options.showLabel && e.label || (i.classList.add("no-label"), e.label && (i.title = le(e.label)));
const a = e.iconSize || 32, o = e.minWidth || 50;
i.style.minWidth = `${o}px`;
const l = document.createElement("div");
@@ -635,7 +685,7 @@ class Ao {
const c = document.createElement("div");
if (c.className = "opt-btn-text-wrapper", this.options.showLabel && e.label) {
const h = document.createElement("span");
- h.className = "opt-btn-label", h.textContent = me(e.label), c.appendChild(h);
+ h.className = "opt-btn-label", h.textContent = le(e.label), c.appendChild(h);
}
if (e.children && e.children.length > 0) {
const h = document.createElement("span");
@@ -672,8 +722,8 @@ class Ao {
if (t) {
if (e.parentId) {
const s = this.findButton(t.buttons, e.parentId)?.children || [];
- for (const n of s)
- n && n.id !== e.id && n.parentId === e.parentId && n.groupId === e.groupId && this.activeBtnIds.has(n.id) && (this.setBtnActive(n.id, !1), n.onClick && n.onClick(n));
+ for (const r of s)
+ r && r.id !== e.id && r.parentId === e.parentId && r.groupId === e.groupId && this.activeBtnIds.has(r.id) && (this.setBtnActive(r.id, !1), r.onClick && r.onClick(r));
return;
}
for (const i of t.buttons)
@@ -692,7 +742,7 @@ class Ao {
i.className = "opt-btn-dropdown", this.options.backgroundColor && i.style.setProperty("--bim-toolbar-bg", this.options.backgroundColor);
const s = i.style;
this.options.iconColor && s.setProperty("--bim-icon-color", this.options.iconColor), this.options.iconActiveColor && s.setProperty("--bim-icon-active-color", this.options.iconActiveColor), this.options.textColor && s.setProperty("--bim-btn-text-color", this.options.textColor), this.options.textActiveColor && s.setProperty("--bim-btn-text-active-color", this.options.textActiveColor), this.options.btnBackgroundColor && s.setProperty("--bim-btn-bg", this.options.btnBackgroundColor), this.options.btnHoverColor && s.setProperty("--bim-btn-hover-bg", this.options.btnHoverColor), this.options.btnActiveColor && s.setProperty("--bim-btn-active-bg", this.options.btnActiveColor);
- const n = t.getBoundingClientRect(), a = this.options.expand || "down";
+ const r = t.getBoundingClientRect(), a = this.options.expand || "down";
this.options.direction === "row" ? i.style.flexDirection = "column" : i.style.flexDirection = "row", document.body.appendChild(i), this.setupEventInterception(i), e.children.forEach((l) => {
if (this.isVisible(l.id)) {
const c = this.renderDropdownItem(l);
@@ -700,20 +750,20 @@ class Ao {
}
});
const o = i.getBoundingClientRect();
- a === "up" ? (i.style.bottom = window.innerHeight - n.top + 8 + "px", i.style.left = n.left + (n.width - o.width) / 2 + "px") : a === "down" ? (i.style.top = n.bottom + 8 + "px", i.style.left = n.left + (n.width - o.width) / 2 + "px") : a === "right" ? (i.style.top = n.top + (n.height - o.height) / 2 + "px", i.style.left = n.right + 8 + "px") : a === "left" && (i.style.top = n.top + (n.height - o.height) / 2 + "px", i.style.right = window.innerWidth - n.left + 8 + "px"), i.addEventListener("mouseenter", () => {
+ a === "up" ? (i.style.bottom = window.innerHeight - r.top + 8 + "px", i.style.left = r.left + (r.width - o.width) / 2 + "px") : a === "down" ? (i.style.top = r.bottom + 8 + "px", i.style.left = r.left + (r.width - o.width) / 2 + "px") : a === "right" ? (i.style.top = r.top + (r.height - o.height) / 2 + "px", i.style.left = r.right + 8 + "px") : a === "left" && (i.style.top = r.top + (r.height - o.height) / 2 + "px", i.style.right = window.innerWidth - r.left + 8 + "px"), i.addEventListener("mouseenter", () => {
this.hoverTimeout && clearTimeout(this.hoverTimeout);
}), i.addEventListener("mouseleave", () => this.handleMouseLeave()), this.dropdownElement = i;
}
renderDropdownItem(e) {
const t = document.createElement("div");
t.className = "opt-btn-dropdown-item", (e.align || "horizontal") === "horizontal" ? t.classList.add("align-horizontal") : t.classList.add("align-vertical"), (this.activeBtnIds.has(e.id) || e.isActive) && t.classList.add("active");
- const s = e.iconSize || 32, n = e.minWidth;
- n && (t.style.minWidth = `${n}px`);
+ const s = e.iconSize || 32, r = e.minWidth;
+ r && (t.style.minWidth = `${r}px`);
const a = document.createElement("div");
if (a.className = "opt-btn-icon", a.style.width = `${s}px`, a.style.height = `${s}px`, a.innerHTML = this.getIcon(e.icon), t.appendChild(a), this.options.showLabel && e.label) {
const o = document.createElement("span");
- o.className = "opt-btn-dropdown-label", o.textContent = me(e.label), t.appendChild(o);
- } else e.label && (t.title = me(e.label));
+ o.className = "opt-btn-dropdown-label", o.textContent = le(e.label), t.appendChild(o);
+ } else e.label && (t.title = le(e.label));
return t.addEventListener("click", (o) => {
o.stopPropagation(), this.handleClick(e);
}), t;
@@ -741,7 +791,7 @@ class Ao {
this.btnRefs.forEach((e, t) => {
const i = this.findButtonById(t);
if (!i) return;
- this.options.showLabel && i.label ? (e.classList.remove("no-label"), e.removeAttribute("title")) : (e.classList.add("no-label"), i.label && (e.title = me(i.label)));
+ this.options.showLabel && i.label ? (e.classList.remove("no-label"), e.removeAttribute("title")) : (e.classList.add("no-label"), i.label && (e.title = le(i.label)));
});
}
findButtonById(e) {
@@ -766,11 +816,11 @@ class tu extends Ao {
*/
async init() {
await super.init();
- const { createHomeButton: e } = await import("./index-omAK6EVd.mjs"), { createZoomBoxButton: t } = await import("./index-BkFKV5gt.mjs"), { createLocationButton: i } = await import("./index-A0EEw0_P.mjs"), { createWalkMenuButton: s } = await import("./index-DFxh1iCd.mjs"), { createWalkPersonButton: n } = await import("./index-8BBVAOW0.mjs"), { createWalkBirdButton: a } = await import("./index-CTxkkzRP.mjs"), { createSettingButton: o } = await import("./index-CdVC4L9S.mjs"), { createInfoButton: l } = await import("./index-BhXYJ1oE.mjs"), { createMeasureButton: c } = await import("./index-DBSg-HUv.mjs"), { createSectionMenuButton: h } = await import("./index-DCQDpXU8.mjs"), { createSectionPlaneButton: u } = await import("./index-B5fO4-Lf.mjs"), { createSectionAxisButton: d } = await import("./index-BOsmLobC.mjs"), { createSectionBoxButton: m } = await import("./index-o9OamV47.mjs");
- this.addGroup("group-1"), this.engine ? (this.addButton(e(this.engine)), this.addButton(t(this.engine)), this.addButton(c(this.engine)), this.addButton(h(this.engine)), this.addButton(u(this.engine)), this.addButton(d(this.engine)), this.addButton(m(this.engine)), this.addButton(s(this.engine)), this.addButton(n(this.engine)), this.addButton(a(this.engine)), this.addButton(i(this.engine)), this.addGroup("group-2"), this.addButton(o(this.engine)), this.addButton(l(this.engine))) : console.warn("[Toolbar] Engine not available when creating buttons."), this.render();
+ const { createHomeButton: e } = await import("./index-omAK6EVd.mjs"), { createZoomBoxButton: t } = await import("./index-BkFKV5gt.mjs"), { createWalkMenuButton: i } = await import("./index-DiRRNmBO.mjs"), { createMapButton: s } = await import("./index-CNFQZkJ6.mjs"), { createPropertyButton: r } = await import("./index-CdXfznb7.mjs"), { createSettingButton: a } = await import("./index-CdVC4L9S.mjs"), { createInfoButton: o } = await import("./index-BhXYJ1oE.mjs"), { createFullscreenButton: l } = await import("./index-ZiCIuHGz.mjs"), { createMeasureButton: c } = await import("./index-DBSg-HUv.mjs"), { createSectionMenuButton: h } = await import("./index-DCQDpXU8.mjs"), { createSectionPlaneButton: u } = await import("./index-B5fO4-Lf.mjs"), { createSectionAxisButton: d } = await import("./index-BOsmLobC.mjs"), { createSectionBoxButton: m } = await import("./index-o9OamV47.mjs");
+ this.addGroup("group-1"), this.engine ? (this.addButton(e(this.engine)), this.addButton(t(this.engine)), this.addButton(c(this.engine)), this.addButton(h(this.engine)), this.addButton(u(this.engine)), this.addButton(d(this.engine)), this.addButton(m(this.engine)), this.addButton(i(this.engine)), this.addButton(s(this.engine)), this.addButton(r(this.engine)), this.addGroup("group-2"), this.addButton(a(this.engine)), this.addButton(o(this.engine)), this.addButton(l(this.engine))) : console.warn("[Toolbar] Engine not available when creating buttons."), this.render();
}
}
-class yi {
+class Yt {
engine;
constructor(e) {
this.engine = e;
@@ -789,7 +839,7 @@ class yi {
return this.engine.on(e, t);
}
}
-class iu extends yi {
+class iu extends Yt {
toolbar = null;
toolbarContainer = null;
container;
@@ -843,8 +893,26 @@ class iu extends yi {
setColors(e) {
this.toolbar?.setColors(e);
}
+ /**
+ * 隐藏工具栏
+ */
+ hide() {
+ this.toolbarContainer && (this.toolbarContainer.style.display = "none");
+ }
+ /**
+ * 显示工具栏
+ */
+ show() {
+ this.toolbarContainer && (this.toolbarContainer.style.display = "");
+ }
+ /**
+ * 获取工具栏容器
+ */
+ getContainer() {
+ return this.toolbarContainer;
+ }
}
-class su extends yi {
+class su extends Yt {
groups = /* @__PURE__ */ new Map();
container;
constructor(e, t) {
@@ -908,16 +976,16 @@ class Gc {
* 初始化组件功能 (接口实现)
*/
init() {
- this._isInitialized || (this.container.appendChild(this.element), this.initPosition(), this.options.draggable && this.initDrag(), this.options.resizable && this.initResize(), this._isInitialized = !0, this.options.onOpen && this.options.onOpen(), this.unsubscribeTheme = lt.subscribe((e) => {
+ this._isInitialized || (this.container.appendChild(this.element), this.initPosition(), this.options.draggable && this.initDrag(), this.options.resizable && this.initResize(), this._isInitialized = !0, this.options.onOpen && this.options.onOpen(), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.unsubscribeLocale = qt.subscribe(() => {
+ }), this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
}));
}
setLocales() {
if (this.options.title) {
const e = this.header.querySelector(".bim-dialog-title");
- e && (e.textContent = me(this.options.title));
+ e && (e.textContent = le(this.options.title));
}
}
/**
@@ -931,11 +999,11 @@ class Gc {
const i = document.createElement("div");
i.className = "bim-dialog-header", this.options.draggable && i.classList.add("draggable");
const s = document.createElement("span");
- s.className = "bim-dialog-title", s.textContent = this.options.title ? me(this.options.title) : "";
- const n = document.createElement("span");
- n.className = "bim-dialog-close", n.innerHTML = "×", n.onclick = () => {
+ s.className = "bim-dialog-title", s.textContent = this.options.title ? le(this.options.title) : "";
+ const r = document.createElement("span");
+ r.className = "bim-dialog-close", r.innerHTML = "×", r.onclick = () => {
this.close();
- }, i.appendChild(s), i.appendChild(n);
+ }, i.appendChild(s), i.appendChild(r);
const a = document.createElement("div");
if (a.className = "bim-dialog-content", typeof this.options.content == "string" ? a.innerHTML = this.options.content : this.options.content instanceof HTMLElement && a.appendChild(this.options.content), e.appendChild(i), e.appendChild(a), this.options.resizable) {
const c = document.createElement("div");
@@ -991,15 +1059,15 @@ class Gc {
fitHeight(e = !1) {
this.element.style.height = "auto";
const t = this.element.getBoundingClientRect().height, i = this.options.minHeight ?? 100, s = this.container.clientHeight || 0;
- let n = Math.max(i, t);
- s > 0 && (n = Math.min(n, s)), this.element.style.height = `${n}px`, e ? this.initPosition() : this.clampToContainer();
+ let r = Math.max(i, t);
+ s > 0 && (r = Math.min(r, s)), this.element.style.height = `${r}px`, e ? this.initPosition() : this.clampToContainer();
}
/**
* 边界夹紧:保持当前 left/top 不变的前提下,确保弹窗不超出容器
* 说明:用于 fitHeight / fitWidth 后的“尺寸变化”场景,避免弹窗被裁切。
*/
clampToContainer() {
- const e = this.container.clientWidth, t = this.container.clientHeight, i = this.element.offsetWidth, s = this.element.offsetHeight, n = this.element.offsetLeft, a = this.element.offsetTop, o = Math.max(0, e - i), l = Math.max(0, t - s), c = Math.max(0, Math.min(n, o)), h = Math.max(0, Math.min(a, l));
+ const e = this.container.clientWidth, t = this.container.clientHeight, i = this.element.offsetWidth, s = this.element.offsetHeight, r = this.element.offsetLeft, a = this.element.offsetTop, o = Math.max(0, e - i), l = Math.max(0, t - s), c = Math.max(0, Math.min(r, o)), h = Math.max(0, Math.min(a, l));
this.element.style.left = `${c}px`, this.element.style.top = `${h}px`;
}
/**
@@ -1008,56 +1076,56 @@ class Gc {
initPosition() {
const e = this.options.position, t = this.element.getBoundingClientRect();
let i = 0, s = 0;
- const n = this.container.clientWidth, a = this.container.clientHeight, o = t.width, l = t.height;
+ const r = this.container.clientWidth, a = this.container.clientHeight, o = t.width, l = t.height;
if (typeof e == "object" && "x" in e)
i = e.x, s = e.y;
else
switch (e) {
case "center":
- i = (n - o) / 2, s = (a - l) / 2;
+ i = (r - o) / 2, s = (a - l) / 2;
break;
case "top-left":
i = 0, s = 0;
break;
case "top-center":
- i = (n - o) / 2, s = 0;
+ i = (r - o) / 2, s = 0;
break;
case "top-right":
- i = n - o, s = 0;
+ i = r - o, s = 0;
break;
case "left-center":
i = 0, s = (a - l) / 2;
break;
case "right-center":
- i = n - o, s = (a - l) / 2;
+ i = r - o, s = (a - l) / 2;
break;
case "bottom-left":
i = 0, s = a - l;
break;
case "bottom-center":
- i = (n - o) / 2, s = a - l;
+ i = (r - o) / 2, s = a - l;
break;
case "bottom-right":
- i = n - o, s = a - l;
+ i = r - o, s = a - l;
break;
default:
- i = (n - o) / 2, s = (a - l) / 2;
+ i = (r - o) / 2, s = (a - l) / 2;
}
- i = Math.max(0, Math.min(i, n - o)), s = Math.max(0, Math.min(s, a - l)), this.element.style.left = `${i}px`, this.element.style.top = `${s}px`;
+ i = Math.max(0, Math.min(i, r - o)), s = Math.max(0, Math.min(s, a - l)), this.element.style.left = `${i}px`, this.element.style.top = `${s}px`;
}
/**
* 初始化拖拽功能 (性能优化 + 解决粘手)
*/
initDrag() {
- let e = 0, t = 0, i = 0, s = 0, n = 0, a = 0, o = 0, l = 0;
+ let e = 0, t = 0, i = 0, s = 0, r = 0, a = 0, o = 0, l = 0;
const c = (d) => {
- d.preventDefault(), d.stopPropagation(), e = d.clientX, t = d.clientY, i = this.element.offsetLeft, s = this.element.offsetTop, n = this.container.clientWidth, a = this.container.clientHeight, o = this.element.offsetWidth, l = this.element.offsetHeight, document.addEventListener("mousemove", h, { capture: !0 }), document.addEventListener("mouseup", u, { capture: !0 });
+ d.preventDefault(), d.stopPropagation(), e = d.clientX, t = d.clientY, i = this.element.offsetLeft, s = this.element.offsetTop, r = this.container.clientWidth, a = this.container.clientHeight, o = this.element.offsetWidth, l = this.element.offsetHeight, document.addEventListener("mousemove", h, { capture: !0 }), document.addEventListener("mouseup", u, { capture: !0 });
}, h = (d) => {
d.preventDefault(), d.stopPropagation(), !this.rafId && (this.rafId = requestAnimationFrame(() => {
const m = d.clientX - e, g = d.clientY - t;
let v = i + m, f = s + g;
- const p = n - o, y = a - l;
- v = Math.max(0, Math.min(v, p)), f = Math.max(0, Math.min(f, y)), this.element.style.left = `${v}px`, this.element.style.top = `${f}px`, this.rafId = null;
+ const p = r - o, b = a - l;
+ v = Math.max(0, Math.min(v, p)), f = Math.max(0, Math.min(f, b)), this.element.style.left = `${v}px`, this.element.style.top = `${f}px`, this.rafId = null;
}));
}, u = () => {
this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = null), document.removeEventListener("mousemove", h, { capture: !0 }), document.removeEventListener("mouseup", u, { capture: !0 });
@@ -1070,12 +1138,12 @@ class Gc {
initResize() {
const e = this.element.querySelector(".bim-dialog-resize-handle");
if (!e) return;
- let t = 0, i = 0, s = 0, n = 0;
+ let t = 0, i = 0, s = 0, r = 0;
const a = (c) => {
- c.preventDefault(), c.stopPropagation(), t = c.clientX, i = c.clientY, s = this.element.offsetWidth, n = this.element.offsetHeight, document.addEventListener("mousemove", o, { capture: !0 }), document.addEventListener("mouseup", l, { capture: !0 });
+ c.preventDefault(), c.stopPropagation(), t = c.clientX, i = c.clientY, s = this.element.offsetWidth, r = this.element.offsetHeight, document.addEventListener("mousemove", o, { capture: !0 }), document.addEventListener("mouseup", l, { capture: !0 });
}, o = (c) => {
c.preventDefault(), c.stopPropagation(), !this.rafId && (this.rafId = requestAnimationFrame(() => {
- const h = c.clientX - t, u = c.clientY - i, d = Math.max(this.options.minWidth || 100, s + h), m = Math.max(this.options.minHeight || 50, n + u);
+ const h = c.clientX - t, u = c.clientY - i, d = Math.max(this.options.minWidth || 100, s + h), m = Math.max(this.options.minHeight || 50, r + u);
this.element.style.width = `${d}px`, this.element.style.height = `${m}px`, this.rafId = null;
}));
}, l = () => {
@@ -1103,7 +1171,7 @@ class Gc {
this.close();
}
}
-class ru extends Gc {
+class nu extends Gc {
/**
* 构造函数
* @param container 父容器
@@ -1120,10 +1188,10 @@ class ru extends Gc {
Date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
Status: Active
`;
- const n = document.createElement("button");
- n.textContent = "Update Status", n.style.marginTop = "10px", n.onclick = () => {
+ const r = document.createElement("button");
+ r.textContent = "Update Status", r.style.marginTop = "10px", r.onclick = () => {
alert("Status updated!");
- }, t.appendChild(i), t.appendChild(s), t.appendChild(n), super({
+ }, t.appendChild(i), t.appendChild(s), t.appendChild(r), super({
container: e,
title: "dialog.testTitle",
content: t,
@@ -1144,7 +1212,7 @@ class ru extends Gc {
// 不需要再手动实现 setTheme, destroy, close, init
// 它们都已从 BimDialog 继承
}
-class nu extends yi {
+class ru extends Yt {
/** 弹窗挂载的父容器 */
container;
/** 活跃的弹窗实例列表 */
@@ -1172,14 +1240,14 @@ class nu extends yi {
this.activeDialogs = this.activeDialogs.filter((i) => i !== t), e.onClose && e.onClose();
}
});
- return t.setTheme(lt.getTheme()), this.activeDialogs.push(t), t;
+ return t.setTheme(Ze.getTheme()), this.activeDialogs.push(t), t;
}
/**
* 显示二次封装的模型信息弹窗
* 演示如何调用特定的业务弹窗组件
*/
showInfoDialog() {
- new ru(this.container);
+ new nu(this.container);
}
/**
* 响应全局主题变更
@@ -1194,51 +1262,51 @@ class nu extends yi {
this.activeDialogs.forEach((e) => e.destroy()), this.activeDialogs = [];
}
}
-const ks = { ROTATE: 0, DOLLY: 1, PAN: 2 }, Bs = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, au = 0, ul = 1, ou = 2, Wc = 1, jc = 2, Hi = 3, Ai = 0, Ht = 1, jt = 2, yt = 0, zs = 1, Sn = 2, dl = 3, pl = 4, Xc = 5, ui = 100, lu = 101, cu = 102, hu = 103, uu = 104, _r = 200, du = 201, pu = 202, mu = 203, Aa = 204, Ra = 205, Pa = 206, fu = 207, La = 208, gu = 209, vu = 210, _u = 211, xu = 212, yu = 213, bu = 214, Da = 0, Ia = 1, Ua = 2, js = 3, Na = 4, Oa = 5, Ba = 6, Fa = 7, Ro = 0, Mu = 1, Su = 2, is = 0, qc = 1, Yc = 2, Kc = 3, Po = 4, Zc = 5, $c = 6, Jc = 7, ml = "attached", Tu = "detached", Qc = 300, Xs = 301, qs = 302, Tn = 303, ka = 304, In = 306, Ri = 1e3, ti = 1001, En = 1002, Ut = 1003, eh = 1004, xr = 1005, Mt = 1006, vn = 1007, wi = 1008, vi = 1009, th = 1010, ih = 1011, wr = 1012, Lo = 1013, gs = 1014, Xt = 1015, vt = 1016, Do = 1017, Io = 1018, Ys = 1020, sh = 35902, rh = 35899, nh = 1021, ah = 1022, $t = 1023, Cr = 1026, Ks = 1027, Uo = 1028, No = 1029, Oo = 1030, Bo = 1031, Fo = 1033, _n = 33776, xn = 33777, yn = 33778, bn = 33779, za = 35840, Ha = 35841, Va = 35842, Ga = 35843, Wa = 36196, ja = 37492, Xa = 37496, qa = 37808, Ya = 37809, Ka = 37810, Za = 37811, $a = 37812, Ja = 37813, Qa = 37814, eo = 37815, to = 37816, io = 37817, so = 37818, ro = 37819, no = 37820, ao = 37821, oo = 36492, lo = 36494, co = 36495, ho = 36283, uo = 36284, po = 36285, mo = 36286, Ar = 2300, Rr = 2301, kn = 2302, fl = 2400, gl = 2401, vl = 2402, Eu = 2500, wu = 0, oh = 1, fo = 2, Cu = 3200, lh = 3201, Un = 0, Au = 1, Qi = "", Rt = "srgb", Bt = "srgb-linear", wn = "linear", tt = "srgb", bs = 7680, zn = 34055, Hn = 34056, Ru = 517, go = 519, Pu = 512, Lu = 513, Du = 514, ch = 515, Iu = 516, Uu = 517, Nu = 518, Ou = 519, vo = 35044, _l = "300 es", Ci = 2e3, Cn = 2001;
-function hh(r) {
- for (let e = r.length - 1; e >= 0; --e)
- if (r[e] >= 65535) return !0;
+const Fs = { ROTATE: 0, DOLLY: 1, PAN: 2 }, Os = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, au = 0, ul = 1, ou = 2, Wc = 1, jc = 2, Hi = 3, Ai = 0, Vt = 1, Xt = 2, bt = 0, zs = 1, Sr = 2, dl = 3, pl = 4, Xc = 5, di = 100, lu = 101, cu = 102, hu = 103, uu = 104, xn = 200, du = 201, pu = 202, mu = 203, Aa = 204, Ra = 205, Pa = 206, fu = 207, La = 208, gu = 209, vu = 210, _u = 211, xu = 212, bu = 213, yu = 214, Da = 0, Ia = 1, Ua = 2, js = 3, Na = 4, Ba = 5, Oa = 6, ka = 7, Ro = 0, Mu = 1, Su = 2, is = 0, qc = 1, Yc = 2, Kc = 3, Po = 4, Zc = 5, $c = 6, Jc = 7, ml = "attached", Tu = "detached", Qc = 300, Xs = 301, qs = 302, Tr = 303, Fa = 304, Ir = 306, Ri = 1e3, ii = 1001, Er = 1002, Nt = 1003, eh = 1004, bn = 1005, Mt = 1006, vr = 1007, wi = 1008, _i = 1009, th = 1010, ih = 1011, Cn = 1012, Lo = 1013, gs = 1014, qt = 1015, vt = 1016, Do = 1017, Io = 1018, Ys = 1020, sh = 35902, nh = 35899, rh = 1021, ah = 1022, Jt = 1023, An = 1026, Ks = 1027, Uo = 1028, No = 1029, Bo = 1030, Oo = 1031, ko = 1033, _r = 33776, xr = 33777, br = 33778, yr = 33779, za = 35840, Ha = 35841, Va = 35842, Ga = 35843, Wa = 36196, ja = 37492, Xa = 37496, qa = 37808, Ya = 37809, Ka = 37810, Za = 37811, $a = 37812, Ja = 37813, Qa = 37814, eo = 37815, to = 37816, io = 37817, so = 37818, no = 37819, ro = 37820, ao = 37821, oo = 36492, lo = 36494, co = 36495, ho = 36283, uo = 36284, po = 36285, mo = 36286, Rn = 2300, Pn = 2301, Fr = 2302, fl = 2400, gl = 2401, vl = 2402, Eu = 2500, wu = 0, oh = 1, fo = 2, Cu = 3200, lh = 3201, Ur = 0, Au = 1, Qi = "", Rt = "srgb", kt = "srgb-linear", wr = "linear", it = "srgb", ys = 7680, zr = 34055, Hr = 34056, Ru = 517, go = 519, Pu = 512, Lu = 513, Du = 514, ch = 515, Iu = 516, Uu = 517, Nu = 518, Bu = 519, vo = 35044, _l = "300 es", Ci = 2e3, Cr = 2001;
+function hh(n) {
+ for (let e = n.length - 1; e >= 0; --e)
+ if (n[e] >= 65535) return !0;
return !1;
}
-function Pr(r) {
- return document.createElementNS("http://www.w3.org/1999/xhtml", r);
+function Ln(n) {
+ return document.createElementNS("http://www.w3.org/1999/xhtml", n);
}
-function Bu() {
- const r = Pr("canvas");
- return r.style.display = "block", r;
+function Ou() {
+ const n = Ln("canvas");
+ return n.style.display = "block", n;
}
const xl = {};
-function An(...r) {
- const e = "THREE." + r.shift();
- console.log(e, ...r);
+function Ar(...n) {
+ const e = "THREE." + n.shift();
+ console.log(e, ...n);
}
-function Se(...r) {
- const e = "THREE." + r.shift();
- console.warn(e, ...r);
+function Se(...n) {
+ const e = "THREE." + n.shift();
+ console.warn(e, ...n);
}
-function Ve(...r) {
- const e = "THREE." + r.shift();
- console.error(e, ...r);
+function Ve(...n) {
+ const e = "THREE." + n.shift();
+ console.error(e, ...n);
}
-function Lr(...r) {
- const e = r.join(" ");
- e in xl || (xl[e] = !0, Se(...r));
+function Dn(...n) {
+ const e = n.join(" ");
+ e in xl || (xl[e] = !0, Se(...n));
}
-function Fu(r, e, t) {
+function ku(n, e, t) {
return new Promise(function(i, s) {
- function n() {
- switch (r.clientWaitSync(e, r.SYNC_FLUSH_COMMANDS_BIT, 0)) {
- case r.WAIT_FAILED:
+ function r() {
+ switch (n.clientWaitSync(e, n.SYNC_FLUSH_COMMANDS_BIT, 0)) {
+ case n.WAIT_FAILED:
s();
break;
- case r.TIMEOUT_EXPIRED:
- setTimeout(n, t);
+ case n.TIMEOUT_EXPIRED:
+ setTimeout(r, t);
break;
default:
i();
}
}
- setTimeout(n, t);
+ setTimeout(r, t);
});
}
class xs {
@@ -1275,8 +1343,8 @@ class xs {
if (i === void 0) return;
const s = i[e];
if (s !== void 0) {
- const n = s.indexOf(t);
- n !== -1 && s.splice(n, 1);
+ const r = s.indexOf(t);
+ r !== -1 && s.splice(r, 1);
}
}
/**
@@ -1291,142 +1359,142 @@ class xs {
if (i !== void 0) {
e.target = this;
const s = i.slice(0);
- for (let n = 0, a = s.length; n < a; n++)
- s[n].call(this, e);
+ for (let r = 0, a = s.length; r < a; r++)
+ s[r].call(this, e);
e.target = null;
}
}
}
-const Nt = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
-let yl = 1234567;
-const Mr = Math.PI / 180, Zs = 180 / Math.PI;
-function fi() {
- const r = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0;
- return (Nt[r & 255] + Nt[r >> 8 & 255] + Nt[r >> 16 & 255] + Nt[r >> 24 & 255] + "-" + Nt[e & 255] + Nt[e >> 8 & 255] + "-" + Nt[e >> 16 & 15 | 64] + Nt[e >> 24 & 255] + "-" + Nt[t & 63 | 128] + Nt[t >> 8 & 255] + "-" + Nt[t >> 16 & 255] + Nt[t >> 24 & 255] + Nt[i & 255] + Nt[i >> 8 & 255] + Nt[i >> 16 & 255] + Nt[i >> 24 & 255]).toLowerCase();
+const Bt = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
+let bl = 1234567;
+const Sn = Math.PI / 180, Zs = 180 / Math.PI;
+function gi() {
+ const n = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0;
+ return (Bt[n & 255] + Bt[n >> 8 & 255] + Bt[n >> 16 & 255] + Bt[n >> 24 & 255] + "-" + Bt[e & 255] + Bt[e >> 8 & 255] + "-" + Bt[e >> 16 & 15 | 64] + Bt[e >> 24 & 255] + "-" + Bt[t & 63 | 128] + Bt[t >> 8 & 255] + "-" + Bt[t >> 16 & 255] + Bt[t >> 24 & 255] + Bt[i & 255] + Bt[i >> 8 & 255] + Bt[i >> 16 & 255] + Bt[i >> 24 & 255]).toLowerCase();
}
-function ze(r, e, t) {
- return Math.max(e, Math.min(t, r));
+function ze(n, e, t) {
+ return Math.max(e, Math.min(t, n));
}
-function ko(r, e) {
- return (r % e + e) % e;
+function Fo(n, e) {
+ return (n % e + e) % e;
}
-function ku(r, e, t, i, s) {
- return i + (r - e) * (s - i) / (t - e);
+function Fu(n, e, t, i, s) {
+ return i + (n - e) * (s - i) / (t - e);
}
-function zu(r, e, t) {
- return r !== e ? (t - r) / (e - r) : 0;
+function zu(n, e, t) {
+ return n !== e ? (t - n) / (e - n) : 0;
}
-function Sr(r, e, t) {
- return (1 - t) * r + t * e;
+function Tn(n, e, t) {
+ return (1 - t) * n + t * e;
}
-function Hu(r, e, t, i) {
- return Sr(r, e, 1 - Math.exp(-t * i));
+function Hu(n, e, t, i) {
+ return Tn(n, e, 1 - Math.exp(-t * i));
}
-function Vu(r, e = 1) {
- return e - Math.abs(ko(r, e * 2) - e);
+function Vu(n, e = 1) {
+ return e - Math.abs(Fo(n, e * 2) - e);
}
-function Gu(r, e, t) {
- return r <= e ? 0 : r >= t ? 1 : (r = (r - e) / (t - e), r * r * (3 - 2 * r));
+function Gu(n, e, t) {
+ return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * (3 - 2 * n));
}
-function Wu(r, e, t) {
- return r <= e ? 0 : r >= t ? 1 : (r = (r - e) / (t - e), r * r * r * (r * (r * 6 - 15) + 10));
+function Wu(n, e, t) {
+ return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * n * (n * (n * 6 - 15) + 10));
}
-function ju(r, e) {
- return r + Math.floor(Math.random() * (e - r + 1));
+function ju(n, e) {
+ return n + Math.floor(Math.random() * (e - n + 1));
}
-function Xu(r, e) {
- return r + Math.random() * (e - r);
+function Xu(n, e) {
+ return n + Math.random() * (e - n);
}
-function qu(r) {
- return r * (0.5 - Math.random());
+function qu(n) {
+ return n * (0.5 - Math.random());
}
-function Yu(r) {
- r !== void 0 && (yl = r);
- let e = yl += 1831565813;
+function Yu(n) {
+ n !== void 0 && (bl = n);
+ let e = bl += 1831565813;
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
}
-function Ku(r) {
- return r * Mr;
+function Ku(n) {
+ return n * Sn;
}
-function Zu(r) {
- return r * Zs;
+function Zu(n) {
+ return n * Zs;
}
-function $u(r) {
- return (r & r - 1) === 0 && r !== 0;
+function $u(n) {
+ return (n & n - 1) === 0 && n !== 0;
}
-function Ju(r) {
- return Math.pow(2, Math.ceil(Math.log(r) / Math.LN2));
+function Ju(n) {
+ return Math.pow(2, Math.ceil(Math.log(n) / Math.LN2));
}
-function Qu(r) {
- return Math.pow(2, Math.floor(Math.log(r) / Math.LN2));
+function Qu(n) {
+ return Math.pow(2, Math.floor(Math.log(n) / Math.LN2));
}
-function ed(r, e, t, i, s) {
- const n = Math.cos, a = Math.sin, o = n(t / 2), l = a(t / 2), c = n((e + i) / 2), h = a((e + i) / 2), u = n((e - i) / 2), d = a((e - i) / 2), m = n((i - e) / 2), g = a((i - e) / 2);
+function ed(n, e, t, i, s) {
+ const r = Math.cos, a = Math.sin, o = r(t / 2), l = a(t / 2), c = r((e + i) / 2), h = a((e + i) / 2), u = r((e - i) / 2), d = a((e - i) / 2), m = r((i - e) / 2), g = a((i - e) / 2);
switch (s) {
case "XYX":
- r.set(o * h, l * u, l * d, o * c);
+ n.set(o * h, l * u, l * d, o * c);
break;
case "YZY":
- r.set(l * d, o * h, l * u, o * c);
+ n.set(l * d, o * h, l * u, o * c);
break;
case "ZXZ":
- r.set(l * u, l * d, o * h, o * c);
+ n.set(l * u, l * d, o * h, o * c);
break;
case "XZX":
- r.set(o * h, l * g, l * m, o * c);
+ n.set(o * h, l * g, l * m, o * c);
break;
case "YXY":
- r.set(l * m, o * h, l * g, o * c);
+ n.set(l * m, o * h, l * g, o * c);
break;
case "ZYZ":
- r.set(l * g, l * m, o * h, o * c);
+ n.set(l * g, l * m, o * h, o * c);
break;
default:
Se("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + s);
}
}
-function di(r, e) {
+function pi(n, e) {
switch (e.constructor) {
case Float32Array:
- return r;
+ return n;
case Uint32Array:
- return r / 4294967295;
+ return n / 4294967295;
case Uint16Array:
- return r / 65535;
+ return n / 65535;
case Uint8Array:
- return r / 255;
+ return n / 255;
case Int32Array:
- return Math.max(r / 2147483647, -1);
+ return Math.max(n / 2147483647, -1);
case Int16Array:
- return Math.max(r / 32767, -1);
+ return Math.max(n / 32767, -1);
case Int8Array:
- return Math.max(r / 127, -1);
+ return Math.max(n / 127, -1);
default:
throw new Error("Invalid component type.");
}
}
-function it(r, e) {
+function st(n, e) {
switch (e.constructor) {
case Float32Array:
- return r;
+ return n;
case Uint32Array:
- return Math.round(r * 4294967295);
+ return Math.round(n * 4294967295);
case Uint16Array:
- return Math.round(r * 65535);
+ return Math.round(n * 65535);
case Uint8Array:
- return Math.round(r * 255);
+ return Math.round(n * 255);
case Int32Array:
- return Math.round(r * 2147483647);
+ return Math.round(n * 2147483647);
case Int16Array:
- return Math.round(r * 32767);
+ return Math.round(n * 32767);
case Int8Array:
- return Math.round(r * 127);
+ return Math.round(n * 127);
default:
throw new Error("Invalid component type.");
}
}
const zo = {
- DEG2RAD: Mr,
+ DEG2RAD: Sn,
RAD2DEG: Zs,
/**
* Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
@@ -1436,7 +1504,7 @@ const zo = {
* @method
* @return {string} The UUID.
*/
- generateUUID: fi,
+ generateUUID: gi,
/**
* Clamps the given value between min and max.
*
@@ -1458,7 +1526,7 @@ const zo = {
* @param {number} m - The second parameter.
* @return {number} The Euclidean modulo.
*/
- euclideanModulo: ko,
+ euclideanModulo: Fo,
/**
* Performs a linear mapping from range `` to range ``
* for the given value.
@@ -1472,7 +1540,7 @@ const zo = {
* @param {number} b2 - Maximum value for range B.
* @return {number} The mapped value.
*/
- mapLinear: ku,
+ mapLinear: Fu,
/**
* Returns the percentage in the closed interval `[0, 1]` of the given value
* between the start and end point.
@@ -1496,7 +1564,7 @@ const zo = {
* @param {number} t - The interpolation factor in the closed interval `[0, 1]`.
* @return {number} The interpolated value.
*/
- lerp: Sr,
+ lerp: Tn,
/**
* Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta
* time to maintain frame rate independent movement. For details, see
@@ -1657,7 +1725,7 @@ const zo = {
* @param {TypedArray} array - The typed array that defines the data type of the value.
* @return {number} The normalize value.
*/
- normalize: it,
+ normalize: st,
/**
* Denormalizes the given value according to the given typed array.
*
@@ -1667,7 +1735,7 @@ const zo = {
* @param {TypedArray} array - The typed array that defines the data type of the value.
* @return {number} The denormalize (float) value in the range `[0,1]`.
*/
- denormalize: di
+ denormalize: pi
};
class oe {
/**
@@ -2192,8 +2260,8 @@ class oe {
* @return {Vector2} A reference to this vector.
*/
rotateAround(e, t) {
- const i = Math.cos(t), s = Math.sin(t), n = this.x - e.x, a = this.y - e.y;
- return this.x = n * i - a * s + e.x, this.y = n * s + a * i + e.y, this;
+ const i = Math.cos(t), s = Math.sin(t), r = this.x - e.x, a = this.y - e.y;
+ return this.x = r * i - a * s + e.x, this.y = r * s + a * i + e.y, this;
}
/**
* Sets each component of this vector to a pseudo-random value between `0` and
@@ -2208,7 +2276,7 @@ class oe {
yield this.x, yield this.y;
}
}
-class _i {
+class xi {
/**
* Constructs a new quaternion.
*
@@ -2233,8 +2301,8 @@ class _i {
* @param {number} t - The interpolation factor in the range `[0,1]`.
* @see {@link Quaternion#slerp}
*/
- static slerpFlat(e, t, i, s, n, a, o) {
- let l = i[s + 0], c = i[s + 1], h = i[s + 2], u = i[s + 3], d = n[a + 0], m = n[a + 1], g = n[a + 2], v = n[a + 3];
+ static slerpFlat(e, t, i, s, r, a, o) {
+ let l = i[s + 0], c = i[s + 1], h = i[s + 2], u = i[s + 3], d = r[a + 0], m = r[a + 1], g = r[a + 2], v = r[a + 3];
if (o <= 0) {
e[t + 0] = l, e[t + 1] = c, e[t + 2] = h, e[t + 3] = u;
return;
@@ -2248,12 +2316,12 @@ class _i {
f < 0 && (d = -d, m = -m, g = -g, v = -v, f = -f);
let p = 1 - o;
if (f < 0.9995) {
- const y = Math.acos(f), _ = Math.sin(y);
- p = Math.sin(p * y) / _, o = Math.sin(o * y) / _, l = l * p + d * o, c = c * p + m * o, h = h * p + g * o, u = u * p + v * o;
+ const b = Math.acos(f), _ = Math.sin(b);
+ p = Math.sin(p * b) / _, o = Math.sin(o * b) / _, l = l * p + d * o, c = c * p + m * o, h = h * p + g * o, u = u * p + v * o;
} else {
l = l * p + d * o, c = c * p + m * o, h = h * p + g * o, u = u * p + v * o;
- const y = 1 / Math.sqrt(l * l + c * c + h * h + u * u);
- l *= y, c *= y, h *= y, u *= y;
+ const b = 1 / Math.sqrt(l * l + c * c + h * h + u * u);
+ l *= b, c *= b, h *= b, u *= b;
}
}
e[t] = l, e[t + 1] = c, e[t + 2] = h, e[t + 3] = u;
@@ -2271,8 +2339,8 @@ class _i {
* @return {Array} The destination array.
* @see {@link Quaternion#multiplyQuaternions}.
*/
- static multiplyQuaternionsFlat(e, t, i, s, n, a) {
- const o = i[s], l = i[s + 1], c = i[s + 2], h = i[s + 3], u = n[a], d = n[a + 1], m = n[a + 2], g = n[a + 3];
+ static multiplyQuaternionsFlat(e, t, i, s, r, a) {
+ const o = i[s], l = i[s + 1], c = i[s + 2], h = i[s + 3], u = r[a], d = r[a + 1], m = r[a + 2], g = r[a + 3];
return e[t] = o * g + h * u + l * m - c * d, e[t + 1] = l * g + h * d + c * u - o * m, e[t + 2] = c * g + h * m + o * d - l * u, e[t + 3] = h * g - o * u - l * d - c * m, e;
}
/**
@@ -2361,7 +2429,7 @@ class _i {
* @return {Quaternion} A reference to this quaternion.
*/
setFromEuler(e, t = !0) {
- const i = e._x, s = e._y, n = e._z, a = e._order, o = Math.cos, l = Math.sin, c = o(i / 2), h = o(s / 2), u = o(n / 2), d = l(i / 2), m = l(s / 2), g = l(n / 2);
+ const i = e._x, s = e._y, r = e._z, a = e._order, o = Math.cos, l = Math.sin, c = o(i / 2), h = o(s / 2), u = o(r / 2), d = l(i / 2), m = l(s / 2), g = l(r / 2);
switch (a) {
case "XYZ":
this._x = d * h * u + c * m * g, this._y = c * m * u - d * h * g, this._z = c * h * g + d * m * u, this._w = c * h * u - d * m * g;
@@ -2404,19 +2472,19 @@ class _i {
* @return {Quaternion} A reference to this quaternion.
*/
setFromRotationMatrix(e) {
- const t = e.elements, i = t[0], s = t[4], n = t[8], a = t[1], o = t[5], l = t[9], c = t[2], h = t[6], u = t[10], d = i + o + u;
+ const t = e.elements, i = t[0], s = t[4], r = t[8], a = t[1], o = t[5], l = t[9], c = t[2], h = t[6], u = t[10], d = i + o + u;
if (d > 0) {
const m = 0.5 / Math.sqrt(d + 1);
- this._w = 0.25 / m, this._x = (h - l) * m, this._y = (n - c) * m, this._z = (a - s) * m;
+ this._w = 0.25 / m, this._x = (h - l) * m, this._y = (r - c) * m, this._z = (a - s) * m;
} else if (i > o && i > u) {
const m = 2 * Math.sqrt(1 + i - o - u);
- this._w = (h - l) / m, this._x = 0.25 * m, this._y = (s + a) / m, this._z = (n + c) / m;
+ this._w = (h - l) / m, this._x = 0.25 * m, this._y = (s + a) / m, this._z = (r + c) / m;
} else if (o > u) {
const m = 2 * Math.sqrt(1 + o - i - u);
- this._w = (n - c) / m, this._x = (s + a) / m, this._y = 0.25 * m, this._z = (l + h) / m;
+ this._w = (r - c) / m, this._x = (s + a) / m, this._y = 0.25 * m, this._z = (l + h) / m;
} else {
const m = 2 * Math.sqrt(1 + u - i - o);
- this._w = (a - s) / m, this._x = (n + c) / m, this._y = (l + h) / m, this._z = 0.25 * m;
+ this._w = (a - s) / m, this._x = (r + c) / m, this._y = (l + h) / m, this._z = 0.25 * m;
}
return this._onChangeCallback(), this;
}
@@ -2548,8 +2616,8 @@ class _i {
* @return {Quaternion} A reference to this quaternion.
*/
multiplyQuaternions(e, t) {
- const i = e._x, s = e._y, n = e._z, a = e._w, o = t._x, l = t._y, c = t._z, h = t._w;
- return this._x = i * h + a * o + s * c - n * l, this._y = s * h + a * l + n * o - i * c, this._z = n * h + a * c + i * l - s * o, this._w = a * h - i * o - s * l - n * c, this._onChangeCallback(), this;
+ const i = e._x, s = e._y, r = e._z, a = e._w, o = t._x, l = t._y, c = t._z, h = t._w;
+ return this._x = i * h + a * o + s * c - r * l, this._y = s * h + a * l + r * o - i * c, this._z = r * h + a * c + i * l - s * o, this._w = a * h - i * o - s * l - r * c, this._onChangeCallback(), this;
}
/**
* Performs a spherical linear interpolation between quaternions.
@@ -2561,14 +2629,14 @@ class _i {
slerp(e, t) {
if (t <= 0) return this;
if (t >= 1) return this.copy(e);
- let i = e._x, s = e._y, n = e._z, a = e._w, o = this.dot(e);
- o < 0 && (i = -i, s = -s, n = -n, a = -a, o = -o);
+ let i = e._x, s = e._y, r = e._z, a = e._w, o = this.dot(e);
+ o < 0 && (i = -i, s = -s, r = -r, a = -a, o = -o);
let l = 1 - t;
if (o < 0.9995) {
const c = Math.acos(o), h = Math.sin(c);
- l = Math.sin(l * c) / h, t = Math.sin(t * c) / h, this._x = this._x * l + i * t, this._y = this._y * l + s * t, this._z = this._z * l + n * t, this._w = this._w * l + a * t, this._onChangeCallback();
+ l = Math.sin(l * c) / h, t = Math.sin(t * c) / h, this._x = this._x * l + i * t, this._y = this._y * l + s * t, this._z = this._z * l + r * t, this._w = this._w * l + a * t, this._onChangeCallback();
} else
- this._x = this._x * l + i * t, this._y = this._y * l + s * t, this._z = this._z * l + n * t, this._w = this._w * l + a * t, this.normalize();
+ this._x = this._x * l + i * t, this._y = this._y * l + s * t, this._z = this._z * l + r * t, this._w = this._w * l + a * t, this.normalize();
return this;
}
/**
@@ -2589,12 +2657,12 @@ class _i {
* @return {Quaternion} A reference to this quaternion.
*/
random() {
- const e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), i = Math.random(), s = Math.sqrt(1 - i), n = Math.sqrt(i);
+ const e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), i = Math.random(), s = Math.sqrt(1 - i), r = Math.sqrt(i);
return this.set(
s * Math.sin(e),
s * Math.cos(e),
- n * Math.sin(t),
- n * Math.cos(t)
+ r * Math.sin(t),
+ r * Math.cos(t)
);
}
/**
@@ -2872,7 +2940,7 @@ class w {
* @return {Vector3} A reference to this vector.
*/
applyEuler(e) {
- return this.applyQuaternion(bl.setFromEuler(e));
+ return this.applyQuaternion(yl.setFromEuler(e));
}
/**
* Applies a rotation specified by an axis and an angle to this vector.
@@ -2882,7 +2950,7 @@ class w {
* @return {Vector3} A reference to this vector.
*/
applyAxisAngle(e, t) {
- return this.applyQuaternion(bl.setFromAxisAngle(e, t));
+ return this.applyQuaternion(yl.setFromAxisAngle(e, t));
}
/**
* Multiplies this vector with the given 3x3 matrix.
@@ -2891,8 +2959,8 @@ class w {
* @return {Vector3} A reference to this vector.
*/
applyMatrix3(e) {
- const t = this.x, i = this.y, s = this.z, n = e.elements;
- return this.x = n[0] * t + n[3] * i + n[6] * s, this.y = n[1] * t + n[4] * i + n[7] * s, this.z = n[2] * t + n[5] * i + n[8] * s, this;
+ const t = this.x, i = this.y, s = this.z, r = e.elements;
+ return this.x = r[0] * t + r[3] * i + r[6] * s, this.y = r[1] * t + r[4] * i + r[7] * s, this.z = r[2] * t + r[5] * i + r[8] * s, this;
}
/**
* Multiplies this vector by the given normal matrix and normalizes
@@ -2912,8 +2980,8 @@ class w {
* @return {Vector3} A reference to this vector.
*/
applyMatrix4(e) {
- const t = this.x, i = this.y, s = this.z, n = e.elements, a = 1 / (n[3] * t + n[7] * i + n[11] * s + n[15]);
- return this.x = (n[0] * t + n[4] * i + n[8] * s + n[12]) * a, this.y = (n[1] * t + n[5] * i + n[9] * s + n[13]) * a, this.z = (n[2] * t + n[6] * i + n[10] * s + n[14]) * a, this;
+ const t = this.x, i = this.y, s = this.z, r = e.elements, a = 1 / (r[3] * t + r[7] * i + r[11] * s + r[15]);
+ return this.x = (r[0] * t + r[4] * i + r[8] * s + r[12]) * a, this.y = (r[1] * t + r[5] * i + r[9] * s + r[13]) * a, this.z = (r[2] * t + r[6] * i + r[10] * s + r[14]) * a, this;
}
/**
* Applies the given Quaternion to this vector.
@@ -2922,8 +2990,8 @@ class w {
* @return {Vector3} A reference to this vector.
*/
applyQuaternion(e) {
- const t = this.x, i = this.y, s = this.z, n = e.x, a = e.y, o = e.z, l = e.w, c = 2 * (a * s - o * i), h = 2 * (o * t - n * s), u = 2 * (n * i - a * t);
- return this.x = t + l * c + a * u - o * h, this.y = i + l * h + o * c - n * u, this.z = s + l * u + n * h - a * c, this;
+ const t = this.x, i = this.y, s = this.z, r = e.x, a = e.y, o = e.z, l = e.w, c = 2 * (a * s - o * i), h = 2 * (o * t - r * s), u = 2 * (r * i - a * t);
+ return this.x = t + l * c + a * u - o * h, this.y = i + l * h + o * c - r * u, this.z = s + l * u + r * h - a * c, this;
}
/**
* Projects this vector from world space into the camera's normalized
@@ -2953,8 +3021,8 @@ class w {
* @return {Vector3} A reference to this vector.
*/
transformDirection(e) {
- const t = this.x, i = this.y, s = this.z, n = e.elements;
- return this.x = n[0] * t + n[4] * i + n[8] * s, this.y = n[1] * t + n[5] * i + n[9] * s, this.z = n[2] * t + n[6] * i + n[10] * s, this.normalize();
+ const t = this.x, i = this.y, s = this.z, r = e.elements;
+ return this.x = r[0] * t + r[4] * i + r[8] * s, this.y = r[1] * t + r[5] * i + r[9] * s, this.z = r[2] * t + r[6] * i + r[10] * s, this.normalize();
}
/**
* Divides this instance by the given vector.
@@ -3173,8 +3241,8 @@ class w {
* @return {Vector3} A reference to this vector.
*/
crossVectors(e, t) {
- const i = e.x, s = e.y, n = e.z, a = t.x, o = t.y, l = t.z;
- return this.x = s * l - n * o, this.y = n * a - i * l, this.z = i * o - s * a, this;
+ const i = e.x, s = e.y, r = e.z, a = t.x, o = t.y, l = t.z;
+ return this.x = s * l - r * o, this.y = r * a - i * l, this.z = i * o - s * a, this;
}
/**
* Projects this vector onto the given one.
@@ -3196,7 +3264,7 @@ class w {
* @return {Vector3} A reference to this vector.
*/
projectOnPlane(e) {
- return Vn.copy(this).projectOnVector(e), this.sub(Vn);
+ return Vr.copy(this).projectOnVector(e), this.sub(Vr);
}
/**
* Reflects this vector off a plane orthogonal to the given normal vector.
@@ -3205,7 +3273,7 @@ class w {
* @return {Vector3} A reference to this vector.
*/
reflect(e) {
- return this.sub(Vn.copy(e).multiplyScalar(2 * this.dot(e)));
+ return this.sub(Vr.copy(e).multiplyScalar(2 * this.dot(e)));
}
/**
* Returns the angle between the given vector and this instance in radians.
@@ -3414,8 +3482,8 @@ class w {
yield this.x, yield this.y, yield this.z;
}
}
-const Vn = /* @__PURE__ */ new w(), bl = /* @__PURE__ */ new _i();
-class Fe {
+const Vr = /* @__PURE__ */ new w(), yl = /* @__PURE__ */ new xi();
+class ke {
/**
* Constructs a new 3x3 matrix. The arguments are supposed to be
* in row-major order. If no arguments are provided, the constructor
@@ -3431,8 +3499,8 @@ class Fe {
* @param {number} [n32] - 3-2 matrix element.
* @param {number} [n33] - 3-3 matrix element.
*/
- constructor(e, t, i, s, n, a, o, l, c) {
- Fe.prototype.isMatrix3 = !0, this.elements = [
+ constructor(e, t, i, s, r, a, o, l, c) {
+ ke.prototype.isMatrix3 = !0, this.elements = [
1,
0,
0,
@@ -3442,7 +3510,7 @@ class Fe {
0,
0,
1
- ], e !== void 0 && this.set(e, t, i, s, n, a, o, l, c);
+ ], e !== void 0 && this.set(e, t, i, s, r, a, o, l, c);
}
/**
* Sets the elements of the matrix.The arguments are supposed to be
@@ -3459,9 +3527,9 @@ class Fe {
* @param {number} [n33] - 3-3 matrix element.
* @return {Matrix3} A reference to this matrix.
*/
- set(e, t, i, s, n, a, o, l, c) {
+ set(e, t, i, s, r, a, o, l, c) {
const h = this.elements;
- return h[0] = e, h[1] = s, h[2] = o, h[3] = t, h[4] = n, h[5] = l, h[6] = i, h[7] = a, h[8] = c, this;
+ return h[0] = e, h[1] = s, h[2] = o, h[3] = t, h[4] = r, h[5] = l, h[6] = i, h[7] = a, h[8] = c, this;
}
/**
* Sets this matrix to the 3x3 identity matrix.
@@ -3549,8 +3617,8 @@ class Fe {
* @return {Matrix3} A reference to this matrix.
*/
multiplyMatrices(e, t) {
- const i = e.elements, s = t.elements, n = this.elements, a = i[0], o = i[3], l = i[6], c = i[1], h = i[4], u = i[7], d = i[2], m = i[5], g = i[8], v = s[0], f = s[3], p = s[6], y = s[1], _ = s[4], E = s[7], R = s[2], T = s[5], A = s[8];
- return n[0] = a * v + o * y + l * R, n[3] = a * f + o * _ + l * T, n[6] = a * p + o * E + l * A, n[1] = c * v + h * y + u * R, n[4] = c * f + h * _ + u * T, n[7] = c * p + h * E + u * A, n[2] = d * v + m * y + g * R, n[5] = d * f + m * _ + g * T, n[8] = d * p + m * E + g * A, this;
+ const i = e.elements, s = t.elements, r = this.elements, a = i[0], o = i[3], l = i[6], c = i[1], h = i[4], u = i[7], d = i[2], m = i[5], g = i[8], v = s[0], f = s[3], p = s[6], b = s[1], _ = s[4], E = s[7], R = s[2], T = s[5], A = s[8];
+ return r[0] = a * v + o * b + l * R, r[3] = a * f + o * _ + l * T, r[6] = a * p + o * E + l * A, r[1] = c * v + h * b + u * R, r[4] = c * f + h * _ + u * T, r[7] = c * p + h * E + u * A, r[2] = d * v + m * b + g * R, r[5] = d * f + m * _ + g * T, r[8] = d * p + m * E + g * A, this;
}
/**
* Multiplies every component of the matrix by the given scalar.
@@ -3568,8 +3636,8 @@ class Fe {
* @return {number} The determinant.
*/
determinant() {
- const e = this.elements, t = e[0], i = e[1], s = e[2], n = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8];
- return t * a * h - t * o * c - i * n * h + i * o * l + s * n * c - s * a * l;
+ const e = this.elements, t = e[0], i = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8];
+ return t * a * h - t * o * c - i * r * h + i * o * l + s * r * c - s * a * l;
}
/**
* Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
@@ -3579,10 +3647,10 @@ class Fe {
* @return {Matrix3} A reference to this matrix.
*/
invert() {
- const e = this.elements, t = e[0], i = e[1], s = e[2], n = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = h * a - o * c, d = o * l - h * n, m = c * n - a * l, g = t * u + i * d + s * m;
+ const e = this.elements, t = e[0], i = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = h * a - o * c, d = o * l - h * r, m = c * r - a * l, g = t * u + i * d + s * m;
if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
const v = 1 / g;
- return e[0] = u * v, e[1] = (s * c - h * i) * v, e[2] = (o * i - s * a) * v, e[3] = d * v, e[4] = (h * t - s * l) * v, e[5] = (s * n - o * t) * v, e[6] = m * v, e[7] = (i * l - c * t) * v, e[8] = (a * t - i * n) * v, this;
+ return e[0] = u * v, e[1] = (s * c - h * i) * v, e[2] = (o * i - s * a) * v, e[3] = d * v, e[4] = (h * t - s * l) * v, e[5] = (s * r - o * t) * v, e[6] = m * v, e[7] = (i * l - c * t) * v, e[8] = (a * t - i * r) * v, this;
}
/**
* Transposes this matrix in place.
@@ -3626,8 +3694,8 @@ class Fe {
* @param {number} cy - Center y of rotation
* @return {Matrix3} A reference to this matrix.
*/
- setUvTransform(e, t, i, s, n, a, o) {
- const l = Math.cos(n), c = Math.sin(n);
+ setUvTransform(e, t, i, s, r, a, o) {
+ const l = Math.cos(r), c = Math.sin(r);
return this.set(
i * l,
i * c,
@@ -3648,7 +3716,7 @@ class Fe {
* @return {Matrix3} A reference to this matrix.
*/
scale(e, t) {
- return this.premultiply(Gn.makeScale(e, t)), this;
+ return this.premultiply(Gr.makeScale(e, t)), this;
}
/**
* Rotates this matrix by the given angle.
@@ -3657,7 +3725,7 @@ class Fe {
* @return {Matrix3} A reference to this matrix.
*/
rotate(e) {
- return this.premultiply(Gn.makeRotation(-e)), this;
+ return this.premultiply(Gr.makeRotation(-e)), this;
}
/**
* Translates this matrix by the given scalar values.
@@ -3667,7 +3735,7 @@ class Fe {
* @return {Matrix3} A reference to this matrix.
*/
translate(e, t) {
- return this.premultiply(Gn.makeTranslation(e, t)), this;
+ return this.premultiply(Gr.makeTranslation(e, t)), this;
}
// for 2D Transforms
/**
@@ -3785,7 +3853,7 @@ class Fe {
return new this.constructor().fromArray(this.elements);
}
}
-const Gn = /* @__PURE__ */ new Fe(), Ml = /* @__PURE__ */ new Fe().set(
+const Gr = /* @__PURE__ */ new ke(), Ml = /* @__PURE__ */ new ke().set(
0.4123908,
0.3575843,
0.1804808,
@@ -3795,7 +3863,7 @@ const Gn = /* @__PURE__ */ new Fe(), Ml = /* @__PURE__ */ new Fe().set(
0.0193308,
0.1191948,
0.9505322
-), Sl = /* @__PURE__ */ new Fe().set(
+), Sl = /* @__PURE__ */ new ke().set(
3.2409699,
-1.5373832,
-0.4986108,
@@ -3807,9 +3875,9 @@ const Gn = /* @__PURE__ */ new Fe(), Ml = /* @__PURE__ */ new Fe().set(
1.0569715
);
function td() {
- const r = {
+ const n = {
enabled: !0,
- workingColorSpace: Bt,
+ workingColorSpace: kt,
/**
* Implementations of supported color spaces.
*
@@ -3829,33 +3897,33 @@ function td() {
* - https://www.russellcottrell.com/photo/matrixCalculator.htm
*/
spaces: {},
- convert: function(s, n, a) {
- return this.enabled === !1 || n === a || !n || !a || (this.spaces[n].transfer === tt && (s.r = ji(s.r), s.g = ji(s.g), s.b = ji(s.b)), this.spaces[n].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[n].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === tt && (s.r = Hs(s.r), s.g = Hs(s.g), s.b = Hs(s.b))), s;
+ convert: function(s, r, a) {
+ return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === it && (s.r = ji(s.r), s.g = ji(s.g), s.b = ji(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === it && (s.r = Hs(s.r), s.g = Hs(s.g), s.b = Hs(s.b))), s;
},
- workingToColorSpace: function(s, n) {
- return this.convert(s, this.workingColorSpace, n);
+ workingToColorSpace: function(s, r) {
+ return this.convert(s, this.workingColorSpace, r);
},
- colorSpaceToWorking: function(s, n) {
- return this.convert(s, n, this.workingColorSpace);
+ colorSpaceToWorking: function(s, r) {
+ return this.convert(s, r, this.workingColorSpace);
},
getPrimaries: function(s) {
return this.spaces[s].primaries;
},
getTransfer: function(s) {
- return s === Qi ? wn : this.spaces[s].transfer;
+ return s === Qi ? wr : this.spaces[s].transfer;
},
getToneMappingMode: function(s) {
return this.spaces[s].outputColorSpaceConfig.toneMappingMode || "standard";
},
- getLuminanceCoefficients: function(s, n = this.workingColorSpace) {
- return s.fromArray(this.spaces[n].luminanceCoefficients);
+ getLuminanceCoefficients: function(s, r = this.workingColorSpace) {
+ return s.fromArray(this.spaces[r].luminanceCoefficients);
},
define: function(s) {
Object.assign(this.spaces, s);
},
// Internal APIs
- _getMatrix: function(s, n, a) {
- return s.copy(this.spaces[n].toXYZ).multiply(this.spaces[a].fromXYZ);
+ _getMatrix: function(s, r, a) {
+ return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ);
},
_getDrawingBufferColorSpace: function(s) {
return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace;
@@ -3864,18 +3932,18 @@ function td() {
return this.spaces[s].workingColorSpaceConfig.unpackColorSpace;
},
// Deprecated
- fromWorkingColorSpace: function(s, n) {
- return Lr("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), r.workingToColorSpace(s, n);
+ fromWorkingColorSpace: function(s, r) {
+ return Dn("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), n.workingToColorSpace(s, r);
},
- toWorkingColorSpace: function(s, n) {
- return Lr("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), r.colorSpaceToWorking(s, n);
+ toWorkingColorSpace: function(s, r) {
+ return Dn("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), n.colorSpaceToWorking(s, r);
}
}, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], t = [0.2126, 0.7152, 0.0722], i = [0.3127, 0.329];
- return r.define({
- [Bt]: {
+ return n.define({
+ [kt]: {
primaries: e,
whitePoint: i,
- transfer: wn,
+ transfer: wr,
toXYZ: Ml,
fromXYZ: Sl,
luminanceCoefficients: t,
@@ -3885,20 +3953,20 @@ function td() {
[Rt]: {
primaries: e,
whitePoint: i,
- transfer: tt,
+ transfer: it,
toXYZ: Ml,
fromXYZ: Sl,
luminanceCoefficients: t,
outputColorSpaceConfig: { drawingBufferColorSpace: Rt }
}
- }), r;
+ }), n;
}
const qe = /* @__PURE__ */ td();
-function ji(r) {
- return r < 0.04045 ? r * 0.0773993808 : Math.pow(r * 0.9478672986 + 0.0521327014, 2.4);
+function ji(n) {
+ return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4);
}
-function Hs(r) {
- return r < 31308e-7 ? r * 12.92 : 1.055 * Math.pow(r, 0.41666) - 0.055;
+function Hs(n) {
+ return n < 31308e-7 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055;
}
let Ms;
class id {
@@ -3916,7 +3984,7 @@ class id {
if (e instanceof HTMLCanvasElement)
i = e;
else {
- Ms === void 0 && (Ms = Pr("canvas")), Ms.width = e.width, Ms.height = e.height;
+ Ms === void 0 && (Ms = Ln("canvas")), Ms.width = e.width, Ms.height = e.height;
const s = Ms.getContext("2d");
e instanceof ImageData ? s.putImageData(e, 0, 0) : s.drawImage(e, 0, 0, e.width, e.height), i = Ms;
}
@@ -3930,13 +3998,13 @@ class id {
*/
static sRGBToLinear(e) {
if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap) {
- const t = Pr("canvas");
+ const t = Ln("canvas");
t.width = e.width, t.height = e.height;
const i = t.getContext("2d");
i.drawImage(e, 0, 0, e.width, e.height);
- const s = i.getImageData(0, 0, e.width, e.height), n = s.data;
- for (let a = 0; a < n.length; a++)
- n[a] = ji(n[a] / 255) * 255;
+ const s = i.getImageData(0, 0, e.width, e.height), r = s.data;
+ for (let a = 0; a < r.length; a++)
+ r[a] = ji(r[a] / 255) * 255;
return i.putImageData(s, 0, 0), t;
} else if (e.data) {
const t = e.data.slice(0);
@@ -3959,7 +4027,7 @@ class Ho {
* @param {any} [data=null] - The data definition of a texture.
*/
constructor(e = null) {
- this.isSource = !0, Object.defineProperty(this, "id", { value: sd++ }), this.uuid = fi(), this.data = e, this.dataReady = !0, this.version = 0;
+ this.isSource = !0, Object.defineProperty(this, "id", { value: sd++ }), this.uuid = gi(), this.data = e, this.dataReady = !0, this.version = 0;
}
/**
* Returns the dimensions of the source into the given target vector.
@@ -3999,28 +4067,28 @@ class Ho {
url: ""
}, s = this.data;
if (s !== null) {
- let n;
+ let r;
if (Array.isArray(s)) {
- n = [];
+ r = [];
for (let a = 0, o = s.length; a < o; a++)
- s[a].isDataTexture ? n.push(Wn(s[a].image)) : n.push(Wn(s[a]));
+ s[a].isDataTexture ? r.push(Wr(s[a].image)) : r.push(Wr(s[a]));
} else
- n = Wn(s);
- i.url = n;
+ r = Wr(s);
+ i.url = r;
}
return t || (e.images[this.uuid] = i), i;
}
}
-function Wn(r) {
- return typeof HTMLImageElement < "u" && r instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && r instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && r instanceof ImageBitmap ? id.getDataURL(r) : r.data ? {
- data: Array.from(r.data),
- width: r.width,
- height: r.height,
- type: r.data.constructor.name
+function Wr(n) {
+ return typeof HTMLImageElement < "u" && n instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && n instanceof ImageBitmap ? id.getDataURL(n) : n.data ? {
+ data: Array.from(n.data),
+ width: n.width,
+ height: n.height,
+ type: n.data.constructor.name
} : (Se("Texture: Unable to serialize Texture."), {});
}
-let rd = 0;
-const jn = /* @__PURE__ */ new w();
+let nd = 0;
+const jr = /* @__PURE__ */ new w();
class Pt extends xs {
/**
* Constructs a new texture.
@@ -4036,26 +4104,26 @@ class Pt extends xs {
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
* @param {string} [colorSpace=NoColorSpace] - The color space.
*/
- constructor(e = Pt.DEFAULT_IMAGE, t = Pt.DEFAULT_MAPPING, i = ti, s = ti, n = Mt, a = wi, o = $t, l = vi, c = Pt.DEFAULT_ANISOTROPY, h = Qi) {
- super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: rd++ }), this.uuid = fi(), this.name = "", this.source = new Ho(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = i, this.wrapT = s, this.magFilter = n, this.minFilter = a, this.anisotropy = c, this.format = o, this.internalFormat = null, this.type = l, this.offset = new oe(0, 0), this.repeat = new oe(1, 1), this.center = new oe(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new Fe(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;
+ constructor(e = Pt.DEFAULT_IMAGE, t = Pt.DEFAULT_MAPPING, i = ii, s = ii, r = Mt, a = wi, o = Jt, l = _i, c = Pt.DEFAULT_ANISOTROPY, h = Qi) {
+ super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: nd++ }), this.uuid = gi(), this.name = "", this.source = new Ho(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = i, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = c, this.format = o, this.internalFormat = null, this.type = l, this.offset = new oe(0, 0), this.repeat = new oe(1, 1), this.center = new oe(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ke(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;
}
/**
* The width of the texture in pixels.
*/
get width() {
- return this.source.getSize(jn).x;
+ return this.source.getSize(jr).x;
}
/**
* The height of the texture in pixels.
*/
get height() {
- return this.source.getSize(jn).y;
+ return this.source.getSize(jr).y;
}
/**
* The depth of the texture in pixels.
*/
get depth() {
- return this.source.getSize(jn).z;
+ return this.source.getSize(jr).z;
}
/**
* The image object holding the texture data.
@@ -4189,10 +4257,10 @@ class Pt extends xs {
case Ri:
e.x = e.x - Math.floor(e.x);
break;
- case ti:
+ case ii:
e.x = e.x < 0 ? 0 : 1;
break;
- case En:
+ case Er:
Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x);
break;
}
@@ -4201,10 +4269,10 @@ class Pt extends xs {
case Ri:
e.y = e.y - Math.floor(e.y);
break;
- case ti:
+ case ii:
e.y = e.y < 0 ? 0 : 1;
break;
- case En:
+ case Er:
Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y);
break;
}
@@ -4237,7 +4305,7 @@ class Pt extends xs {
Pt.DEFAULT_IMAGE = null;
Pt.DEFAULT_MAPPING = Qc;
Pt.DEFAULT_ANISOTROPY = 1;
-class Je {
+class Qe {
/**
* Constructs a new 4D vector.
*
@@ -4247,7 +4315,7 @@ class Je {
* @param {number} [w=1] - The w value of this vector.
*/
constructor(e = 0, t = 0, i = 0, s = 1) {
- Je.prototype.isVector4 = !0, this.x = e, this.y = t, this.z = i, this.w = s;
+ Qe.prototype.isVector4 = !0, this.x = e, this.y = t, this.z = i, this.w = s;
}
/**
* Alias for {@link Vector4#z}.
@@ -4484,8 +4552,8 @@ class Je {
* @return {Vector4} A reference to this vector.
*/
applyMatrix4(e) {
- const t = this.x, i = this.y, s = this.z, n = this.w, a = e.elements;
- return this.x = a[0] * t + a[4] * i + a[8] * s + a[12] * n, this.y = a[1] * t + a[5] * i + a[9] * s + a[13] * n, this.z = a[2] * t + a[6] * i + a[10] * s + a[14] * n, this.w = a[3] * t + a[7] * i + a[11] * s + a[15] * n, this;
+ const t = this.x, i = this.y, s = this.z, r = this.w, a = e.elements;
+ return this.x = a[0] * t + a[4] * i + a[8] * s + a[12] * r, this.y = a[1] * t + a[5] * i + a[9] * s + a[13] * r, this.z = a[2] * t + a[6] * i + a[10] * s + a[14] * r, this.w = a[3] * t + a[7] * i + a[11] * s + a[15] * r, this;
}
/**
* Divides this instance by the given vector.
@@ -4525,14 +4593,14 @@ class Je {
* @return {Vector4} A reference to this vector.
*/
setAxisAngleFromRotationMatrix(e) {
- let t, i, s, n;
+ let t, i, s, r;
const a = e.elements, o = a[0], l = a[4], c = a[8], h = a[1], u = a[5], d = a[9], m = a[2], g = a[6], v = a[10];
if (Math.abs(l - h) < 0.01 && Math.abs(c - m) < 0.01 && Math.abs(d - g) < 0.01) {
if (Math.abs(l + h) < 0.1 && Math.abs(c + m) < 0.1 && Math.abs(d + g) < 0.1 && Math.abs(o + u + v - 3) < 0.1)
return this.set(1, 0, 0, 0), this;
t = Math.PI;
- const p = (o + 1) / 2, y = (u + 1) / 2, _ = (v + 1) / 2, E = (l + h) / 4, R = (c + m) / 4, T = (d + g) / 4;
- return p > y && p > _ ? p < 0.01 ? (i = 0, s = 0.707106781, n = 0.707106781) : (i = Math.sqrt(p), s = E / i, n = R / i) : y > _ ? y < 0.01 ? (i = 0.707106781, s = 0, n = 0.707106781) : (s = Math.sqrt(y), i = E / s, n = T / s) : _ < 0.01 ? (i = 0.707106781, s = 0.707106781, n = 0) : (n = Math.sqrt(_), i = R / n, s = T / n), this.set(i, s, n, t), this;
+ const p = (o + 1) / 2, b = (u + 1) / 2, _ = (v + 1) / 2, E = (l + h) / 4, R = (c + m) / 4, T = (d + g) / 4;
+ return p > b && p > _ ? p < 0.01 ? (i = 0, s = 0.707106781, r = 0.707106781) : (i = Math.sqrt(p), s = E / i, r = R / i) : b > _ ? b < 0.01 ? (i = 0.707106781, s = 0, r = 0.707106781) : (s = Math.sqrt(b), i = E / s, r = T / s) : _ < 0.01 ? (i = 0.707106781, s = 0.707106781, r = 0) : (r = Math.sqrt(_), i = R / r, s = T / r), this.set(i, s, r, t), this;
}
let f = Math.sqrt((g - d) * (g - d) + (c - m) * (c - m) + (h - l) * (h - l));
return Math.abs(f) < 1e-3 && (f = 1), this.x = (g - d) / f, this.y = (c - m) / f, this.z = (h - l) / f, this.w = Math.acos((o + u + v - 1) / 2), this;
@@ -4782,7 +4850,7 @@ class Je {
yield this.x, yield this.y, yield this.z, yield this.w;
}
}
-class nd extends xs {
+class rd extends xs {
/**
* Render target options.
*
@@ -4828,12 +4896,12 @@ class nd extends xs {
count: 1,
depth: 1,
multiview: !1
- }, i), this.isRenderTarget = !0, this.width = e, this.height = t, this.depth = i.depth, this.scissor = new Je(0, 0, e, t), this.scissorTest = !1, this.viewport = new Je(0, 0, e, t);
- const s = { width: e, height: t, depth: i.depth }, n = new Pt(s);
+ }, i), this.isRenderTarget = !0, this.width = e, this.height = t, this.depth = i.depth, this.scissor = new Qe(0, 0, e, t), this.scissorTest = !1, this.viewport = new Qe(0, 0, e, t);
+ const s = { width: e, height: t, depth: i.depth }, r = new Pt(s);
this.textures = [];
const a = i.count;
for (let o = 0; o < a; o++)
- this.textures[o] = n.clone(), this.textures[o].isRenderTargetTexture = !0, this.textures[o].renderTarget = this;
+ this.textures[o] = r.clone(), this.textures[o].isRenderTargetTexture = !0, this.textures[o].renderTarget = this;
this._setTextureOptions(i), this.depthBuffer = i.depthBuffer, this.stencilBuffer = i.stencilBuffer, this.resolveDepthBuffer = i.resolveDepthBuffer, this.resolveStencilBuffer = i.resolveStencilBuffer, this._depthTexture = null, this.depthTexture = i.depthTexture, this.samples = i.samples, this.multiview = i.multiview;
}
_setTextureOptions(e = {}) {
@@ -4882,7 +4950,7 @@ class nd extends xs {
setSize(e, t, i = 1) {
if (this.width !== e || this.height !== t || this.depth !== i) {
this.width = e, this.height = t, this.depth = i;
- for (let s = 0, n = this.textures.length; s < n; s++)
+ for (let s = 0, r = this.textures.length; s < r; s++)
this.textures[s].image.width = e, this.textures[s].image.height = t, this.textures[s].image.depth = i, this.textures[s].isData3DTexture !== !0 && (this.textures[s].isArrayTexture = this.textures[s].image.depth > 1);
this.dispose();
}
@@ -4923,7 +4991,7 @@ class nd extends xs {
this.dispatchEvent({ type: "dispose" });
}
}
-class bt extends nd {
+class yt extends rd {
/**
* Constructs a new 3D render target.
*
@@ -4945,7 +5013,7 @@ class uh extends Pt {
* @param {number} [depth=1] - The depth of the texture.
*/
constructor(e = null, t = 1, i = 1, s = 1) {
- super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: i, depth: s }, this.magFilter = Ut, this.minFilter = Ut, this.wrapR = ti, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
+ super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: i, depth: s }, this.magFilter = Nt, this.minFilter = Nt, this.wrapR = ii, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
}
/**
* Describes that a specific layer of the texture needs to be updated.
@@ -4976,7 +5044,7 @@ class ad extends Pt {
* @param {number} [depth=1] - The depth of the texture.
*/
constructor(e = null, t = 1, i = 1, s = 1) {
- super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: i, depth: s }, this.magFilter = Ut, this.minFilter = Ut, this.wrapR = ti, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
+ super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: i, depth: s }, this.magFilter = Nt, this.minFilter = Nt, this.wrapR = ii, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
}
}
class Lt {
@@ -5010,7 +5078,7 @@ class Lt {
setFromArray(e) {
this.makeEmpty();
for (let t = 0, i = e.length; t < i; t += 3)
- this.expandByPoint(oi.fromArray(e, t));
+ this.expandByPoint(li.fromArray(e, t));
return this;
}
/**
@@ -5023,7 +5091,7 @@ class Lt {
setFromBufferAttribute(e) {
this.makeEmpty();
for (let t = 0, i = e.count; t < i; t++)
- this.expandByPoint(oi.fromBufferAttribute(e, t));
+ this.expandByPoint(li.fromBufferAttribute(e, t));
return this;
}
/**
@@ -5048,7 +5116,7 @@ class Lt {
* @return {Box3} A reference to this bounding box.
*/
setFromCenterAndSize(e, t) {
- const i = oi.copy(t).multiplyScalar(0.5);
+ const i = li.copy(t).multiplyScalar(0.5);
return this.min.copy(e).sub(i), this.max.copy(e).add(i), this;
}
/**
@@ -5164,16 +5232,16 @@ class Lt {
e.updateWorldMatrix(!1, !1);
const i = e.geometry;
if (i !== void 0) {
- const n = i.getAttribute("position");
- if (t === !0 && n !== void 0 && e.isInstancedMesh !== !0)
- for (let a = 0, o = n.count; a < o; a++)
- e.isMesh === !0 ? e.getVertexPosition(a, oi) : oi.fromBufferAttribute(n, a), oi.applyMatrix4(e.matrixWorld), this.expandByPoint(oi);
+ const r = i.getAttribute("position");
+ if (t === !0 && r !== void 0 && e.isInstancedMesh !== !0)
+ for (let a = 0, o = r.count; a < o; a++)
+ e.isMesh === !0 ? e.getVertexPosition(a, li) : li.fromBufferAttribute(r, a), li.applyMatrix4(e.matrixWorld), this.expandByPoint(li);
else
- e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), Fr.copy(e.boundingBox)) : (i.boundingBox === null && i.computeBoundingBox(), Fr.copy(i.boundingBox)), Fr.applyMatrix4(e.matrixWorld), this.union(Fr);
+ e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), Fn.copy(e.boundingBox)) : (i.boundingBox === null && i.computeBoundingBox(), Fn.copy(i.boundingBox)), Fn.applyMatrix4(e.matrixWorld), this.union(Fn);
}
const s = e.children;
- for (let n = 0, a = s.length; n < a; n++)
- this.expandByObject(s[n], t);
+ for (let r = 0, a = s.length; r < a; r++)
+ this.expandByObject(s[r], t);
return this;
}
/**
@@ -5225,7 +5293,7 @@ class Lt {
* @return {boolean} Whether the given bounding sphere intersects with this bounding box.
*/
intersectsSphere(e) {
- return this.clampPoint(e.center, oi), oi.distanceToSquared(e.center) <= e.radius * e.radius;
+ return this.clampPoint(e.center, li), li.distanceToSquared(e.center) <= e.radius * e.radius;
}
/**
* Returns `true` if the given plane intersects with this bounding box.
@@ -5246,7 +5314,7 @@ class Lt {
intersectsTriangle(e) {
if (this.isEmpty())
return !1;
- this.getCenter(lr), kr.subVectors(this.max, lr), Ss.subVectors(e.a, lr), Ts.subVectors(e.b, lr), Es.subVectors(e.c, lr), Xi.subVectors(Ts, Ss), qi.subVectors(Es, Ts), ls.subVectors(Ss, Es);
+ this.getCenter(cn), zn.subVectors(this.max, cn), Ss.subVectors(e.a, cn), Ts.subVectors(e.b, cn), Es.subVectors(e.c, cn), Xi.subVectors(Ts, Ss), qi.subVectors(Es, Ts), ls.subVectors(Ss, Es);
let t = [
0,
-Xi.z,
@@ -5276,7 +5344,7 @@ class Lt {
ls.x,
0
];
- return !Xn(t, Ss, Ts, Es, kr) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Xn(t, Ss, Ts, Es, kr)) ? !1 : (zr.crossVectors(Xi, qi), t = [zr.x, zr.y, zr.z], Xn(t, Ss, Ts, Es, kr));
+ return !Xr(t, Ss, Ts, Es, zn) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Xr(t, Ss, Ts, Es, zn)) ? !1 : (Hn.crossVectors(Xi, qi), t = [Hn.x, Hn.y, Hn.z], Xr(t, Ss, Ts, Es, zn));
}
/**
* Clamps the given point within the bounds of this box.
@@ -5296,7 +5364,7 @@ class Lt {
* @return {number} The euclidean distance.
*/
distanceToPoint(e) {
- return this.clampPoint(e, oi).distanceTo(e);
+ return this.clampPoint(e, li).distanceTo(e);
}
/**
* Returns a bounding sphere that encloses this bounding box.
@@ -5305,7 +5373,7 @@ class Lt {
* @return {Sphere} The bounding sphere that encloses this bounding box.
*/
getBoundingSphere(e) {
- return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(oi).length() * 0.5), e;
+ return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(li).length() * 0.5), e;
}
/**
* Computes the intersection of this bounding box and the given one, setting the upper
@@ -5388,17 +5456,17 @@ const Ui = [
/* @__PURE__ */ new w(),
/* @__PURE__ */ new w(),
/* @__PURE__ */ new w()
-], oi = /* @__PURE__ */ new w(), Fr = /* @__PURE__ */ new Lt(), Ss = /* @__PURE__ */ new w(), Ts = /* @__PURE__ */ new w(), Es = /* @__PURE__ */ new w(), Xi = /* @__PURE__ */ new w(), qi = /* @__PURE__ */ new w(), ls = /* @__PURE__ */ new w(), lr = /* @__PURE__ */ new w(), kr = /* @__PURE__ */ new w(), zr = /* @__PURE__ */ new w(), cs = /* @__PURE__ */ new w();
-function Xn(r, e, t, i, s) {
- for (let n = 0, a = r.length - 3; n <= a; n += 3) {
- cs.fromArray(r, n);
+], li = /* @__PURE__ */ new w(), Fn = /* @__PURE__ */ new Lt(), Ss = /* @__PURE__ */ new w(), Ts = /* @__PURE__ */ new w(), Es = /* @__PURE__ */ new w(), Xi = /* @__PURE__ */ new w(), qi = /* @__PURE__ */ new w(), ls = /* @__PURE__ */ new w(), cn = /* @__PURE__ */ new w(), zn = /* @__PURE__ */ new w(), Hn = /* @__PURE__ */ new w(), cs = /* @__PURE__ */ new w();
+function Xr(n, e, t, i, s) {
+ for (let r = 0, a = n.length - 3; r <= a; r += 3) {
+ cs.fromArray(n, r);
const o = s.x * Math.abs(cs.x) + s.y * Math.abs(cs.y) + s.z * Math.abs(cs.z), l = e.dot(cs), c = t.dot(cs), h = i.dot(cs);
if (Math.max(-Math.max(l, c, h), Math.min(l, c, h)) > o)
return !1;
}
return !0;
}
-const od = /* @__PURE__ */ new Lt(), cr = /* @__PURE__ */ new w(), qn = /* @__PURE__ */ new w();
+const od = /* @__PURE__ */ new Lt(), hn = /* @__PURE__ */ new w(), qr = /* @__PURE__ */ new w();
class Li {
/**
* Constructs a new sphere.
@@ -5433,8 +5501,8 @@ class Li {
const i = this.center;
t !== void 0 ? i.copy(t) : od.setFromPoints(e).getCenter(i);
let s = 0;
- for (let n = 0, a = e.length; n < a; n++)
- s = Math.max(s, i.distanceToSquared(e[n]));
+ for (let r = 0, a = e.length; r < a; r++)
+ s = Math.max(s, i.distanceToSquared(e[r]));
return this.radius = Math.sqrt(s), this;
}
/**
@@ -5563,11 +5631,11 @@ class Li {
expandByPoint(e) {
if (this.isEmpty())
return this.center.copy(e), this.radius = 0, this;
- cr.subVectors(e, this.center);
- const t = cr.lengthSq();
+ hn.subVectors(e, this.center);
+ const t = hn.lengthSq();
if (t > this.radius * this.radius) {
const i = Math.sqrt(t), s = (i - this.radius) * 0.5;
- this.center.addScaledVector(cr, s / i), this.radius += s;
+ this.center.addScaledVector(hn, s / i), this.radius += s;
}
return this;
}
@@ -5578,7 +5646,7 @@ class Li {
* @return {Sphere} A reference to this sphere.
*/
union(e) {
- return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (qn.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(cr.copy(e.center).add(qn)), this.expandByPoint(cr.copy(e.center).sub(qn))), this);
+ return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (qr.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(hn.copy(e.center).add(qr)), this.expandByPoint(hn.copy(e.center).sub(qr))), this);
}
/**
* Returns `true` if this sphere is equal with the given one.
@@ -5618,8 +5686,8 @@ class Li {
return this.radius = e.radius, this.center.fromArray(e.center), this;
}
}
-const Ni = /* @__PURE__ */ new w(), Yn = /* @__PURE__ */ new w(), Hr = /* @__PURE__ */ new w(), Yi = /* @__PURE__ */ new w(), Kn = /* @__PURE__ */ new w(), Vr = /* @__PURE__ */ new w(), Zn = /* @__PURE__ */ new w();
-class ir {
+const Ni = /* @__PURE__ */ new w(), Yr = /* @__PURE__ */ new w(), Vn = /* @__PURE__ */ new w(), Yi = /* @__PURE__ */ new w(), Kr = /* @__PURE__ */ new w(), Gn = /* @__PURE__ */ new w(), Zr = /* @__PURE__ */ new w();
+class sn {
/**
* Constructs a new ray.
*
@@ -5717,24 +5785,24 @@ class ir {
* @return {number} The squared distance.
*/
distanceSqToSegment(e, t, i, s) {
- Yn.copy(e).add(t).multiplyScalar(0.5), Hr.copy(t).sub(e).normalize(), Yi.copy(this.origin).sub(Yn);
- const n = e.distanceTo(t) * 0.5, a = -this.direction.dot(Hr), o = Yi.dot(this.direction), l = -Yi.dot(Hr), c = Yi.lengthSq(), h = Math.abs(1 - a * a);
+ Yr.copy(e).add(t).multiplyScalar(0.5), Vn.copy(t).sub(e).normalize(), Yi.copy(this.origin).sub(Yr);
+ const r = e.distanceTo(t) * 0.5, a = -this.direction.dot(Vn), o = Yi.dot(this.direction), l = -Yi.dot(Vn), c = Yi.lengthSq(), h = Math.abs(1 - a * a);
let u, d, m, g;
if (h > 0)
- if (u = a * l - o, d = a * o - l, g = n * h, u >= 0)
+ if (u = a * l - o, d = a * o - l, g = r * h, u >= 0)
if (d >= -g)
if (d <= g) {
const v = 1 / h;
u *= v, d *= v, m = u * (u + a * d + 2 * o) + d * (a * u + d + 2 * l) + c;
} else
- d = n, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
+ d = r, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
else
- d = -n, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
+ d = -r, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
else
- d <= -g ? (u = Math.max(0, -(-a * n + o)), d = u > 0 ? -n : Math.min(Math.max(-n, -l), n), m = -u * u + d * (d + 2 * l) + c) : d <= g ? (u = 0, d = Math.min(Math.max(-n, -l), n), m = d * (d + 2 * l) + c) : (u = Math.max(0, -(a * n + o)), d = u > 0 ? n : Math.min(Math.max(-n, -l), n), m = -u * u + d * (d + 2 * l) + c);
+ d <= -g ? (u = Math.max(0, -(-a * r + o)), d = u > 0 ? -r : Math.min(Math.max(-r, -l), r), m = -u * u + d * (d + 2 * l) + c) : d <= g ? (u = 0, d = Math.min(Math.max(-r, -l), r), m = d * (d + 2 * l) + c) : (u = Math.max(0, -(a * r + o)), d = u > 0 ? r : Math.min(Math.max(-r, -l), r), m = -u * u + d * (d + 2 * l) + c);
else
- d = a > 0 ? -n : n, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
- return i && i.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(Yn).addScaledVector(Hr, d), m;
+ d = a > 0 ? -r : r, u = Math.max(0, -(a * d + o)), m = -u * u + d * (d + 2 * l) + c;
+ return i && i.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(Yr).addScaledVector(Vn, d), m;
}
/**
* Intersects this ray with the given sphere, returning the intersection
@@ -5746,9 +5814,9 @@ class ir {
*/
intersectSphere(e, t) {
Ni.subVectors(e.center, this.origin);
- const i = Ni.dot(this.direction), s = Ni.dot(Ni) - i * i, n = e.radius * e.radius;
- if (s > n) return null;
- const a = Math.sqrt(n - s), o = i - a, l = i + a;
+ const i = Ni.dot(this.direction), s = Ni.dot(Ni) - i * i, r = e.radius * e.radius;
+ if (s > r) return null;
+ const a = Math.sqrt(r - s), o = i - a, l = i + a;
return l < 0 ? null : o < 0 ? this.at(l, t) : this.at(o, t);
}
/**
@@ -5805,9 +5873,9 @@ class ir {
* @return {?Vector3} The intersection point.
*/
intersectBox(e, t) {
- let i, s, n, a, o, l;
+ let i, s, r, a, o, l;
const c = 1 / this.direction.x, h = 1 / this.direction.y, u = 1 / this.direction.z, d = this.origin;
- return c >= 0 ? (i = (e.min.x - d.x) * c, s = (e.max.x - d.x) * c) : (i = (e.max.x - d.x) * c, s = (e.min.x - d.x) * c), h >= 0 ? (n = (e.min.y - d.y) * h, a = (e.max.y - d.y) * h) : (n = (e.max.y - d.y) * h, a = (e.min.y - d.y) * h), i > a || n > s || ((n > i || isNaN(i)) && (i = n), (a < s || isNaN(s)) && (s = a), u >= 0 ? (o = (e.min.z - d.z) * u, l = (e.max.z - d.z) * u) : (o = (e.max.z - d.z) * u, l = (e.min.z - d.z) * u), i > l || o > s) || ((o > i || i !== i) && (i = o), (l < s || s !== s) && (s = l), s < 0) ? null : this.at(i >= 0 ? i : s, t);
+ return c >= 0 ? (i = (e.min.x - d.x) * c, s = (e.max.x - d.x) * c) : (i = (e.max.x - d.x) * c, s = (e.min.x - d.x) * c), h >= 0 ? (r = (e.min.y - d.y) * h, a = (e.max.y - d.y) * h) : (r = (e.max.y - d.y) * h, a = (e.min.y - d.y) * h), i > a || r > s || ((r > i || isNaN(i)) && (i = r), (a < s || isNaN(s)) && (s = a), u >= 0 ? (o = (e.min.z - d.z) * u, l = (e.max.z - d.z) * u) : (o = (e.max.z - d.z) * u, l = (e.min.z - d.z) * u), i > l || o > s) || ((o > i || i !== i) && (i = o), (l < s || s !== s) && (s = l), s < 0) ? null : this.at(i >= 0 ? i : s, t);
}
/**
* Returns `true` if this ray intersects with the given box.
@@ -5829,9 +5897,9 @@ class ir {
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {?Vector3} The intersection point.
*/
- intersectTriangle(e, t, i, s, n) {
- Kn.subVectors(t, e), Vr.subVectors(i, e), Zn.crossVectors(Kn, Vr);
- let a = this.direction.dot(Zn), o;
+ intersectTriangle(e, t, i, s, r) {
+ Kr.subVectors(t, e), Gn.subVectors(i, e), Zr.crossVectors(Kr, Gn);
+ let a = this.direction.dot(Zr), o;
if (a > 0) {
if (s) return null;
o = 1;
@@ -5840,14 +5908,14 @@ class ir {
else
return null;
Yi.subVectors(this.origin, e);
- const l = o * this.direction.dot(Vr.crossVectors(Yi, Vr));
+ const l = o * this.direction.dot(Gn.crossVectors(Yi, Gn));
if (l < 0)
return null;
- const c = o * this.direction.dot(Kn.cross(Yi));
+ const c = o * this.direction.dot(Kr.cross(Yi));
if (c < 0 || l + c > a)
return null;
- const h = -o * Yi.dot(Zn);
- return h < 0 ? null : this.at(h / a, n);
+ const h = -o * Yi.dot(Zr);
+ return h < 0 ? null : this.at(h / a, r);
}
/**
* Transforms this ray with the given 4x4 transformation matrix.
@@ -5899,7 +5967,7 @@ class Ne {
* @param {number} [n43] - 4-3 matrix element.
* @param {number} [n44] - 4-4 matrix element.
*/
- constructor(e, t, i, s, n, a, o, l, c, h, u, d, m, g, v, f) {
+ constructor(e, t, i, s, r, a, o, l, c, h, u, d, m, g, v, f) {
Ne.prototype.isMatrix4 = !0, this.elements = [
1,
0,
@@ -5917,7 +5985,7 @@ class Ne {
0,
0,
1
- ], e !== void 0 && this.set(e, t, i, s, n, a, o, l, c, h, u, d, m, g, v, f);
+ ], e !== void 0 && this.set(e, t, i, s, r, a, o, l, c, h, u, d, m, g, v, f);
}
/**
* Sets the elements of the matrix.The arguments are supposed to be
@@ -5941,9 +6009,9 @@ class Ne {
* @param {number} [n44] - 4-4 matrix element.
* @return {Matrix4} A reference to this matrix.
*/
- set(e, t, i, s, n, a, o, l, c, h, u, d, m, g, v, f) {
+ set(e, t, i, s, r, a, o, l, c, h, u, d, m, g, v, f) {
const p = this.elements;
- return p[0] = e, p[4] = t, p[8] = i, p[12] = s, p[1] = n, p[5] = a, p[9] = o, p[13] = l, p[2] = c, p[6] = h, p[10] = u, p[14] = d, p[3] = m, p[7] = g, p[11] = v, p[15] = f, this;
+ return p[0] = e, p[4] = t, p[8] = i, p[12] = s, p[1] = r, p[5] = a, p[9] = o, p[13] = l, p[2] = c, p[6] = h, p[10] = u, p[14] = d, p[3] = m, p[7] = g, p[11] = v, p[15] = f, this;
}
/**
* Sets this matrix to the 4x4 identity matrix.
@@ -6075,8 +6143,8 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
extractRotation(e) {
- const t = this.elements, i = e.elements, s = 1 / ws.setFromMatrixColumn(e, 0).length(), n = 1 / ws.setFromMatrixColumn(e, 1).length(), a = 1 / ws.setFromMatrixColumn(e, 2).length();
- return t[0] = i[0] * s, t[1] = i[1] * s, t[2] = i[2] * s, t[3] = 0, t[4] = i[4] * n, t[5] = i[5] * n, t[6] = i[6] * n, t[7] = 0, t[8] = i[8] * a, t[9] = i[9] * a, t[10] = i[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
+ const t = this.elements, i = e.elements, s = 1 / ws.setFromMatrixColumn(e, 0).length(), r = 1 / ws.setFromMatrixColumn(e, 1).length(), a = 1 / ws.setFromMatrixColumn(e, 2).length();
+ return t[0] = i[0] * s, t[1] = i[1] * s, t[2] = i[2] * s, t[3] = 0, t[4] = i[4] * r, t[5] = i[5] * r, t[6] = i[6] * r, t[7] = 0, t[8] = i[8] * a, t[9] = i[9] * a, t[10] = i[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
}
/**
* Sets the rotation component (the upper left 3x3 matrix) of this matrix to
@@ -6089,7 +6157,7 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
makeRotationFromEuler(e) {
- const t = this.elements, i = e.x, s = e.y, n = e.z, a = Math.cos(i), o = Math.sin(i), l = Math.cos(s), c = Math.sin(s), h = Math.cos(n), u = Math.sin(n);
+ const t = this.elements, i = e.x, s = e.y, r = e.z, a = Math.cos(i), o = Math.sin(i), l = Math.cos(s), c = Math.sin(s), h = Math.cos(r), u = Math.sin(r);
if (e.order === "XYZ") {
const d = a * h, m = a * u, g = o * h, v = o * u;
t[0] = l * h, t[4] = -l * u, t[8] = c, t[1] = m + g * c, t[5] = d - v * c, t[9] = -o * l, t[2] = v - d * c, t[6] = g + m * c, t[10] = a * l;
@@ -6133,7 +6201,7 @@ class Ne {
*/
lookAt(e, t, i) {
const s = this.elements;
- return Kt.subVectors(e, t), Kt.lengthSq() === 0 && (Kt.z = 1), Kt.normalize(), Ki.crossVectors(i, Kt), Ki.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Kt.x += 1e-4 : Kt.z += 1e-4, Kt.normalize(), Ki.crossVectors(i, Kt)), Ki.normalize(), Gr.crossVectors(Kt, Ki), s[0] = Ki.x, s[4] = Gr.x, s[8] = Kt.x, s[1] = Ki.y, s[5] = Gr.y, s[9] = Kt.y, s[2] = Ki.z, s[6] = Gr.z, s[10] = Kt.z, this;
+ return Zt.subVectors(e, t), Zt.lengthSq() === 0 && (Zt.z = 1), Zt.normalize(), Ki.crossVectors(i, Zt), Ki.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Zt.x += 1e-4 : Zt.z += 1e-4, Zt.normalize(), Ki.crossVectors(i, Zt)), Ki.normalize(), Wn.crossVectors(Zt, Ki), s[0] = Ki.x, s[4] = Wn.x, s[8] = Zt.x, s[1] = Ki.y, s[5] = Wn.y, s[9] = Zt.y, s[2] = Ki.z, s[6] = Wn.z, s[10] = Zt.z, this;
}
/**
* Post-multiplies this matrix by the given 4x4 matrix.
@@ -6162,8 +6230,8 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
multiplyMatrices(e, t) {
- const i = e.elements, s = t.elements, n = this.elements, a = i[0], o = i[4], l = i[8], c = i[12], h = i[1], u = i[5], d = i[9], m = i[13], g = i[2], v = i[6], f = i[10], p = i[14], y = i[3], _ = i[7], E = i[11], R = i[15], T = s[0], A = s[4], I = s[8], S = s[12], M = s[1], L = s[5], N = s[9], z = s[13], H = s[2], j = s[6], q = s[10], te = s[14], G = s[3], Z = s[7], re = s[11], Le = s[15];
- return n[0] = a * T + o * M + l * H + c * G, n[4] = a * A + o * L + l * j + c * Z, n[8] = a * I + o * N + l * q + c * re, n[12] = a * S + o * z + l * te + c * Le, n[1] = h * T + u * M + d * H + m * G, n[5] = h * A + u * L + d * j + m * Z, n[9] = h * I + u * N + d * q + m * re, n[13] = h * S + u * z + d * te + m * Le, n[2] = g * T + v * M + f * H + p * G, n[6] = g * A + v * L + f * j + p * Z, n[10] = g * I + v * N + f * q + p * re, n[14] = g * S + v * z + f * te + p * Le, n[3] = y * T + _ * M + E * H + R * G, n[7] = y * A + _ * L + E * j + R * Z, n[11] = y * I + _ * N + E * q + R * re, n[15] = y * S + _ * z + E * te + R * Le, this;
+ const i = e.elements, s = t.elements, r = this.elements, a = i[0], o = i[4], l = i[8], c = i[12], h = i[1], u = i[5], d = i[9], m = i[13], g = i[2], v = i[6], f = i[10], p = i[14], b = i[3], _ = i[7], E = i[11], R = i[15], T = s[0], A = s[4], I = s[8], S = s[12], M = s[1], L = s[5], N = s[9], z = s[13], H = s[2], j = s[6], q = s[10], te = s[14], G = s[3], Z = s[7], ne = s[11], Le = s[15];
+ return r[0] = a * T + o * M + l * H + c * G, r[4] = a * A + o * L + l * j + c * Z, r[8] = a * I + o * N + l * q + c * ne, r[12] = a * S + o * z + l * te + c * Le, r[1] = h * T + u * M + d * H + m * G, r[5] = h * A + u * L + d * j + m * Z, r[9] = h * I + u * N + d * q + m * ne, r[13] = h * S + u * z + d * te + m * Le, r[2] = g * T + v * M + f * H + p * G, r[6] = g * A + v * L + f * j + p * Z, r[10] = g * I + v * N + f * q + p * ne, r[14] = g * S + v * z + f * te + p * Le, r[3] = b * T + _ * M + E * H + R * G, r[7] = b * A + _ * L + E * j + R * Z, r[11] = b * I + _ * N + E * q + R * ne, r[15] = b * S + _ * z + E * te + R * Le, this;
}
/**
* Multiplies every component of the matrix by the given scalar.
@@ -6183,8 +6251,8 @@ class Ne {
* @return {number} The determinant.
*/
determinant() {
- const e = this.elements, t = e[0], i = e[4], s = e[8], n = e[12], a = e[1], o = e[5], l = e[9], c = e[13], h = e[2], u = e[6], d = e[10], m = e[14], g = e[3], v = e[7], f = e[11], p = e[15];
- return g * (+n * l * u - s * c * u - n * o * d + i * c * d + s * o * m - i * l * m) + v * (+t * l * m - t * c * d + n * a * d - s * a * m + s * c * h - n * l * h) + f * (+t * c * u - t * o * m - n * a * u + i * a * m + n * o * h - i * c * h) + p * (-s * o * h - t * l * u + t * o * d + s * a * u - i * a * d + i * l * h);
+ const e = this.elements, t = e[0], i = e[4], s = e[8], r = e[12], a = e[1], o = e[5], l = e[9], c = e[13], h = e[2], u = e[6], d = e[10], m = e[14], g = e[3], v = e[7], f = e[11], p = e[15];
+ return g * (+r * l * u - s * c * u - r * o * d + i * c * d + s * o * m - i * l * m) + v * (+t * l * m - t * c * d + r * a * d - s * a * m + s * c * h - r * l * h) + f * (+t * c * u - t * o * m - r * a * u + i * a * m + r * o * h - i * c * h) + p * (-s * o * h - t * l * u + t * o * d + s * a * u - i * a * d + i * l * h);
}
/**
* Transposes this matrix in place.
@@ -6217,10 +6285,10 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
invert() {
- const e = this.elements, t = e[0], i = e[1], s = e[2], n = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = e[9], d = e[10], m = e[11], g = e[12], v = e[13], f = e[14], p = e[15], y = u * f * c - v * d * c + v * l * m - o * f * m - u * l * p + o * d * p, _ = g * d * c - h * f * c - g * l * m + a * f * m + h * l * p - a * d * p, E = h * v * c - g * u * c + g * o * m - a * v * m - h * o * p + a * u * p, R = g * u * l - h * v * l - g * o * d + a * v * d + h * o * f - a * u * f, T = t * y + i * _ + s * E + n * R;
+ const e = this.elements, t = e[0], i = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = e[9], d = e[10], m = e[11], g = e[12], v = e[13], f = e[14], p = e[15], b = u * f * c - v * d * c + v * l * m - o * f * m - u * l * p + o * d * p, _ = g * d * c - h * f * c - g * l * m + a * f * m + h * l * p - a * d * p, E = h * v * c - g * u * c + g * o * m - a * v * m - h * o * p + a * u * p, R = g * u * l - h * v * l - g * o * d + a * v * d + h * o * f - a * u * f, T = t * b + i * _ + s * E + r * R;
if (T === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
const A = 1 / T;
- return e[0] = y * A, e[1] = (v * d * n - u * f * n - v * s * m + i * f * m + u * s * p - i * d * p) * A, e[2] = (o * f * n - v * l * n + v * s * c - i * f * c - o * s * p + i * l * p) * A, e[3] = (u * l * n - o * d * n - u * s * c + i * d * c + o * s * m - i * l * m) * A, e[4] = _ * A, e[5] = (h * f * n - g * d * n + g * s * m - t * f * m - h * s * p + t * d * p) * A, e[6] = (g * l * n - a * f * n - g * s * c + t * f * c + a * s * p - t * l * p) * A, e[7] = (a * d * n - h * l * n + h * s * c - t * d * c - a * s * m + t * l * m) * A, e[8] = E * A, e[9] = (g * u * n - h * v * n - g * i * m + t * v * m + h * i * p - t * u * p) * A, e[10] = (a * v * n - g * o * n + g * i * c - t * v * c - a * i * p + t * o * p) * A, e[11] = (h * o * n - a * u * n - h * i * c + t * u * c + a * i * m - t * o * m) * A, e[12] = R * A, e[13] = (h * v * s - g * u * s + g * i * d - t * v * d - h * i * f + t * u * f) * A, e[14] = (g * o * s - a * v * s - g * i * l + t * v * l + a * i * f - t * o * f) * A, e[15] = (a * u * s - h * o * s + h * i * l - t * u * l - a * i * d + t * o * d) * A, this;
+ return e[0] = b * A, e[1] = (v * d * r - u * f * r - v * s * m + i * f * m + u * s * p - i * d * p) * A, e[2] = (o * f * r - v * l * r + v * s * c - i * f * c - o * s * p + i * l * p) * A, e[3] = (u * l * r - o * d * r - u * s * c + i * d * c + o * s * m - i * l * m) * A, e[4] = _ * A, e[5] = (h * f * r - g * d * r + g * s * m - t * f * m - h * s * p + t * d * p) * A, e[6] = (g * l * r - a * f * r - g * s * c + t * f * c + a * s * p - t * l * p) * A, e[7] = (a * d * r - h * l * r + h * s * c - t * d * c - a * s * m + t * l * m) * A, e[8] = E * A, e[9] = (g * u * r - h * v * r - g * i * m + t * v * m + h * i * p - t * u * p) * A, e[10] = (a * v * r - g * o * r + g * i * c - t * v * c - a * i * p + t * o * p) * A, e[11] = (h * o * r - a * u * r - h * i * c + t * u * c + a * i * m - t * o * m) * A, e[12] = R * A, e[13] = (h * v * s - g * u * s + g * i * d - t * v * d - h * i * f + t * u * f) * A, e[14] = (g * o * s - a * v * s - g * i * l + t * v * l + a * i * f - t * o * f) * A, e[15] = (a * u * s - h * o * s + h * i * l - t * u * l - a * i * d + t * o * d) * A, this;
}
/**
* Multiplies the columns of this matrix by the given vector.
@@ -6229,8 +6297,8 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
scale(e) {
- const t = this.elements, i = e.x, s = e.y, n = e.z;
- return t[0] *= i, t[4] *= s, t[8] *= n, t[1] *= i, t[5] *= s, t[9] *= n, t[2] *= i, t[6] *= s, t[10] *= n, t[3] *= i, t[7] *= s, t[11] *= n, this;
+ const t = this.elements, i = e.x, s = e.y, r = e.z;
+ return t[0] *= i, t[4] *= s, t[8] *= r, t[1] *= i, t[5] *= s, t[9] *= r, t[2] *= i, t[6] *= s, t[10] *= r, t[3] *= i, t[7] *= s, t[11] *= r, this;
}
/**
* Gets the maximum scale value of the three axes.
@@ -6382,7 +6450,7 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
makeRotationAxis(e, t) {
- const i = Math.cos(t), s = Math.sin(t), n = 1 - i, a = e.x, o = e.y, l = e.z, c = n * a, h = n * o;
+ const i = Math.cos(t), s = Math.sin(t), r = 1 - i, a = e.x, o = e.y, l = e.z, c = r * a, h = r * o;
return this.set(
c * a + i,
c * o - s * l,
@@ -6394,7 +6462,7 @@ class Ne {
0,
c * l - s * o,
h * l + s * a,
- n * l * l + i,
+ r * l * l + i,
0,
0,
0,
@@ -6441,11 +6509,11 @@ class Ne {
* @param {number} zy - The amount to shear Z by Y.
* @return {Matrix4} A reference to this matrix.
*/
- makeShear(e, t, i, s, n, a) {
+ makeShear(e, t, i, s, r, a) {
return this.set(
1,
i,
- n,
+ r,
0,
e,
1,
@@ -6471,8 +6539,8 @@ class Ne {
* @return {Matrix4} A reference to this matrix.
*/
compose(e, t, i) {
- const s = this.elements, n = t._x, a = t._y, o = t._z, l = t._w, c = n + n, h = a + a, u = o + o, d = n * c, m = n * h, g = n * u, v = a * h, f = a * u, p = o * u, y = l * c, _ = l * h, E = l * u, R = i.x, T = i.y, A = i.z;
- return s[0] = (1 - (v + p)) * R, s[1] = (m + E) * R, s[2] = (g - _) * R, s[3] = 0, s[4] = (m - E) * T, s[5] = (1 - (d + p)) * T, s[6] = (f + y) * T, s[7] = 0, s[8] = (g + _) * A, s[9] = (f - y) * A, s[10] = (1 - (d + v)) * A, s[11] = 0, s[12] = e.x, s[13] = e.y, s[14] = e.z, s[15] = 1, this;
+ const s = this.elements, r = t._x, a = t._y, o = t._z, l = t._w, c = r + r, h = a + a, u = o + o, d = r * c, m = r * h, g = r * u, v = a * h, f = a * u, p = o * u, b = l * c, _ = l * h, E = l * u, R = i.x, T = i.y, A = i.z;
+ return s[0] = (1 - (v + p)) * R, s[1] = (m + E) * R, s[2] = (g - _) * R, s[3] = 0, s[4] = (m - E) * T, s[5] = (1 - (d + p)) * T, s[6] = (f + b) * T, s[7] = 0, s[8] = (g + _) * A, s[9] = (f - b) * A, s[10] = (1 - (d + v)) * A, s[11] = 0, s[12] = e.x, s[13] = e.y, s[14] = e.z, s[15] = 1, this;
}
/**
* Decomposes this matrix into its position, rotation and scale components
@@ -6489,11 +6557,11 @@ class Ne {
*/
decompose(e, t, i) {
const s = this.elements;
- let n = ws.set(s[0], s[1], s[2]).length();
+ let r = ws.set(s[0], s[1], s[2]).length();
const a = ws.set(s[4], s[5], s[6]).length(), o = ws.set(s[8], s[9], s[10]).length();
- this.determinant() < 0 && (n = -n), e.x = s[12], e.y = s[13], e.z = s[14], li.copy(this);
- const l = 1 / n, c = 1 / a, h = 1 / o;
- return li.elements[0] *= l, li.elements[1] *= l, li.elements[2] *= l, li.elements[4] *= c, li.elements[5] *= c, li.elements[6] *= c, li.elements[8] *= h, li.elements[9] *= h, li.elements[10] *= h, t.setFromRotationMatrix(li), i.x = n, i.y = a, i.z = o, this;
+ this.determinant() < 0 && (r = -r), e.x = s[12], e.y = s[13], e.z = s[14], ci.copy(this);
+ const l = 1 / r, c = 1 / a, h = 1 / o;
+ return ci.elements[0] *= l, ci.elements[1] *= l, ci.elements[2] *= l, ci.elements[4] *= c, ci.elements[5] *= c, ci.elements[6] *= c, ci.elements[8] *= h, ci.elements[9] *= h, ci.elements[10] *= h, t.setFromRotationMatrix(ci), i.x = r, i.y = a, i.z = o, this;
}
/**
* Creates a perspective projection matrix. This is used internally by
@@ -6509,15 +6577,15 @@ class Ne {
* @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
* @return {Matrix4} A reference to this matrix.
*/
- makePerspective(e, t, i, s, n, a, o = Ci, l = !1) {
- const c = this.elements, h = 2 * n / (t - e), u = 2 * n / (i - s), d = (t + e) / (t - e), m = (i + s) / (i - s);
+ makePerspective(e, t, i, s, r, a, o = Ci, l = !1) {
+ const c = this.elements, h = 2 * r / (t - e), u = 2 * r / (i - s), d = (t + e) / (t - e), m = (i + s) / (i - s);
let g, v;
if (l)
- g = n / (a - n), v = a * n / (a - n);
+ g = r / (a - r), v = a * r / (a - r);
else if (o === Ci)
- g = -(a + n) / (a - n), v = -2 * a * n / (a - n);
- else if (o === Cn)
- g = -a / (a - n), v = -a * n / (a - n);
+ g = -(a + r) / (a - r), v = -2 * a * r / (a - r);
+ else if (o === Cr)
+ g = -a / (a - r), v = -a * r / (a - r);
else
throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + o);
return c[0] = h, c[4] = 0, c[8] = d, c[12] = 0, c[1] = 0, c[5] = u, c[9] = m, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = g, c[14] = v, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;
@@ -6536,15 +6604,15 @@ class Ne {
* @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
* @return {Matrix4} A reference to this matrix.
*/
- makeOrthographic(e, t, i, s, n, a, o = Ci, l = !1) {
+ makeOrthographic(e, t, i, s, r, a, o = Ci, l = !1) {
const c = this.elements, h = 2 / (t - e), u = 2 / (i - s), d = -(t + e) / (t - e), m = -(i + s) / (i - s);
let g, v;
if (l)
- g = 1 / (a - n), v = a / (a - n);
+ g = 1 / (a - r), v = a / (a - r);
else if (o === Ci)
- g = -2 / (a - n), v = -(a + n) / (a - n);
- else if (o === Cn)
- g = -1 / (a - n), v = -n / (a - n);
+ g = -2 / (a - r), v = -(a + r) / (a - r);
+ else if (o === Cr)
+ g = -1 / (a - r), v = -r / (a - r);
else
throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + o);
return c[0] = h, c[4] = 0, c[8] = 0, c[12] = d, c[1] = 0, c[5] = u, c[9] = 0, c[13] = m, c[2] = 0, c[6] = 0, c[10] = g, c[14] = v, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this;
@@ -6586,8 +6654,8 @@ class Ne {
return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e[t + 9] = i[9], e[t + 10] = i[10], e[t + 11] = i[11], e[t + 12] = i[12], e[t + 13] = i[13], e[t + 14] = i[14], e[t + 15] = i[15], e;
}
}
-const ws = /* @__PURE__ */ new w(), li = /* @__PURE__ */ new Ne(), ld = /* @__PURE__ */ new w(0, 0, 0), cd = /* @__PURE__ */ new w(1, 1, 1), Ki = /* @__PURE__ */ new w(), Gr = /* @__PURE__ */ new w(), Kt = /* @__PURE__ */ new w(), Tl = /* @__PURE__ */ new Ne(), El = /* @__PURE__ */ new _i();
-class xi {
+const ws = /* @__PURE__ */ new w(), ci = /* @__PURE__ */ new Ne(), ld = /* @__PURE__ */ new w(0, 0, 0), cd = /* @__PURE__ */ new w(1, 1, 1), Ki = /* @__PURE__ */ new w(), Wn = /* @__PURE__ */ new w(), Zt = /* @__PURE__ */ new w(), Tl = /* @__PURE__ */ new Ne(), El = /* @__PURE__ */ new xi();
+class bi {
/**
* Constructs a new euler instance.
*
@@ -6596,7 +6664,7 @@ class xi {
* @param {number} [z=0] - The angle of the z axis in radians.
* @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.
*/
- constructor(e = 0, t = 0, i = 0, s = xi.DEFAULT_ORDER) {
+ constructor(e = 0, t = 0, i = 0, s = bi.DEFAULT_ORDER) {
this.isEuler = !0, this._x = e, this._y = t, this._z = i, this._order = s;
}
/**
@@ -6685,25 +6753,25 @@ class xi {
* @return {Euler} A reference to this Euler instance.
*/
setFromRotationMatrix(e, t = this._order, i = !0) {
- const s = e.elements, n = s[0], a = s[4], o = s[8], l = s[1], c = s[5], h = s[9], u = s[2], d = s[6], m = s[10];
+ const s = e.elements, r = s[0], a = s[4], o = s[8], l = s[1], c = s[5], h = s[9], u = s[2], d = s[6], m = s[10];
switch (t) {
case "XYZ":
- this._y = Math.asin(ze(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-h, m), this._z = Math.atan2(-a, n)) : (this._x = Math.atan2(d, c), this._z = 0);
+ this._y = Math.asin(ze(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-h, m), this._z = Math.atan2(-a, r)) : (this._x = Math.atan2(d, c), this._z = 0);
break;
case "YXZ":
- this._x = Math.asin(-ze(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(o, m), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, n), this._z = 0);
+ this._x = Math.asin(-ze(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(o, m), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, r), this._z = 0);
break;
case "ZXY":
- this._x = Math.asin(ze(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(-u, m), this._z = Math.atan2(-a, c)) : (this._y = 0, this._z = Math.atan2(l, n));
+ this._x = Math.asin(ze(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(-u, m), this._z = Math.atan2(-a, c)) : (this._y = 0, this._z = Math.atan2(l, r));
break;
case "ZYX":
- this._y = Math.asin(-ze(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(d, m), this._z = Math.atan2(l, n)) : (this._x = 0, this._z = Math.atan2(-a, c));
+ this._y = Math.asin(-ze(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(d, m), this._z = Math.atan2(l, r)) : (this._x = 0, this._z = Math.atan2(-a, c));
break;
case "YZX":
- this._z = Math.asin(ze(l, -1, 1)), Math.abs(l) < 0.9999999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, n)) : (this._x = 0, this._y = Math.atan2(o, m));
+ this._z = Math.asin(ze(l, -1, 1)), Math.abs(l) < 0.9999999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(o, m));
break;
case "XZY":
- this._z = Math.asin(-ze(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(o, n)) : (this._x = Math.atan2(-h, m), this._y = 0);
+ this._z = Math.asin(-ze(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(o, r)) : (this._x = Math.atan2(-h, m), this._y = 0);
break;
default:
Se("Euler: .setFromRotationMatrix() encountered an unknown order: " + t);
@@ -6784,7 +6852,7 @@ class xi {
yield this._x, yield this._y, yield this._z, yield this._order;
}
}
-xi.DEFAULT_ORDER = "XYZ";
+bi.DEFAULT_ORDER = "XYZ";
class Vo {
/**
* Constructs a new layers instance, with membership
@@ -6858,21 +6926,21 @@ class Vo {
}
}
let hd = 0;
-const wl = /* @__PURE__ */ new w(), Cs = /* @__PURE__ */ new _i(), Oi = /* @__PURE__ */ new Ne(), Wr = /* @__PURE__ */ new w(), hr = /* @__PURE__ */ new w(), ud = /* @__PURE__ */ new w(), dd = /* @__PURE__ */ new _i(), Cl = /* @__PURE__ */ new w(1, 0, 0), Al = /* @__PURE__ */ new w(0, 1, 0), Rl = /* @__PURE__ */ new w(0, 0, 1), Pl = { type: "added" }, pd = { type: "removed" }, As = { type: "childadded", child: null }, $n = { type: "childremoved", child: null };
+const wl = /* @__PURE__ */ new w(), Cs = /* @__PURE__ */ new xi(), Bi = /* @__PURE__ */ new Ne(), jn = /* @__PURE__ */ new w(), un = /* @__PURE__ */ new w(), ud = /* @__PURE__ */ new w(), dd = /* @__PURE__ */ new xi(), Cl = /* @__PURE__ */ new w(1, 0, 0), Al = /* @__PURE__ */ new w(0, 1, 0), Rl = /* @__PURE__ */ new w(0, 0, 1), Pl = { type: "added" }, pd = { type: "removed" }, As = { type: "childadded", child: null }, $r = { type: "childremoved", child: null };
class mt extends xs {
/**
* Constructs a new 3D object.
*/
constructor() {
- super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: hd++ }), this.uuid = fi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = mt.DEFAULT_UP.clone();
- const e = new w(), t = new xi(), i = new _i(), s = new w(1, 1, 1);
- function n() {
+ super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: hd++ }), this.uuid = gi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = mt.DEFAULT_UP.clone();
+ const e = new w(), t = new bi(), i = new xi(), s = new w(1, 1, 1);
+ function r() {
i.setFromEuler(t, !1);
}
function a() {
t.setFromQuaternion(i, void 0, !1);
}
- t._onChange(n), i._onChange(a), Object.defineProperties(this, {
+ t._onChange(r), i._onChange(a), Object.defineProperties(this, {
/**
* Represents the object's local position.
*
@@ -6936,7 +7004,7 @@ class mt extends xs {
* @type {Matrix3}
*/
normalMatrix: {
- value: new Fe()
+ value: new ke()
}
}), this.matrix = new Ne(), this.matrixWorld = new Ne(), this.matrixAutoUpdate = mt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = mt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Vo(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.userData = {};
}
@@ -7142,7 +7210,7 @@ class mt extends xs {
* @return {Vector3} The converted vector.
*/
worldToLocal(e) {
- return this.updateWorldMatrix(!0, !1), e.applyMatrix4(Oi.copy(this.matrixWorld).invert());
+ return this.updateWorldMatrix(!0, !1), e.applyMatrix4(Bi.copy(this.matrixWorld).invert());
}
/**
* Rotates the object to face a point in world space.
@@ -7154,9 +7222,9 @@ class mt extends xs {
* @param {number} [z] - The z coordinate in world space.
*/
lookAt(e, t, i) {
- e.isVector3 ? Wr.copy(e) : Wr.set(e, t, i);
+ e.isVector3 ? jn.copy(e) : jn.set(e, t, i);
const s = this.parent;
- this.updateWorldMatrix(!0, !1), hr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Oi.lookAt(hr, Wr, this.up) : Oi.lookAt(Wr, hr, this.up), this.quaternion.setFromRotationMatrix(Oi), s && (Oi.extractRotation(s.matrixWorld), Cs.setFromRotationMatrix(Oi), this.quaternion.premultiply(Cs.invert()));
+ this.updateWorldMatrix(!0, !1), un.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Bi.lookAt(un, jn, this.up) : Bi.lookAt(jn, un, this.up), this.quaternion.setFromRotationMatrix(Bi), s && (Bi.extractRotation(s.matrixWorld), Cs.setFromRotationMatrix(Bi), this.quaternion.premultiply(Cs.invert()));
}
/**
* Adds the given 3D object as a child to this 3D object. An arbitrary number of
@@ -7192,7 +7260,7 @@ class mt extends xs {
return this;
}
const t = this.children.indexOf(e);
- return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(pd), $n.child = e, this.dispatchEvent($n), $n.child = null), this;
+ return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(pd), $r.child = e, this.dispatchEvent($r), $r.child = null), this;
}
/**
* Removes this 3D object from its current parent.
@@ -7225,7 +7293,7 @@ class mt extends xs {
* @return {Object3D} A reference to this instance.
*/
attach(e) {
- return this.updateWorldMatrix(!0, !1), Oi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Oi.multiply(e.parent.matrixWorld)), e.applyMatrix4(Oi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Pl), As.child = e, this.dispatchEvent(As), As.child = null, this;
+ return this.updateWorldMatrix(!0, !1), Bi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Bi.multiply(e.parent.matrixWorld)), e.applyMatrix4(Bi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Pl), As.child = e, this.dispatchEvent(As), As.child = null, this;
}
/**
* Searches through the 3D object and its children, starting with the 3D object
@@ -7258,9 +7326,9 @@ class mt extends xs {
getObjectByProperty(e, t) {
if (this[e] === t) return this;
for (let i = 0, s = this.children.length; i < s; i++) {
- const n = this.children[i].getObjectByProperty(e, t);
- if (n !== void 0)
- return n;
+ const r = this.children[i].getObjectByProperty(e, t);
+ if (r !== void 0)
+ return r;
}
}
/**
@@ -7275,8 +7343,8 @@ class mt extends xs {
getObjectsByProperty(e, t, i = []) {
this[e] === t && i.push(this);
const s = this.children;
- for (let n = 0, a = s.length; n < a; n++)
- s[n].getObjectsByProperty(e, t, i);
+ for (let r = 0, a = s.length; r < a; r++)
+ s[r].getObjectsByProperty(e, t, i);
return i;
}
/**
@@ -7295,7 +7363,7 @@ class mt extends xs {
* @return {Quaternion} The 3D object's rotation in world space.
*/
getWorldQuaternion(e) {
- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(hr, e, ud), e;
+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(un, e, ud), e;
}
/**
* Returns a vector representing the scale of the 3D object in world space.
@@ -7304,7 +7372,7 @@ class mt extends xs {
* @return {Vector3} The 3D object's scale in world space.
*/
getWorldScale(e) {
- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(hr, dd, e), e;
+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(un, dd, e), e;
}
/**
* Returns a vector representing the ("look") direction of the 3D object in world space.
@@ -7402,8 +7470,8 @@ class mt extends xs {
const i = this.parent;
if (e === !0 && i !== null && i.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.matrixWorldAutoUpdate === !0 && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), t === !0) {
const s = this.children;
- for (let n = 0, a = s.length; n < a; n++)
- s[n].updateWorldMatrix(!1, !0);
+ for (let r = 0, a = s.length; r < a; r++)
+ s[r].updateWorldMatrix(!1, !0);
}
}
/**
@@ -7435,33 +7503,33 @@ class mt extends xs {
boundingBox: o.boundingBox ? o.boundingBox.toJSON() : void 0,
boundingSphere: o.boundingSphere ? o.boundingSphere.toJSON() : void 0
})), s.instanceInfo = this._instanceInfo.map((o) => ({ ...o })), s.availableInstanceIds = this._availableInstanceIds.slice(), s.availableGeometryIds = this._availableGeometryIds.slice(), s.nextIndexStart = this._nextIndexStart, s.nextVertexStart = this._nextVertexStart, s.geometryCount = this._geometryCount, s.maxInstanceCount = this._maxInstanceCount, s.maxVertexCount = this._maxVertexCount, s.maxIndexCount = this._maxIndexCount, s.geometryInitialized = this._geometryInitialized, s.matricesTexture = this._matricesTexture.toJSON(e), s.indirectTexture = this._indirectTexture.toJSON(e), this._colorsTexture !== null && (s.colorsTexture = this._colorsTexture.toJSON(e)), this.boundingSphere !== null && (s.boundingSphere = this.boundingSphere.toJSON()), this.boundingBox !== null && (s.boundingBox = this.boundingBox.toJSON()));
- function n(o, l) {
+ function r(o, l) {
return o[l.uuid] === void 0 && (o[l.uuid] = l.toJSON(e)), l.uuid;
}
if (this.isScene)
this.background && (this.background.isColor ? s.background = this.background.toJSON() : this.background.isTexture && (s.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== !0 && (s.environment = this.environment.toJSON(e).uuid);
else if (this.isMesh || this.isLine || this.isPoints) {
- s.geometry = n(e.geometries, this.geometry);
+ s.geometry = r(e.geometries, this.geometry);
const o = this.geometry.parameters;
if (o !== void 0 && o.shapes !== void 0) {
const l = o.shapes;
if (Array.isArray(l))
for (let c = 0, h = l.length; c < h; c++) {
const u = l[c];
- n(e.shapes, u);
+ r(e.shapes, u);
}
else
- n(e.shapes, l);
+ r(e.shapes, l);
}
}
- if (this.isSkinnedMesh && (s.bindMode = this.bindMode, s.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (n(e.skeletons, this.skeleton), s.skeleton = this.skeleton.uuid)), this.material !== void 0)
+ if (this.isSkinnedMesh && (s.bindMode = this.bindMode, s.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (r(e.skeletons, this.skeleton), s.skeleton = this.skeleton.uuid)), this.material !== void 0)
if (Array.isArray(this.material)) {
const o = [];
for (let l = 0, c = this.material.length; l < c; l++)
- o.push(n(e.materials, this.material[l]));
+ o.push(r(e.materials, this.material[l]));
s.material = o;
} else
- s.material = n(e.materials, this.material);
+ s.material = r(e.materials, this.material);
if (this.children.length > 0) {
s.children = [];
for (let o = 0; o < this.children.length; o++)
@@ -7471,7 +7539,7 @@ class mt extends xs {
s.animations = [];
for (let o = 0; o < this.animations.length; o++) {
const l = this.animations[o];
- s.animations.push(n(e.animations, l));
+ s.animations.push(r(e.animations, l));
}
}
if (t) {
@@ -7516,8 +7584,8 @@ class mt extends xs {
mt.DEFAULT_UP = /* @__PURE__ */ new w(0, 1, 0);
mt.DEFAULT_MATRIX_AUTO_UPDATE = !0;
mt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
-const ci = /* @__PURE__ */ new w(), Bi = /* @__PURE__ */ new w(), Jn = /* @__PURE__ */ new w(), Fi = /* @__PURE__ */ new w(), Rs = /* @__PURE__ */ new w(), Ps = /* @__PURE__ */ new w(), Ll = /* @__PURE__ */ new w(), Qn = /* @__PURE__ */ new w(), ea = /* @__PURE__ */ new w(), ta = /* @__PURE__ */ new w(), ia = /* @__PURE__ */ new Je(), sa = /* @__PURE__ */ new Je(), ra = /* @__PURE__ */ new Je();
-class pi {
+const hi = /* @__PURE__ */ new w(), Oi = /* @__PURE__ */ new w(), Jr = /* @__PURE__ */ new w(), ki = /* @__PURE__ */ new w(), Rs = /* @__PURE__ */ new w(), Ps = /* @__PURE__ */ new w(), Ll = /* @__PURE__ */ new w(), Qr = /* @__PURE__ */ new w(), ea = /* @__PURE__ */ new w(), ta = /* @__PURE__ */ new w(), ia = /* @__PURE__ */ new Qe(), sa = /* @__PURE__ */ new Qe(), na = /* @__PURE__ */ new Qe();
+class mi {
/**
* Constructs a new triangle.
*
@@ -7538,9 +7606,9 @@ class pi {
* @return {Vector3} The triangle's normal.
*/
static getNormal(e, t, i, s) {
- s.subVectors(i, t), ci.subVectors(e, t), s.cross(ci);
- const n = s.lengthSq();
- return n > 0 ? s.multiplyScalar(1 / Math.sqrt(n)) : s.set(0, 0, 0);
+ s.subVectors(i, t), hi.subVectors(e, t), s.cross(hi);
+ const r = s.lengthSq();
+ return r > 0 ? s.multiplyScalar(1 / Math.sqrt(r)) : s.set(0, 0, 0);
}
/**
* Computes a barycentric coordinates from the given vector.
@@ -7553,13 +7621,13 @@ class pi {
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {?Vector3} The barycentric coordinates for the given point
*/
- static getBarycoord(e, t, i, s, n) {
- ci.subVectors(s, t), Bi.subVectors(i, t), Jn.subVectors(e, t);
- const a = ci.dot(ci), o = ci.dot(Bi), l = ci.dot(Jn), c = Bi.dot(Bi), h = Bi.dot(Jn), u = a * c - o * o;
+ static getBarycoord(e, t, i, s, r) {
+ hi.subVectors(s, t), Oi.subVectors(i, t), Jr.subVectors(e, t);
+ const a = hi.dot(hi), o = hi.dot(Oi), l = hi.dot(Jr), c = Oi.dot(Oi), h = Oi.dot(Jr), u = a * c - o * o;
if (u === 0)
- return n.set(0, 0, 0), null;
+ return r.set(0, 0, 0), null;
const d = 1 / u, m = (c * l - o * h) * d, g = (a * h - o * l) * d;
- return n.set(1 - m - g, g, m);
+ return r.set(1 - m - g, g, m);
}
/**
* Returns `true` if the given point, when projected onto the plane of the
@@ -7573,7 +7641,7 @@ class pi {
* triangle, lies within the triangle or not.
*/
static containsPoint(e, t, i, s) {
- return this.getBarycoord(e, t, i, s, Fi) === null ? !1 : Fi.x >= 0 && Fi.y >= 0 && Fi.x + Fi.y <= 1;
+ return this.getBarycoord(e, t, i, s, ki) === null ? !1 : ki.x >= 0 && ki.y >= 0 && ki.x + ki.y <= 1;
}
/**
* Computes the value barycentrically interpolated for the given point on the
@@ -7589,8 +7657,8 @@ class pi {
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {?Vector3} The interpolated value.
*/
- static getInterpolation(e, t, i, s, n, a, o, l) {
- return this.getBarycoord(e, t, i, s, Fi) === null ? (l.x = 0, l.y = 0, "z" in l && (l.z = 0), "w" in l && (l.w = 0), null) : (l.setScalar(0), l.addScaledVector(n, Fi.x), l.addScaledVector(a, Fi.y), l.addScaledVector(o, Fi.z), l);
+ static getInterpolation(e, t, i, s, r, a, o, l) {
+ return this.getBarycoord(e, t, i, s, ki) === null ? (l.x = 0, l.y = 0, "z" in l && (l.z = 0), "w" in l && (l.w = 0), null) : (l.setScalar(0), l.addScaledVector(r, ki.x), l.addScaledVector(a, ki.y), l.addScaledVector(o, ki.z), l);
}
/**
* Computes the value barycentrically interpolated for the given attribute and indices.
@@ -7603,8 +7671,8 @@ class pi {
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {Vector3} The interpolated attribute value.
*/
- static getInterpolatedAttribute(e, t, i, s, n, a) {
- return ia.setScalar(0), sa.setScalar(0), ra.setScalar(0), ia.fromBufferAttribute(e, t), sa.fromBufferAttribute(e, i), ra.fromBufferAttribute(e, s), a.setScalar(0), a.addScaledVector(ia, n.x), a.addScaledVector(sa, n.y), a.addScaledVector(ra, n.z), a;
+ static getInterpolatedAttribute(e, t, i, s, r, a) {
+ return ia.setScalar(0), sa.setScalar(0), na.setScalar(0), ia.fromBufferAttribute(e, t), sa.fromBufferAttribute(e, i), na.fromBufferAttribute(e, s), a.setScalar(0), a.addScaledVector(ia, r.x), a.addScaledVector(sa, r.y), a.addScaledVector(na, r.z), a;
}
/**
* Returns `true` if the triangle is oriented towards the given direction.
@@ -7616,7 +7684,7 @@ class pi {
* @return {boolean} Whether the triangle is oriented towards the given direction or not.
*/
static isFrontFacing(e, t, i, s) {
- return ci.subVectors(i, t), Bi.subVectors(e, t), ci.cross(Bi).dot(s) < 0;
+ return hi.subVectors(i, t), Oi.subVectors(e, t), hi.cross(Oi).dot(s) < 0;
}
/**
* Sets the triangle's vertices by copying the given values.
@@ -7676,7 +7744,7 @@ class pi {
* @return {number} The triangle's area.
*/
getArea() {
- return ci.subVectors(this.c, this.b), Bi.subVectors(this.a, this.b), ci.cross(Bi).length() * 0.5;
+ return hi.subVectors(this.c, this.b), Oi.subVectors(this.a, this.b), hi.cross(Oi).length() * 0.5;
}
/**
* Computes the midpoint of the triangle.
@@ -7694,7 +7762,7 @@ class pi {
* @return {Vector3} The triangle's normal.
*/
getNormal(e) {
- return pi.getNormal(this.a, this.b, this.c, e);
+ return mi.getNormal(this.a, this.b, this.c, e);
}
/**
* Computes a plane the triangle lies within.
@@ -7714,7 +7782,7 @@ class pi {
* @return {?Vector3} The barycentric coordinates for the given point
*/
getBarycoord(e, t) {
- return pi.getBarycoord(e, this.a, this.b, this.c, t);
+ return mi.getBarycoord(e, this.a, this.b, this.c, t);
}
/**
* Computes the value barycentrically interpolated for the given point on the
@@ -7727,8 +7795,8 @@ class pi {
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {?Vector3} The interpolated value.
*/
- getInterpolation(e, t, i, s, n) {
- return pi.getInterpolation(e, this.a, this.b, this.c, t, i, s, n);
+ getInterpolation(e, t, i, s, r) {
+ return mi.getInterpolation(e, this.a, this.b, this.c, t, i, s, r);
}
/**
* Returns `true` if the given point, when projected onto the plane of the
@@ -7739,7 +7807,7 @@ class pi {
* triangle, lies within the triangle or not.
*/
containsPoint(e) {
- return pi.containsPoint(e, this.a, this.b, this.c);
+ return mi.containsPoint(e, this.a, this.b, this.c);
}
/**
* Returns `true` if the triangle is oriented towards the given direction.
@@ -7748,7 +7816,7 @@ class pi {
* @return {boolean} Whether the triangle is oriented towards the given direction or not.
*/
isFrontFacing(e) {
- return pi.isFrontFacing(this.a, this.b, this.c, e);
+ return mi.isFrontFacing(this.a, this.b, this.c, e);
}
/**
* Returns `true` if this triangle intersects with the given box.
@@ -7767,10 +7835,10 @@ class pi {
* @return {Vector3} The closest point on the triangle.
*/
closestPointToPoint(e, t) {
- const i = this.a, s = this.b, n = this.c;
+ const i = this.a, s = this.b, r = this.c;
let a, o;
- Rs.subVectors(s, i), Ps.subVectors(n, i), Qn.subVectors(e, i);
- const l = Rs.dot(Qn), c = Ps.dot(Qn);
+ Rs.subVectors(s, i), Ps.subVectors(r, i), Qr.subVectors(e, i);
+ const l = Rs.dot(Qr), c = Ps.dot(Qr);
if (l <= 0 && c <= 0)
return t.copy(i);
ea.subVectors(e, s);
@@ -7780,16 +7848,16 @@ class pi {
const d = l * u - h * c;
if (d <= 0 && l >= 0 && h <= 0)
return a = l / (l - h), t.copy(i).addScaledVector(Rs, a);
- ta.subVectors(e, n);
+ ta.subVectors(e, r);
const m = Rs.dot(ta), g = Ps.dot(ta);
if (g >= 0 && m <= g)
- return t.copy(n);
+ return t.copy(r);
const v = m * c - l * g;
if (v <= 0 && c >= 0 && g <= 0)
return o = c / (c - g), t.copy(i).addScaledVector(Ps, o);
const f = h * g - m * u;
if (f <= 0 && u - h >= 0 && m - g >= 0)
- return Ll.subVectors(n, s), o = (u - h) / (u - h + (m - g)), t.copy(s).addScaledVector(Ll, o);
+ return Ll.subVectors(r, s), o = (u - h) / (u - h + (m - g)), t.copy(s).addScaledVector(Ll, o);
const p = 1 / (f + v + d);
return a = v * p, o = d * p, t.copy(i).addScaledVector(Rs, a).addScaledVector(Ps, o);
}
@@ -7952,9 +8020,9 @@ const dh = {
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
-}, Zi = { h: 0, s: 0, l: 0 }, jr = { h: 0, s: 0, l: 0 };
-function na(r, e, t) {
- return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? r + (e - r) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? r + (e - r) * 6 * (2 / 3 - t) : r;
+}, Zi = { h: 0, s: 0, l: 0 }, Xn = { h: 0, s: 0, l: 0 };
+function ra(n, e, t) {
+ return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * 6 * (2 / 3 - t) : n;
}
class xe {
/**
@@ -8029,11 +8097,11 @@ class xe {
* @return {Color} A reference to this color.
*/
setHSL(e, t, i, s = qe.workingColorSpace) {
- if (e = ko(e, 1), t = ze(t, 0, 1), i = ze(i, 0, 1), t === 0)
+ if (e = Fo(e, 1), t = ze(t, 0, 1), i = ze(i, 0, 1), t === 0)
this.r = this.g = this.b = i;
else {
- const n = i <= 0.5 ? i * (1 + t) : i + t - i * t, a = 2 * i - n;
- this.r = na(a, n, e + 1 / 3), this.g = na(a, n, e), this.b = na(a, n, e - 1 / 3);
+ const r = i <= 0.5 ? i * (1 + t) : i + t - i * t, a = 2 * i - r;
+ this.r = ra(a, r, e + 1 / 3), this.g = ra(a, r, e), this.b = ra(a, r, e - 1 / 3);
}
return qe.colorSpaceToWorking(this, s), this;
}
@@ -8048,38 +8116,38 @@ class xe {
* @return {Color} A reference to this color.
*/
setStyle(e, t = Rt) {
- function i(n) {
- n !== void 0 && parseFloat(n) < 1 && Se("Color: Alpha component of " + e + " will be ignored.");
+ function i(r) {
+ r !== void 0 && parseFloat(r) < 1 && Se("Color: Alpha component of " + e + " will be ignored.");
}
let s;
if (s = /^(\w+)\(([^\)]*)\)/.exec(e)) {
- let n;
+ let r;
const a = s[1], o = s[2];
switch (a) {
case "rgb":
case "rgba":
- if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
- return i(n[4]), this.setRGB(
- Math.min(255, parseInt(n[1], 10)) / 255,
- Math.min(255, parseInt(n[2], 10)) / 255,
- Math.min(255, parseInt(n[3], 10)) / 255,
+ if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
+ return i(r[4]), this.setRGB(
+ Math.min(255, parseInt(r[1], 10)) / 255,
+ Math.min(255, parseInt(r[2], 10)) / 255,
+ Math.min(255, parseInt(r[3], 10)) / 255,
t
);
- if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
- return i(n[4]), this.setRGB(
- Math.min(100, parseInt(n[1], 10)) / 100,
- Math.min(100, parseInt(n[2], 10)) / 100,
- Math.min(100, parseInt(n[3], 10)) / 100,
+ if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
+ return i(r[4]), this.setRGB(
+ Math.min(100, parseInt(r[1], 10)) / 100,
+ Math.min(100, parseInt(r[2], 10)) / 100,
+ Math.min(100, parseInt(r[3], 10)) / 100,
t
);
break;
case "hsl":
case "hsla":
- if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
- return i(n[4]), this.setHSL(
- parseFloat(n[1]) / 360,
- parseFloat(n[2]) / 100,
- parseFloat(n[3]) / 100,
+ if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
+ return i(r[4]), this.setHSL(
+ parseFloat(r[1]) / 360,
+ parseFloat(r[2]) / 100,
+ parseFloat(r[3]) / 100,
t
);
break;
@@ -8087,16 +8155,16 @@ class xe {
Se("Color: Unknown color model " + e);
}
} else if (s = /^\#([A-Fa-f\d]+)$/.exec(e)) {
- const n = s[1], a = n.length;
+ const r = s[1], a = r.length;
if (a === 3)
return this.setRGB(
- parseInt(n.charAt(0), 16) / 15,
- parseInt(n.charAt(1), 16) / 15,
- parseInt(n.charAt(2), 16) / 15,
+ parseInt(r.charAt(0), 16) / 15,
+ parseInt(r.charAt(1), 16) / 15,
+ parseInt(r.charAt(2), 16) / 15,
t
);
if (a === 6)
- return this.setHex(parseInt(n, 16), t);
+ return this.setHex(parseInt(r, 16), t);
Se("Color: Invalid hex color " + e);
} else if (e && e.length > 0)
return this.setColorName(e, t);
@@ -8200,7 +8268,7 @@ class xe {
*/
getHSL(e, t = qe.workingColorSpace) {
qe.workingToColorSpace(Ot.copy(this), t);
- const i = Ot.r, s = Ot.g, n = Ot.b, a = Math.max(i, s, n), o = Math.min(i, s, n);
+ const i = Ot.r, s = Ot.g, r = Ot.b, a = Math.max(i, s, r), o = Math.min(i, s, r);
let l, c;
const h = (o + a) / 2;
if (o === a)
@@ -8209,12 +8277,12 @@ class xe {
const u = a - o;
switch (c = h <= 0.5 ? u / (a + o) : u / (2 - a - o), a) {
case i:
- l = (s - n) / u + (s < n ? 6 : 0);
+ l = (s - r) / u + (s < r ? 6 : 0);
break;
case s:
- l = (n - i) / u + 2;
+ l = (r - i) / u + 2;
break;
- case n:
+ case r:
l = (i - s) / u + 4;
break;
}
@@ -8348,9 +8416,9 @@ class xe {
* @return {Color} A reference to this color.
*/
lerpHSL(e, t) {
- this.getHSL(Zi), e.getHSL(jr);
- const i = Sr(Zi.h, jr.h, t), s = Sr(Zi.s, jr.s, t), n = Sr(Zi.l, jr.l, t);
- return this.setHSL(i, s, n), this;
+ this.getHSL(Zi), e.getHSL(Xn);
+ const i = Tn(Zi.h, Xn.h, t), s = Tn(Zi.s, Xn.s, t), r = Tn(Zi.l, Xn.l, t);
+ return this.setHSL(i, s, r), this;
}
/**
* Sets the color's RGB components from the given 3D vector.
@@ -8368,8 +8436,8 @@ class xe {
* @return {Color} A reference to this color.
*/
applyMatrix3(e) {
- const t = this.r, i = this.g, s = this.b, n = e.elements;
- return this.r = n[0] * t + n[3] * i + n[6] * s, this.g = n[1] * t + n[4] * i + n[7] * s, this.b = n[2] * t + n[5] * i + n[8] * s, this;
+ const t = this.r, i = this.g, s = this.b, r = e.elements;
+ return this.r = r[0] * t + r[3] * i + r[6] * s, this.g = r[1] * t + r[4] * i + r[7] * s, this.b = r[2] * t + r[5] * i + r[8] * s, this;
}
/**
* Returns `true` if this color is equal with the given one.
@@ -8427,12 +8495,12 @@ class xe {
const Ot = /* @__PURE__ */ new xe();
xe.NAMES = dh;
let md = 0;
-class ii extends xs {
+class si extends xs {
/**
* Constructs a new material.
*/
constructor() {
- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: md++ }), this.uuid = fi(), this.name = "", this.type = "Material", this.blending = zs, this.side = Ai, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = Aa, this.blendDst = Ra, this.blendEquation = ui, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new xe(0, 0, 0), this.blendAlpha = 0, this.depthFunc = js, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = go, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = bs, this.stencilZFail = bs, this.stencilZPass = bs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
+ super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: md++ }), this.uuid = gi(), this.name = "", this.type = "Material", this.blending = zs, this.side = Ai, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = Aa, this.blendDst = Ra, this.blendEquation = di, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new xe(0, 0, 0), this.blendAlpha = 0, this.depthFunc = js, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = go, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = ys, this.stencilZFail = ys, this.stencilZPass = ys, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
}
/**
* Sets the alpha value to be used when running an alpha test. The material
@@ -8531,18 +8599,18 @@ class ii extends xs {
generator: "Material.toJSON"
}
};
- i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen !== void 0 && (i.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (i.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (i.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (i.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (i.dispersion = this.dispersion), this.iridescence !== void 0 && (i.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (i.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (i.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (i.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (i.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (i.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== zs && (i.blending = this.blending), this.side !== Ai && (i.side = this.side), this.vertexColors === !0 && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = !0), this.blendSrc !== Aa && (i.blendSrc = this.blendSrc), this.blendDst !== Ra && (i.blendDst = this.blendDst), this.blendEquation !== ui && (i.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha), this.depthFunc !== js && (i.depthFunc = this.depthFunc), this.depthTest === !1 && (i.depthTest = this.depthTest), this.depthWrite === !1 && (i.depthWrite = this.depthWrite), this.colorWrite === !1 && (i.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== go && (i.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (i.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== bs && (i.stencilFail = this.stencilFail), this.stencilZFail !== bs && (i.stencilZFail = this.stencilZFail), this.stencilZPass !== bs && (i.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaHash === !0 && (i.alphaHash = !0), this.alphaToCoverage === !0 && (i.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0), this.forceSinglePass === !0 && (i.forceSinglePass = !0), this.wireframe === !0 && (i.wireframe = !0), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (i.flatShading = !0), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), this.fog === !1 && (i.fog = !1), Object.keys(this.userData).length > 0 && (i.userData = this.userData);
- function s(n) {
+ i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen !== void 0 && (i.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (i.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (i.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (i.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (i.dispersion = this.dispersion), this.iridescence !== void 0 && (i.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (i.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (i.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (i.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (i.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (i.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== zs && (i.blending = this.blending), this.side !== Ai && (i.side = this.side), this.vertexColors === !0 && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = !0), this.blendSrc !== Aa && (i.blendSrc = this.blendSrc), this.blendDst !== Ra && (i.blendDst = this.blendDst), this.blendEquation !== di && (i.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha), this.depthFunc !== js && (i.depthFunc = this.depthFunc), this.depthTest === !1 && (i.depthTest = this.depthTest), this.depthWrite === !1 && (i.depthWrite = this.depthWrite), this.colorWrite === !1 && (i.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== go && (i.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (i.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== ys && (i.stencilFail = this.stencilFail), this.stencilZFail !== ys && (i.stencilZFail = this.stencilZFail), this.stencilZPass !== ys && (i.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaHash === !0 && (i.alphaHash = !0), this.alphaToCoverage === !0 && (i.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0), this.forceSinglePass === !0 && (i.forceSinglePass = !0), this.wireframe === !0 && (i.wireframe = !0), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (i.flatShading = !0), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), this.fog === !1 && (i.fog = !1), Object.keys(this.userData).length > 0 && (i.userData = this.userData);
+ function s(r) {
const a = [];
- for (const o in n) {
- const l = n[o];
+ for (const o in r) {
+ const l = r[o];
delete l.metadata, a.push(l);
}
return a;
}
if (t) {
- const n = s(e.textures), a = s(e.images);
- n.length > 0 && (i.textures = n), a.length > 0 && (i.images = a);
+ const r = s(e.textures), a = s(e.images);
+ r.length > 0 && (i.textures = r), a.length > 0 && (i.images = a);
}
return i;
}
@@ -8567,8 +8635,8 @@ class ii extends xs {
if (t !== null) {
const s = t.length;
i = new Array(s);
- for (let n = 0; n !== s; ++n)
- i[n] = t[n].clone();
+ for (let r = 0; r !== s; ++r)
+ i[r] = t[r].clone();
}
return this.clippingPlanes = i, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaHash = e.alphaHash, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.forceSinglePass = e.forceSinglePass, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this;
}
@@ -8593,7 +8661,7 @@ class ii extends xs {
e === !0 && this.version++;
}
}
-class zt extends ii {
+class Ht extends si {
/**
* Constructs a new mesh basic material.
*
@@ -8604,7 +8672,7 @@ class zt extends ii {
* by {@link Color#set}.
*/
constructor(e) {
- super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new xe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xi(), this.combine = Ro, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
+ super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new xe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new bi(), this.combine = Ro, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
}
copy(e) {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.fog = e.fog, this;
@@ -8612,20 +8680,20 @@ class zt extends ii {
}
const Vi = /* @__PURE__ */ fd();
function fd() {
- const r = new ArrayBuffer(4), e = new Float32Array(r), t = new Uint32Array(r), i = new Uint32Array(512), s = new Uint32Array(512);
+ const n = new ArrayBuffer(4), e = new Float32Array(n), t = new Uint32Array(n), i = new Uint32Array(512), s = new Uint32Array(512);
for (let l = 0; l < 256; ++l) {
const c = l - 127;
c < -27 ? (i[l] = 0, i[l | 256] = 32768, s[l] = 24, s[l | 256] = 24) : c < -14 ? (i[l] = 1024 >> -c - 14, i[l | 256] = 1024 >> -c - 14 | 32768, s[l] = -c - 1, s[l | 256] = -c - 1) : c <= 15 ? (i[l] = c + 15 << 10, i[l | 256] = c + 15 << 10 | 32768, s[l] = 13, s[l | 256] = 13) : c < 128 ? (i[l] = 31744, i[l | 256] = 64512, s[l] = 24, s[l | 256] = 24) : (i[l] = 31744, i[l | 256] = 64512, s[l] = 13, s[l | 256] = 13);
}
- const n = new Uint32Array(2048), a = new Uint32Array(64), o = new Uint32Array(64);
+ const r = new Uint32Array(2048), a = new Uint32Array(64), o = new Uint32Array(64);
for (let l = 1; l < 1024; ++l) {
let c = l << 13, h = 0;
for (; (c & 8388608) === 0; )
c <<= 1, h -= 8388608;
- c &= -8388609, h += 947912704, n[l] = c | h;
+ c &= -8388609, h += 947912704, r[l] = c | h;
}
for (let l = 1024; l < 2048; ++l)
- n[l] = 939524096 + (l - 1024 << 13);
+ r[l] = 939524096 + (l - 1024 << 13);
for (let l = 1; l < 31; ++l)
a[l] = l << 23;
a[31] = 1199570944, a[32] = 2147483648;
@@ -8639,21 +8707,21 @@ function fd() {
uint32View: t,
baseTable: i,
shiftTable: s,
- mantissaTable: n,
+ mantissaTable: r,
exponentTable: a,
offsetTable: o
};
}
-function gd(r) {
- Math.abs(r) > 65504 && Se("DataUtils.toHalfFloat(): Value out of range."), r = ze(r, -65504, 65504), Vi.floatView[0] = r;
+function gd(n) {
+ Math.abs(n) > 65504 && Se("DataUtils.toHalfFloat(): Value out of range."), n = ze(n, -65504, 65504), Vi.floatView[0] = n;
const e = Vi.uint32View[0], t = e >> 23 & 511;
return Vi.baseTable[t] + ((e & 8388607) >> Vi.shiftTable[t]);
}
-function vd(r) {
- const e = r >> 10;
- return Vi.uint32View[0] = Vi.mantissaTable[Vi.offsetTable[e] + (r & 1023)] + Vi.exponentTable[e], Vi.floatView[0];
+function vd(n) {
+ const e = n >> 10;
+ return Vi.uint32View[0] = Vi.mantissaTable[Vi.offsetTable[e] + (n & 1023)] + Vi.exponentTable[e], Vi.floatView[0];
}
-class Xr {
+class qn {
/**
* Returns a half precision floating point value (FP16) from the given single
* precision floating point value (FP32).
@@ -8675,9 +8743,9 @@ class Xr {
return vd(e);
}
}
-const xt = /* @__PURE__ */ new w(), qr = /* @__PURE__ */ new oe();
+const xt = /* @__PURE__ */ new w(), Yn = /* @__PURE__ */ new oe();
let _d = 0;
-class Vt {
+class Gt {
/**
* Constructs a new buffer attribute.
*
@@ -8688,7 +8756,7 @@ class Vt {
constructor(e, t, i = !1) {
if (Array.isArray(e))
throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
- this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: _d++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = i, this.usage = vo, this.updateRanges = [], this.gpuType = Xt, this.version = 0;
+ this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: _d++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = i, this.usage = vo, this.updateRanges = [], this.gpuType = qt, this.version = 0;
}
/**
* A callback function that is executed after the renderer has transferred the attribute
@@ -8752,7 +8820,7 @@ class Vt {
*/
copyAt(e, t, i) {
e *= this.itemSize, i *= t.itemSize;
- for (let s = 0, n = this.itemSize; s < n; s++)
+ for (let s = 0, r = this.itemSize; s < r; s++)
this.array[e + s] = t.array[i + s];
return this;
}
@@ -8775,7 +8843,7 @@ class Vt {
applyMatrix3(e) {
if (this.itemSize === 2)
for (let t = 0, i = this.count; t < i; t++)
- qr.fromBufferAttribute(this, t), qr.applyMatrix3(e), this.setXY(t, qr.x, qr.y);
+ Yn.fromBufferAttribute(this, t), Yn.applyMatrix3(e), this.setXY(t, Yn.x, Yn.y);
else if (this.itemSize === 3)
for (let t = 0, i = this.count; t < i; t++)
xt.fromBufferAttribute(this, t), xt.applyMatrix3(e), this.setXYZ(t, xt.x, xt.y, xt.z);
@@ -8836,7 +8904,7 @@ class Vt {
*/
getComponent(e, t) {
let i = this.array[e * this.itemSize + t];
- return this.normalized && (i = di(i, this.array)), i;
+ return this.normalized && (i = pi(i, this.array)), i;
}
/**
* Sets the given value to the given component of the vector at the given index.
@@ -8847,7 +8915,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setComponent(e, t, i) {
- return this.normalized && (i = it(i, this.array)), this.array[e * this.itemSize + t] = i, this;
+ return this.normalized && (i = st(i, this.array)), this.array[e * this.itemSize + t] = i, this;
}
/**
* Returns the x component of the vector at the given index.
@@ -8857,7 +8925,7 @@ class Vt {
*/
getX(e) {
let t = this.array[e * this.itemSize];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Sets the x component of the vector at the given index.
@@ -8867,7 +8935,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setX(e, t) {
- return this.normalized && (t = it(t, this.array)), this.array[e * this.itemSize] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.array[e * this.itemSize] = t, this;
}
/**
* Returns the y component of the vector at the given index.
@@ -8877,7 +8945,7 @@ class Vt {
*/
getY(e) {
let t = this.array[e * this.itemSize + 1];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Sets the y component of the vector at the given index.
@@ -8887,7 +8955,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setY(e, t) {
- return this.normalized && (t = it(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
}
/**
* Returns the z component of the vector at the given index.
@@ -8897,7 +8965,7 @@ class Vt {
*/
getZ(e) {
let t = this.array[e * this.itemSize + 2];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Sets the z component of the vector at the given index.
@@ -8907,7 +8975,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setZ(e, t) {
- return this.normalized && (t = it(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
}
/**
* Returns the w component of the vector at the given index.
@@ -8917,7 +8985,7 @@ class Vt {
*/
getW(e) {
let t = this.array[e * this.itemSize + 3];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Sets the w component of the vector at the given index.
@@ -8927,7 +8995,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setW(e, t) {
- return this.normalized && (t = it(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
}
/**
* Sets the x and y component of the vector at the given index.
@@ -8938,7 +9006,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setXY(e, t, i) {
- return e *= this.itemSize, this.normalized && (t = it(t, this.array), i = it(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this;
+ return e *= this.itemSize, this.normalized && (t = st(t, this.array), i = st(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this;
}
/**
* Sets the x, y and z component of the vector at the given index.
@@ -8950,7 +9018,7 @@ class Vt {
* @return {BufferAttribute} A reference to this instance.
*/
setXYZ(e, t, i, s) {
- return e *= this.itemSize, this.normalized && (t = it(t, this.array), i = it(i, this.array), s = it(s, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = s, this;
+ return e *= this.itemSize, this.normalized && (t = st(t, this.array), i = st(i, this.array), s = st(s, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = s, this;
}
/**
* Sets the x, y, z and w component of the vector at the given index.
@@ -8962,8 +9030,8 @@ class Vt {
* @param {number} w - The value for the w component to set.
* @return {BufferAttribute} A reference to this instance.
*/
- setXYZW(e, t, i, s, n) {
- return e *= this.itemSize, this.normalized && (t = it(t, this.array), i = it(i, this.array), s = it(s, this.array), n = it(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = s, this.array[e + 3] = n, this;
+ setXYZW(e, t, i, s, r) {
+ return e *= this.itemSize, this.normalized && (t = st(t, this.array), i = st(i, this.array), s = st(s, this.array), r = st(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = s, this.array[e + 3] = r, this;
}
/**
* Sets the given callback function that is executed after the Renderer has transferred
@@ -8999,7 +9067,7 @@ class Vt {
return this.name !== "" && (e.name = this.name), this.usage !== vo && (e.usage = this.usage), e;
}
}
-class ph extends Vt {
+class ph extends Gt {
/**
* Constructs a new buffer attribute.
*
@@ -9011,7 +9079,7 @@ class ph extends Vt {
super(new Uint16Array(e), t, i);
}
}
-class mh extends Vt {
+class mh extends Gt {
/**
* Constructs a new buffer attribute.
*
@@ -9023,7 +9091,7 @@ class mh extends Vt {
super(new Uint32Array(e), t, i);
}
}
-class gi extends Vt {
+class vi extends Gt {
/**
* Constructs a new buffer attribute.
*
@@ -9036,13 +9104,13 @@ class gi extends Vt {
}
}
let xd = 0;
-const Qt = /* @__PURE__ */ new Ne(), aa = /* @__PURE__ */ new mt(), Ls = /* @__PURE__ */ new w(), Zt = /* @__PURE__ */ new Lt(), ur = /* @__PURE__ */ new Lt(), At = /* @__PURE__ */ new w();
-class si extends xs {
+const ei = /* @__PURE__ */ new Ne(), aa = /* @__PURE__ */ new mt(), Ls = /* @__PURE__ */ new w(), $t = /* @__PURE__ */ new Lt(), dn = /* @__PURE__ */ new Lt(), At = /* @__PURE__ */ new w();
+class ni extends xs {
/**
* Constructs a new geometry.
*/
constructor() {
- super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: xd++ }), this.uuid = fi(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
+ super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: xd++ }), this.uuid = gi(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
}
/**
* Returns the index of this geometry.
@@ -9158,8 +9226,8 @@ class si extends xs {
t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);
const i = this.attributes.normal;
if (i !== void 0) {
- const n = new Fe().getNormalMatrix(e);
- i.applyNormalMatrix(n), i.needsUpdate = !0;
+ const r = new ke().getNormalMatrix(e);
+ i.applyNormalMatrix(r), i.needsUpdate = !0;
}
const s = this.attributes.tangent;
return s !== void 0 && (s.transformDirection(e), s.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
@@ -9171,7 +9239,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
applyQuaternion(e) {
- return Qt.makeRotationFromQuaternion(e), this.applyMatrix4(Qt), this;
+ return ei.makeRotationFromQuaternion(e), this.applyMatrix4(ei), this;
}
/**
* Rotates the geometry about the X axis. This is typically done as a one time
@@ -9182,7 +9250,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
rotateX(e) {
- return Qt.makeRotationX(e), this.applyMatrix4(Qt), this;
+ return ei.makeRotationX(e), this.applyMatrix4(ei), this;
}
/**
* Rotates the geometry about the Y axis. This is typically done as a one time
@@ -9193,7 +9261,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
rotateY(e) {
- return Qt.makeRotationY(e), this.applyMatrix4(Qt), this;
+ return ei.makeRotationY(e), this.applyMatrix4(ei), this;
}
/**
* Rotates the geometry about the Z axis. This is typically done as a one time
@@ -9204,7 +9272,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
rotateZ(e) {
- return Qt.makeRotationZ(e), this.applyMatrix4(Qt), this;
+ return ei.makeRotationZ(e), this.applyMatrix4(ei), this;
}
/**
* Translates the geometry. This is typically done as a one time
@@ -9217,7 +9285,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
translate(e, t, i) {
- return Qt.makeTranslation(e, t, i), this.applyMatrix4(Qt), this;
+ return ei.makeTranslation(e, t, i), this.applyMatrix4(ei), this;
}
/**
* Scales the geometry. This is typically done as a one time
@@ -9230,7 +9298,7 @@ class si extends xs {
* @return {BufferGeometry} A reference to this instance.
*/
scale(e, t, i) {
- return Qt.makeScale(e, t, i), this.applyMatrix4(Qt), this;
+ return ei.makeScale(e, t, i), this.applyMatrix4(ei), this;
}
/**
* Rotates the geometry to face a point in 3D space. This is typically done as a one time
@@ -9266,16 +9334,16 @@ class si extends xs {
const t = this.getAttribute("position");
if (t === void 0) {
const i = [];
- for (let s = 0, n = e.length; s < n; s++) {
+ for (let s = 0, r = e.length; s < r; s++) {
const a = e[s];
i.push(a.x, a.y, a.z || 0);
}
- this.setAttribute("position", new gi(i, 3));
+ this.setAttribute("position", new vi(i, 3));
} else {
const i = Math.min(e.length, t.count);
for (let s = 0; s < i; s++) {
- const n = e[s];
- t.setXYZ(s, n.x, n.y, n.z || 0);
+ const r = e[s];
+ t.setXYZ(s, r.x, r.y, r.z || 0);
}
e.length > t.count && Se("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."), t.needsUpdate = !0;
}
@@ -9299,8 +9367,8 @@ class si extends xs {
if (e !== void 0) {
if (this.boundingBox.setFromBufferAttribute(e), t)
for (let i = 0, s = t.length; i < s; i++) {
- const n = t[i];
- Zt.setFromBufferAttribute(n), this.morphTargetsRelative ? (At.addVectors(this.boundingBox.min, Zt.min), this.boundingBox.expandByPoint(At), At.addVectors(this.boundingBox.max, Zt.max), this.boundingBox.expandByPoint(At)) : (this.boundingBox.expandByPoint(Zt.min), this.boundingBox.expandByPoint(Zt.max));
+ const r = t[i];
+ $t.setFromBufferAttribute(r), this.morphTargetsRelative ? (At.addVectors(this.boundingBox.min, $t.min), this.boundingBox.expandByPoint(At), At.addVectors(this.boundingBox.max, $t.max), this.boundingBox.expandByPoint(At)) : (this.boundingBox.expandByPoint($t.min), this.boundingBox.expandByPoint($t.max));
}
} else
this.boundingBox.makeEmpty();
@@ -9320,18 +9388,18 @@ class si extends xs {
}
if (e) {
const i = this.boundingSphere.center;
- if (Zt.setFromBufferAttribute(e), t)
- for (let n = 0, a = t.length; n < a; n++) {
- const o = t[n];
- ur.setFromBufferAttribute(o), this.morphTargetsRelative ? (At.addVectors(Zt.min, ur.min), Zt.expandByPoint(At), At.addVectors(Zt.max, ur.max), Zt.expandByPoint(At)) : (Zt.expandByPoint(ur.min), Zt.expandByPoint(ur.max));
+ if ($t.setFromBufferAttribute(e), t)
+ for (let r = 0, a = t.length; r < a; r++) {
+ const o = t[r];
+ dn.setFromBufferAttribute(o), this.morphTargetsRelative ? (At.addVectors($t.min, dn.min), $t.expandByPoint(At), At.addVectors($t.max, dn.max), $t.expandByPoint(At)) : ($t.expandByPoint(dn.min), $t.expandByPoint(dn.max));
}
- Zt.getCenter(i);
+ $t.getCenter(i);
let s = 0;
- for (let n = 0, a = e.count; n < a; n++)
- At.fromBufferAttribute(e, n), s = Math.max(s, i.distanceToSquared(At));
+ for (let r = 0, a = e.count; r < a; r++)
+ At.fromBufferAttribute(e, r), s = Math.max(s, i.distanceToSquared(At));
if (t)
- for (let n = 0, a = t.length; n < a; n++) {
- const o = t[n], l = this.morphTargetsRelative;
+ for (let r = 0, a = t.length; r < a; r++) {
+ const o = t[r], l = this.morphTargetsRelative;
for (let c = 0, h = o.count; c < h; c++)
At.fromBufferAttribute(o, c), l && (Ls.fromBufferAttribute(e, c), At.add(Ls)), s = Math.max(s, i.distanceToSquared(At));
}
@@ -9351,24 +9419,24 @@ class si extends xs {
Ve("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
return;
}
- const i = t.position, s = t.normal, n = t.uv;
- this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new Vt(new Float32Array(4 * i.count), 4));
+ const i = t.position, s = t.normal, r = t.uv;
+ this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new Gt(new Float32Array(4 * i.count), 4));
const a = this.getAttribute("tangent"), o = [], l = [];
for (let I = 0; I < i.count; I++)
o[I] = new w(), l[I] = new w();
const c = new w(), h = new w(), u = new w(), d = new oe(), m = new oe(), g = new oe(), v = new w(), f = new w();
function p(I, S, M) {
- c.fromBufferAttribute(i, I), h.fromBufferAttribute(i, S), u.fromBufferAttribute(i, M), d.fromBufferAttribute(n, I), m.fromBufferAttribute(n, S), g.fromBufferAttribute(n, M), h.sub(c), u.sub(c), m.sub(d), g.sub(d);
+ c.fromBufferAttribute(i, I), h.fromBufferAttribute(i, S), u.fromBufferAttribute(i, M), d.fromBufferAttribute(r, I), m.fromBufferAttribute(r, S), g.fromBufferAttribute(r, M), h.sub(c), u.sub(c), m.sub(d), g.sub(d);
const L = 1 / (m.x * g.y - g.x * m.y);
isFinite(L) && (v.copy(h).multiplyScalar(g.y).addScaledVector(u, -m.y).multiplyScalar(L), f.copy(u).multiplyScalar(m.x).addScaledVector(h, -g.x).multiplyScalar(L), o[I].add(v), o[S].add(v), o[M].add(v), l[I].add(f), l[S].add(f), l[M].add(f));
}
- let y = this.groups;
- y.length === 0 && (y = [{
+ let b = this.groups;
+ b.length === 0 && (b = [{
start: 0,
count: e.count
}]);
- for (let I = 0, S = y.length; I < S; ++I) {
- const M = y[I], L = M.start, N = M.count;
+ for (let I = 0, S = b.length; I < S; ++I) {
+ const M = b[I], L = M.start, N = M.count;
for (let z = L, H = L + N; z < H; z += 3)
p(
e.getX(z + 0),
@@ -9384,8 +9452,8 @@ class si extends xs {
const M = E.dot(l[I]) < 0 ? -1 : 1;
a.setXYZW(I, _.x, _.y, _.z, M);
}
- for (let I = 0, S = y.length; I < S; ++I) {
- const M = y[I], L = M.start, N = M.count;
+ for (let I = 0, S = b.length; I < S; ++I) {
+ const M = b[I], L = M.start, N = M.count;
for (let z = L, H = L + N; z < H; z += 3)
A(e.getX(z + 0)), A(e.getX(z + 1)), A(e.getX(z + 2));
}
@@ -9401,19 +9469,19 @@ class si extends xs {
if (t !== void 0) {
let i = this.getAttribute("normal");
if (i === void 0)
- i = new Vt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", i);
+ i = new Gt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", i);
else
for (let d = 0, m = i.count; d < m; d++)
i.setXYZ(d, 0, 0, 0);
- const s = new w(), n = new w(), a = new w(), o = new w(), l = new w(), c = new w(), h = new w(), u = new w();
+ const s = new w(), r = new w(), a = new w(), o = new w(), l = new w(), c = new w(), h = new w(), u = new w();
if (e)
for (let d = 0, m = e.count; d < m; d += 3) {
const g = e.getX(d + 0), v = e.getX(d + 1), f = e.getX(d + 2);
- s.fromBufferAttribute(t, g), n.fromBufferAttribute(t, v), a.fromBufferAttribute(t, f), h.subVectors(a, n), u.subVectors(s, n), h.cross(u), o.fromBufferAttribute(i, g), l.fromBufferAttribute(i, v), c.fromBufferAttribute(i, f), o.add(h), l.add(h), c.add(h), i.setXYZ(g, o.x, o.y, o.z), i.setXYZ(v, l.x, l.y, l.z), i.setXYZ(f, c.x, c.y, c.z);
+ s.fromBufferAttribute(t, g), r.fromBufferAttribute(t, v), a.fromBufferAttribute(t, f), h.subVectors(a, r), u.subVectors(s, r), h.cross(u), o.fromBufferAttribute(i, g), l.fromBufferAttribute(i, v), c.fromBufferAttribute(i, f), o.add(h), l.add(h), c.add(h), i.setXYZ(g, o.x, o.y, o.z), i.setXYZ(v, l.x, l.y, l.z), i.setXYZ(f, c.x, c.y, c.z);
}
else
for (let d = 0, m = t.count; d < m; d += 3)
- s.fromBufferAttribute(t, d + 0), n.fromBufferAttribute(t, d + 1), a.fromBufferAttribute(t, d + 2), h.subVectors(a, n), u.subVectors(s, n), h.cross(u), i.setXYZ(d + 0, h.x, h.y, h.z), i.setXYZ(d + 1, h.x, h.y, h.z), i.setXYZ(d + 2, h.x, h.y, h.z);
+ s.fromBufferAttribute(t, d + 0), r.fromBufferAttribute(t, d + 1), a.fromBufferAttribute(t, d + 2), h.subVectors(a, r), u.subVectors(s, r), h.cross(u), i.setXYZ(d + 0, h.x, h.y, h.z), i.setXYZ(d + 1, h.x, h.y, h.z), i.setXYZ(d + 2, h.x, h.y, h.z);
this.normalizeNormals(), i.needsUpdate = !0;
}
}
@@ -9441,18 +9509,18 @@ class si extends xs {
for (let p = 0; p < h; p++)
d[g++] = c[m++];
}
- return new Vt(d, h, u);
+ return new Gt(d, h, u);
}
if (this.index === null)
return Se("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
- const t = new si(), i = this.index.array, s = this.attributes;
+ const t = new ni(), i = this.index.array, s = this.attributes;
for (const o in s) {
const l = s[o], c = e(l, i);
t.setAttribute(o, c);
}
- const n = this.morphAttributes;
- for (const o in n) {
- const l = [], c = n[o];
+ const r = this.morphAttributes;
+ for (const o in r) {
+ const l = [], c = r[o];
for (let h = 0, u = c.length; h < u; h++) {
const d = c[h], m = e(d, i);
l.push(m);
@@ -9498,16 +9566,16 @@ class si extends xs {
e.data.attributes[l] = c.toJSON(e.data);
}
const s = {};
- let n = !1;
+ let r = !1;
for (const l in this.morphAttributes) {
const c = this.morphAttributes[l], h = [];
for (let u = 0, d = c.length; u < d; u++) {
const m = c[u];
h.push(m.toJSON(e.data));
}
- h.length > 0 && (s[l] = h, n = !0);
+ h.length > 0 && (s[l] = h, r = !0);
}
- n && (e.data.morphAttributes = s, e.data.morphTargetsRelative = this.morphTargetsRelative);
+ r && (e.data.morphAttributes = s, e.data.morphTargetsRelative = this.morphTargetsRelative);
const a = this.groups;
a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));
const o = this.boundingSphere;
@@ -9538,9 +9606,9 @@ class si extends xs {
const h = s[c];
this.setAttribute(c, h.clone(t));
}
- const n = e.morphAttributes;
- for (const c in n) {
- const h = [], u = n[c];
+ const r = e.morphAttributes;
+ for (const c in r) {
+ const h = [], u = r[c];
for (let d = 0, m = u.length; d < m; d++)
h.push(u[d].clone(t));
this.morphAttributes[c] = h;
@@ -9566,15 +9634,15 @@ class si extends xs {
this.dispatchEvent({ type: "dispose" });
}
}
-const Dl = /* @__PURE__ */ new Ne(), hs = /* @__PURE__ */ new ir(), Yr = /* @__PURE__ */ new Li(), Il = /* @__PURE__ */ new w(), Kr = /* @__PURE__ */ new w(), Zr = /* @__PURE__ */ new w(), $r = /* @__PURE__ */ new w(), oa = /* @__PURE__ */ new w(), Jr = /* @__PURE__ */ new w(), Ul = /* @__PURE__ */ new w(), Qr = /* @__PURE__ */ new w();
-class at extends mt {
+const Dl = /* @__PURE__ */ new Ne(), hs = /* @__PURE__ */ new sn(), Kn = /* @__PURE__ */ new Li(), Il = /* @__PURE__ */ new w(), Zn = /* @__PURE__ */ new w(), $n = /* @__PURE__ */ new w(), Jn = /* @__PURE__ */ new w(), oa = /* @__PURE__ */ new w(), Qn = /* @__PURE__ */ new w(), Ul = /* @__PURE__ */ new w(), er = /* @__PURE__ */ new w();
+class ot extends mt {
/**
* Constructs a new mesh.
*
* @param {BufferGeometry} [geometry] - The mesh geometry.
* @param {Material|Array} [material] - The mesh material.
*/
- constructor(e = new si(), t = new zt()) {
+ constructor(e = new ni(), t = new Ht()) {
super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();
}
copy(e, t) {
@@ -9590,7 +9658,7 @@ class at extends mt {
const i = e[t[0]];
if (i !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
- for (let s = 0, n = i.length; s < n; s++) {
+ for (let s = 0, r = i.length; s < r; s++) {
const a = i[s].name || String(s);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s;
}
@@ -9606,16 +9674,16 @@ class at extends mt {
* @return {Vector3} The vertex position in local space.
*/
getVertexPosition(e, t) {
- const i = this.geometry, s = i.attributes.position, n = i.morphAttributes.position, a = i.morphTargetsRelative;
+ const i = this.geometry, s = i.attributes.position, r = i.morphAttributes.position, a = i.morphTargetsRelative;
t.fromBufferAttribute(s, e);
const o = this.morphTargetInfluences;
- if (n && o) {
- Jr.set(0, 0, 0);
- for (let l = 0, c = n.length; l < c; l++) {
- const h = o[l], u = n[l];
- h !== 0 && (oa.fromBufferAttribute(u, e), a ? Jr.addScaledVector(oa, h) : Jr.addScaledVector(oa.sub(t), h));
+ if (r && o) {
+ Qn.set(0, 0, 0);
+ for (let l = 0, c = r.length; l < c; l++) {
+ const h = o[l], u = r[l];
+ h !== 0 && (oa.fromBufferAttribute(u, e), a ? Qn.addScaledVector(oa, h) : Qn.addScaledVector(oa.sub(t), h));
}
- t.add(Jr);
+ t.add(Qn);
}
return t;
}
@@ -9626,63 +9694,63 @@ class at extends mt {
* @param {Array} intersects - The target array that holds the intersection points.
*/
raycast(e, t) {
- const i = this.geometry, s = this.material, n = this.matrixWorld;
- s !== void 0 && (i.boundingSphere === null && i.computeBoundingSphere(), Yr.copy(i.boundingSphere), Yr.applyMatrix4(n), hs.copy(e.ray).recast(e.near), !(Yr.containsPoint(hs.origin) === !1 && (hs.intersectSphere(Yr, Il) === null || hs.origin.distanceToSquared(Il) > (e.far - e.near) ** 2)) && (Dl.copy(n).invert(), hs.copy(e.ray).applyMatrix4(Dl), !(i.boundingBox !== null && hs.intersectsBox(i.boundingBox) === !1) && this._computeIntersections(e, t, hs)));
+ const i = this.geometry, s = this.material, r = this.matrixWorld;
+ s !== void 0 && (i.boundingSphere === null && i.computeBoundingSphere(), Kn.copy(i.boundingSphere), Kn.applyMatrix4(r), hs.copy(e.ray).recast(e.near), !(Kn.containsPoint(hs.origin) === !1 && (hs.intersectSphere(Kn, Il) === null || hs.origin.distanceToSquared(Il) > (e.far - e.near) ** 2)) && (Dl.copy(r).invert(), hs.copy(e.ray).applyMatrix4(Dl), !(i.boundingBox !== null && hs.intersectsBox(i.boundingBox) === !1) && this._computeIntersections(e, t, hs)));
}
_computeIntersections(e, t, i) {
let s;
- const n = this.geometry, a = this.material, o = n.index, l = n.attributes.position, c = n.attributes.uv, h = n.attributes.uv1, u = n.attributes.normal, d = n.groups, m = n.drawRange;
+ const r = this.geometry, a = this.material, o = r.index, l = r.attributes.position, c = r.attributes.uv, h = r.attributes.uv1, u = r.attributes.normal, d = r.groups, m = r.drawRange;
if (o !== null)
if (Array.isArray(a))
for (let g = 0, v = d.length; g < v; g++) {
- const f = d[g], p = a[f.materialIndex], y = Math.max(f.start, m.start), _ = Math.min(o.count, Math.min(f.start + f.count, m.start + m.count));
- for (let E = y, R = _; E < R; E += 3) {
+ const f = d[g], p = a[f.materialIndex], b = Math.max(f.start, m.start), _ = Math.min(o.count, Math.min(f.start + f.count, m.start + m.count));
+ for (let E = b, R = _; E < R; E += 3) {
const T = o.getX(E), A = o.getX(E + 1), I = o.getX(E + 2);
- s = en(this, p, e, i, c, h, u, T, A, I), s && (s.faceIndex = Math.floor(E / 3), s.face.materialIndex = f.materialIndex, t.push(s));
+ s = tr(this, p, e, i, c, h, u, T, A, I), s && (s.faceIndex = Math.floor(E / 3), s.face.materialIndex = f.materialIndex, t.push(s));
}
}
else {
const g = Math.max(0, m.start), v = Math.min(o.count, m.start + m.count);
for (let f = g, p = v; f < p; f += 3) {
- const y = o.getX(f), _ = o.getX(f + 1), E = o.getX(f + 2);
- s = en(this, a, e, i, c, h, u, y, _, E), s && (s.faceIndex = Math.floor(f / 3), t.push(s));
+ const b = o.getX(f), _ = o.getX(f + 1), E = o.getX(f + 2);
+ s = tr(this, a, e, i, c, h, u, b, _, E), s && (s.faceIndex = Math.floor(f / 3), t.push(s));
}
}
else if (l !== void 0)
if (Array.isArray(a))
for (let g = 0, v = d.length; g < v; g++) {
- const f = d[g], p = a[f.materialIndex], y = Math.max(f.start, m.start), _ = Math.min(l.count, Math.min(f.start + f.count, m.start + m.count));
- for (let E = y, R = _; E < R; E += 3) {
+ const f = d[g], p = a[f.materialIndex], b = Math.max(f.start, m.start), _ = Math.min(l.count, Math.min(f.start + f.count, m.start + m.count));
+ for (let E = b, R = _; E < R; E += 3) {
const T = E, A = E + 1, I = E + 2;
- s = en(this, p, e, i, c, h, u, T, A, I), s && (s.faceIndex = Math.floor(E / 3), s.face.materialIndex = f.materialIndex, t.push(s));
+ s = tr(this, p, e, i, c, h, u, T, A, I), s && (s.faceIndex = Math.floor(E / 3), s.face.materialIndex = f.materialIndex, t.push(s));
}
}
else {
const g = Math.max(0, m.start), v = Math.min(l.count, m.start + m.count);
for (let f = g, p = v; f < p; f += 3) {
- const y = f, _ = f + 1, E = f + 2;
- s = en(this, a, e, i, c, h, u, y, _, E), s && (s.faceIndex = Math.floor(f / 3), t.push(s));
+ const b = f, _ = f + 1, E = f + 2;
+ s = tr(this, a, e, i, c, h, u, b, _, E), s && (s.faceIndex = Math.floor(f / 3), t.push(s));
}
}
}
}
-function yd(r, e, t, i, s, n, a, o) {
+function bd(n, e, t, i, s, r, a, o) {
let l;
- if (e.side === Ht ? l = i.intersectTriangle(a, n, s, !0, o) : l = i.intersectTriangle(s, n, a, e.side === Ai, o), l === null) return null;
- Qr.copy(o), Qr.applyMatrix4(r.matrixWorld);
- const c = t.ray.origin.distanceTo(Qr);
+ if (e.side === Vt ? l = i.intersectTriangle(a, r, s, !0, o) : l = i.intersectTriangle(s, r, a, e.side === Ai, o), l === null) return null;
+ er.copy(o), er.applyMatrix4(n.matrixWorld);
+ const c = t.ray.origin.distanceTo(er);
return c < t.near || c > t.far ? null : {
distance: c,
- point: Qr.clone(),
- object: r
+ point: er.clone(),
+ object: n
};
}
-function en(r, e, t, i, s, n, a, o, l, c) {
- r.getVertexPosition(o, Kr), r.getVertexPosition(l, Zr), r.getVertexPosition(c, $r);
- const h = yd(r, e, t, i, Kr, Zr, $r, Ul);
+function tr(n, e, t, i, s, r, a, o, l, c) {
+ n.getVertexPosition(o, Zn), n.getVertexPosition(l, $n), n.getVertexPosition(c, Jn);
+ const h = bd(n, e, t, i, Zn, $n, Jn, Ul);
if (h) {
const u = new w();
- pi.getBarycoord(Ul, Kr, Zr, $r, u), s && (h.uv = pi.getInterpolatedAttribute(s, o, l, c, u, new oe())), n && (h.uv1 = pi.getInterpolatedAttribute(n, o, l, c, u, new oe())), a && (h.normal = pi.getInterpolatedAttribute(a, o, l, c, u, new w()), h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1));
+ mi.getBarycoord(Ul, Zn, $n, Jn, u), s && (h.uv = mi.getInterpolatedAttribute(s, o, l, c, u, new oe())), r && (h.uv1 = mi.getInterpolatedAttribute(r, o, l, c, u, new oe())), a && (h.normal = mi.getInterpolatedAttribute(a, o, l, c, u, new w()), h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1));
const d = {
a: o,
b: l,
@@ -9690,11 +9758,11 @@ function en(r, e, t, i, s, n, a, o, l, c) {
normal: new w(),
materialIndex: 0
};
- pi.getNormal(Kr, Zr, $r, d.normal), h.face = d, h.barycoord = u;
+ mi.getNormal(Zn, $n, Jn, d.normal), h.face = d, h.barycoord = u;
}
return h;
}
-class vs extends si {
+class vs extends ni {
/**
* Constructs a new box geometry.
*
@@ -9705,35 +9773,35 @@ class vs extends si {
* @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides.
* @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides.
*/
- constructor(e = 1, t = 1, i = 1, s = 1, n = 1, a = 1) {
+ constructor(e = 1, t = 1, i = 1, s = 1, r = 1, a = 1) {
super(), this.type = "BoxGeometry", this.parameters = {
width: e,
height: t,
depth: i,
widthSegments: s,
- heightSegments: n,
+ heightSegments: r,
depthSegments: a
};
const o = this;
- s = Math.floor(s), n = Math.floor(n), a = Math.floor(a);
+ s = Math.floor(s), r = Math.floor(r), a = Math.floor(a);
const l = [], c = [], h = [], u = [];
let d = 0, m = 0;
- g("z", "y", "x", -1, -1, i, t, e, a, n, 0), g("z", "y", "x", 1, -1, i, t, -e, a, n, 1), g("x", "z", "y", 1, 1, e, i, t, s, a, 2), g("x", "z", "y", 1, -1, e, i, -t, s, a, 3), g("x", "y", "z", 1, -1, e, t, i, s, n, 4), g("x", "y", "z", -1, -1, e, t, -i, s, n, 5), this.setIndex(l), this.setAttribute("position", new gi(c, 3)), this.setAttribute("normal", new gi(h, 3)), this.setAttribute("uv", new gi(u, 2));
- function g(v, f, p, y, _, E, R, T, A, I, S) {
+ g("z", "y", "x", -1, -1, i, t, e, a, r, 0), g("z", "y", "x", 1, -1, i, t, -e, a, r, 1), g("x", "z", "y", 1, 1, e, i, t, s, a, 2), g("x", "z", "y", 1, -1, e, i, -t, s, a, 3), g("x", "y", "z", 1, -1, e, t, i, s, r, 4), g("x", "y", "z", -1, -1, e, t, -i, s, r, 5), this.setIndex(l), this.setAttribute("position", new vi(c, 3)), this.setAttribute("normal", new vi(h, 3)), this.setAttribute("uv", new vi(u, 2));
+ function g(v, f, p, b, _, E, R, T, A, I, S) {
const M = E / A, L = R / I, N = E / 2, z = R / 2, H = T / 2, j = A + 1, q = I + 1;
let te = 0, G = 0;
const Z = new w();
- for (let re = 0; re < q; re++) {
- const Le = re * L - z;
+ for (let ne = 0; ne < q; ne++) {
+ const Le = ne * L - z;
for (let He = 0; He < j; He++) {
const Ye = He * M - N;
- Z[v] = Ye * y, Z[f] = Le * _, Z[p] = H, c.push(Z.x, Z.y, Z.z), Z[v] = 0, Z[f] = 0, Z[p] = T > 0 ? 1 : -1, h.push(Z.x, Z.y, Z.z), u.push(He / A), u.push(1 - re / I), te += 1;
+ Z[v] = Ye * b, Z[f] = Le * _, Z[p] = H, c.push(Z.x, Z.y, Z.z), Z[v] = 0, Z[f] = 0, Z[p] = T > 0 ? 1 : -1, h.push(Z.x, Z.y, Z.z), u.push(He / A), u.push(1 - ne / I), te += 1;
}
}
- for (let re = 0; re < I; re++)
+ for (let ne = 0; ne < I; ne++)
for (let Le = 0; Le < A; Le++) {
- const He = d + Le + j * re, Ye = d + Le + j * (re + 1), Ze = d + (Le + 1) + j * (re + 1), $e = d + (Le + 1) + j * re;
- l.push(He, Ye, $e), l.push(Ye, Ze, $e), G += 6;
+ const He = d + Le + j * ne, Ye = d + Le + j * (ne + 1), $e = d + (Le + 1) + j * (ne + 1), Je = d + (Le + 1) + j * ne;
+ l.push(He, Ye, Je), l.push(Ye, $e, Je), G += 6;
}
o.addGroup(m, G, S), m += G, d += te;
}
@@ -9752,43 +9820,43 @@ class vs extends si {
return new vs(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);
}
}
-function $s(r) {
+function $s(n) {
const e = {};
- for (const t in r) {
+ for (const t in n) {
e[t] = {};
- for (const i in r[t]) {
- const s = r[t][i];
+ for (const i in n[t]) {
+ const s = n[t][i];
s && (s.isColor || s.isMatrix3 || s.isMatrix4 || s.isVector2 || s.isVector3 || s.isVector4 || s.isTexture || s.isQuaternion) ? s.isRenderTargetTexture ? (Se("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."), e[t][i] = null) : e[t][i] = s.clone() : Array.isArray(s) ? e[t][i] = s.slice() : e[t][i] = s;
}
}
return e;
}
-function kt(r) {
+function zt(n) {
const e = {};
- for (let t = 0; t < r.length; t++) {
- const i = $s(r[t]);
+ for (let t = 0; t < n.length; t++) {
+ const i = $s(n[t]);
for (const s in i)
e[s] = i[s];
}
return e;
}
-function bd(r) {
+function yd(n) {
const e = [];
- for (let t = 0; t < r.length; t++)
- e.push(r[t].clone());
+ for (let t = 0; t < n.length; t++)
+ e.push(n[t].clone());
return e;
}
-function fh(r) {
- const e = r.getRenderTarget();
- return e === null ? r.outputColorSpace : e.isXRRenderTarget === !0 ? e.texture.colorSpace : qe.workingColorSpace;
+function fh(n) {
+ const e = n.getRenderTarget();
+ return e === null ? n.outputColorSpace : e.isXRRenderTarget === !0 ? e.texture.colorSpace : qe.workingColorSpace;
}
-const mi = { clone: $s, merge: kt };
+const fi = { clone: $s, merge: zt };
var Md = `void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`, Sd = `void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;
-class ut extends ii {
+class ut extends si {
/**
* Constructs a new shader material.
*
@@ -9811,36 +9879,36 @@ class ut extends ii {
}, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && this.setValues(e);
}
copy(e) {
- return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = $s(e.uniforms), this.uniformsGroups = bd(e.uniformsGroups), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.clipping = e.clipping, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this;
+ return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = $s(e.uniforms), this.uniformsGroups = yd(e.uniformsGroups), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.clipping = e.clipping, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this;
}
toJSON(e) {
const t = super.toJSON(e);
t.glslVersion = this.glslVersion, t.uniforms = {};
for (const s in this.uniforms) {
- const n = this.uniforms[s].value;
- n && n.isTexture ? t.uniforms[s] = {
+ const r = this.uniforms[s].value;
+ r && r.isTexture ? t.uniforms[s] = {
type: "t",
- value: n.toJSON(e).uuid
- } : n && n.isColor ? t.uniforms[s] = {
+ value: r.toJSON(e).uuid
+ } : r && r.isColor ? t.uniforms[s] = {
type: "c",
- value: n.getHex()
- } : n && n.isVector2 ? t.uniforms[s] = {
+ value: r.getHex()
+ } : r && r.isVector2 ? t.uniforms[s] = {
type: "v2",
- value: n.toArray()
- } : n && n.isVector3 ? t.uniforms[s] = {
+ value: r.toArray()
+ } : r && r.isVector3 ? t.uniforms[s] = {
type: "v3",
- value: n.toArray()
- } : n && n.isVector4 ? t.uniforms[s] = {
+ value: r.toArray()
+ } : r && r.isVector4 ? t.uniforms[s] = {
type: "v4",
- value: n.toArray()
- } : n && n.isMatrix3 ? t.uniforms[s] = {
+ value: r.toArray()
+ } : r && r.isMatrix3 ? t.uniforms[s] = {
type: "m3",
- value: n.toArray()
- } : n && n.isMatrix4 ? t.uniforms[s] = {
+ value: r.toArray()
+ } : r && r.isMatrix4 ? t.uniforms[s] = {
type: "m4",
- value: n.toArray()
+ value: r.toArray()
} : t.uniforms[s] = {
- value: n
+ value: r
};
}
Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader, t.lights = this.lights, t.clipping = this.clipping;
@@ -9891,7 +9959,7 @@ class gh extends mt {
return new this.constructor().copy(this);
}
}
-const $i = /* @__PURE__ */ new w(), Nl = /* @__PURE__ */ new oe(), Ol = /* @__PURE__ */ new oe();
+const $i = /* @__PURE__ */ new w(), Nl = /* @__PURE__ */ new oe(), Bl = /* @__PURE__ */ new oe();
class Tt extends gh {
/**
* Constructs a new perspective camera.
@@ -9926,7 +9994,7 @@ class Tt extends gh {
* @return {number} The computed focal length.
*/
getFocalLength() {
- const e = Math.tan(Mr * 0.5 * this.fov);
+ const e = Math.tan(Sn * 0.5 * this.fov);
return 0.5 * this.getFilmHeight() / e;
}
/**
@@ -9936,7 +10004,7 @@ class Tt extends gh {
*/
getEffectiveFOV() {
return Zs * 2 * Math.atan(
- Math.tan(Mr * 0.5 * this.fov) / this.zoom
+ Math.tan(Sn * 0.5 * this.fov) / this.zoom
);
}
/**
@@ -9976,7 +10044,7 @@ class Tt extends gh {
* @returns {Vector2} The view size.
*/
getViewSize(e, t) {
- return this.getViewBounds(e, Nl, Ol), t.subVectors(Ol, Nl);
+ return this.getViewBounds(e, Nl, Bl), t.subVectors(Bl, Nl);
}
/**
* Sets an offset in a larger frustum. This is useful for multi-window or
@@ -10021,7 +10089,7 @@ class Tt extends gh {
* @param {number} width - The width of subcamera.
* @param {number} height - The height of subcamera.
*/
- setViewOffset(e, t, i, s, n, a) {
+ setViewOffset(e, t, i, s, r, a) {
this.aspect = e / t, this.view === null && (this.view = {
enabled: !0,
fullWidth: 1,
@@ -10030,7 +10098,7 @@ class Tt extends gh {
offsetY: 0,
width: 1,
height: 1
- }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = s, this.view.width = n, this.view.height = a, this.updateProjectionMatrix();
+ }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = s, this.view.width = r, this.view.height = a, this.updateProjectionMatrix();
}
/**
* Removes the view offset from the projection matrix.
@@ -10044,14 +10112,14 @@ class Tt extends gh {
*/
updateProjectionMatrix() {
const e = this.near;
- let t = e * Math.tan(Mr * 0.5 * this.fov) / this.zoom, i = 2 * t, s = this.aspect * i, n = -0.5 * s;
+ let t = e * Math.tan(Sn * 0.5 * this.fov) / this.zoom, i = 2 * t, s = this.aspect * i, r = -0.5 * s;
const a = this.view;
if (this.view !== null && this.view.enabled) {
const l = a.fullWidth, c = a.fullHeight;
- n += a.offsetX * s / l, t -= a.offsetY * i / c, s *= a.width / l, i *= a.height / c;
+ r += a.offsetX * s / l, t -= a.offsetY * i / c, s *= a.width / l, i *= a.height / c;
}
const o = this.filmOffset;
- o !== 0 && (n += e * o / this.getFilmWidth()), this.projectionMatrix.makePerspective(n, n + s, t, t - i, e, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
+ o !== 0 && (r += e * o / this.getFilmWidth()), this.projectionMatrix.makePerspective(r, r + s, t, t - i, e, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
}
toJSON(e) {
const t = super.toJSON(e);
@@ -10071,8 +10139,8 @@ class Td extends mt {
super(), this.type = "CubeCamera", this.renderTarget = i, this.coordinateSystem = null, this.activeMipmapLevel = 0;
const s = new Tt(Ds, Is, e, t);
s.layers = this.layers, this.add(s);
- const n = new Tt(Ds, Is, e, t);
- n.layers = this.layers, this.add(n);
+ const r = new Tt(Ds, Is, e, t);
+ r.layers = this.layers, this.add(r);
const a = new Tt(Ds, Is, e, t);
a.layers = this.layers, this.add(a);
const o = new Tt(Ds, Is, e, t);
@@ -10086,12 +10154,12 @@ class Td extends mt {
* Must be called when the coordinate system of the cube camera is changed.
*/
updateCoordinateSystem() {
- const e = this.coordinateSystem, t = this.children.concat(), [i, s, n, a, o, l] = t;
+ const e = this.coordinateSystem, t = this.children.concat(), [i, s, r, a, o, l] = t;
for (const c of t) this.remove(c);
if (e === Ci)
- i.up.set(0, 1, 0), i.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), n.up.set(0, 0, -1), n.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), l.up.set(0, 1, 0), l.lookAt(0, 0, -1);
- else if (e === Cn)
- i.up.set(0, -1, 0), i.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), n.up.set(0, 0, 1), n.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), l.up.set(0, -1, 0), l.lookAt(0, 0, -1);
+ i.up.set(0, 1, 0), i.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), l.up.set(0, 1, 0), l.lookAt(0, 0, -1);
+ else if (e === Cr)
+ i.up.set(0, -1, 0), i.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), l.up.set(0, -1, 0), l.lookAt(0, 0, -1);
else
throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + e);
for (const c of t)
@@ -10108,10 +10176,10 @@ class Td extends mt {
this.parent === null && this.updateMatrixWorld();
const { renderTarget: i, activeMipmapLevel: s } = this;
this.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem, this.updateCoordinateSystem());
- const [n, a, o, l, c, h] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), m = e.getActiveMipmapLevel(), g = e.xr.enabled;
+ const [r, a, o, l, c, h] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), m = e.getActiveMipmapLevel(), g = e.xr.enabled;
e.xr.enabled = !1;
const v = i.texture.generateMipmaps;
- i.texture.generateMipmaps = !1, e.setRenderTarget(i, 0, s), e.render(t, n), e.setRenderTarget(i, 1, s), e.render(t, a), e.setRenderTarget(i, 2, s), e.render(t, o), e.setRenderTarget(i, 3, s), e.render(t, l), e.setRenderTarget(i, 4, s), e.render(t, c), i.texture.generateMipmaps = v, e.setRenderTarget(i, 5, s), e.render(t, h), e.setRenderTarget(u, d, m), e.xr.enabled = g, i.texture.needsPMREMUpdate = !0;
+ i.texture.generateMipmaps = !1, e.setRenderTarget(i, 0, s), e.render(t, r), e.setRenderTarget(i, 1, s), e.render(t, a), e.setRenderTarget(i, 2, s), e.render(t, o), e.setRenderTarget(i, 3, s), e.render(t, l), e.setRenderTarget(i, 4, s), e.render(t, c), i.texture.generateMipmaps = v, e.setRenderTarget(i, 5, s), e.render(t, h), e.setRenderTarget(u, d, m), e.xr.enabled = g, i.texture.needsPMREMUpdate = !0;
}
}
class Go extends Pt {
@@ -10129,8 +10197,8 @@ class Go extends Pt {
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
* @param {string} [colorSpace=NoColorSpace] - The color space value.
*/
- constructor(e = [], t = Xs, i, s, n, a, o, l, c, h) {
- super(e, t, i, s, n, a, o, l, c, h), this.isCubeTexture = !0, this.flipY = !1;
+ constructor(e = [], t = Xs, i, s, r, a, o, l, c, h) {
+ super(e, t, i, s, r, a, o, l, c, h), this.isCubeTexture = !0, this.flipY = !1;
}
/**
* Alias for {@link CubeTexture#image}.
@@ -10144,7 +10212,7 @@ class Go extends Pt {
this.image = e;
}
}
-class Ed extends bt {
+class Ed extends yt {
/**
* Constructs a new cube render target.
*
@@ -10212,16 +10280,16 @@ class Ed extends bt {
}
`
)
- }, s = new vs(5, 5, 5), n = new ut({
+ }, s = new vs(5, 5, 5), r = new ut({
name: "CubemapFromEquirect",
uniforms: $s(i.uniforms),
vertexShader: i.vertexShader,
fragmentShader: i.fragmentShader,
- side: Ht,
- blending: yt
+ side: Vt,
+ blending: bt
});
- n.uniforms.tEquirect.value = t;
- const a = new at(s, n), o = t.minFilter;
+ r.uniforms.tEquirect.value = t;
+ const a = new ot(s, r), o = t.minFilter;
return t.minFilter === wi && (t.minFilter = Mt), new Td(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;
}
/**
@@ -10233,10 +10301,10 @@ class Ed extends bt {
* @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
*/
clear(e, t = !0, i = !0, s = !0) {
- const n = e.getRenderTarget();
+ const r = e.getRenderTarget();
for (let a = 0; a < 6; a++)
e.setRenderTarget(this, a), e.clear(t, i, s);
- e.setRenderTarget(n);
+ e.setRenderTarget(r);
}
}
let Gi = class extends mt {
@@ -10321,7 +10389,7 @@ class la {
* @return {WebXRController} A reference to this instance.
*/
update(e, t, i) {
- let s = null, n = null, a = null;
+ let s = null, r = null, a = null;
const o = this._targetRay, l = this._grip, c = this._hand;
if (e && t.session.visibilityState !== "visible-blurred") {
if (c && e.hand) {
@@ -10341,10 +10409,10 @@ class la {
target: this
}));
} else
- l !== null && e.gripSpace && (n = t.getPose(e.gripSpace, i), n !== null && (l.matrix.fromArray(n.transform.matrix), l.matrix.decompose(l.position, l.rotation, l.scale), l.matrixWorldNeedsUpdate = !0, n.linearVelocity ? (l.hasLinearVelocity = !0, l.linearVelocity.copy(n.linearVelocity)) : l.hasLinearVelocity = !1, n.angularVelocity ? (l.hasAngularVelocity = !0, l.angularVelocity.copy(n.angularVelocity)) : l.hasAngularVelocity = !1));
- o !== null && (s = t.getPose(e.targetRaySpace, i), s === null && n !== null && (s = n), s !== null && (o.matrix.fromArray(s.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(s.linearVelocity)) : o.hasLinearVelocity = !1, s.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(s.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(wd)));
+ l !== null && e.gripSpace && (r = t.getPose(e.gripSpace, i), r !== null && (l.matrix.fromArray(r.transform.matrix), l.matrix.decompose(l.position, l.rotation, l.scale), l.matrixWorldNeedsUpdate = !0, r.linearVelocity ? (l.hasLinearVelocity = !0, l.linearVelocity.copy(r.linearVelocity)) : l.hasLinearVelocity = !1, r.angularVelocity ? (l.hasAngularVelocity = !0, l.angularVelocity.copy(r.angularVelocity)) : l.hasAngularVelocity = !1));
+ o !== null && (s = t.getPose(e.targetRaySpace, i), s === null && r !== null && (s = r), s !== null && (o.matrix.fromArray(s.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(s.linearVelocity)) : o.hasLinearVelocity = !1, s.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(s.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(wd)));
}
- return o !== null && (o.visible = s !== null), l !== null && (l.visible = n !== null), c !== null && (c.visible = a !== null), this;
+ return o !== null && (o.visible = s !== null), l !== null && (l.visible = r !== null), c !== null && (c.visible = a !== null), this;
}
/**
* Returns a group representing the hand joint for the given input joint.
@@ -10367,7 +10435,7 @@ class Wo extends mt {
* Constructs a new scene.
*/
constructor() {
- super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new xi(), this.environmentIntensity = 1, this.environmentRotation = new xi(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
+ super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new bi(), this.environmentIntensity = 1, this.environmentRotation = new bi(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
}
copy(e, t) {
return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), this.backgroundBlurriness = e.backgroundBlurriness, this.backgroundIntensity = e.backgroundIntensity, this.backgroundRotation.copy(e.backgroundRotation), this.environmentIntensity = e.environmentIntensity, this.environmentRotation.copy(e.environmentRotation), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.matrixAutoUpdate = e.matrixAutoUpdate, this;
@@ -10385,7 +10453,7 @@ class Cd {
* @param {number} stride - The number of typed-array elements per vertex.
*/
constructor(e, t) {
- this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = vo, this.updateRanges = [], this.version = 0, this.uuid = fi();
+ this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = vo, this.updateRanges = [], this.version = 0, this.uuid = gi();
}
/**
* A callback function that is executed after the renderer has transferred the attribute array
@@ -10449,7 +10517,7 @@ class Cd {
*/
copyAt(e, t, i) {
e *= this.stride, i *= t.stride;
- for (let s = 0, n = this.stride; s < n; s++)
+ for (let s = 0, r = this.stride; s < r; s++)
this.array[e + s] = t.array[i + s];
return this;
}
@@ -10470,7 +10538,7 @@ class Cd {
* @return {InterleavedBuffer} A clone of this instance.
*/
clone(e) {
- e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = fi()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);
+ e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = gi()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);
const t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), i = new this.constructor(t, this.stride);
return i.setUsage(this.usage), i;
}
@@ -10492,7 +10560,7 @@ class Cd {
* @return {Object} A JSON object representing the serialized interleaved buffer.
*/
toJSON(e) {
- return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = fi()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), {
+ return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = gi()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), {
uuid: this.uuid,
buffer: this.array.buffer._uuid,
type: this.array.constructor.name,
@@ -10586,7 +10654,7 @@ class jo {
*/
getComponent(e, t) {
let i = this.array[e * this.data.stride + this.offset + t];
- return this.normalized && (i = di(i, this.array)), i;
+ return this.normalized && (i = pi(i, this.array)), i;
}
/**
* Sets the given value to the given component of the vector at the given index.
@@ -10597,7 +10665,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setComponent(e, t, i) {
- return this.normalized && (i = it(i, this.array)), this.data.array[e * this.data.stride + this.offset + t] = i, this;
+ return this.normalized && (i = st(i, this.array)), this.data.array[e * this.data.stride + this.offset + t] = i, this;
}
/**
* Sets the x component of the vector at the given index.
@@ -10607,7 +10675,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setX(e, t) {
- return this.normalized && (t = it(t, this.array)), this.data.array[e * this.data.stride + this.offset] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.data.array[e * this.data.stride + this.offset] = t, this;
}
/**
* Sets the y component of the vector at the given index.
@@ -10617,7 +10685,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setY(e, t) {
- return this.normalized && (t = it(t, this.array)), this.data.array[e * this.data.stride + this.offset + 1] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.data.array[e * this.data.stride + this.offset + 1] = t, this;
}
/**
* Sets the z component of the vector at the given index.
@@ -10627,7 +10695,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setZ(e, t) {
- return this.normalized && (t = it(t, this.array)), this.data.array[e * this.data.stride + this.offset + 2] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.data.array[e * this.data.stride + this.offset + 2] = t, this;
}
/**
* Sets the w component of the vector at the given index.
@@ -10637,7 +10705,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setW(e, t) {
- return this.normalized && (t = it(t, this.array)), this.data.array[e * this.data.stride + this.offset + 3] = t, this;
+ return this.normalized && (t = st(t, this.array)), this.data.array[e * this.data.stride + this.offset + 3] = t, this;
}
/**
* Returns the x component of the vector at the given index.
@@ -10647,7 +10715,7 @@ class jo {
*/
getX(e) {
let t = this.data.array[e * this.data.stride + this.offset];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Returns the y component of the vector at the given index.
@@ -10657,7 +10725,7 @@ class jo {
*/
getY(e) {
let t = this.data.array[e * this.data.stride + this.offset + 1];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Returns the z component of the vector at the given index.
@@ -10667,7 +10735,7 @@ class jo {
*/
getZ(e) {
let t = this.data.array[e * this.data.stride + this.offset + 2];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Returns the w component of the vector at the given index.
@@ -10677,7 +10745,7 @@ class jo {
*/
getW(e) {
let t = this.data.array[e * this.data.stride + this.offset + 3];
- return this.normalized && (t = di(t, this.array)), t;
+ return this.normalized && (t = pi(t, this.array)), t;
}
/**
* Sets the x and y component of the vector at the given index.
@@ -10688,7 +10756,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setXY(e, t, i) {
- return e = e * this.data.stride + this.offset, this.normalized && (t = it(t, this.array), i = it(i, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this;
+ return e = e * this.data.stride + this.offset, this.normalized && (t = st(t, this.array), i = st(i, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this;
}
/**
* Sets the x, y and z component of the vector at the given index.
@@ -10700,7 +10768,7 @@ class jo {
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
setXYZ(e, t, i, s) {
- return e = e * this.data.stride + this.offset, this.normalized && (t = it(t, this.array), i = it(i, this.array), s = it(s, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = s, this;
+ return e = e * this.data.stride + this.offset, this.normalized && (t = st(t, this.array), i = st(i, this.array), s = st(s, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = s, this;
}
/**
* Sets the x, y, z and w component of the vector at the given index.
@@ -10712,8 +10780,8 @@ class jo {
* @param {number} w - The value for the w component to set.
* @return {InterleavedBufferAttribute} A reference to this instance.
*/
- setXYZW(e, t, i, s, n) {
- return e = e * this.data.stride + this.offset, this.normalized && (t = it(t, this.array), i = it(i, this.array), s = it(s, this.array), n = it(n, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = s, this.data.array[e + 3] = n, this;
+ setXYZW(e, t, i, s, r) {
+ return e = e * this.data.stride + this.offset, this.normalized && (t = st(t, this.array), i = st(i, this.array), s = st(s, this.array), r = st(r, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = s, this.data.array[e + 3] = r, this;
}
/**
* Returns a new buffer attribute with copied values from this instance.
@@ -10725,14 +10793,14 @@ class jo {
*/
clone(e) {
if (e === void 0) {
- An("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
+ Ar("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
const t = [];
for (let i = 0; i < this.count; i++) {
const s = i * this.data.stride + this.offset;
- for (let n = 0; n < this.itemSize; n++)
- t.push(this.data.array[s + n]);
+ for (let r = 0; r < this.itemSize; r++)
+ t.push(this.data.array[s + r]);
}
- return new Vt(new this.array.constructor(t), this.itemSize, this.normalized);
+ return new Gt(new this.array.constructor(t), this.itemSize, this.normalized);
} else
return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new jo(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);
}
@@ -10746,12 +10814,12 @@ class jo {
*/
toJSON(e) {
if (e === void 0) {
- An("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
+ Ar("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
const t = [];
for (let i = 0; i < this.count; i++) {
const s = i * this.data.stride + this.offset;
- for (let n = 0; n < this.itemSize; n++)
- t.push(this.data.array[s + n]);
+ for (let r = 0; r < this.itemSize; r++)
+ t.push(this.data.array[s + r]);
}
return {
itemSize: this.itemSize,
@@ -10769,8 +10837,8 @@ class jo {
};
}
}
-const Bl = /* @__PURE__ */ new w(), Fl = /* @__PURE__ */ new Je(), kl = /* @__PURE__ */ new Je(), Ad = /* @__PURE__ */ new w(), zl = /* @__PURE__ */ new Ne(), tn = /* @__PURE__ */ new w(), ca = /* @__PURE__ */ new Li(), Hl = /* @__PURE__ */ new Ne(), ha = /* @__PURE__ */ new ir();
-class Rd extends at {
+const Ol = /* @__PURE__ */ new w(), kl = /* @__PURE__ */ new Qe(), Fl = /* @__PURE__ */ new Qe(), Ad = /* @__PURE__ */ new w(), zl = /* @__PURE__ */ new Ne(), ir = /* @__PURE__ */ new w(), ca = /* @__PURE__ */ new Li(), Hl = /* @__PURE__ */ new Ne(), ha = /* @__PURE__ */ new sn();
+class Rd extends ot {
/**
* Constructs a new skinned mesh.
*
@@ -10791,7 +10859,7 @@ class Rd extends at {
this.boundingBox === null && (this.boundingBox = new Lt()), this.boundingBox.makeEmpty();
const t = e.getAttribute("position");
for (let i = 0; i < t.count; i++)
- this.getVertexPosition(i, tn), this.boundingBox.expandByPoint(tn);
+ this.getVertexPosition(i, ir), this.boundingBox.expandByPoint(ir);
}
/**
* Computes the bounding sphere of the skinned mesh, and updates {@link SkinnedMesh#boundingSphere}.
@@ -10804,7 +10872,7 @@ class Rd extends at {
this.boundingSphere === null && (this.boundingSphere = new Li()), this.boundingSphere.makeEmpty();
const t = e.getAttribute("position");
for (let i = 0; i < t.count; i++)
- this.getVertexPosition(i, tn), this.boundingSphere.expandByPoint(tn);
+ this.getVertexPosition(i, ir), this.boundingSphere.expandByPoint(ir);
}
copy(e, t) {
return super.copy(e, t), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this;
@@ -10837,11 +10905,11 @@ class Rd extends at {
* in the skinned mesh's geometry.
*/
normalizeSkinWeights() {
- const e = new Je(), t = this.geometry.attributes.skinWeight;
+ const e = new Qe(), t = this.geometry.attributes.skinWeight;
for (let i = 0, s = t.count; i < s; i++) {
e.fromBufferAttribute(t, i);
- const n = 1 / e.manhattanLength();
- n !== 1 / 0 ? e.multiplyScalar(n) : e.set(1, 0, 0, 0), t.setXYZW(i, e.x, e.y, e.z, e.w);
+ const r = 1 / e.manhattanLength();
+ r !== 1 / 0 ? e.multiplyScalar(r) : e.set(1, 0, 0, 0), t.setXYZW(i, e.x, e.y, e.z, e.w);
}
}
updateMatrixWorld(e) {
@@ -10858,12 +10926,12 @@ class Rd extends at {
*/
applyBoneTransform(e, t) {
const i = this.skeleton, s = this.geometry;
- Fl.fromBufferAttribute(s.attributes.skinIndex, e), kl.fromBufferAttribute(s.attributes.skinWeight, e), Bl.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0);
- for (let n = 0; n < 4; n++) {
- const a = kl.getComponent(n);
+ kl.fromBufferAttribute(s.attributes.skinIndex, e), Fl.fromBufferAttribute(s.attributes.skinWeight, e), Ol.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0);
+ for (let r = 0; r < 4; r++) {
+ const a = Fl.getComponent(r);
if (a !== 0) {
- const o = Fl.getComponent(n);
- zl.multiplyMatrices(i.bones[o].matrixWorld, i.boneInverses[o]), t.addScaledVector(Ad.copy(Bl).applyMatrix4(zl), a);
+ const o = kl.getComponent(r);
+ zl.multiplyMatrices(i.bones[o].matrixWorld, i.boneInverses[o]), t.addScaledVector(Ad.copy(Ol).applyMatrix4(zl), a);
}
}
return t.applyMatrix4(this.bindMatrixInverse);
@@ -10877,7 +10945,7 @@ class vh extends mt {
super(), this.isBone = !0, this.type = "Bone";
}
}
-class sr extends Pt {
+class nn extends Pt {
/**
* Constructs a new data texture.
*
@@ -10894,8 +10962,8 @@ class sr extends Pt {
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
* @param {string} [colorSpace=NoColorSpace] - The color space.
*/
- constructor(e = null, t = 1, i = 1, s, n, a, o, l, c = Ut, h = Ut, u, d) {
- super(null, a, o, l, c, h, s, n, u, d), this.isDataTexture = !0, this.image = { data: e, width: t, height: i }, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
+ constructor(e = null, t = 1, i = 1, s, r, a, o, l, c = Nt, h = Nt, u, d) {
+ super(null, a, o, l, c, h, s, r, u, d), this.isDataTexture = !0, this.image = { data: e, width: t, height: i }, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
}
}
const Vl = /* @__PURE__ */ new Ne(), Pd = /* @__PURE__ */ new Ne();
@@ -10908,7 +10976,7 @@ class Xo {
* If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}.
*/
constructor(e = [], t = []) {
- this.uuid = fi(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init();
+ this.uuid = gi(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init();
}
/**
* Initializes the skeleton. This method gets automatically called by the constructor
@@ -10954,9 +11022,9 @@ class Xo {
*/
update() {
const e = this.bones, t = this.boneInverses, i = this.boneMatrices, s = this.boneTexture;
- for (let n = 0, a = e.length; n < a; n++) {
- const o = e[n] ? e[n].matrixWorld : Pd;
- Vl.multiplyMatrices(o, t[n]), Vl.toArray(i, n * 16);
+ for (let r = 0, a = e.length; r < a; r++) {
+ const o = e[r] ? e[r].matrixWorld : Pd;
+ Vl.multiplyMatrices(o, t[r]), Vl.toArray(i, r * 16);
}
s !== null && (s.needsUpdate = !0);
}
@@ -10978,7 +11046,7 @@ class Xo {
e = Math.ceil(e / 4) * 4, e = Math.max(e, 4);
const t = new Float32Array(e * e * 4);
t.set(this.boneMatrices);
- const i = new sr(t, e, e, $t, Xt);
+ const i = new nn(t, e, e, Jt, qt);
return i.needsUpdate = !0, this.boneMatrices = t, this.boneTexture = i, this;
}
/**
@@ -11012,9 +11080,9 @@ class Xo {
fromJSON(e, t) {
this.uuid = e.uuid;
for (let i = 0, s = e.bones.length; i < s; i++) {
- const n = e.bones[i];
- let a = t[n];
- a === void 0 && (Se("Skeleton: No bone found with UUID:", n), a = new vh()), this.bones.push(a), this.boneInverses.push(new Ne().fromArray(e.boneInverses[i]));
+ const r = e.bones[i];
+ let a = t[r];
+ a === void 0 && (Se("Skeleton: No bone found with UUID:", r), a = new vh()), this.bones.push(a), this.boneInverses.push(new Ne().fromArray(e.boneInverses[i]));
}
return this.init(), this;
}
@@ -11036,7 +11104,7 @@ class Xo {
};
e.uuid = this.uuid;
const t = this.bones, i = this.boneInverses;
- for (let s = 0, n = t.length; s < n; s++) {
+ for (let s = 0, r = t.length; s < r; s++) {
const a = t[s];
e.bones.push(a.uuid);
const o = i[s];
@@ -11045,7 +11113,7 @@ class Xo {
return e;
}
}
-class _o extends Vt {
+class _o extends Gt {
/**
* Constructs a new instanced buffer attribute.
*
@@ -11065,8 +11133,8 @@ class _o extends Vt {
return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e;
}
}
-const Us = /* @__PURE__ */ new Ne(), Gl = /* @__PURE__ */ new Ne(), sn = [], Wl = /* @__PURE__ */ new Lt(), Ld = /* @__PURE__ */ new Ne(), dr = /* @__PURE__ */ new at(), pr = /* @__PURE__ */ new Li();
-class Dd extends at {
+const Us = /* @__PURE__ */ new Ne(), Gl = /* @__PURE__ */ new Ne(), sr = [], Wl = /* @__PURE__ */ new Lt(), Ld = /* @__PURE__ */ new Ne(), pn = /* @__PURE__ */ new ot(), mn = /* @__PURE__ */ new Li();
+class Dd extends ot {
/**
* Constructs a new instanced mesh.
*
@@ -11099,7 +11167,7 @@ class Dd extends at {
const e = this.geometry, t = this.count;
this.boundingSphere === null && (this.boundingSphere = new Li()), e.boundingSphere === null && e.computeBoundingSphere(), this.boundingSphere.makeEmpty();
for (let i = 0; i < t; i++)
- this.getMatrixAt(i, Us), pr.copy(e.boundingSphere).applyMatrix4(Us), this.boundingSphere.union(pr);
+ this.getMatrixAt(i, Us), mn.copy(e.boundingSphere).applyMatrix4(Us), this.boundingSphere.union(mn);
}
copy(e, t) {
return super.copy(e, t), this.instanceMatrix.copy(e.instanceMatrix), e.morphTexture !== null && (this.morphTexture = e.morphTexture.clone()), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this;
@@ -11129,20 +11197,20 @@ class Dd extends at {
* @param {Mesh} object - The target object that is used to store the method's result.
*/
getMorphAt(e, t) {
- const i = t.morphTargetInfluences, s = this.morphTexture.source.data.data, n = i.length + 1, a = e * n + 1;
+ const i = t.morphTargetInfluences, s = this.morphTexture.source.data.data, r = i.length + 1, a = e * r + 1;
for (let o = 0; o < i.length; o++)
i[o] = s[a + o];
}
raycast(e, t) {
const i = this.matrixWorld, s = this.count;
- if (dr.geometry = this.geometry, dr.material = this.material, dr.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), pr.copy(this.boundingSphere), pr.applyMatrix4(i), e.ray.intersectsSphere(pr) !== !1))
- for (let n = 0; n < s; n++) {
- this.getMatrixAt(n, Us), Gl.multiplyMatrices(i, Us), dr.matrixWorld = Gl, dr.raycast(e, sn);
- for (let a = 0, o = sn.length; a < o; a++) {
- const l = sn[a];
- l.instanceId = n, l.object = this, t.push(l);
+ if (pn.geometry = this.geometry, pn.material = this.material, pn.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), mn.copy(this.boundingSphere), mn.applyMatrix4(i), e.ray.intersectsSphere(mn) !== !1))
+ for (let r = 0; r < s; r++) {
+ this.getMatrixAt(r, Us), Gl.multiplyMatrices(i, Us), pn.matrixWorld = Gl, pn.raycast(e, sr);
+ for (let a = 0, o = sr.length; a < o; a++) {
+ const l = sr[a];
+ l.instanceId = r, l.object = this, t.push(l);
}
- sn.length = 0;
+ sr.length = 0;
}
}
/**
@@ -11175,13 +11243,13 @@ class Dd extends at {
*/
setMorphAt(e, t) {
const i = t.morphTargetInfluences, s = i.length + 1;
- this.morphTexture === null && (this.morphTexture = new sr(new Float32Array(s * this.count), s, this.count, Uo, Xt));
- const n = this.morphTexture.source.data.data;
+ this.morphTexture === null && (this.morphTexture = new nn(new Float32Array(s * this.count), s, this.count, Uo, qt));
+ const r = this.morphTexture.source.data.data;
let a = 0;
for (let c = 0; c < i.length; c++)
a += i[c];
const o = this.geometry.morphTargetsRelative ? 1 : 1 - a, l = s * e;
- n[l] = o, n.set(i, l + 1);
+ r[l] = o, r.set(i, l + 1);
}
updateMorphTargets() {
}
@@ -11193,7 +11261,7 @@ class Dd extends at {
this.dispatchEvent({ type: "dispose" }), this.morphTexture !== null && (this.morphTexture.dispose(), this.morphTexture = null);
}
}
-const ua = /* @__PURE__ */ new w(), Id = /* @__PURE__ */ new w(), Ud = /* @__PURE__ */ new Fe();
+const ua = /* @__PURE__ */ new w(), Id = /* @__PURE__ */ new w(), Ud = /* @__PURE__ */ new ke();
class Ti {
/**
* Constructs a new plane.
@@ -11319,8 +11387,8 @@ class Ti {
const i = e.delta(ua), s = this.normal.dot(i);
if (s === 0)
return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;
- const n = -(e.start.dot(this.normal) + this.constant) / s;
- return n < 0 || n > 1 ? null : t.copy(e.start).addScaledVector(i, n);
+ const r = -(e.start.dot(this.normal) + this.constant) / s;
+ return r < 0 || r > 1 ? null : t.copy(e.start).addScaledVector(i, r);
}
/**
* Returns `true` if the given line segment intersects with (passes through) the plane.
@@ -11373,8 +11441,8 @@ class Ti {
* @return {Plane} A reference to this plane.
*/
applyMatrix4(e, t) {
- const i = t || Ud.getNormalMatrix(e), s = this.coplanarPoint(ua).applyMatrix4(e), n = this.normal.applyMatrix3(i).normalize();
- return this.constant = -s.dot(n), this;
+ const i = t || Ud.getNormalMatrix(e), s = this.coplanarPoint(ua).applyMatrix4(e), r = this.normal.applyMatrix3(i).normalize();
+ return this.constant = -s.dot(r), this;
}
/**
* Translates the plane by the distance defined by the given offset vector.
@@ -11404,7 +11472,7 @@ class Ti {
return new this.constructor().copy(this);
}
}
-const us = /* @__PURE__ */ new Li(), Nd = /* @__PURE__ */ new oe(0.5, 0.5), rn = /* @__PURE__ */ new w();
+const us = /* @__PURE__ */ new Li(), Nd = /* @__PURE__ */ new oe(0.5, 0.5), nr = /* @__PURE__ */ new w();
class qo {
/**
* Constructs a new frustum.
@@ -11416,8 +11484,8 @@ class qo {
* @param {Plane} [p4] - The fifth plane that encloses the frustum.
* @param {Plane} [p5] - The sixth plane that encloses the frustum.
*/
- constructor(e = new Ti(), t = new Ti(), i = new Ti(), s = new Ti(), n = new Ti(), a = new Ti()) {
- this.planes = [e, t, i, s, n, a];
+ constructor(e = new Ti(), t = new Ti(), i = new Ti(), s = new Ti(), r = new Ti(), a = new Ti()) {
+ this.planes = [e, t, i, s, r, a];
}
/**
* Sets the frustum planes by copying the given planes.
@@ -11430,9 +11498,9 @@ class qo {
* @param {Plane} [p5] - The sixth plane that encloses the frustum.
* @return {Frustum} A reference to this frustum.
*/
- set(e, t, i, s, n, a) {
+ set(e, t, i, s, r, a) {
const o = this.planes;
- return o[0].copy(e), o[1].copy(t), o[2].copy(i), o[3].copy(s), o[4].copy(n), o[5].copy(a), this;
+ return o[0].copy(e), o[1].copy(t), o[2].copy(i), o[3].copy(s), o[4].copy(r), o[5].copy(a), this;
}
/**
* Copies the values of the given frustum to this instance.
@@ -11455,12 +11523,12 @@ class qo {
* @return {Frustum} A reference to this frustum.
*/
setFromProjectionMatrix(e, t = Ci, i = !1) {
- const s = this.planes, n = e.elements, a = n[0], o = n[1], l = n[2], c = n[3], h = n[4], u = n[5], d = n[6], m = n[7], g = n[8], v = n[9], f = n[10], p = n[11], y = n[12], _ = n[13], E = n[14], R = n[15];
- if (s[0].setComponents(c - a, m - h, p - g, R - y).normalize(), s[1].setComponents(c + a, m + h, p + g, R + y).normalize(), s[2].setComponents(c + o, m + u, p + v, R + _).normalize(), s[3].setComponents(c - o, m - u, p - v, R - _).normalize(), i)
+ const s = this.planes, r = e.elements, a = r[0], o = r[1], l = r[2], c = r[3], h = r[4], u = r[5], d = r[6], m = r[7], g = r[8], v = r[9], f = r[10], p = r[11], b = r[12], _ = r[13], E = r[14], R = r[15];
+ if (s[0].setComponents(c - a, m - h, p - g, R - b).normalize(), s[1].setComponents(c + a, m + h, p + g, R + b).normalize(), s[2].setComponents(c + o, m + u, p + v, R + _).normalize(), s[3].setComponents(c - o, m - u, p - v, R - _).normalize(), i)
s[4].setComponents(l, d, f, E).normalize(), s[5].setComponents(c - l, m - d, p - f, R - E).normalize();
else if (s[4].setComponents(c - l, m - d, p - f, R - E).normalize(), t === Ci)
s[5].setComponents(c + l, m + d, p + f, R + E).normalize();
- else if (t === Cn)
+ else if (t === Cr)
s[5].setComponents(l, d, f, E).normalize();
else
throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + t);
@@ -11502,8 +11570,8 @@ class qo {
*/
intersectsSphere(e) {
const t = this.planes, i = e.center, s = -e.radius;
- for (let n = 0; n < 6; n++)
- if (t[n].distanceToPoint(i) < s)
+ for (let r = 0; r < 6; r++)
+ if (t[r].distanceToPoint(i) < s)
return !1;
return !0;
}
@@ -11517,7 +11585,7 @@ class qo {
const t = this.planes;
for (let i = 0; i < 6; i++) {
const s = t[i];
- if (rn.x = s.normal.x > 0 ? e.max.x : e.min.x, rn.y = s.normal.y > 0 ? e.max.y : e.min.y, rn.z = s.normal.z > 0 ? e.max.z : e.min.z, s.distanceToPoint(rn) < 0)
+ if (nr.x = s.normal.x > 0 ? e.max.x : e.min.x, nr.y = s.normal.y > 0 ? e.max.y : e.min.y, nr.z = s.normal.z > 0 ? e.max.z : e.min.z, s.distanceToPoint(nr) < 0)
return !1;
}
return !0;
@@ -11544,7 +11612,7 @@ class qo {
return new this.constructor().copy(this);
}
}
-class _h extends ii {
+class _h extends si {
/**
* Constructs a new line basic material.
*
@@ -11561,7 +11629,7 @@ class _h extends ii {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.fog = e.fog, this;
}
}
-const Rn = /* @__PURE__ */ new w(), Pn = /* @__PURE__ */ new w(), jl = /* @__PURE__ */ new Ne(), mr = /* @__PURE__ */ new ir(), nn = /* @__PURE__ */ new Li(), da = /* @__PURE__ */ new w(), Xl = /* @__PURE__ */ new w();
+const Rr = /* @__PURE__ */ new w(), Pr = /* @__PURE__ */ new w(), jl = /* @__PURE__ */ new Ne(), fn = /* @__PURE__ */ new sn(), rr = /* @__PURE__ */ new Li(), da = /* @__PURE__ */ new w(), Xl = /* @__PURE__ */ new w();
class Yo extends mt {
/**
* Constructs a new line.
@@ -11569,7 +11637,7 @@ class Yo extends mt {
* @param {BufferGeometry} [geometry] - The line geometry.
* @param {Material|Array} [material] - The line material.
*/
- constructor(e = new si(), t = new _h()) {
+ constructor(e = new ni(), t = new _h()) {
super(), this.isLine = !0, this.type = "Line", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();
}
copy(e, t) {
@@ -11586,9 +11654,9 @@ class Yo extends mt {
const e = this.geometry;
if (e.index === null) {
const t = e.attributes.position, i = [0];
- for (let s = 1, n = t.count; s < n; s++)
- Rn.fromBufferAttribute(t, s - 1), Pn.fromBufferAttribute(t, s), i[s] = i[s - 1], i[s] += Rn.distanceTo(Pn);
- e.setAttribute("lineDistance", new gi(i, 1));
+ for (let s = 1, r = t.count; s < r; s++)
+ Rr.fromBufferAttribute(t, s - 1), Pr.fromBufferAttribute(t, s), i[s] = i[s - 1], i[s] += Rr.distanceTo(Pr);
+ e.setAttribute("lineDistance", new vi(i, 1));
} else
Se("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
return this;
@@ -11600,28 +11668,28 @@ class Yo extends mt {
* @param {Array} intersects - The target array that holds the intersection points.
*/
raycast(e, t) {
- const i = this.geometry, s = this.matrixWorld, n = e.params.Line.threshold, a = i.drawRange;
- if (i.boundingSphere === null && i.computeBoundingSphere(), nn.copy(i.boundingSphere), nn.applyMatrix4(s), nn.radius += n, e.ray.intersectsSphere(nn) === !1) return;
- jl.copy(s).invert(), mr.copy(e.ray).applyMatrix4(jl);
- const o = n / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = this.isLineSegments ? 2 : 1, h = i.index, u = i.attributes.position;
+ const i = this.geometry, s = this.matrixWorld, r = e.params.Line.threshold, a = i.drawRange;
+ if (i.boundingSphere === null && i.computeBoundingSphere(), rr.copy(i.boundingSphere), rr.applyMatrix4(s), rr.radius += r, e.ray.intersectsSphere(rr) === !1) return;
+ jl.copy(s).invert(), fn.copy(e.ray).applyMatrix4(jl);
+ const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = this.isLineSegments ? 2 : 1, h = i.index, u = i.attributes.position;
if (h !== null) {
const d = Math.max(0, a.start), m = Math.min(h.count, a.start + a.count);
for (let g = d, v = m - 1; g < v; g += c) {
- const f = h.getX(g), p = h.getX(g + 1), y = an(this, e, mr, l, f, p, g);
- y && t.push(y);
+ const f = h.getX(g), p = h.getX(g + 1), b = ar(this, e, fn, l, f, p, g);
+ b && t.push(b);
}
if (this.isLineLoop) {
- const g = h.getX(m - 1), v = h.getX(d), f = an(this, e, mr, l, g, v, m - 1);
+ const g = h.getX(m - 1), v = h.getX(d), f = ar(this, e, fn, l, g, v, m - 1);
f && t.push(f);
}
} else {
const d = Math.max(0, a.start), m = Math.min(u.count, a.start + a.count);
for (let g = d, v = m - 1; g < v; g += c) {
- const f = an(this, e, mr, l, g, g + 1, g);
+ const f = ar(this, e, fn, l, g, g + 1, g);
f && t.push(f);
}
if (this.isLineLoop) {
- const g = an(this, e, mr, l, m - 1, d, m - 1);
+ const g = ar(this, e, fn, l, m - 1, d, m - 1);
g && t.push(g);
}
}
@@ -11636,7 +11704,7 @@ class Yo extends mt {
const i = e[t[0]];
if (i !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
- for (let s = 0, n = i.length; s < n; s++) {
+ for (let s = 0, r = i.length; s < r; s++) {
const a = i[s].name || String(s);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s;
}
@@ -11644,26 +11712,26 @@ class Yo extends mt {
}
}
}
-function an(r, e, t, i, s, n, a) {
- const o = r.geometry.attributes.position;
- if (Rn.fromBufferAttribute(o, s), Pn.fromBufferAttribute(o, n), t.distanceSqToSegment(Rn, Pn, da, Xl) > i) return;
- da.applyMatrix4(r.matrixWorld);
+function ar(n, e, t, i, s, r, a) {
+ const o = n.geometry.attributes.position;
+ if (Rr.fromBufferAttribute(o, s), Pr.fromBufferAttribute(o, r), t.distanceSqToSegment(Rr, Pr, da, Xl) > i) return;
+ da.applyMatrix4(n.matrixWorld);
const l = e.ray.origin.distanceTo(da);
if (!(l < e.near || l > e.far))
return {
distance: l,
// What do we want? intersection point on the ray or on the segment??
// point: raycaster.ray.at( distance ),
- point: Xl.clone().applyMatrix4(r.matrixWorld),
+ point: Xl.clone().applyMatrix4(n.matrixWorld),
index: a,
face: null,
faceIndex: null,
barycoord: null,
- object: r
+ object: n
};
}
const ql = /* @__PURE__ */ new w(), Yl = /* @__PURE__ */ new w();
-class Od extends Yo {
+class Bd extends Yo {
/**
* Constructs a new line segments.
*
@@ -11677,15 +11745,15 @@ class Od extends Yo {
const e = this.geometry;
if (e.index === null) {
const t = e.attributes.position, i = [];
- for (let s = 0, n = t.count; s < n; s += 2)
+ for (let s = 0, r = t.count; s < r; s += 2)
ql.fromBufferAttribute(t, s), Yl.fromBufferAttribute(t, s + 1), i[s] = s === 0 ? 0 : i[s - 1], i[s + 1] = i[s] + ql.distanceTo(Yl);
- e.setAttribute("lineDistance", new gi(i, 1));
+ e.setAttribute("lineDistance", new vi(i, 1));
} else
Se("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
return this;
}
}
-class Bd extends Yo {
+class Od extends Yo {
/**
* Constructs a new line loop.
*
@@ -11696,7 +11764,7 @@ class Bd extends Yo {
super(e, t), this.isLineLoop = !0, this.type = "LineLoop";
}
}
-class xh extends ii {
+class xh extends si {
/**
* Constructs a new points material.
*
@@ -11713,15 +11781,15 @@ class xh extends ii {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.fog = e.fog, this;
}
}
-const Kl = /* @__PURE__ */ new Ne(), xo = /* @__PURE__ */ new ir(), on = /* @__PURE__ */ new Li(), ln = /* @__PURE__ */ new w();
-class Fd extends mt {
+const Kl = /* @__PURE__ */ new Ne(), xo = /* @__PURE__ */ new sn(), or = /* @__PURE__ */ new Li(), lr = /* @__PURE__ */ new w();
+class kd extends mt {
/**
* Constructs a new point cloud.
*
* @param {BufferGeometry} [geometry] - The points geometry.
* @param {Material|Array} [material] - The points material.
*/
- constructor(e = new si(), t = new xh()) {
+ constructor(e = new ni(), t = new xh()) {
super(), this.isPoints = !0, this.type = "Points", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();
}
copy(e, t) {
@@ -11734,20 +11802,20 @@ class Fd extends mt {
* @param {Array} intersects - The target array that holds the intersection points.
*/
raycast(e, t) {
- const i = this.geometry, s = this.matrixWorld, n = e.params.Points.threshold, a = i.drawRange;
- if (i.boundingSphere === null && i.computeBoundingSphere(), on.copy(i.boundingSphere), on.applyMatrix4(s), on.radius += n, e.ray.intersectsSphere(on) === !1) return;
+ const i = this.geometry, s = this.matrixWorld, r = e.params.Points.threshold, a = i.drawRange;
+ if (i.boundingSphere === null && i.computeBoundingSphere(), or.copy(i.boundingSphere), or.applyMatrix4(s), or.radius += r, e.ray.intersectsSphere(or) === !1) return;
Kl.copy(s).invert(), xo.copy(e.ray).applyMatrix4(Kl);
- const o = n / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = i.index, h = i.attributes.position;
+ const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = i.index, h = i.attributes.position;
if (c !== null) {
const u = Math.max(0, a.start), d = Math.min(c.count, a.start + a.count);
for (let m = u, g = d; m < g; m++) {
const v = c.getX(m);
- ln.fromBufferAttribute(h, v), Zl(ln, v, l, s, e, t, this);
+ lr.fromBufferAttribute(h, v), Zl(lr, v, l, s, e, t, this);
}
} else {
const u = Math.max(0, a.start), d = Math.min(h.count, a.start + a.count);
for (let m = u, g = d; m < g; m++)
- ln.fromBufferAttribute(h, m), Zl(ln, m, l, s, e, t, this);
+ lr.fromBufferAttribute(h, m), Zl(lr, m, l, s, e, t, this);
}
}
/**
@@ -11760,7 +11828,7 @@ class Fd extends mt {
const i = e[t[0]];
if (i !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
- for (let s = 0, n = i.length; s < n; s++) {
+ for (let s = 0, r = i.length; s < r; s++) {
const a = i[s].name || String(s);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s;
}
@@ -11768,14 +11836,14 @@ class Fd extends mt {
}
}
}
-function Zl(r, e, t, i, s, n, a) {
- const o = xo.distanceSqToPoint(r);
+function Zl(n, e, t, i, s, r, a) {
+ const o = xo.distanceSqToPoint(n);
if (o < t) {
const l = new w();
- xo.closestPointToPoint(r, l), l.applyMatrix4(i);
+ xo.closestPointToPoint(n, l), l.applyMatrix4(i);
const c = s.ray.origin.distanceTo(l);
if (c < s.near || c > s.far) return;
- n.push({
+ r.push({
distance: c,
distanceToRay: Math.sqrt(o),
point: l,
@@ -11803,11 +11871,11 @@ class Ko extends Pt {
* @param {number} [format=DepthFormat] - The texture format.
* @param {number} [depth=1] - The depth of the texture.
*/
- constructor(e, t, i = gs, s, n, a, o = Ut, l = Ut, c, h = Cr, u = 1) {
- if (h !== Cr && h !== Ks)
+ constructor(e, t, i = gs, s, r, a, o = Nt, l = Nt, c, h = An, u = 1) {
+ if (h !== An && h !== Ks)
throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
const d = { width: e, height: t, depth: u };
- super(d, s, n, a, o, l, h, i, c), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;
+ super(d, s, r, a, o, l, h, i, c), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;
}
copy(e) {
return super.copy(e), this.source = new Ho(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this;
@@ -11817,7 +11885,7 @@ class Ko extends Pt {
return this.compareFunction !== null && (t.compareFunction = this.compareFunction), t;
}
}
-class yh extends Pt {
+class bh extends Pt {
/**
* Creates a new raw texture.
*
@@ -11830,7 +11898,7 @@ class yh extends Pt {
return super.copy(e), this.sourceTexture = e.sourceTexture, this;
}
}
-class Dr extends si {
+class In extends ni {
/**
* Constructs a new plane geometry.
*
@@ -11846,20 +11914,20 @@ class Dr extends si {
widthSegments: i,
heightSegments: s
};
- const n = e / 2, a = t / 2, o = Math.floor(i), l = Math.floor(s), c = o + 1, h = l + 1, u = e / o, d = t / l, m = [], g = [], v = [], f = [];
+ const r = e / 2, a = t / 2, o = Math.floor(i), l = Math.floor(s), c = o + 1, h = l + 1, u = e / o, d = t / l, m = [], g = [], v = [], f = [];
for (let p = 0; p < h; p++) {
- const y = p * d - a;
+ const b = p * d - a;
for (let _ = 0; _ < c; _++) {
- const E = _ * u - n;
- g.push(E, -y, 0), v.push(0, 0, 1), f.push(_ / o), f.push(1 - p / l);
+ const E = _ * u - r;
+ g.push(E, -b, 0), v.push(0, 0, 1), f.push(_ / o), f.push(1 - p / l);
}
}
for (let p = 0; p < l; p++)
- for (let y = 0; y < o; y++) {
- const _ = y + c * p, E = y + c * (p + 1), R = y + 1 + c * (p + 1), T = y + 1 + c * p;
+ for (let b = 0; b < o; b++) {
+ const _ = b + c * p, E = b + c * (p + 1), R = b + 1 + c * (p + 1), T = b + 1 + c * p;
m.push(_, E, T), m.push(E, R, T);
}
- this.setIndex(m), this.setAttribute("position", new gi(g, 3)), this.setAttribute("normal", new gi(v, 3)), this.setAttribute("uv", new gi(f, 2));
+ this.setIndex(m), this.setAttribute("position", new vi(g, 3)), this.setAttribute("normal", new vi(v, 3)), this.setAttribute("uv", new vi(f, 2));
}
copy(e) {
return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;
@@ -11872,10 +11940,10 @@ class Dr extends si {
* @return {PlaneGeometry} A new instance.
*/
static fromJSON(e) {
- return new Dr(e.width, e.height, e.widthSegments, e.heightSegments);
+ return new In(e.width, e.height, e.widthSegments, e.heightSegments);
}
}
-class kd extends ut {
+class Fd extends ut {
/**
* Constructs a new raw shader material.
*
@@ -11889,7 +11957,7 @@ class kd extends ut {
super(e), this.isRawShaderMaterial = !0, this.type = "RawShaderMaterial";
}
}
-class Zo extends ii {
+class Zo extends si {
/**
* Constructs a new mesh standard material.
*
@@ -11900,7 +11968,7 @@ class Zo extends ii {
* by {@link Color#set}.
*/
constructor(e) {
- super(), this.isMeshStandardMaterial = !0, this.type = "MeshStandardMaterial", this.defines = { STANDARD: "" }, this.color = new xe(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new xe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Un, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xi(), this.envMapIntensity = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e);
+ super(), this.isMeshStandardMaterial = !0, this.type = "MeshStandardMaterial", this.defines = { STANDARD: "" }, this.color = new xe(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new xe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Ur, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new bi(), this.envMapIntensity = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e);
}
copy(e) {
return super.copy(e), this.defines = { STANDARD: "" }, this.color.copy(e.color), this.roughness = e.roughness, this.metalness = e.metalness, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.roughnessMap = e.roughnessMap, this.metalnessMap = e.metalnessMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.envMapIntensity = e.envMapIntensity, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.flatShading = e.flatShading, this.fog = e.fog, this;
@@ -12019,7 +12087,7 @@ class Di extends Zo {
}, this.anisotropy = e.anisotropy, this.anisotropyRotation = e.anisotropyRotation, this.anisotropyMap = e.anisotropyMap, this.clearcoat = e.clearcoat, this.clearcoatMap = e.clearcoatMap, this.clearcoatRoughness = e.clearcoatRoughness, this.clearcoatRoughnessMap = e.clearcoatRoughnessMap, this.clearcoatNormalMap = e.clearcoatNormalMap, this.clearcoatNormalScale.copy(e.clearcoatNormalScale), this.dispersion = e.dispersion, this.ior = e.ior, this.iridescence = e.iridescence, this.iridescenceMap = e.iridescenceMap, this.iridescenceIOR = e.iridescenceIOR, this.iridescenceThicknessRange = [...e.iridescenceThicknessRange], this.iridescenceThicknessMap = e.iridescenceThicknessMap, this.sheen = e.sheen, this.sheenColor.copy(e.sheenColor), this.sheenColorMap = e.sheenColorMap, this.sheenRoughness = e.sheenRoughness, this.sheenRoughnessMap = e.sheenRoughnessMap, this.transmission = e.transmission, this.transmissionMap = e.transmissionMap, this.thickness = e.thickness, this.thicknessMap = e.thicknessMap, this.attenuationDistance = e.attenuationDistance, this.attenuationColor.copy(e.attenuationColor), this.specularIntensity = e.specularIntensity, this.specularIntensityMap = e.specularIntensityMap, this.specularColor.copy(e.specularColor), this.specularColorMap = e.specularColorMap, this;
}
}
-class zd extends ii {
+class zd extends si {
/**
* Constructs a new mesh normal material.
*
@@ -12030,13 +12098,13 @@ class zd extends ii {
* by {@link Color#set}.
*/
constructor(e) {
- super(), this.isMeshNormalMaterial = !0, this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Un, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.flatShading = !1, this.setValues(e);
+ super(), this.isMeshNormalMaterial = !0, this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Ur, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.flatShading = !1, this.setValues(e);
}
copy(e) {
return super.copy(e), this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.flatShading = e.flatShading, this;
}
}
-class Hd extends ii {
+class Hd extends si {
/**
* Constructs a new mesh lambert material.
*
@@ -12047,13 +12115,13 @@ class Hd extends ii {
* by {@link Color#set}.
*/
constructor(e) {
- super(), this.isMeshLambertMaterial = !0, this.type = "MeshLambertMaterial", this.color = new xe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new xe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Un, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xi(), this.combine = Ro, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e);
+ super(), this.isMeshLambertMaterial = !0, this.type = "MeshLambertMaterial", this.color = new xe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new xe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Ur, this.normalScale = new oe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new bi(), this.combine = Ro, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e);
}
copy(e) {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.flatShading = e.flatShading, this.fog = e.fog, this;
}
}
-class bh extends ii {
+class yh extends si {
/**
* Constructs a new mesh depth material.
*
@@ -12070,7 +12138,7 @@ class bh extends ii {
return super.copy(e), this.depthPacking = e.depthPacking, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this;
}
}
-class Vd extends ii {
+class Vd extends si {
/**
* Constructs a new mesh distance material.
*
@@ -12087,50 +12155,50 @@ class Vd extends ii {
return super.copy(e), this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this;
}
}
-function cn(r, e) {
- return !r || r.constructor === e ? r : typeof e.BYTES_PER_ELEMENT == "number" ? new e(r) : Array.prototype.slice.call(r);
+function cr(n, e) {
+ return !n || n.constructor === e ? n : typeof e.BYTES_PER_ELEMENT == "number" ? new e(n) : Array.prototype.slice.call(n);
}
-function Gd(r) {
- return ArrayBuffer.isView(r) && !(r instanceof DataView);
+function Gd(n) {
+ return ArrayBuffer.isView(n) && !(n instanceof DataView);
}
-function Wd(r) {
- function e(s, n) {
- return r[s] - r[n];
+function Wd(n) {
+ function e(s, r) {
+ return n[s] - n[r];
}
- const t = r.length, i = new Array(t);
+ const t = n.length, i = new Array(t);
for (let s = 0; s !== t; ++s) i[s] = s;
return i.sort(e), i;
}
-function $l(r, e, t) {
- const i = r.length, s = new r.constructor(i);
- for (let n = 0, a = 0; a !== i; ++n) {
- const o = t[n] * e;
+function $l(n, e, t) {
+ const i = n.length, s = new n.constructor(i);
+ for (let r = 0, a = 0; a !== i; ++r) {
+ const o = t[r] * e;
for (let l = 0; l !== e; ++l)
- s[a++] = r[o + l];
+ s[a++] = n[o + l];
}
return s;
}
-function Mh(r, e, t, i) {
- let s = 1, n = r[0];
- for (; n !== void 0 && n[i] === void 0; )
- n = r[s++];
- if (n === void 0) return;
- let a = n[i];
+function Mh(n, e, t, i) {
+ let s = 1, r = n[0];
+ for (; r !== void 0 && r[i] === void 0; )
+ r = n[s++];
+ if (r === void 0) return;
+ let a = r[i];
if (a !== void 0)
if (Array.isArray(a))
do
- a = n[i], a !== void 0 && (e.push(n.time), t.push(...a)), n = r[s++];
- while (n !== void 0);
+ a = r[i], a !== void 0 && (e.push(r.time), t.push(...a)), r = n[s++];
+ while (r !== void 0);
else if (a.toArray !== void 0)
do
- a = n[i], a !== void 0 && (e.push(n.time), a.toArray(t, t.length)), n = r[s++];
- while (n !== void 0);
+ a = r[i], a !== void 0 && (e.push(r.time), a.toArray(t, t.length)), r = n[s++];
+ while (r !== void 0);
else
do
- a = n[i], a !== void 0 && (e.push(n.time), t.push(a)), n = r[s++];
- while (n !== void 0);
+ a = r[i], a !== void 0 && (e.push(r.time), t.push(a)), r = n[s++];
+ while (r !== void 0);
}
-class Ir {
+class Un {
/**
* Constructs a new interpolant.
*
@@ -12150,7 +12218,7 @@ class Ir {
*/
evaluate(e) {
const t = this.parameterPositions;
- let i = this._cachedIndex, s = t[i], n = t[i - 1];
+ let i = this._cachedIndex, s = t[i], r = t[i - 1];
i: {
e: {
let a;
@@ -12158,24 +12226,24 @@ class Ir {
s: if (!(e < s)) {
for (let o = i + 2; ; ) {
if (s === void 0) {
- if (e < n) break s;
+ if (e < r) break s;
return i = t.length, this._cachedIndex = i, this.copySampleValue_(i - 1);
}
if (i === o) break;
- if (n = s, s = t[++i], e < s)
+ if (r = s, s = t[++i], e < s)
break e;
}
a = t.length;
break t;
}
- if (!(e >= n)) {
+ if (!(e >= r)) {
const o = t[1];
- e < o && (i = 2, n = o);
+ e < o && (i = 2, r = o);
for (let l = i - 2; ; ) {
- if (n === void 0)
+ if (r === void 0)
return this._cachedIndex = 0, this.copySampleValue_(0);
if (i === l) break;
- if (s = n, n = t[--i - 1], e >= n)
+ if (s = r, r = t[--i - 1], e >= r)
break e;
}
a = i, i = 0;
@@ -12187,14 +12255,14 @@ class Ir {
const o = i + a >>> 1;
e < t[o] ? a = o : i = o + 1;
}
- if (s = t[i], n = t[i - 1], n === void 0)
+ if (s = t[i], r = t[i - 1], r === void 0)
return this._cachedIndex = 0, this.copySampleValue_(0);
if (s === void 0)
return i = t.length, this._cachedIndex = i, this.copySampleValue_(i - 1);
}
- this._cachedIndex = i, this.intervalChanged_(i, n, s);
+ this._cachedIndex = i, this.intervalChanged_(i, r, s);
}
- return this.interpolate_(i, n, e, s);
+ return this.interpolate_(i, r, e, s);
}
/**
* Returns the interpolation settings.
@@ -12211,9 +12279,9 @@ class Ir {
* @return {TypedArray} The result buffer.
*/
copySampleValue_(e) {
- const t = this.resultBuffer, i = this.sampleValues, s = this.valueSize, n = e * s;
+ const t = this.resultBuffer, i = this.sampleValues, s = this.valueSize, r = e * s;
for (let a = 0; a !== s; ++a)
- t[a] = i[n + a];
+ t[a] = i[r + a];
return t;
}
/**
@@ -12239,7 +12307,7 @@ class Ir {
intervalChanged_() {
}
}
-class jd extends Ir {
+class jd extends Un {
/**
* Constructs a new cubic interpolant.
*
@@ -12256,17 +12324,17 @@ class jd extends Ir {
}
intervalChanged_(e, t, i) {
const s = this.parameterPositions;
- let n = e - 2, a = e + 1, o = s[n], l = s[a];
+ let r = e - 2, a = e + 1, o = s[r], l = s[a];
if (o === void 0)
switch (this.getSettings_().endingStart) {
case gl:
- n = e, o = 2 * t - i;
+ r = e, o = 2 * t - i;
break;
case vl:
- n = s.length - 2, o = t + s[n] - s[n + 1];
+ r = s.length - 2, o = t + s[r] - s[r + 1];
break;
default:
- n = e, o = i;
+ r = e, o = i;
}
if (l === void 0)
switch (this.getSettings_().endingEnd) {
@@ -12280,16 +12348,16 @@ class jd extends Ir {
a = e - 1, l = t;
}
const c = (i - t) * 0.5, h = this.valueSize;
- this._weightPrev = c / (t - o), this._weightNext = c / (l - i), this._offsetPrev = n * h, this._offsetNext = a * h;
+ this._weightPrev = c / (t - o), this._weightNext = c / (l - i), this._offsetPrev = r * h, this._offsetNext = a * h;
}
interpolate_(e, t, i, s) {
- const n = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, m = this._weightNext, g = (i - t) / (s - t), v = g * g, f = v * g, p = -d * f + 2 * d * v - d * g, y = (1 + d) * f + (-1.5 - 2 * d) * v + (-0.5 + d) * g + 1, _ = (-1 - m) * f + (1.5 + m) * v + 0.5 * g, E = m * f - m * v;
+ const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, m = this._weightNext, g = (i - t) / (s - t), v = g * g, f = v * g, p = -d * f + 2 * d * v - d * g, b = (1 + d) * f + (-1.5 - 2 * d) * v + (-0.5 + d) * g + 1, _ = (-1 - m) * f + (1.5 + m) * v + 0.5 * g, E = m * f - m * v;
for (let R = 0; R !== o; ++R)
- n[R] = p * a[h + R] + y * a[c + R] + _ * a[l + R] + E * a[u + R];
- return n;
+ r[R] = p * a[h + R] + b * a[c + R] + _ * a[l + R] + E * a[u + R];
+ return r;
}
}
-class Xd extends Ir {
+class Xd extends Un {
/**
* Constructs a new linear interpolant.
*
@@ -12302,13 +12370,13 @@ class Xd extends Ir {
super(e, t, i, s);
}
interpolate_(e, t, i, s) {
- const n = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = (i - t) / (s - t), u = 1 - h;
+ const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = (i - t) / (s - t), u = 1 - h;
for (let d = 0; d !== o; ++d)
- n[d] = a[c + d] * u + a[l + d] * h;
- return n;
+ r[d] = a[c + d] * u + a[l + d] * h;
+ return r;
}
}
-class qd extends Ir {
+class qd extends Un {
/**
* Constructs a new discrete interpolant.
*
@@ -12324,7 +12392,7 @@ class qd extends Ir {
return this.copySampleValue_(e - 1);
}
}
-class bi {
+class yi {
/**
* Constructs a new keyframe track.
*
@@ -12336,7 +12404,7 @@ class bi {
constructor(e, t, i, s) {
if (e === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined");
if (t === void 0 || t.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e);
- this.name = e, this.times = cn(t, this.TimeBufferType), this.values = cn(i, this.ValueBufferType), this.setInterpolation(s || this.DefaultInterpolation);
+ this.name = e, this.times = cr(t, this.TimeBufferType), this.values = cr(i, this.ValueBufferType), this.setInterpolation(s || this.DefaultInterpolation);
}
/**
* Converts the keyframe track to JSON.
@@ -12353,8 +12421,8 @@ class bi {
else {
i = {
name: e.name,
- times: cn(e.times, Array),
- values: cn(e.values, Array)
+ times: cr(e.times, Array),
+ values: cr(e.values, Array)
};
const s = e.getInterpolation();
s !== e.DefaultInterpolation && (i.interpolation = s);
@@ -12400,13 +12468,13 @@ class bi {
setInterpolation(e) {
let t;
switch (e) {
- case Ar:
+ case Rn:
t = this.InterpolantFactoryMethodDiscrete;
break;
- case Rr:
+ case Pn:
t = this.InterpolantFactoryMethodLinear;
break;
- case kn:
+ case Fr:
t = this.InterpolantFactoryMethodSmooth;
break;
}
@@ -12429,11 +12497,11 @@ class bi {
getInterpolation() {
switch (this.createInterpolant) {
case this.InterpolantFactoryMethodDiscrete:
- return Ar;
+ return Rn;
case this.InterpolantFactoryMethodLinear:
- return Rr;
+ return Pn;
case this.InterpolantFactoryMethodSmooth:
- return kn;
+ return Fr;
}
}
/**
@@ -12484,15 +12552,15 @@ class bi {
*/
trim(e, t) {
const i = this.times, s = i.length;
- let n = 0, a = s - 1;
- for (; n !== s && i[n] < e; )
- ++n;
+ let r = 0, a = s - 1;
+ for (; r !== s && i[r] < e; )
+ ++r;
for (; a !== -1 && i[a] > t; )
--a;
- if (++a, n !== 0 || a !== s) {
- n >= a && (a = Math.max(a, 1), n = a - 1);
+ if (++a, r !== 0 || a !== s) {
+ r >= a && (a = Math.max(a, 1), r = a - 1);
const o = this.getValueSize();
- this.times = i.slice(n, a), this.values = this.values.slice(n * o, a * o);
+ this.times = i.slice(r, a), this.values = this.values.slice(r * o, a * o);
}
return this;
}
@@ -12506,10 +12574,10 @@ class bi {
let e = !0;
const t = this.getValueSize();
t - Math.floor(t) !== 0 && (Ve("KeyframeTrack: Invalid value size in track.", this), e = !1);
- const i = this.times, s = this.values, n = i.length;
- n === 0 && (Ve("KeyframeTrack: Track is empty.", this), e = !1);
+ const i = this.times, s = this.values, r = i.length;
+ r === 0 && (Ve("KeyframeTrack: Track is empty.", this), e = !1);
let a = null;
- for (let o = 0; o !== n; o++) {
+ for (let o = 0; o !== r; o++) {
const l = i[o];
if (typeof l == "number" && isNaN(l)) {
Ve("KeyframeTrack: Time is not a valid number.", this, o, l), e = !1;
@@ -12538,9 +12606,9 @@ class bi {
* @return {AnimationClip} A reference to this animation clip.
*/
optimize() {
- const e = this.times.slice(), t = this.values.slice(), i = this.getValueSize(), s = this.getInterpolation() === kn, n = e.length - 1;
+ const e = this.times.slice(), t = this.values.slice(), i = this.getValueSize(), s = this.getInterpolation() === Fr, r = e.length - 1;
let a = 1;
- for (let o = 1; o < n; ++o) {
+ for (let o = 1; o < r; ++o) {
let l = !1;
const c = e[o], h = e[o + 1];
if (c !== h && (o !== 1 || c !== e[0]))
@@ -12566,9 +12634,9 @@ class bi {
++a;
}
}
- if (n > 0) {
- e[a] = e[n];
- for (let o = n * i, l = a * i, c = 0; c !== i; ++c)
+ if (r > 0) {
+ e[a] = e[r];
+ for (let o = r * i, l = a * i, c = 0; c !== i; ++c)
t[l + c] = t[o + c];
++a;
}
@@ -12584,11 +12652,11 @@ class bi {
return s.createInterpolant = this.createInterpolant, s;
}
}
-bi.prototype.ValueTypeName = "";
-bi.prototype.TimeBufferType = Float32Array;
-bi.prototype.ValueBufferType = Float32Array;
-bi.prototype.DefaultInterpolation = Rr;
-class rr extends bi {
+yi.prototype.ValueTypeName = "";
+yi.prototype.TimeBufferType = Float32Array;
+yi.prototype.ValueBufferType = Float32Array;
+yi.prototype.DefaultInterpolation = Pn;
+class rn extends yi {
/**
* Constructs a new boolean keyframe track.
*
@@ -12603,12 +12671,12 @@ class rr extends bi {
super(e, t, i);
}
}
-rr.prototype.ValueTypeName = "bool";
-rr.prototype.ValueBufferType = Array;
-rr.prototype.DefaultInterpolation = Ar;
-rr.prototype.InterpolantFactoryMethodLinear = void 0;
-rr.prototype.InterpolantFactoryMethodSmooth = void 0;
-class Sh extends bi {
+rn.prototype.ValueTypeName = "bool";
+rn.prototype.ValueBufferType = Array;
+rn.prototype.DefaultInterpolation = Rn;
+rn.prototype.InterpolantFactoryMethodLinear = void 0;
+rn.prototype.InterpolantFactoryMethodSmooth = void 0;
+class Sh extends yi {
/**
* Constructs a new color keyframe track.
*
@@ -12622,7 +12690,7 @@ class Sh extends bi {
}
}
Sh.prototype.ValueTypeName = "color";
-class Js extends bi {
+class Js extends yi {
/**
* Constructs a new number keyframe track.
*
@@ -12636,7 +12704,7 @@ class Js extends bi {
}
}
Js.prototype.ValueTypeName = "number";
-class Yd extends Ir {
+class Yd extends Un {
/**
* Constructs a new SLERP interpolant.
*
@@ -12649,14 +12717,14 @@ class Yd extends Ir {
super(e, t, i, s);
}
interpolate_(e, t, i, s) {
- const n = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = (i - t) / (s - t);
+ const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = (i - t) / (s - t);
let c = e * o;
for (let h = c + o; c !== h; c += 4)
- _i.slerpFlat(n, 0, a, c - o, a, c, l);
- return n;
+ xi.slerpFlat(r, 0, a, c - o, a, c, l);
+ return r;
}
}
-class Qs extends bi {
+class Qs extends yi {
/**
* Constructs a new Quaternion keyframe track.
*
@@ -12681,7 +12749,7 @@ class Qs extends bi {
}
Qs.prototype.ValueTypeName = "quaternion";
Qs.prototype.InterpolantFactoryMethodSmooth = void 0;
-class nr extends bi {
+class an extends yi {
/**
* Constructs a new string keyframe track.
*
@@ -12696,12 +12764,12 @@ class nr extends bi {
super(e, t, i);
}
}
-nr.prototype.ValueTypeName = "string";
-nr.prototype.ValueBufferType = Array;
-nr.prototype.DefaultInterpolation = Ar;
-nr.prototype.InterpolantFactoryMethodLinear = void 0;
-nr.prototype.InterpolantFactoryMethodSmooth = void 0;
-class er extends bi {
+an.prototype.ValueTypeName = "string";
+an.prototype.ValueBufferType = Array;
+an.prototype.DefaultInterpolation = Rn;
+an.prototype.InterpolantFactoryMethodLinear = void 0;
+an.prototype.InterpolantFactoryMethodSmooth = void 0;
+class en extends yi {
/**
* Constructs a new vector keyframe track.
*
@@ -12714,7 +12782,7 @@ class er extends bi {
super(e, t, i, s);
}
}
-er.prototype.ValueTypeName = "vector";
+en.prototype.ValueTypeName = "vector";
class Kd {
/**
* Constructs a new animation clip.
@@ -12731,7 +12799,7 @@ class Kd {
* is blended/combined when two or more animations are simultaneously played.
*/
constructor(e = "", t = -1, i = [], s = Eu) {
- this.name = e, this.tracks = i, this.duration = t, this.blendMode = s, this.uuid = fi(), this.userData = {}, this.duration < 0 && this.resetDuration();
+ this.name = e, this.tracks = i, this.duration = t, this.blendMode = s, this.uuid = gi(), this.userData = {}, this.duration < 0 && this.resetDuration();
}
/**
* Factory method for creating an animation clip from the given JSON.
@@ -12744,8 +12812,8 @@ class Kd {
const t = [], i = e.tracks, s = 1 / (e.fps || 1);
for (let a = 0, o = i.length; a !== o; ++a)
t.push($d(i[a]).scale(s));
- const n = new this(e.name, e.duration, t, e.blendMode);
- return n.uuid = e.uuid, n.userData = JSON.parse(e.userData || "{}"), n;
+ const r = new this(e.name, e.duration, t, e.blendMode);
+ return r.uuid = e.uuid, r.userData = JSON.parse(e.userData || "{}"), r;
}
/**
* Serializes the given animation clip into JSON.
@@ -12763,8 +12831,8 @@ class Kd {
blendMode: e.blendMode,
userData: JSON.stringify(e.userData)
};
- for (let n = 0, a = i.length; n !== a; ++n)
- t.push(bi.toJSON(i[n]));
+ for (let r = 0, a = i.length; r !== a; ++r)
+ t.push(yi.toJSON(i[r]));
return s;
}
/**
@@ -12782,16 +12850,16 @@ class Kd {
* @return {AnimationClip} The new animation clip.
*/
static CreateFromMorphTargetSequence(e, t, i, s) {
- const n = t.length, a = [];
- for (let o = 0; o < n; o++) {
+ const r = t.length, a = [];
+ for (let o = 0; o < r; o++) {
let l = [], c = [];
l.push(
- (o + n - 1) % n,
+ (o + r - 1) % r,
o,
- (o + 1) % n
+ (o + 1) % r
), c.push(0, 1, 0);
const h = Wd(l);
- l = $l(l, 1, h), c = $l(c, 1, h), !s && l[0] === 0 && (l.push(n), c.push(c[0])), a.push(
+ l = $l(l, 1, h), c = $l(c, 1, h), !s && l[0] === 0 && (l.push(r), c.push(c[0])), a.push(
new Js(
".morphTargetInfluences[" + t[o].name + "]",
l,
@@ -12836,9 +12904,9 @@ class Kd {
* @return {Array} An array of new animation clips.
*/
static CreateClipsFromMorphTargetSequences(e, t, i) {
- const s = {}, n = /^([\w-]*?)([\d]+)$/;
+ const s = {}, r = /^([\w-]*?)([\d]+)$/;
for (let o = 0, l = e.length; o < l; o++) {
- const c = e[o], h = c.name.match(n);
+ const c = e[o], h = c.name.match(r);
if (h && h.length > 1) {
const u = h[1];
let d = s[u];
@@ -12867,7 +12935,7 @@ class Kd {
const v = [], f = [];
Mh(d, v, f, m), v.length !== 0 && g.push(new h(u, v, f));
}
- }, s = [], n = e.name || "default", a = e.fps || 30, o = e.blendMode;
+ }, s = [], r = e.name || "default", a = e.fps || 30, o = e.blendMode;
let l = e.length || -1;
const c = e.hierarchy || [];
for (let h = 0; h < c.length; h++) {
@@ -12883,8 +12951,8 @@ class Kd {
for (const g in d) {
const v = [], f = [];
for (let p = 0; p !== u[m].morphTargets.length; ++p) {
- const y = u[m];
- v.push(y.time), f.push(y.morphTarget === g ? 1 : 0);
+ const b = u[m];
+ v.push(b.time), f.push(b.morphTarget === g ? 1 : 0);
}
s.push(new Js(".morphTargetInfluence[" + g + "]", v, f));
}
@@ -12892,7 +12960,7 @@ class Kd {
} else {
const d = ".bones[" + t[h].name + "]";
i(
- er,
+ en,
d + ".position",
u,
"pos",
@@ -12904,7 +12972,7 @@ class Kd {
"rot",
s
), i(
- er,
+ en,
d + ".scale",
u,
"scl",
@@ -12912,7 +12980,7 @@ class Kd {
);
}
}
- return s.length === 0 ? null : new this(n, l, s, o);
+ return s.length === 0 ? null : new this(r, l, s, o);
}
/**
* Sets the duration of this clip to the duration of its longest keyframe track.
@@ -12923,8 +12991,8 @@ class Kd {
const e = this.tracks;
let t = 0;
for (let i = 0, s = e.length; i !== s; ++i) {
- const n = this.tracks[i];
- t = Math.max(t, n.times[n.times.length - 1]);
+ const r = this.tracks[i];
+ t = Math.max(t, r.times[r.times.length - 1]);
}
return this.duration = t, this;
}
@@ -12982,8 +13050,8 @@ class Kd {
return this.constructor.toJSON(this);
}
}
-function Zd(r) {
- switch (r.toLowerCase()) {
+function Zd(n) {
+ switch (n.toLowerCase()) {
case "scalar":
case "double":
case "float":
@@ -12994,28 +13062,28 @@ function Zd(r) {
case "vector2":
case "vector3":
case "vector4":
- return er;
+ return en;
case "color":
return Sh;
case "quaternion":
return Qs;
case "bool":
case "boolean":
- return rr;
+ return rn;
case "string":
- return nr;
+ return an;
}
- throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + r);
+ throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + n);
}
-function $d(r) {
- if (r.type === void 0)
+function $d(n) {
+ if (n.type === void 0)
throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");
- const e = Zd(r.type);
- if (r.times === void 0) {
+ const e = Zd(n.type);
+ if (n.times === void 0) {
const t = [], i = [];
- Mh(r.keys, t, i, "value"), r.times = t, r.values = i;
+ Mh(n.keys, t, i, "value"), n.times = t, n.values = i;
}
- return e.parse !== void 0 ? e.parse(r) : new e(r.name, r.times, r.values, r.interpolation);
+ return e.parse !== void 0 ? e.parse(n) : new e(n.name, n.times, n.values, n.interpolation);
}
const Wi = {
/**
@@ -13041,8 +13109,8 @@ const Wi = {
* @param {string} key - The key to reference the cached file.
* @param {Object} file - The file to be cached.
*/
- add: function(r, e) {
- this.enabled !== !1 && (this.files[r] = e);
+ add: function(n, e) {
+ this.enabled !== !1 && (this.files[n] = e);
},
/**
* Gets the cached value for the given key.
@@ -13051,9 +13119,9 @@ const Wi = {
* @param {string} key - The key to reference the cached file.
* @return {Object|undefined} The cached file. If the key does not exist `undefined` is returned.
*/
- get: function(r) {
+ get: function(n) {
if (this.enabled !== !1)
- return this.files[r];
+ return this.files[n];
},
/**
* Removes the cached file associated with the given key.
@@ -13061,8 +13129,8 @@ const Wi = {
* @static
* @param {string} key - The key to reference the cached file.
*/
- remove: function(r) {
- delete this.files[r];
+ remove: function(n) {
+ delete this.files[n];
},
/**
* Remove all values from the cache.
@@ -13083,12 +13151,12 @@ class Jd {
*/
constructor(e, t, i) {
const s = this;
- let n = !1, a = 0, o = 0, l;
+ let r = !1, a = 0, o = 0, l;
const c = [];
this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = i, this._abortController = null, this.itemStart = function(h) {
- o++, n === !1 && s.onStart !== void 0 && s.onStart(h, a, o), n = !0;
+ o++, r === !1 && s.onStart !== void 0 && s.onStart(h, a, o), r = !0;
}, this.itemEnd = function(h) {
- a++, s.onProgress !== void 0 && s.onProgress(h, a, o), a === o && (n = !1, s.onLoad !== void 0 && s.onLoad());
+ a++, s.onProgress !== void 0 && s.onProgress(h, a, o), a === o && (r = !1, s.onLoad !== void 0 && s.onLoad());
}, this.itemError = function(h) {
s.onError !== void 0 && s.onError(h);
}, this.resolveURL = function(h) {
@@ -13123,7 +13191,7 @@ class Jd {
}
}
const Qd = /* @__PURE__ */ new Jd();
-class rs {
+class ns {
/**
* Constructs a new loader.
*
@@ -13153,8 +13221,8 @@ class rs {
*/
loadAsync(e, t) {
const i = this;
- return new Promise(function(s, n) {
- i.load(e, s, t, n);
+ return new Promise(function(s, r) {
+ i.load(e, s, t, r);
});
}
/**
@@ -13226,14 +13294,14 @@ class rs {
return this;
}
}
-rs.DEFAULT_MATERIAL_NAME = "__DEFAULT";
-const ki = {};
+ns.DEFAULT_MATERIAL_NAME = "__DEFAULT";
+const Fi = {};
class ep extends Error {
constructor(e, t) {
super(e), this.response = t;
}
}
-class $o extends rs {
+class $o extends ns {
/**
* Constructs a new file loader.
*
@@ -13253,20 +13321,20 @@ class $o extends rs {
*/
load(e, t, i, s) {
e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);
- const n = Wi.get(`file:${e}`);
- if (n !== void 0)
+ const r = Wi.get(`file:${e}`);
+ if (r !== void 0)
return this.manager.itemStart(e), setTimeout(() => {
- t && t(n), this.manager.itemEnd(e);
- }, 0), n;
- if (ki[e] !== void 0) {
- ki[e].push({
+ t && t(r), this.manager.itemEnd(e);
+ }, 0), r;
+ if (Fi[e] !== void 0) {
+ Fi[e].push({
onLoad: t,
onProgress: i,
onError: s
});
return;
}
- ki[e] = [], ki[e].push({
+ Fi[e] = [], Fi[e].push({
onLoad: t,
onProgress: i,
onError: s
@@ -13280,12 +13348,12 @@ class $o extends rs {
if (c.status === 200 || c.status === 0) {
if (c.status === 0 && Se("FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || c.body === void 0 || c.body.getReader === void 0)
return c;
- const h = ki[e], u = c.body.getReader(), d = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), m = d ? parseInt(d) : 0, g = m !== 0;
+ const h = Fi[e], u = c.body.getReader(), d = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), m = d ? parseInt(d) : 0, g = m !== 0;
let v = 0;
const f = new ReadableStream({
start(p) {
- y();
- function y() {
+ b();
+ function b() {
u.read().then(({ done: _, value: E }) => {
if (_)
p.close();
@@ -13296,7 +13364,7 @@ class $o extends rs {
const I = h[T];
I.onProgress && I.onProgress(R);
}
- p.enqueue(E), y();
+ p.enqueue(E), b();
}
}, (_) => {
p.error(_);
@@ -13327,17 +13395,17 @@ class $o extends rs {
}
}).then((c) => {
Wi.add(`file:${e}`, c);
- const h = ki[e];
- delete ki[e];
+ const h = Fi[e];
+ delete Fi[e];
for (let u = 0, d = h.length; u < d; u++) {
const m = h[u];
m.onLoad && m.onLoad(c);
}
}).catch((c) => {
- const h = ki[e];
+ const h = Fi[e];
if (h === void 0)
throw this.manager.itemError(e), c;
- delete ki[e];
+ delete Fi[e];
for (let u = 0, d = h.length; u < d; u++) {
const m = h[u];
m.onError && m.onError(c);
@@ -13375,7 +13443,7 @@ class $o extends rs {
}
}
const Ns = /* @__PURE__ */ new WeakMap();
-class Th extends rs {
+class Th extends ns {
/**
* Constructs a new image loader.
*
@@ -13398,11 +13466,11 @@ class Th extends rs {
*/
load(e, t, i, s) {
this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);
- const n = this, a = Wi.get(`image:${e}`);
+ const r = this, a = Wi.get(`image:${e}`);
if (a !== void 0) {
if (a.complete === !0)
- n.manager.itemStart(e), setTimeout(function() {
- t && t(a), n.manager.itemEnd(e);
+ r.manager.itemStart(e), setTimeout(function() {
+ t && t(a), r.manager.itemEnd(e);
}, 0);
else {
let u = Ns.get(a);
@@ -13410,7 +13478,7 @@ class Th extends rs {
}
return a;
}
- const o = Pr("img");
+ const o = Ln("img");
function l() {
h(), t && t(this);
const u = Ns.get(this) || [];
@@ -13418,7 +13486,7 @@ class Th extends rs {
const m = u[d];
m.onLoad && m.onLoad(this);
}
- Ns.delete(this), n.manager.itemEnd(e);
+ Ns.delete(this), r.manager.itemEnd(e);
}
function c(u) {
h(), s && s(u), Wi.remove(`image:${e}`);
@@ -13427,15 +13495,15 @@ class Th extends rs {
const g = d[m];
g.onError && g.onError(u);
}
- Ns.delete(this), n.manager.itemError(e), n.manager.itemEnd(e);
+ Ns.delete(this), r.manager.itemError(e), r.manager.itemEnd(e);
}
function h() {
o.removeEventListener("load", l, !1), o.removeEventListener("error", c, !1);
}
- return o.addEventListener("load", l, !1), o.addEventListener("error", c, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), Wi.add(`image:${e}`, o), n.manager.itemStart(e), o.src = e, o;
+ return o.addEventListener("load", l, !1), o.addEventListener("error", c, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), Wi.add(`image:${e}`, o), r.manager.itemStart(e), o.src = e, o;
}
}
-class Eh extends rs {
+class Eh extends ns {
/**
* Constructs a new cube texture loader.
*
@@ -13459,22 +13527,22 @@ class Eh extends rs {
* @return {CubeTexture} The cube texture.
*/
load(e, t, i, s) {
- const n = new Go();
- n.colorSpace = Rt;
+ const r = new Go();
+ r.colorSpace = Rt;
const a = new Th(this.manager);
a.setCrossOrigin(this.crossOrigin), a.setPath(this.path);
let o = 0;
function l(c) {
a.load(e[c], function(h) {
- n.images[c] = h, o++, o === 6 && (n.needsUpdate = !0, t && t(n));
+ r.images[c] = h, o++, o === 6 && (r.needsUpdate = !0, t && t(r));
}, void 0, s);
}
for (let c = 0; c < e.length; ++c)
l(c);
- return n;
+ return r;
}
}
-class tp extends rs {
+class tp extends ns {
/**
* Constructs a new data texture loader.
*
@@ -13496,11 +13564,11 @@ class tp extends rs {
* @return {DataTexture} The data texture.
*/
load(e, t, i, s) {
- const n = this, a = new sr(), o = new $o(this.manager);
- return o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(n.withCredentials), o.load(e, function(l) {
+ const r = this, a = new nn(), o = new $o(this.manager);
+ return o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(r.withCredentials), o.load(e, function(l) {
let c;
try {
- c = n.parse(l);
+ c = r.parse(l);
} catch (h) {
if (s !== void 0)
s(h);
@@ -13509,11 +13577,11 @@ class tp extends rs {
return;
}
}
- c.image !== void 0 ? a.image = c.image : c.data !== void 0 && (a.image.width = c.width, a.image.height = c.height, a.image.data = c.data), a.wrapS = c.wrapS !== void 0 ? c.wrapS : ti, a.wrapT = c.wrapT !== void 0 ? c.wrapT : ti, a.magFilter = c.magFilter !== void 0 ? c.magFilter : Mt, a.minFilter = c.minFilter !== void 0 ? c.minFilter : Mt, a.anisotropy = c.anisotropy !== void 0 ? c.anisotropy : 1, c.colorSpace !== void 0 && (a.colorSpace = c.colorSpace), c.flipY !== void 0 && (a.flipY = c.flipY), c.format !== void 0 && (a.format = c.format), c.type !== void 0 && (a.type = c.type), c.mipmaps !== void 0 && (a.mipmaps = c.mipmaps, a.minFilter = wi), c.mipmapCount === 1 && (a.minFilter = Mt), c.generateMipmaps !== void 0 && (a.generateMipmaps = c.generateMipmaps), a.needsUpdate = !0, t && t(a, c);
+ c.image !== void 0 ? a.image = c.image : c.data !== void 0 && (a.image.width = c.width, a.image.height = c.height, a.image.data = c.data), a.wrapS = c.wrapS !== void 0 ? c.wrapS : ii, a.wrapT = c.wrapT !== void 0 ? c.wrapT : ii, a.magFilter = c.magFilter !== void 0 ? c.magFilter : Mt, a.minFilter = c.minFilter !== void 0 ? c.minFilter : Mt, a.anisotropy = c.anisotropy !== void 0 ? c.anisotropy : 1, c.colorSpace !== void 0 && (a.colorSpace = c.colorSpace), c.flipY !== void 0 && (a.flipY = c.flipY), c.format !== void 0 && (a.format = c.format), c.type !== void 0 && (a.type = c.type), c.mipmaps !== void 0 && (a.mipmaps = c.mipmaps, a.minFilter = wi), c.mipmapCount === 1 && (a.minFilter = Mt), c.generateMipmaps !== void 0 && (a.generateMipmaps = c.generateMipmaps), a.needsUpdate = !0, t && t(a, c);
}, i, s), a;
}
}
-class wh extends rs {
+class wh extends ns {
/**
* Constructs a new texture loader.
*
@@ -13535,13 +13603,13 @@ class wh extends rs {
* @return {Texture} The texture.
*/
load(e, t, i, s) {
- const n = new Pt(), a = new Th(this.manager);
+ const r = new Pt(), a = new Th(this.manager);
return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(o) {
- n.image = o, n.needsUpdate = !0, t !== void 0 && t(n);
- }, i, s), n;
+ r.image = o, r.needsUpdate = !0, t !== void 0 && t(r);
+ }, i, s), r;
}
}
-class Ur extends mt {
+class Nn extends mt {
/**
* Constructs a new light.
*
@@ -13573,8 +13641,8 @@ class Jo {
* @param {Camera} camera - The light's view of the world.
*/
constructor(e) {
- this.camera = e, this.intensity = 1, this.bias = 0, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new oe(512, 512), this.mapType = vi, this.map = null, this.mapPass = null, this.matrix = new Ne(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new qo(), this._frameExtents = new oe(1, 1), this._viewportCount = 1, this._viewports = [
- new Je(0, 0, 1, 1)
+ this.camera = e, this.intensity = 1, this.bias = 0, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new oe(512, 512), this.mapType = _i, this.map = null, this.mapPass = null, this.matrix = new Ne(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new qo(), this._frameExtents = new oe(1, 1), this._viewportCount = 1, this._viewports = [
+ new Qe(0, 0, 1, 1)
];
}
/**
@@ -13697,14 +13765,14 @@ class ip extends Jo {
super(new Tt(50, 1, 0.5, 500)), this.isSpotLightShadow = !0, this.focus = 1, this.aspect = 1;
}
updateMatrices(e) {
- const t = this.camera, i = Zs * 2 * e.angle * this.focus, s = this.mapSize.width / this.mapSize.height * this.aspect, n = e.distance || t.far;
- (i !== t.fov || s !== t.aspect || n !== t.far) && (t.fov = i, t.aspect = s, t.far = n, t.updateProjectionMatrix()), super.updateMatrices(e);
+ const t = this.camera, i = Zs * 2 * e.angle * this.focus, s = this.mapSize.width / this.mapSize.height * this.aspect, r = e.distance || t.far;
+ (i !== t.fov || s !== t.aspect || r !== t.far) && (t.fov = i, t.aspect = s, t.far = r, t.updateProjectionMatrix()), super.updateMatrices(e);
}
copy(e) {
return super.copy(e), this.focus = e.focus, this;
}
}
-class sp extends Ur {
+class sp extends Nn {
/**
* Constructs a new spot light.
*
@@ -13715,8 +13783,8 @@ class sp extends Ur {
* @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`.
* @param {number} [decay=2] - The amount the light dims along the distance of the light.
*/
- constructor(e, t, i = 0, s = Math.PI / 3, n = 0, a = 2) {
- super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(mt.DEFAULT_UP), this.updateMatrix(), this.target = new mt(), this.distance = i, this.angle = s, this.penumbra = n, this.decay = a, this.map = null, this.shadow = new ip();
+ constructor(e, t, i = 0, s = Math.PI / 3, r = 0, a = 2) {
+ super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(mt.DEFAULT_UP), this.updateMatrix(), this.target = new mt(), this.distance = i, this.angle = s, this.penumbra = r, this.decay = a, this.map = null, this.shadow = new ip();
}
/**
* The light's power. Power is the luminous power of the light measured in lumens (lm).
@@ -13737,8 +13805,8 @@ class sp extends Ur {
return super.copy(e, t), this.distance = e.distance, this.angle = e.angle, this.penumbra = e.penumbra, this.decay = e.decay, this.target = e.target.clone(), this.shadow = e.shadow.clone(), this;
}
}
-const ec = /* @__PURE__ */ new Ne(), fr = /* @__PURE__ */ new w(), ma = /* @__PURE__ */ new w();
-class rp extends Jo {
+const ec = /* @__PURE__ */ new Ne(), gn = /* @__PURE__ */ new w(), ma = /* @__PURE__ */ new w();
+class np extends Jo {
/**
* Constructs a new point light shadow.
*/
@@ -13757,17 +13825,17 @@ class rp extends Jo {
// Z - Positive z direction
// z - Negative z direction
// positive X
- new Je(2, 1, 1, 1),
+ new Qe(2, 1, 1, 1),
// negative X
- new Je(0, 1, 1, 1),
+ new Qe(0, 1, 1, 1),
// positive Z
- new Je(3, 1, 1, 1),
+ new Qe(3, 1, 1, 1),
// negative Z
- new Je(1, 1, 1, 1),
+ new Qe(1, 1, 1, 1),
// positive Y
- new Je(3, 0, 1, 1),
+ new Qe(3, 0, 1, 1),
// negative Y
- new Je(1, 0, 1, 1)
+ new Qe(1, 0, 1, 1)
], this._cubeDirections = [
new w(1, 0, 0),
new w(-1, 0, 0),
@@ -13791,11 +13859,11 @@ class rp extends Jo {
* @param {number} [viewportIndex=0] - The viewport index.
*/
updateMatrices(e, t = 0) {
- const i = this.camera, s = this.matrix, n = e.distance || i.far;
- n !== i.far && (i.far = n, i.updateProjectionMatrix()), fr.setFromMatrixPosition(e.matrixWorld), i.position.copy(fr), ma.copy(i.position), ma.add(this._cubeDirections[t]), i.up.copy(this._cubeUps[t]), i.lookAt(ma), i.updateMatrixWorld(), s.makeTranslation(-fr.x, -fr.y, -fr.z), ec.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse), this._frustum.setFromProjectionMatrix(ec, i.coordinateSystem, i.reversedDepth);
+ const i = this.camera, s = this.matrix, r = e.distance || i.far;
+ r !== i.far && (i.far = r, i.updateProjectionMatrix()), gn.setFromMatrixPosition(e.matrixWorld), i.position.copy(gn), ma.copy(i.position), ma.add(this._cubeDirections[t]), i.up.copy(this._cubeUps[t]), i.lookAt(ma), i.updateMatrixWorld(), s.makeTranslation(-gn.x, -gn.y, -gn.z), ec.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse), this._frustum.setFromProjectionMatrix(ec, i.coordinateSystem, i.reversedDepth);
}
}
-class np extends Ur {
+class rp extends Nn {
/**
* Constructs a new point light.
*
@@ -13805,7 +13873,7 @@ class np extends Ur {
* @param {number} [decay=2] - The amount the light dims along the distance of the light.
*/
constructor(e, t, i = 0, s = 2) {
- super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = i, this.decay = s, this.shadow = new rp();
+ super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = i, this.decay = s, this.shadow = new np();
}
/**
* The light's power. Power is the luminous power of the light measured in lumens (lm).
@@ -13837,8 +13905,8 @@ class _s extends gh {
* @param {number} [near=0.1] - The camera's near plane.
* @param {number} [far=2000] - The camera's far plane.
*/
- constructor(e = -1, t = 1, i = 1, s = -1, n = 0.1, a = 2e3) {
- super(), this.isOrthographicCamera = !0, this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = i, this.bottom = s, this.near = n, this.far = a, this.updateProjectionMatrix();
+ constructor(e = -1, t = 1, i = 1, s = -1, r = 0.1, a = 2e3) {
+ super(), this.isOrthographicCamera = !0, this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = i, this.bottom = s, this.near = r, this.far = a, this.updateProjectionMatrix();
}
copy(e, t) {
return super.copy(e, t), this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.near = e.near, this.far = e.far, this.zoom = e.zoom, this.view = e.view === null ? null : Object.assign({}, e.view), this;
@@ -13855,7 +13923,7 @@ class _s extends gh {
* @param {number} height - The height of subcamera.
* @see {@link PerspectiveCamera#setViewOffset}
*/
- setViewOffset(e, t, i, s, n, a) {
+ setViewOffset(e, t, i, s, r, a) {
this.view === null && (this.view = {
enabled: !0,
fullWidth: 1,
@@ -13864,7 +13932,7 @@ class _s extends gh {
offsetY: 0,
width: 1,
height: 1
- }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = s, this.view.width = n, this.view.height = a, this.updateProjectionMatrix();
+ }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = s, this.view.width = r, this.view.height = a, this.updateProjectionMatrix();
}
/**
* Removes the view offset from the projection matrix.
@@ -13878,12 +13946,12 @@ class _s extends gh {
*/
updateProjectionMatrix() {
const e = (this.right - this.left) / (2 * this.zoom), t = (this.top - this.bottom) / (2 * this.zoom), i = (this.right + this.left) / 2, s = (this.top + this.bottom) / 2;
- let n = i - e, a = i + e, o = s + t, l = s - t;
+ let r = i - e, a = i + e, o = s + t, l = s - t;
if (this.view !== null && this.view.enabled) {
const c = (this.right - this.left) / this.view.fullWidth / this.zoom, h = (this.top - this.bottom) / this.view.fullHeight / this.zoom;
- n += c * this.view.offsetX, a = n + c * this.view.width, o -= h * this.view.offsetY, l = o - h * this.view.height;
+ r += c * this.view.offsetX, a = r + c * this.view.width, o -= h * this.view.offsetY, l = o - h * this.view.height;
}
- this.projectionMatrix.makeOrthographic(n, a, o, l, this.near, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
+ this.projectionMatrix.makeOrthographic(r, a, o, l, this.near, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
}
toJSON(e) {
const t = super.toJSON(e);
@@ -13898,7 +13966,7 @@ class ap extends Jo {
super(new _s(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0;
}
}
-class Ch extends Ur {
+class Ch extends Nn {
/**
* Constructs a new directional light.
*
@@ -13915,7 +13983,7 @@ class Ch extends Ur {
return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this;
}
}
-class Ah extends Ur {
+class Ah extends Nn {
/**
* Constructs a new ambient light.
*
@@ -13926,7 +13994,7 @@ class Ah extends Ur {
super(e, t), this.isAmbientLight = !0, this.type = "AmbientLight";
}
}
-class Tr {
+class En {
/**
* Extracts the base URL from the given URL.
*
@@ -13951,7 +14019,7 @@ class Tr {
}
}
const fa = /* @__PURE__ */ new WeakMap();
-class op extends rs {
+class op extends ns {
/**
* Constructs a new image bitmap loader.
*
@@ -13981,19 +14049,19 @@ class op extends rs {
*/
load(e, t, i, s) {
e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);
- const n = this, a = Wi.get(`image-bitmap:${e}`);
+ const r = this, a = Wi.get(`image-bitmap:${e}`);
if (a !== void 0) {
- if (n.manager.itemStart(e), a.then) {
+ if (r.manager.itemStart(e), a.then) {
a.then((c) => {
if (fa.has(a) === !0)
- s && s(fa.get(a)), n.manager.itemError(e), n.manager.itemEnd(e);
+ s && s(fa.get(a)), r.manager.itemError(e), r.manager.itemEnd(e);
else
- return t && t(c), n.manager.itemEnd(e), c;
+ return t && t(c), r.manager.itemEnd(e), c;
});
return;
}
return setTimeout(function() {
- t && t(a), n.manager.itemEnd(e);
+ t && t(a), r.manager.itemEnd(e);
}, 0), a;
}
const o = {};
@@ -14001,13 +14069,13 @@ class op extends rs {
const l = fetch(e, o).then(function(c) {
return c.blob();
}).then(function(c) {
- return createImageBitmap(c, Object.assign(n.options, { colorSpaceConversion: "none" }));
+ return createImageBitmap(c, Object.assign(r.options, { colorSpaceConversion: "none" }));
}).then(function(c) {
- return Wi.add(`image-bitmap:${e}`, c), t && t(c), n.manager.itemEnd(e), c;
+ return Wi.add(`image-bitmap:${e}`, c), t && t(c), r.manager.itemEnd(e), c;
}).catch(function(c) {
- s && s(c), fa.set(l, c), Wi.remove(`image-bitmap:${e}`), n.manager.itemError(e), n.manager.itemEnd(e);
+ s && s(c), fa.set(l, c), Wi.remove(`image-bitmap:${e}`), r.manager.itemError(e), r.manager.itemEnd(e);
});
- Wi.add(`image-bitmap:${e}`, l), n.manager.itemStart(e);
+ Wi.add(`image-bitmap:${e}`, l), r.manager.itemStart(e);
}
/**
* Aborts ongoing fetch requests.
@@ -14080,7 +14148,7 @@ const Qo = "\\[\\]\\.:\\/", hp = new RegExp("[" + Qo + "]", "g"), el = "[^" + Qo
), vp = ["material", "materials", "bones", "map"];
class _p {
constructor(e, t, i) {
- const s = i || st.parseTrackName(t);
+ const s = i || nt.parseTrackName(t);
this._targetGroup = e, this._bindings = e.subscribe_(t, s);
}
getValue(e, t) {
@@ -14090,7 +14158,7 @@ class _p {
}
setValue(e, t) {
const i = this._bindings;
- for (let s = this._targetGroup.nCachedObjects_, n = i.length; s !== n; ++s)
+ for (let s = this._targetGroup.nCachedObjects_, r = i.length; s !== r; ++s)
i[s].setValue(e, t);
}
bind() {
@@ -14104,7 +14172,7 @@ class _p {
e[t].unbind();
}
}
-class st {
+class nt {
/**
* Constructs a new property binding.
*
@@ -14113,7 +14181,7 @@ class st {
* @param {?Object} [parsedPath] - The parsed path.
*/
constructor(e, t, i) {
- this.path = t, this.parsedPath = i || st.parseTrackName(t), this.node = st.findNode(e, this.parsedPath.nodeName), this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
+ this.path = t, this.parsedPath = i || nt.parseTrackName(t), this.node = nt.findNode(e, this.parsedPath.nodeName), this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
}
/**
* Factory method for creating a property binding from the given parameters.
@@ -14125,7 +14193,7 @@ class st {
* @return {PropertyBinding|Composite} The created property binding or composite.
*/
static create(e, t, i) {
- return e && e.isAnimationObjectGroup ? new st.Composite(e, t, i) : new st(e, t, i);
+ return e && e.isAnimationObjectGroup ? new nt.Composite(e, t, i) : new nt(e, t, i);
}
/**
* Replaces spaces with underscores and removes unsupported characters from
@@ -14169,8 +14237,8 @@ class st {
propertyIndex: t[6]
}, s = i.nodeName && i.nodeName.lastIndexOf(".");
if (s !== void 0 && s !== -1) {
- const n = i.nodeName.substring(s + 1);
- vp.indexOf(n) !== -1 && (i.nodeName = i.nodeName.substring(0, s), i.objectName = n);
+ const r = i.nodeName.substring(s + 1);
+ vp.indexOf(r) !== -1 && (i.nodeName = i.nodeName.substring(0, s), i.objectName = r);
}
if (i.propertyName === null || i.propertyName.length === 0)
throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e);
@@ -14194,9 +14262,9 @@ class st {
return i;
}
if (e.children) {
- const i = function(n) {
- for (let a = 0; a < n.length; a++) {
- const o = n[a];
+ const i = function(r) {
+ for (let a = 0; a < r.length; a++) {
+ const o = r[a];
if (o.name === t || o.uuid === t)
return o;
const l = i(o.children);
@@ -14220,7 +14288,7 @@ class st {
}
_getValue_array(e, t) {
const i = this.resolvedProperty;
- for (let s = 0, n = i.length; s !== n; ++s)
+ for (let s = 0, r = i.length; s !== r; ++s)
e[t++] = i[s];
}
_getValue_arrayElement(e, t) {
@@ -14242,18 +14310,18 @@ class st {
// EntireArray
_setValue_array(e, t) {
const i = this.resolvedProperty;
- for (let s = 0, n = i.length; s !== n; ++s)
+ for (let s = 0, r = i.length; s !== r; ++s)
i[s] = e[t++];
}
_setValue_array_setNeedsUpdate(e, t) {
const i = this.resolvedProperty;
- for (let s = 0, n = i.length; s !== n; ++s)
+ for (let s = 0, r = i.length; s !== r; ++s)
i[s] = e[t++];
this.targetObject.needsUpdate = !0;
}
_setValue_array_setMatrixWorldNeedsUpdate(e, t) {
const i = this.resolvedProperty;
- for (let s = 0, n = i.length; s !== n; ++s)
+ for (let s = 0, r = i.length; s !== r; ++s)
i[s] = e[t++];
this.targetObject.matrixWorldNeedsUpdate = !0;
}
@@ -14289,8 +14357,8 @@ class st {
bind() {
let e = this.node;
const t = this.parsedPath, i = t.objectName, s = t.propertyName;
- let n = t.propertyIndex;
- if (e || (e = st.findNode(this.rootNode, t.nodeName), this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) {
+ let r = t.propertyIndex;
+ if (e || (e = nt.findNode(this.rootNode, t.nodeName), this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) {
Se("PropertyBinding: No target node found for track: " + this.path + ".");
return;
}
@@ -14359,7 +14427,7 @@ class st {
let o = this.Versioning.None;
this.targetObject = e, e.isMaterial === !0 ? o = this.Versioning.NeedsUpdate : e.isObject3D === !0 && (o = this.Versioning.MatrixWorldNeedsUpdate);
let l = this.BindingType.Direct;
- if (n !== void 0) {
+ if (r !== void 0) {
if (s === "morphTargetInfluences") {
if (!e.geometry) {
Ve("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this);
@@ -14369,9 +14437,9 @@ class st {
Ve("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this);
return;
}
- e.morphTargetDictionary[n] !== void 0 && (n = e.morphTargetDictionary[n]);
+ e.morphTargetDictionary[r] !== void 0 && (r = e.morphTargetDictionary[r]);
}
- l = this.BindingType.ArrayElement, this.resolvedProperty = a, this.propertyIndex = n;
+ l = this.BindingType.ArrayElement, this.resolvedProperty = a, this.propertyIndex = r;
} else a.fromArray !== void 0 && a.toArray !== void 0 ? (l = this.BindingType.HasFromToArray, this.resolvedProperty = a) : Array.isArray(a) ? (l = this.BindingType.EntireArray, this.resolvedProperty = a) : this.propertyName = s;
this.getValue = this.GetterByBindingType[l], this.setValue = this.SetterByBindingTypeAndVersioning[l][o];
}
@@ -14382,48 +14450,48 @@ class st {
this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
}
}
-st.Composite = _p;
-st.prototype.BindingType = {
+nt.Composite = _p;
+nt.prototype.BindingType = {
Direct: 0,
EntireArray: 1,
ArrayElement: 2,
HasFromToArray: 3
};
-st.prototype.Versioning = {
+nt.prototype.Versioning = {
None: 0,
NeedsUpdate: 1,
MatrixWorldNeedsUpdate: 2
};
-st.prototype.GetterByBindingType = [
- st.prototype._getValue_direct,
- st.prototype._getValue_array,
- st.prototype._getValue_arrayElement,
- st.prototype._getValue_toArray
+nt.prototype.GetterByBindingType = [
+ nt.prototype._getValue_direct,
+ nt.prototype._getValue_array,
+ nt.prototype._getValue_arrayElement,
+ nt.prototype._getValue_toArray
];
-st.prototype.SetterByBindingTypeAndVersioning = [
+nt.prototype.SetterByBindingTypeAndVersioning = [
[
// Direct
- st.prototype._setValue_direct,
- st.prototype._setValue_direct_setNeedsUpdate,
- st.prototype._setValue_direct_setMatrixWorldNeedsUpdate
+ nt.prototype._setValue_direct,
+ nt.prototype._setValue_direct_setNeedsUpdate,
+ nt.prototype._setValue_direct_setMatrixWorldNeedsUpdate
],
[
// EntireArray
- st.prototype._setValue_array,
- st.prototype._setValue_array_setNeedsUpdate,
- st.prototype._setValue_array_setMatrixWorldNeedsUpdate
+ nt.prototype._setValue_array,
+ nt.prototype._setValue_array_setNeedsUpdate,
+ nt.prototype._setValue_array_setMatrixWorldNeedsUpdate
],
[
// ArrayElement
- st.prototype._setValue_arrayElement,
- st.prototype._setValue_arrayElement_setNeedsUpdate,
- st.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
+ nt.prototype._setValue_arrayElement,
+ nt.prototype._setValue_arrayElement_setNeedsUpdate,
+ nt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
],
[
// HasToFromArray
- st.prototype._setValue_fromArray,
- st.prototype._setValue_fromArray_setNeedsUpdate,
- st.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
+ nt.prototype._setValue_fromArray,
+ nt.prototype._setValue_fromArray_setNeedsUpdate,
+ nt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
]
];
const tc = /* @__PURE__ */ new Ne();
@@ -14437,7 +14505,7 @@ class ic {
* @param {number} [far=Infinity] - All results returned are closer than far. Far can't be lower than near.
*/
constructor(e, t, i = 0, s = 1 / 0) {
- this.ray = new ir(e, t), this.near = i, this.far = s, this.camera = null, this.layers = new Vo(), this.params = {
+ this.ray = new sn(e, t), this.near = i, this.far = s, this.camera = null, this.layers = new Vo(), this.params = {
Mesh: {},
Line: { threshold: 1 },
LOD: {},
@@ -14509,7 +14577,7 @@ class ic {
* @return {Array} An array holding the intersection points.
*/
intersectObject(e, t = !0, i = []) {
- return yo(e, this, i, t), i.sort(sc), i;
+ return bo(e, this, i, t), i.sort(sc), i;
}
/**
* Checks all intersection between the ray and the objects with or without
@@ -14522,23 +14590,23 @@ class ic {
* @return {Array} An array holding the intersection points.
*/
intersectObjects(e, t = !0, i = []) {
- for (let s = 0, n = e.length; s < n; s++)
- yo(e[s], this, i, t);
+ for (let s = 0, r = e.length; s < r; s++)
+ bo(e[s], this, i, t);
return i.sort(sc), i;
}
}
-function sc(r, e) {
- return r.distance - e.distance;
+function sc(n, e) {
+ return n.distance - e.distance;
}
-function yo(r, e, t, i) {
+function bo(n, e, t, i) {
let s = !0;
- if (r.layers.test(e.layers) && r.raycast(e, t) === !1 && (s = !1), s === !0 && i === !0) {
- const n = r.children;
- for (let a = 0, o = n.length; a < o; a++)
- yo(n[a], e, t, !0);
+ if (n.layers.test(e.layers) && n.raycast(e, t) === !1 && (s = !1), s === !0 && i === !0) {
+ const r = n.children;
+ for (let a = 0, o = r.length; a < o; a++)
+ bo(r[a], e, t, !0);
}
}
-class rc {
+class nc {
/**
* Constructs a new spherical.
*
@@ -14651,98 +14719,98 @@ class xp extends xs {
update() {
}
}
-function nc(r, e, t, i) {
- const s = yp(i);
+function rc(n, e, t, i) {
+ const s = bp(i);
switch (t) {
// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
- case nh:
- return r * e;
+ case rh:
+ return n * e;
case Uo:
- return r * e / s.components * s.byteLength;
+ return n * e / s.components * s.byteLength;
case No:
- return r * e / s.components * s.byteLength;
- case Oo:
- return r * e * 2 / s.components * s.byteLength;
+ return n * e / s.components * s.byteLength;
case Bo:
- return r * e * 2 / s.components * s.byteLength;
+ return n * e * 2 / s.components * s.byteLength;
+ case Oo:
+ return n * e * 2 / s.components * s.byteLength;
case ah:
- return r * e * 3 / s.components * s.byteLength;
- case $t:
- return r * e * 4 / s.components * s.byteLength;
- case Fo:
- return r * e * 4 / s.components * s.byteLength;
+ return n * e * 3 / s.components * s.byteLength;
+ case Jt:
+ return n * e * 4 / s.components * s.byteLength;
+ case ko:
+ return n * e * 4 / s.components * s.byteLength;
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/
- case _n:
- case xn:
- return Math.floor((r + 3) / 4) * Math.floor((e + 3) / 4) * 8;
- case yn:
- case bn:
- return Math.floor((r + 3) / 4) * Math.floor((e + 3) / 4) * 16;
+ case _r:
+ case xr:
+ return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 8;
+ case br:
+ case yr:
+ return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16;
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/
case Ha:
case Ga:
- return Math.max(r, 16) * Math.max(e, 8) / 4;
+ return Math.max(n, 16) * Math.max(e, 8) / 4;
case za:
case Va:
- return Math.max(r, 8) * Math.max(e, 8) / 2;
+ return Math.max(n, 8) * Math.max(e, 8) / 2;
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/
case Wa:
case ja:
- return Math.floor((r + 3) / 4) * Math.floor((e + 3) / 4) * 8;
+ return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 8;
case Xa:
- return Math.floor((r + 3) / 4) * Math.floor((e + 3) / 4) * 16;
+ return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16;
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/
case qa:
- return Math.floor((r + 3) / 4) * Math.floor((e + 3) / 4) * 16;
+ return Math.floor((n + 3) / 4) * Math.floor((e + 3) / 4) * 16;
case Ya:
- return Math.floor((r + 4) / 5) * Math.floor((e + 3) / 4) * 16;
+ return Math.floor((n + 4) / 5) * Math.floor((e + 3) / 4) * 16;
case Ka:
- return Math.floor((r + 4) / 5) * Math.floor((e + 4) / 5) * 16;
+ return Math.floor((n + 4) / 5) * Math.floor((e + 4) / 5) * 16;
case Za:
- return Math.floor((r + 5) / 6) * Math.floor((e + 4) / 5) * 16;
+ return Math.floor((n + 5) / 6) * Math.floor((e + 4) / 5) * 16;
case $a:
- return Math.floor((r + 5) / 6) * Math.floor((e + 5) / 6) * 16;
+ return Math.floor((n + 5) / 6) * Math.floor((e + 5) / 6) * 16;
case Ja:
- return Math.floor((r + 7) / 8) * Math.floor((e + 4) / 5) * 16;
+ return Math.floor((n + 7) / 8) * Math.floor((e + 4) / 5) * 16;
case Qa:
- return Math.floor((r + 7) / 8) * Math.floor((e + 5) / 6) * 16;
+ return Math.floor((n + 7) / 8) * Math.floor((e + 5) / 6) * 16;
case eo:
- return Math.floor((r + 7) / 8) * Math.floor((e + 7) / 8) * 16;
+ return Math.floor((n + 7) / 8) * Math.floor((e + 7) / 8) * 16;
case to:
- return Math.floor((r + 9) / 10) * Math.floor((e + 4) / 5) * 16;
+ return Math.floor((n + 9) / 10) * Math.floor((e + 4) / 5) * 16;
case io:
- return Math.floor((r + 9) / 10) * Math.floor((e + 5) / 6) * 16;
+ return Math.floor((n + 9) / 10) * Math.floor((e + 5) / 6) * 16;
case so:
- return Math.floor((r + 9) / 10) * Math.floor((e + 7) / 8) * 16;
- case ro:
- return Math.floor((r + 9) / 10) * Math.floor((e + 9) / 10) * 16;
+ return Math.floor((n + 9) / 10) * Math.floor((e + 7) / 8) * 16;
case no:
- return Math.floor((r + 11) / 12) * Math.floor((e + 9) / 10) * 16;
+ return Math.floor((n + 9) / 10) * Math.floor((e + 9) / 10) * 16;
+ case ro:
+ return Math.floor((n + 11) / 12) * Math.floor((e + 9) / 10) * 16;
case ao:
- return Math.floor((r + 11) / 12) * Math.floor((e + 11) / 12) * 16;
+ return Math.floor((n + 11) / 12) * Math.floor((e + 11) / 12) * 16;
// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/
case oo:
case lo:
case co:
- return Math.ceil(r / 4) * Math.ceil(e / 4) * 16;
+ return Math.ceil(n / 4) * Math.ceil(e / 4) * 16;
// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/
case ho:
case uo:
- return Math.ceil(r / 4) * Math.ceil(e / 4) * 8;
+ return Math.ceil(n / 4) * Math.ceil(e / 4) * 8;
case po:
case mo:
- return Math.ceil(r / 4) * Math.ceil(e / 4) * 16;
+ return Math.ceil(n / 4) * Math.ceil(e / 4) * 16;
}
throw new Error(
`Unable to determine texture byte length for ${t} format.`
);
}
-function yp(r) {
- switch (r) {
- case vi:
+function bp(n) {
+ switch (n) {
+ case _i:
case th:
return { byteLength: 1, components: 1 };
- case wr:
+ case Cn:
case ih:
case vt:
return { byteLength: 2, components: 1 };
@@ -14751,62 +14819,62 @@ function yp(r) {
return { byteLength: 2, components: 4 };
case gs:
case Lo:
- case Xt:
+ case qt:
return { byteLength: 4, components: 1 };
case sh:
- case rh:
+ case nh:
return { byteLength: 4, components: 3 };
}
- throw new Error(`Unknown texture type ${r}.`);
+ throw new Error(`Unknown texture type ${n}.`);
}
typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
revision: "181"
} }));
typeof window < "u" && (window.__THREE__ ? Se("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "181");
function Rh() {
- let r = null, e = !1, t = null, i = null;
- function s(n, a) {
- t(n, a), i = r.requestAnimationFrame(s);
+ let n = null, e = !1, t = null, i = null;
+ function s(r, a) {
+ t(r, a), i = n.requestAnimationFrame(s);
}
return {
start: function() {
- e !== !0 && t !== null && (i = r.requestAnimationFrame(s), e = !0);
+ e !== !0 && t !== null && (i = n.requestAnimationFrame(s), e = !0);
},
stop: function() {
- r.cancelAnimationFrame(i), e = !1;
+ n.cancelAnimationFrame(i), e = !1;
},
- setAnimationLoop: function(n) {
- t = n;
+ setAnimationLoop: function(r) {
+ t = r;
},
- setContext: function(n) {
- r = n;
+ setContext: function(r) {
+ n = r;
}
};
}
-function bp(r) {
+function yp(n) {
const e = /* @__PURE__ */ new WeakMap();
function t(o, l) {
- const c = o.array, h = o.usage, u = c.byteLength, d = r.createBuffer();
- r.bindBuffer(l, d), r.bufferData(l, c, h), o.onUploadCallback();
+ const c = o.array, h = o.usage, u = c.byteLength, d = n.createBuffer();
+ n.bindBuffer(l, d), n.bufferData(l, c, h), o.onUploadCallback();
let m;
if (c instanceof Float32Array)
- m = r.FLOAT;
+ m = n.FLOAT;
else if (typeof Float16Array < "u" && c instanceof Float16Array)
- m = r.HALF_FLOAT;
+ m = n.HALF_FLOAT;
else if (c instanceof Uint16Array)
- o.isFloat16BufferAttribute ? m = r.HALF_FLOAT : m = r.UNSIGNED_SHORT;
+ o.isFloat16BufferAttribute ? m = n.HALF_FLOAT : m = n.UNSIGNED_SHORT;
else if (c instanceof Int16Array)
- m = r.SHORT;
+ m = n.SHORT;
else if (c instanceof Uint32Array)
- m = r.UNSIGNED_INT;
+ m = n.UNSIGNED_INT;
else if (c instanceof Int32Array)
- m = r.INT;
+ m = n.INT;
else if (c instanceof Int8Array)
- m = r.BYTE;
+ m = n.BYTE;
else if (c instanceof Uint8Array)
- m = r.UNSIGNED_BYTE;
+ m = n.UNSIGNED_BYTE;
else if (c instanceof Uint8ClampedArray)
- m = r.UNSIGNED_BYTE;
+ m = n.UNSIGNED_BYTE;
else
throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + c);
return {
@@ -14819,8 +14887,8 @@ function bp(r) {
}
function i(o, l, c) {
const h = l.array, u = l.updateRanges;
- if (r.bindBuffer(c, o), u.length === 0)
- r.bufferSubData(c, 0, h);
+ if (n.bindBuffer(c, o), u.length === 0)
+ n.bufferSubData(c, 0, h);
else {
u.sort((m, g) => m.start - g.start);
let d = 0;
@@ -14834,7 +14902,7 @@ function bp(r) {
u.length = d + 1;
for (let m = 0, g = u.length; m < g; m++) {
const v = u[m];
- r.bufferSubData(
+ n.bufferSubData(
c,
v.start * h.BYTES_PER_ELEMENT,
h,
@@ -14849,10 +14917,10 @@ function bp(r) {
function s(o) {
return o.isInterleavedBufferAttribute && (o = o.data), e.get(o);
}
- function n(o) {
+ function r(o) {
o.isInterleavedBufferAttribute && (o = o.data);
const l = e.get(o);
- l && (r.deleteBuffer(l.buffer), e.delete(o));
+ l && (n.deleteBuffer(l.buffer), e.delete(o));
}
function a(o, l) {
if (o.isInterleavedBufferAttribute && (o = o.data), o.isGLBufferAttribute) {
@@ -14876,7 +14944,7 @@ function bp(r) {
}
return {
get: s,
- remove: n,
+ remove: r,
update: a
};
}
@@ -15065,7 +15133,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
}
return max( I, vec3( 0.0 ) );
}
-#endif`, Op = `#ifdef USE_BUMPMAP
+#endif`, Bp = `#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
@@ -15086,7 +15154,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
-#endif`, Bp = `#if NUM_CLIPPING_PLANES > 0
+#endif`, Op = `#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#ifdef ALPHA_TO_COVERAGE
float distanceToPlane, distanceGradient;
@@ -15132,10 +15200,10 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
if ( clipped ) discard;
#endif
#endif
-#endif`, Fp = `#if NUM_CLIPPING_PLANES > 0
+#endif`, kp = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
-#endif`, kp = `#if NUM_CLIPPING_PLANES > 0
+#endif`, Fp = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`, zp = `#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
@@ -15436,7 +15504,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
varying vec3 vReflect;
uniform float refractionRatio;
#endif
-#endif`, rm = `#ifdef USE_ENVMAP
+#endif`, nm = `#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
#else
@@ -15453,7 +15521,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
#endif
#endif
-#endif`, nm = `#ifdef USE_FOG
+#endif`, rm = `#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`, am = `#ifdef USE_FOG
varying float vFogDepth;
@@ -15773,7 +15841,7 @@ material.roughness = min( material.roughness, 1.0 );
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
-#endif`, ym = `uniform sampler2D dfgLUT;
+#endif`, bm = `uniform sampler2D dfgLUT;
struct PhysicalMaterial {
vec3 diffuseColor;
float roughness;
@@ -16089,7 +16157,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
-}`, bm = `
+}`, ym = `
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
@@ -16293,12 +16361,12 @@ IncidentLight directLight;
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
#endif
}
-#endif`, Om = `#ifdef USE_MORPHNORMALS
+#endif`, Bm = `#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
-#endif`, Bm = `#ifdef USE_MORPHTARGETS
+#endif`, Om = `#ifdef USE_MORPHTARGETS
#ifndef USE_INSTANCING_MORPH
uniform float morphTargetBaseInfluence;
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
@@ -16312,12 +16380,12 @@ IncidentLight directLight;
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
return texelFetch( morphTargetsTexture, morphUV, 0 );
}
-#endif`, Fm = `#ifdef USE_MORPHTARGETS
+#endif`, km = `#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
-#endif`, km = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
+#endif`, Fm = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
vec3 fdx = dFdx( vViewPosition );
vec3 fdy = dFdy( vViewPosition );
@@ -16533,7 +16601,7 @@ gl_Position = projectionMatrix * mvPosition;`, Qm = `#ifdef DITHERING
roughnessFactor *= texelRoughness.g;
#endif`, sf = `#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
-#endif`, rf = `#if NUM_SPOT_LIGHT_COORDS > 0
+#endif`, nf = `#if NUM_SPOT_LIGHT_COORDS > 0
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
@@ -16728,7 +16796,7 @@ gl_Position = projectionMatrix * mvPosition;`, Qm = `#ifdef DITHERING
}
return mix( 1.0, shadow, shadowIntensity );
}
-#endif`, nf = `#if NUM_SPOT_LIGHT_COORDS > 0
+#endif`, rf = `#if NUM_SPOT_LIGHT_COORDS > 0
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
@@ -17290,7 +17358,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, gf = `#ifdef USE_TRANSM
#ifdef USE_THICKNESSMAP
uniform mat3 thicknessMapTransform;
varying vec2 vThicknessMapUv;
-#endif`, yf = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )
+#endif`, bf = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )
vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
@@ -17361,7 +17429,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, gf = `#ifdef USE_TRANSM
#endif
#ifdef USE_THICKNESSMAP
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
-#endif`, bf = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
+#endif`, yf = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
vec4 worldPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
worldPosition = batchingMatrix * worldPosition;
@@ -17616,7 +17684,7 @@ void main() {
#include
#include
#include
-}`, Of = `#include
+}`, Bf = `#include
#include
#include
#include
@@ -17648,7 +17716,7 @@ void main() {
#include
#include
#include
-}`, Bf = `uniform vec3 diffuse;
+}`, Of = `uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
@@ -17696,7 +17764,7 @@ void main() {
#include
#include
#include
-}`, Ff = `#define LAMBERT
+}`, kf = `#define LAMBERT
varying vec3 vViewPosition;
#include
#include
@@ -17735,7 +17803,7 @@ void main() {
#include
#include
#include
-}`, kf = `#define LAMBERT
+}`, Ff = `#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
@@ -18427,7 +18495,7 @@ void main() {
#include
#include
#include
-}`, ke = {
+}`, Fe = {
alphahash_fragment: Mp,
alphahash_pars_fragment: Sp,
alphamap_fragment: Tp,
@@ -18442,10 +18510,10 @@ void main() {
beginnormal_vertex: Ip,
bsdfs: Up,
iridescence_fragment: Np,
- bumpmap_pars_fragment: Op,
- clipping_planes_fragment: Bp,
- clipping_planes_pars_fragment: Fp,
- clipping_planes_pars_vertex: kp,
+ bumpmap_pars_fragment: Bp,
+ clipping_planes_fragment: Op,
+ clipping_planes_pars_fragment: kp,
+ clipping_planes_pars_vertex: Fp,
clipping_planes_vertex: zp,
color_fragment: Hp,
color_pars_fragment: Vp,
@@ -18465,8 +18533,8 @@ void main() {
envmap_pars_fragment: im,
envmap_pars_vertex: sm,
envmap_physical_pars_fragment: mm,
- envmap_vertex: rm,
- fog_vertex: nm,
+ envmap_vertex: nm,
+ fog_vertex: rm,
fog_pars_vertex: am,
fog_fragment: om,
fog_pars_fragment: lm,
@@ -18480,8 +18548,8 @@ void main() {
lights_phong_fragment: vm,
lights_phong_pars_fragment: _m,
lights_physical_fragment: xm,
- lights_physical_pars_fragment: ym,
- lights_fragment_begin: bm,
+ lights_physical_pars_fragment: bm,
+ lights_fragment_begin: ym,
lights_fragment_maps: Mm,
lights_fragment_end: Sm,
logdepthbuf_fragment: Tm,
@@ -18496,10 +18564,10 @@ void main() {
metalnessmap_pars_fragment: Im,
morphinstance_vertex: Um,
morphcolor_vertex: Nm,
- morphnormal_vertex: Om,
- morphtarget_pars_vertex: Bm,
- morphtarget_vertex: Fm,
- normal_fragment_begin: km,
+ morphnormal_vertex: Bm,
+ morphtarget_pars_vertex: Om,
+ morphtarget_vertex: km,
+ normal_fragment_begin: Fm,
normal_fragment_maps: zm,
normal_pars_fragment: Hm,
normal_pars_vertex: Vm,
@@ -18517,8 +18585,8 @@ void main() {
dithering_pars_fragment: ef,
roughnessmap_fragment: tf,
roughnessmap_pars_fragment: sf,
- shadowmap_pars_fragment: rf,
- shadowmap_pars_vertex: nf,
+ shadowmap_pars_fragment: nf,
+ shadowmap_pars_vertex: rf,
shadowmap_vertex: af,
shadowmask_pars_fragment: of,
skinbase_vertex: lf,
@@ -18533,8 +18601,8 @@ void main() {
transmission_pars_fragment: vf,
uv_pars_fragment: _f,
uv_pars_vertex: xf,
- uv_vertex: yf,
- worldpos_vertex: bf,
+ uv_vertex: bf,
+ worldpos_vertex: yf,
background_vert: Mf,
background_frag: Sf,
backgroundCube_vert: Tf,
@@ -18549,10 +18617,10 @@ void main() {
equirect_frag: If,
linedashed_vert: Uf,
linedashed_frag: Nf,
- meshbasic_vert: Of,
- meshbasic_frag: Bf,
- meshlambert_vert: Ff,
- meshlambert_frag: kf,
+ meshbasic_vert: Bf,
+ meshbasic_frag: Of,
+ meshlambert_vert: kf,
+ meshlambert_frag: Ff,
meshmatcap_vert: zf,
meshmatcap_frag: Hf,
meshnormal_vert: Vf,
@@ -18569,23 +18637,23 @@ void main() {
shadow_frag: Qf,
sprite_vert: eg,
sprite_frag: tg
-}, ce = {
+}, he = {
common: {
diffuse: { value: /* @__PURE__ */ new xe(16777215) },
opacity: { value: 1 },
map: { value: null },
- mapTransform: { value: /* @__PURE__ */ new Fe() },
+ mapTransform: { value: /* @__PURE__ */ new ke() },
alphaMap: { value: null },
- alphaMapTransform: { value: /* @__PURE__ */ new Fe() },
+ alphaMapTransform: { value: /* @__PURE__ */ new ke() },
alphaTest: { value: 0 }
},
specularmap: {
specularMap: { value: null },
- specularMapTransform: { value: /* @__PURE__ */ new Fe() }
+ specularMapTransform: { value: /* @__PURE__ */ new ke() }
},
envmap: {
envMap: { value: null },
- envMapRotation: { value: /* @__PURE__ */ new Fe() },
+ envMapRotation: { value: /* @__PURE__ */ new ke() },
flipEnvMap: { value: -1 },
reflectivity: { value: 1 },
// basic, lambert, phong
@@ -18599,40 +18667,40 @@ void main() {
aomap: {
aoMap: { value: null },
aoMapIntensity: { value: 1 },
- aoMapTransform: { value: /* @__PURE__ */ new Fe() }
+ aoMapTransform: { value: /* @__PURE__ */ new ke() }
},
lightmap: {
lightMap: { value: null },
lightMapIntensity: { value: 1 },
- lightMapTransform: { value: /* @__PURE__ */ new Fe() }
+ lightMapTransform: { value: /* @__PURE__ */ new ke() }
},
bumpmap: {
bumpMap: { value: null },
- bumpMapTransform: { value: /* @__PURE__ */ new Fe() },
+ bumpMapTransform: { value: /* @__PURE__ */ new ke() },
bumpScale: { value: 1 }
},
normalmap: {
normalMap: { value: null },
- normalMapTransform: { value: /* @__PURE__ */ new Fe() },
+ normalMapTransform: { value: /* @__PURE__ */ new ke() },
normalScale: { value: /* @__PURE__ */ new oe(1, 1) }
},
displacementmap: {
displacementMap: { value: null },
- displacementMapTransform: { value: /* @__PURE__ */ new Fe() },
+ displacementMapTransform: { value: /* @__PURE__ */ new ke() },
displacementScale: { value: 1 },
displacementBias: { value: 0 }
},
emissivemap: {
emissiveMap: { value: null },
- emissiveMapTransform: { value: /* @__PURE__ */ new Fe() }
+ emissiveMapTransform: { value: /* @__PURE__ */ new ke() }
},
metalnessmap: {
metalnessMap: { value: null },
- metalnessMapTransform: { value: /* @__PURE__ */ new Fe() }
+ metalnessMapTransform: { value: /* @__PURE__ */ new ke() }
},
roughnessmap: {
roughnessMap: { value: null },
- roughnessMapTransform: { value: /* @__PURE__ */ new Fe() }
+ roughnessMapTransform: { value: /* @__PURE__ */ new ke() }
},
gradientmap: {
gradientMap: { value: null }
@@ -18717,9 +18785,9 @@ void main() {
scale: { value: 1 },
map: { value: null },
alphaMap: { value: null },
- alphaMapTransform: { value: /* @__PURE__ */ new Fe() },
+ alphaMapTransform: { value: /* @__PURE__ */ new ke() },
alphaTest: { value: 0 },
- uvTransform: { value: /* @__PURE__ */ new Fe() }
+ uvTransform: { value: /* @__PURE__ */ new ke() }
},
sprite: {
diffuse: { value: /* @__PURE__ */ new xe(16777215) },
@@ -18727,80 +18795,80 @@ void main() {
center: { value: /* @__PURE__ */ new oe(0.5, 0.5) },
rotation: { value: 0 },
map: { value: null },
- mapTransform: { value: /* @__PURE__ */ new Fe() },
+ mapTransform: { value: /* @__PURE__ */ new ke() },
alphaMap: { value: null },
- alphaMapTransform: { value: /* @__PURE__ */ new Fe() },
+ alphaMapTransform: { value: /* @__PURE__ */ new ke() },
alphaTest: { value: 0 }
}
}, Ei = {
basic: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.specularmap,
- ce.envmap,
- ce.aomap,
- ce.lightmap,
- ce.fog
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.specularmap,
+ he.envmap,
+ he.aomap,
+ he.lightmap,
+ he.fog
]),
- vertexShader: ke.meshbasic_vert,
- fragmentShader: ke.meshbasic_frag
+ vertexShader: Fe.meshbasic_vert,
+ fragmentShader: Fe.meshbasic_frag
},
lambert: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.specularmap,
- ce.envmap,
- ce.aomap,
- ce.lightmap,
- ce.emissivemap,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
- ce.fog,
- ce.lights,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.specularmap,
+ he.envmap,
+ he.aomap,
+ he.lightmap,
+ he.emissivemap,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
+ he.fog,
+ he.lights,
{
emissive: { value: /* @__PURE__ */ new xe(0) }
}
]),
- vertexShader: ke.meshlambert_vert,
- fragmentShader: ke.meshlambert_frag
+ vertexShader: Fe.meshlambert_vert,
+ fragmentShader: Fe.meshlambert_frag
},
phong: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.specularmap,
- ce.envmap,
- ce.aomap,
- ce.lightmap,
- ce.emissivemap,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
- ce.fog,
- ce.lights,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.specularmap,
+ he.envmap,
+ he.aomap,
+ he.lightmap,
+ he.emissivemap,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
+ he.fog,
+ he.lights,
{
emissive: { value: /* @__PURE__ */ new xe(0) },
specular: { value: /* @__PURE__ */ new xe(1118481) },
shininess: { value: 30 }
}
]),
- vertexShader: ke.meshphong_vert,
- fragmentShader: ke.meshphong_frag
+ vertexShader: Fe.meshphong_vert,
+ fragmentShader: Fe.meshphong_frag
},
standard: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.envmap,
- ce.aomap,
- ce.lightmap,
- ce.emissivemap,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
- ce.roughnessmap,
- ce.metalnessmap,
- ce.fog,
- ce.lights,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.envmap,
+ he.aomap,
+ he.lightmap,
+ he.emissivemap,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
+ he.roughnessmap,
+ he.metalnessmap,
+ he.fog,
+ he.lights,
{
emissive: { value: /* @__PURE__ */ new xe(0) },
roughness: { value: 1 },
@@ -18808,100 +18876,100 @@ void main() {
envMapIntensity: { value: 1 }
}
]),
- vertexShader: ke.meshphysical_vert,
- fragmentShader: ke.meshphysical_frag
+ vertexShader: Fe.meshphysical_vert,
+ fragmentShader: Fe.meshphysical_frag
},
toon: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.aomap,
- ce.lightmap,
- ce.emissivemap,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
- ce.gradientmap,
- ce.fog,
- ce.lights,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.aomap,
+ he.lightmap,
+ he.emissivemap,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
+ he.gradientmap,
+ he.fog,
+ he.lights,
{
emissive: { value: /* @__PURE__ */ new xe(0) }
}
]),
- vertexShader: ke.meshtoon_vert,
- fragmentShader: ke.meshtoon_frag
+ vertexShader: Fe.meshtoon_vert,
+ fragmentShader: Fe.meshtoon_frag
},
matcap: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
- ce.fog,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
+ he.fog,
{
matcap: { value: null }
}
]),
- vertexShader: ke.meshmatcap_vert,
- fragmentShader: ke.meshmatcap_frag
+ vertexShader: Fe.meshmatcap_vert,
+ fragmentShader: Fe.meshmatcap_frag
},
points: {
- uniforms: /* @__PURE__ */ kt([
- ce.points,
- ce.fog
+ uniforms: /* @__PURE__ */ zt([
+ he.points,
+ he.fog
]),
- vertexShader: ke.points_vert,
- fragmentShader: ke.points_frag
+ vertexShader: Fe.points_vert,
+ fragmentShader: Fe.points_frag
},
dashed: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.fog,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.fog,
{
scale: { value: 1 },
dashSize: { value: 1 },
totalSize: { value: 2 }
}
]),
- vertexShader: ke.linedashed_vert,
- fragmentShader: ke.linedashed_frag
+ vertexShader: Fe.linedashed_vert,
+ fragmentShader: Fe.linedashed_frag
},
depth: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.displacementmap
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.displacementmap
]),
- vertexShader: ke.depth_vert,
- fragmentShader: ke.depth_frag
+ vertexShader: Fe.depth_vert,
+ fragmentShader: Fe.depth_frag
},
normal: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.bumpmap,
- ce.normalmap,
- ce.displacementmap,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.bumpmap,
+ he.normalmap,
+ he.displacementmap,
{
opacity: { value: 1 }
}
]),
- vertexShader: ke.meshnormal_vert,
- fragmentShader: ke.meshnormal_frag
+ vertexShader: Fe.meshnormal_vert,
+ fragmentShader: Fe.meshnormal_frag
},
sprite: {
- uniforms: /* @__PURE__ */ kt([
- ce.sprite,
- ce.fog
+ uniforms: /* @__PURE__ */ zt([
+ he.sprite,
+ he.fog
]),
- vertexShader: ke.sprite_vert,
- fragmentShader: ke.sprite_frag
+ vertexShader: Fe.sprite_vert,
+ fragmentShader: Fe.sprite_frag
},
background: {
uniforms: {
- uvTransform: { value: /* @__PURE__ */ new Fe() },
+ uvTransform: { value: /* @__PURE__ */ new ke() },
t2D: { value: null },
backgroundIntensity: { value: 1 }
},
- vertexShader: ke.background_vert,
- fragmentShader: ke.background_frag
+ vertexShader: Fe.background_vert,
+ fragmentShader: Fe.background_frag
},
backgroundCube: {
uniforms: {
@@ -18909,10 +18977,10 @@ void main() {
flipEnvMap: { value: -1 },
backgroundBlurriness: { value: 0 },
backgroundIntensity: { value: 1 },
- backgroundRotation: { value: /* @__PURE__ */ new Fe() }
+ backgroundRotation: { value: /* @__PURE__ */ new ke() }
},
- vertexShader: ke.backgroundCube_vert,
- fragmentShader: ke.backgroundCube_frag
+ vertexShader: Fe.backgroundCube_vert,
+ fragmentShader: Fe.backgroundCube_frag
},
cube: {
uniforms: {
@@ -18920,99 +18988,99 @@ void main() {
tFlip: { value: -1 },
opacity: { value: 1 }
},
- vertexShader: ke.cube_vert,
- fragmentShader: ke.cube_frag
+ vertexShader: Fe.cube_vert,
+ fragmentShader: Fe.cube_frag
},
equirect: {
uniforms: {
tEquirect: { value: null }
},
- vertexShader: ke.equirect_vert,
- fragmentShader: ke.equirect_frag
+ vertexShader: Fe.equirect_vert,
+ fragmentShader: Fe.equirect_frag
},
distanceRGBA: {
- uniforms: /* @__PURE__ */ kt([
- ce.common,
- ce.displacementmap,
+ uniforms: /* @__PURE__ */ zt([
+ he.common,
+ he.displacementmap,
{
referencePosition: { value: /* @__PURE__ */ new w() },
nearDistance: { value: 1 },
farDistance: { value: 1e3 }
}
]),
- vertexShader: ke.distanceRGBA_vert,
- fragmentShader: ke.distanceRGBA_frag
+ vertexShader: Fe.distanceRGBA_vert,
+ fragmentShader: Fe.distanceRGBA_frag
},
shadow: {
- uniforms: /* @__PURE__ */ kt([
- ce.lights,
- ce.fog,
+ uniforms: /* @__PURE__ */ zt([
+ he.lights,
+ he.fog,
{
color: { value: /* @__PURE__ */ new xe(0) },
opacity: { value: 1 }
}
]),
- vertexShader: ke.shadow_vert,
- fragmentShader: ke.shadow_frag
+ vertexShader: Fe.shadow_vert,
+ fragmentShader: Fe.shadow_frag
}
};
Ei.physical = {
- uniforms: /* @__PURE__ */ kt([
+ uniforms: /* @__PURE__ */ zt([
Ei.standard.uniforms,
{
clearcoat: { value: 0 },
clearcoatMap: { value: null },
- clearcoatMapTransform: { value: /* @__PURE__ */ new Fe() },
+ clearcoatMapTransform: { value: /* @__PURE__ */ new ke() },
clearcoatNormalMap: { value: null },
- clearcoatNormalMapTransform: { value: /* @__PURE__ */ new Fe() },
+ clearcoatNormalMapTransform: { value: /* @__PURE__ */ new ke() },
clearcoatNormalScale: { value: /* @__PURE__ */ new oe(1, 1) },
clearcoatRoughness: { value: 0 },
clearcoatRoughnessMap: { value: null },
- clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new Fe() },
+ clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new ke() },
dispersion: { value: 0 },
iridescence: { value: 0 },
iridescenceMap: { value: null },
- iridescenceMapTransform: { value: /* @__PURE__ */ new Fe() },
+ iridescenceMapTransform: { value: /* @__PURE__ */ new ke() },
iridescenceIOR: { value: 1.3 },
iridescenceThicknessMinimum: { value: 100 },
iridescenceThicknessMaximum: { value: 400 },
iridescenceThicknessMap: { value: null },
- iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new Fe() },
+ iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new ke() },
sheen: { value: 0 },
sheenColor: { value: /* @__PURE__ */ new xe(0) },
sheenColorMap: { value: null },
- sheenColorMapTransform: { value: /* @__PURE__ */ new Fe() },
+ sheenColorMapTransform: { value: /* @__PURE__ */ new ke() },
sheenRoughness: { value: 1 },
sheenRoughnessMap: { value: null },
- sheenRoughnessMapTransform: { value: /* @__PURE__ */ new Fe() },
+ sheenRoughnessMapTransform: { value: /* @__PURE__ */ new ke() },
transmission: { value: 0 },
transmissionMap: { value: null },
- transmissionMapTransform: { value: /* @__PURE__ */ new Fe() },
+ transmissionMapTransform: { value: /* @__PURE__ */ new ke() },
transmissionSamplerSize: { value: /* @__PURE__ */ new oe() },
transmissionSamplerMap: { value: null },
thickness: { value: 0 },
thicknessMap: { value: null },
- thicknessMapTransform: { value: /* @__PURE__ */ new Fe() },
+ thicknessMapTransform: { value: /* @__PURE__ */ new ke() },
attenuationDistance: { value: 0 },
attenuationColor: { value: /* @__PURE__ */ new xe(0) },
specularColor: { value: /* @__PURE__ */ new xe(1, 1, 1) },
specularColorMap: { value: null },
- specularColorMapTransform: { value: /* @__PURE__ */ new Fe() },
+ specularColorMapTransform: { value: /* @__PURE__ */ new ke() },
specularIntensity: { value: 1 },
specularIntensityMap: { value: null },
- specularIntensityMapTransform: { value: /* @__PURE__ */ new Fe() },
+ specularIntensityMapTransform: { value: /* @__PURE__ */ new ke() },
anisotropyVector: { value: /* @__PURE__ */ new oe() },
anisotropyMap: { value: null },
- anisotropyMapTransform: { value: /* @__PURE__ */ new Fe() }
+ anisotropyMapTransform: { value: /* @__PURE__ */ new ke() }
}
]),
- vertexShader: ke.meshphysical_vert,
- fragmentShader: ke.meshphysical_frag
+ vertexShader: Fe.meshphysical_vert,
+ fragmentShader: Fe.meshphysical_frag
};
-const hn = { r: 0, b: 0, g: 0 }, ds = /* @__PURE__ */ new xi(), ig = /* @__PURE__ */ new Ne();
-function sg(r, e, t, i, s, n, a) {
+const hr = { r: 0, b: 0, g: 0 }, ds = /* @__PURE__ */ new bi(), ig = /* @__PURE__ */ new Ne();
+function sg(n, e, t, i, s, r, a) {
const o = new xe(0);
- let l = n === !0 ? 0 : 1, c, h, u = null, d = 0, m = null;
+ let l = r === !0 ? 0 : 1, c, h, u = null, d = 0, m = null;
function g(_) {
let E = _.isScene === !0 ? _.background : null;
return E && E.isTexture && (E = (_.backgroundBlurriness > 0 ? t : e).get(E)), E;
@@ -19021,19 +19089,19 @@ function sg(r, e, t, i, s, n, a) {
let E = !1;
const R = g(_);
R === null ? p(o, l) : R && R.isColor && (p(R, 1), E = !0);
- const T = r.xr.getEnvironmentBlendMode();
- T === "additive" ? i.buffers.color.setClear(0, 0, 0, 1, a) : T === "alpha-blend" && i.buffers.color.setClear(0, 0, 0, 0, a), (r.autoClear || E) && (i.buffers.depth.setTest(!0), i.buffers.depth.setMask(!0), i.buffers.color.setMask(!0), r.clear(r.autoClearColor, r.autoClearDepth, r.autoClearStencil));
+ const T = n.xr.getEnvironmentBlendMode();
+ T === "additive" ? i.buffers.color.setClear(0, 0, 0, 1, a) : T === "alpha-blend" && i.buffers.color.setClear(0, 0, 0, 0, a), (n.autoClear || E) && (i.buffers.depth.setTest(!0), i.buffers.depth.setMask(!0), i.buffers.color.setMask(!0), n.clear(n.autoClearColor, n.autoClearDepth, n.autoClearStencil));
}
function f(_, E) {
const R = g(E);
- R && (R.isCubeTexture || R.mapping === In) ? (h === void 0 && (h = new at(
+ R && (R.isCubeTexture || R.mapping === Ir) ? (h === void 0 && (h = new ot(
new vs(1, 1, 1),
new ut({
name: "BackgroundCubeMaterial",
uniforms: $s(Ei.backgroundCube.uniforms),
vertexShader: Ei.backgroundCube.vertexShader,
fragmentShader: Ei.backgroundCube.fragmentShader,
- side: Ht,
+ side: Vt,
depthTest: !1,
depthWrite: !1,
fog: !1,
@@ -19045,8 +19113,8 @@ function sg(r, e, t, i, s, n, a) {
get: function() {
return this.uniforms.envMap.value;
}
- }), s.update(h)), ds.copy(E.backgroundRotation), ds.x *= -1, ds.y *= -1, ds.z *= -1, R.isCubeTexture && R.isRenderTargetTexture === !1 && (ds.y *= -1, ds.z *= -1), h.material.uniforms.envMap.value = R, h.material.uniforms.flipEnvMap.value = R.isCubeTexture && R.isRenderTargetTexture === !1 ? -1 : 1, h.material.uniforms.backgroundBlurriness.value = E.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = E.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(ig.makeRotationFromEuler(ds)), h.material.toneMapped = qe.getTransfer(R.colorSpace) !== tt, (u !== R || d !== R.version || m !== r.toneMapping) && (h.material.needsUpdate = !0, u = R, d = R.version, m = r.toneMapping), h.layers.enableAll(), _.unshift(h, h.geometry, h.material, 0, 0, null)) : R && R.isTexture && (c === void 0 && (c = new at(
- new Dr(2, 2),
+ }), s.update(h)), ds.copy(E.backgroundRotation), ds.x *= -1, ds.y *= -1, ds.z *= -1, R.isCubeTexture && R.isRenderTargetTexture === !1 && (ds.y *= -1, ds.z *= -1), h.material.uniforms.envMap.value = R, h.material.uniforms.flipEnvMap.value = R.isCubeTexture && R.isRenderTargetTexture === !1 ? -1 : 1, h.material.uniforms.backgroundBlurriness.value = E.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = E.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(ig.makeRotationFromEuler(ds)), h.material.toneMapped = qe.getTransfer(R.colorSpace) !== it, (u !== R || d !== R.version || m !== n.toneMapping) && (h.material.needsUpdate = !0, u = R, d = R.version, m = n.toneMapping), h.layers.enableAll(), _.unshift(h, h.geometry, h.material, 0, 0, null)) : R && R.isTexture && (c === void 0 && (c = new ot(
+ new In(2, 2),
new ut({
name: "BackgroundMaterial",
uniforms: $s(Ei.background.uniforms),
@@ -19062,12 +19130,12 @@ function sg(r, e, t, i, s, n, a) {
get: function() {
return this.uniforms.t2D.value;
}
- }), s.update(c)), c.material.uniforms.t2D.value = R, c.material.uniforms.backgroundIntensity.value = E.backgroundIntensity, c.material.toneMapped = qe.getTransfer(R.colorSpace) !== tt, R.matrixAutoUpdate === !0 && R.updateMatrix(), c.material.uniforms.uvTransform.value.copy(R.matrix), (u !== R || d !== R.version || m !== r.toneMapping) && (c.material.needsUpdate = !0, u = R, d = R.version, m = r.toneMapping), c.layers.enableAll(), _.unshift(c, c.geometry, c.material, 0, 0, null));
+ }), s.update(c)), c.material.uniforms.t2D.value = R, c.material.uniforms.backgroundIntensity.value = E.backgroundIntensity, c.material.toneMapped = qe.getTransfer(R.colorSpace) !== it, R.matrixAutoUpdate === !0 && R.updateMatrix(), c.material.uniforms.uvTransform.value.copy(R.matrix), (u !== R || d !== R.version || m !== n.toneMapping) && (c.material.needsUpdate = !0, u = R, d = R.version, m = n.toneMapping), c.layers.enableAll(), _.unshift(c, c.geometry, c.material, 0, 0, null));
}
function p(_, E) {
- _.getRGB(hn, fh(r)), i.buffers.color.setClear(hn.r, hn.g, hn.b, E, a);
+ _.getRGB(hr, fh(n)), i.buffers.color.setClear(hr.r, hr.g, hr.b, E, a);
}
- function y() {
+ function b() {
h !== void 0 && (h.geometry.dispose(), h.material.dispose(), h = void 0), c !== void 0 && (c.geometry.dispose(), c.material.dispose(), c = void 0);
}
return {
@@ -19085,25 +19153,25 @@ function sg(r, e, t, i, s, n, a) {
},
render: v,
addToRenderList: f,
- dispose: y
+ dispose: b
};
}
-function rg(r, e) {
- const t = r.getParameter(r.MAX_VERTEX_ATTRIBS), i = {}, s = d(null);
- let n = s, a = !1;
+function ng(n, e) {
+ const t = n.getParameter(n.MAX_VERTEX_ATTRIBS), i = {}, s = d(null);
+ let r = s, a = !1;
function o(M, L, N, z, H) {
let j = !1;
const q = u(z, N, L);
- n !== q && (n = q, c(n.object)), j = m(M, z, N, H), j && g(M, z, N, H), H !== null && e.update(H, r.ELEMENT_ARRAY_BUFFER), (j || a) && (a = !1, E(M, L, N, z), H !== null && r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, e.get(H).buffer));
+ r !== q && (r = q, c(r.object)), j = m(M, z, N, H), j && g(M, z, N, H), H !== null && e.update(H, n.ELEMENT_ARRAY_BUFFER), (j || a) && (a = !1, E(M, L, N, z), H !== null && n.bindBuffer(n.ELEMENT_ARRAY_BUFFER, e.get(H).buffer));
}
function l() {
- return r.createVertexArray();
+ return n.createVertexArray();
}
function c(M) {
- return r.bindVertexArray(M);
+ return n.bindVertexArray(M);
}
function h(M) {
- return r.deleteVertexArray(M);
+ return n.deleteVertexArray(M);
}
function u(M, L, N) {
const z = N.wireframe === !0;
@@ -19132,17 +19200,17 @@ function rg(r, e) {
};
}
function m(M, L, N, z) {
- const H = n.attributes, j = L.attributes;
+ const H = r.attributes, j = L.attributes;
let q = 0;
const te = N.getAttributes();
for (const G in te)
if (te[G].location >= 0) {
const Z = H[G];
- let re = j[G];
- if (re === void 0 && (G === "instanceMatrix" && M.instanceMatrix && (re = M.instanceMatrix), G === "instanceColor" && M.instanceColor && (re = M.instanceColor)), Z === void 0 || Z.attribute !== re || re && Z.data !== re.data) return !0;
+ let ne = j[G];
+ if (ne === void 0 && (G === "instanceMatrix" && M.instanceMatrix && (ne = M.instanceMatrix), G === "instanceColor" && M.instanceColor && (ne = M.instanceColor)), Z === void 0 || Z.attribute !== ne || ne && Z.data !== ne.data) return !0;
q++;
}
- return n.attributesNum !== q || n.index !== z;
+ return r.attributesNum !== q || r.index !== z;
}
function g(M, L, N, z) {
const H = {}, j = L.attributes;
@@ -19152,13 +19220,13 @@ function rg(r, e) {
if (te[G].location >= 0) {
let Z = j[G];
Z === void 0 && (G === "instanceMatrix" && M.instanceMatrix && (Z = M.instanceMatrix), G === "instanceColor" && M.instanceColor && (Z = M.instanceColor));
- const re = {};
- re.attribute = Z, Z && Z.data && (re.data = Z.data), H[G] = re, q++;
+ const ne = {};
+ ne.attribute = Z, Z && Z.data && (ne.data = Z.data), H[G] = ne, q++;
}
- n.attributes = H, n.attributesNum = q, n.index = z;
+ r.attributes = H, r.attributesNum = q, r.index = z;
}
function v() {
- const M = n.newAttributes;
+ const M = r.newAttributes;
for (let L = 0, N = M.length; L < N; L++)
M[L] = 0;
}
@@ -19166,16 +19234,16 @@ function rg(r, e) {
p(M, 0);
}
function p(M, L) {
- const N = n.newAttributes, z = n.enabledAttributes, H = n.attributeDivisors;
- N[M] = 1, z[M] === 0 && (r.enableVertexAttribArray(M), z[M] = 1), H[M] !== L && (r.vertexAttribDivisor(M, L), H[M] = L);
+ const N = r.newAttributes, z = r.enabledAttributes, H = r.attributeDivisors;
+ N[M] = 1, z[M] === 0 && (n.enableVertexAttribArray(M), z[M] = 1), H[M] !== L && (n.vertexAttribDivisor(M, L), H[M] = L);
}
- function y() {
- const M = n.newAttributes, L = n.enabledAttributes;
+ function b() {
+ const M = r.newAttributes, L = r.enabledAttributes;
for (let N = 0, z = L.length; N < z; N++)
- L[N] !== M[N] && (r.disableVertexAttribArray(N), L[N] = 0);
+ L[N] !== M[N] && (n.disableVertexAttribArray(N), L[N] = 0);
}
function _(M, L, N, z, H, j, q) {
- q === !0 ? r.vertexAttribIPointer(M, L, N, H, j) : r.vertexAttribPointer(M, L, N, z, H, j);
+ q === !0 ? n.vertexAttribIPointer(M, L, N, H, j) : n.vertexAttribPointer(M, L, N, z, H, j);
}
function E(M, L, N, z) {
v();
@@ -19185,11 +19253,11 @@ function rg(r, e) {
if (G.location >= 0) {
let Z = H[te];
if (Z === void 0 && (te === "instanceMatrix" && M.instanceMatrix && (Z = M.instanceMatrix), te === "instanceColor" && M.instanceColor && (Z = M.instanceColor)), Z !== void 0) {
- const re = Z.normalized, Le = Z.itemSize, He = e.get(Z);
+ const ne = Z.normalized, Le = Z.itemSize, He = e.get(Z);
if (He === void 0) continue;
- const Ye = He.buffer, Ze = He.type, $e = He.bytesPerElement, W = Ze === r.INT || Ze === r.UNSIGNED_INT || Z.gpuType === Lo;
+ const Ye = He.buffer, $e = He.type, Je = He.bytesPerElement, W = $e === n.INT || $e === n.UNSIGNED_INT || Z.gpuType === Lo;
if (Z.isInterleavedBufferAttribute) {
- const Y = Z.data, ue = Y.stride, Ae = Z.offset;
+ const Y = Z.data, de = Y.stride, Ae = Z.offset;
if (Y.isInstancedInterleavedBuffer) {
for (let Te = 0; Te < G.locationSize; Te++)
p(G.location + Te, Y.meshPerAttribute);
@@ -19197,15 +19265,15 @@ function rg(r, e) {
} else
for (let Te = 0; Te < G.locationSize; Te++)
f(G.location + Te);
- r.bindBuffer(r.ARRAY_BUFFER, Ye);
+ n.bindBuffer(n.ARRAY_BUFFER, Ye);
for (let Te = 0; Te < G.locationSize; Te++)
_(
G.location + Te,
Le / G.locationSize,
- Ze,
- re,
- ue * $e,
- (Ae + Le / G.locationSize * Te) * $e,
+ $e,
+ ne,
+ de * Je,
+ (Ae + Le / G.locationSize * Te) * Je,
W
);
} else {
@@ -19216,38 +19284,38 @@ function rg(r, e) {
} else
for (let Y = 0; Y < G.locationSize; Y++)
f(G.location + Y);
- r.bindBuffer(r.ARRAY_BUFFER, Ye);
+ n.bindBuffer(n.ARRAY_BUFFER, Ye);
for (let Y = 0; Y < G.locationSize; Y++)
_(
G.location + Y,
Le / G.locationSize,
- Ze,
- re,
- Le * $e,
- Le / G.locationSize * Y * $e,
+ $e,
+ ne,
+ Le * Je,
+ Le / G.locationSize * Y * Je,
W
);
}
} else if (q !== void 0) {
- const re = q[te];
- if (re !== void 0)
- switch (re.length) {
+ const ne = q[te];
+ if (ne !== void 0)
+ switch (ne.length) {
case 2:
- r.vertexAttrib2fv(G.location, re);
+ n.vertexAttrib2fv(G.location, ne);
break;
case 3:
- r.vertexAttrib3fv(G.location, re);
+ n.vertexAttrib3fv(G.location, ne);
break;
case 4:
- r.vertexAttrib4fv(G.location, re);
+ n.vertexAttrib4fv(G.location, ne);
break;
default:
- r.vertexAttrib1fv(G.location, re);
+ n.vertexAttrib1fv(G.location, ne);
}
}
}
}
- y();
+ b();
}
function R() {
I();
@@ -19284,7 +19352,7 @@ function rg(r, e) {
}
}
function I() {
- S(), a = !0, n !== s && (n = s, c(n.object));
+ S(), a = !0, r !== s && (r = s, c(r.object));
}
function S() {
s.geometry = null, s.program = null, s.wireframe = !1;
@@ -19298,19 +19366,19 @@ function rg(r, e) {
releaseStatesOfProgram: A,
initAttributes: v,
enableAttribute: f,
- disableUnusedAttributes: y
+ disableUnusedAttributes: b
};
}
-function ng(r, e, t) {
+function rg(n, e, t) {
let i;
function s(c) {
i = c;
}
- function n(c, h) {
- r.drawArrays(i, c, h), t.update(h, i, 1);
+ function r(c, h) {
+ n.drawArrays(i, c, h), t.update(h, i, 1);
}
function a(c, h, u) {
- u !== 0 && (r.drawArraysInstanced(i, c, h, u), t.update(h, i, u));
+ u !== 0 && (n.drawArraysInstanced(i, c, h, u), t.update(h, i, u));
}
function o(c, h, u) {
if (u === 0) return;
@@ -19334,43 +19402,43 @@ function ng(r, e, t) {
t.update(g, i, 1);
}
}
- this.setMode = s, this.render = n, this.renderInstances = a, this.renderMultiDraw = o, this.renderMultiDrawInstances = l;
+ this.setMode = s, this.render = r, this.renderInstances = a, this.renderMultiDraw = o, this.renderMultiDrawInstances = l;
}
-function ag(r, e, t, i) {
+function ag(n, e, t, i) {
let s;
- function n() {
+ function r() {
if (s !== void 0) return s;
if (e.has("EXT_texture_filter_anisotropic") === !0) {
const A = e.get("EXT_texture_filter_anisotropic");
- s = r.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
+ s = n.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
} else
s = 0;
return s;
}
function a(A) {
- return !(A !== $t && i.convert(A) !== r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT));
+ return !(A !== Jt && i.convert(A) !== n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT));
}
function o(A) {
const I = A === vt && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
- return !(A !== vi && i.convert(A) !== r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)
- A !== Xt && !I);
+ return !(A !== _i && i.convert(A) !== n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)
+ A !== qt && !I);
}
function l(A) {
if (A === "highp") {
- if (r.getShaderPrecisionFormat(r.VERTEX_SHADER, r.HIGH_FLOAT).precision > 0 && r.getShaderPrecisionFormat(r.FRAGMENT_SHADER, r.HIGH_FLOAT).precision > 0)
+ if (n.getShaderPrecisionFormat(n.VERTEX_SHADER, n.HIGH_FLOAT).precision > 0 && n.getShaderPrecisionFormat(n.FRAGMENT_SHADER, n.HIGH_FLOAT).precision > 0)
return "highp";
A = "mediump";
}
- return A === "mediump" && r.getShaderPrecisionFormat(r.VERTEX_SHADER, r.MEDIUM_FLOAT).precision > 0 && r.getShaderPrecisionFormat(r.FRAGMENT_SHADER, r.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp";
+ return A === "mediump" && n.getShaderPrecisionFormat(n.VERTEX_SHADER, n.MEDIUM_FLOAT).precision > 0 && n.getShaderPrecisionFormat(n.FRAGMENT_SHADER, n.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp";
}
let c = t.precision !== void 0 ? t.precision : "highp";
const h = l(c);
h !== c && (Se("WebGLRenderer:", c, "not supported, using", h, "instead."), c = h);
- const u = t.logarithmicDepthBuffer === !0, d = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), m = r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS), g = r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS), v = r.getParameter(r.MAX_TEXTURE_SIZE), f = r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE), p = r.getParameter(r.MAX_VERTEX_ATTRIBS), y = r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS), _ = r.getParameter(r.MAX_VARYING_VECTORS), E = r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS), R = g > 0, T = r.getParameter(r.MAX_SAMPLES);
+ const u = t.logarithmicDepthBuffer === !0, d = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), m = n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS), g = n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS), v = n.getParameter(n.MAX_TEXTURE_SIZE), f = n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE), p = n.getParameter(n.MAX_VERTEX_ATTRIBS), b = n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS), _ = n.getParameter(n.MAX_VARYING_VECTORS), E = n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS), R = g > 0, T = n.getParameter(n.MAX_SAMPLES);
return {
isWebGL2: !0,
// keeping this for backwards compatibility
- getMaxAnisotropy: n,
+ getMaxAnisotropy: r,
getMaxPrecision: l,
textureFormatReadable: a,
textureTypeReadable: o,
@@ -19382,39 +19450,39 @@ function ag(r, e, t, i) {
maxTextureSize: v,
maxCubemapSize: f,
maxAttributes: p,
- maxVertexUniforms: y,
+ maxVertexUniforms: b,
maxVaryings: _,
maxFragmentUniforms: E,
vertexTextures: R,
maxSamples: T
};
}
-function og(r) {
+function og(n) {
const e = this;
- let t = null, i = 0, s = !1, n = !1;
- const a = new Ti(), o = new Fe(), l = { value: null, needsUpdate: !1 };
+ let t = null, i = 0, s = !1, r = !1;
+ const a = new Ti(), o = new ke(), l = { value: null, needsUpdate: !1 };
this.uniform = l, this.numPlanes = 0, this.numIntersection = 0, this.init = function(u, d) {
const m = u.length !== 0 || d || // enable state of previous frame - the clipping code has to
// run another frame in order to reset the state:
i !== 0 || s;
return s = d, i = u.length, m;
}, this.beginShadows = function() {
- n = !0, h(null);
+ r = !0, h(null);
}, this.endShadows = function() {
- n = !1;
+ r = !1;
}, this.setGlobalState = function(u, d) {
t = h(u, d, 0);
}, this.setState = function(u, d, m) {
- const g = u.clippingPlanes, v = u.clipIntersection, f = u.clipShadows, p = r.get(u);
- if (!s || g === null || g.length === 0 || n && !f)
- n ? h(null) : c();
+ const g = u.clippingPlanes, v = u.clipIntersection, f = u.clipShadows, p = n.get(u);
+ if (!s || g === null || g.length === 0 || r && !f)
+ r ? h(null) : c();
else {
- const y = n ? 0 : i, _ = y * 4;
+ const b = r ? 0 : i, _ = b * 4;
let E = p.clippingState || null;
l.value = E, E = h(g, d, _, m);
for (let R = 0; R !== _; ++R)
E[R] = t[R];
- p.clippingState = E, this.numIntersection = v ? this.numPlanes : 0, this.numPlanes += y;
+ p.clippingState = E, this.numIntersection = v ? this.numPlanes : 0, this.numPlanes += b;
}
};
function c() {
@@ -19425,25 +19493,25 @@ function og(r) {
let f = null;
if (v !== 0) {
if (f = l.value, g !== !0 || f === null) {
- const p = m + v * 4, y = d.matrixWorldInverse;
- o.getNormalMatrix(y), (f === null || f.length < p) && (f = new Float32Array(p));
+ const p = m + v * 4, b = d.matrixWorldInverse;
+ o.getNormalMatrix(b), (f === null || f.length < p) && (f = new Float32Array(p));
for (let _ = 0, E = m; _ !== v; ++_, E += 4)
- a.copy(u[_]).applyMatrix4(y, o), a.normal.toArray(f, E), f[E + 3] = a.constant;
+ a.copy(u[_]).applyMatrix4(b, o), a.normal.toArray(f, E), f[E + 3] = a.constant;
}
l.value = f, l.needsUpdate = !0;
}
return e.numPlanes = v, e.numIntersection = 0, f;
}
}
-function lg(r) {
+function lg(n) {
let e = /* @__PURE__ */ new WeakMap();
function t(a, o) {
- return o === Tn ? a.mapping = Xs : o === ka && (a.mapping = qs), a;
+ return o === Tr ? a.mapping = Xs : o === Fa && (a.mapping = qs), a;
}
function i(a) {
if (a && a.isTexture) {
const o = a.mapping;
- if (o === Tn || o === ka)
+ if (o === Tr || o === Fa)
if (e.has(a)) {
const l = e.get(a).texture;
return t(l, a.mapping);
@@ -19451,7 +19519,7 @@ function lg(r) {
const l = a.image;
if (l && l.height > 0) {
const c = new Ed(l.height);
- return c.fromEquirectangularTexture(r, a), e.set(a, c), a.addEventListener("dispose", s), t(c.texture, a.mapping);
+ return c.fromEquirectangularTexture(n, a), e.set(a, c), a.addEventListener("dispose", s), t(c.texture, a.mapping);
} else
return null;
}
@@ -19464,15 +19532,15 @@ function lg(r) {
const l = e.get(o);
l !== void 0 && (e.delete(o), l.dispose());
}
- function n() {
+ function r() {
e = /* @__PURE__ */ new WeakMap();
}
return {
get: i,
- dispose: n
+ dispose: r
};
}
-const es = 4, ac = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], fs = 20, cg = 256, gr = /* @__PURE__ */ new _s(), oc = /* @__PURE__ */ new xe();
+const es = 4, ac = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], fs = 20, cg = 256, vn = /* @__PURE__ */ new _s(), oc = /* @__PURE__ */ new xe();
let ga = null, va = 0, _a = 0, xa = !1;
const hg = /* @__PURE__ */ new w();
class lc {
@@ -19499,11 +19567,11 @@ class lc {
* @param {Vector3} [options.renderTarget=origin] - The position of the internal cube camera that renders the scene.
* @return {WebGLRenderTarget} The resulting PMREM.
*/
- fromScene(e, t = 0, i = 0.1, s = 100, n = {}) {
+ fromScene(e, t = 0, i = 0.1, s = 100, r = {}) {
const {
size: a = 256,
position: o = hg
- } = n;
+ } = r;
ga = this._renderer.getRenderTarget(), va = this._renderer.getActiveCubeFace(), _a = this._renderer.getActiveMipmapLevel(), xa = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
const l = this._allocateTargets();
return l.depthBuffer = !0, this._sceneToCubeUV(e, i, s, l, o), t > 0 && this._blur(l, 0, 0, t), this._applyPMREM(l), this._cleanup(l), l;
@@ -19564,7 +19632,7 @@ class lc {
this._lodMeshes[e].geometry.dispose();
}
_cleanup(e) {
- this._renderer.setRenderTarget(ga, va, _a), this._renderer.xr.enabled = xa, e.scissorTest = !1, Os(e, 0, 0, e.width, e.height);
+ this._renderer.setRenderTarget(ga, va, _a), this._renderer.xr.enabled = xa, e.scissorTest = !1, Bs(e, 0, 0, e.width, e.height);
}
_fromTexture(e, t) {
e.mapping === Xs || e.mapping === qs ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), ga = this._renderer.getRenderTarget(), va = this._renderer.getActiveCubeFace(), _a = this._renderer.getActiveMipmapLevel(), xa = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
@@ -19577,28 +19645,28 @@ class lc {
minFilter: Mt,
generateMipmaps: !1,
type: vt,
- format: $t,
- colorSpace: Bt,
+ format: Jt,
+ colorSpace: kt,
depthBuffer: !1
}, s = cc(e, t, i);
if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = cc(e, t, i);
- const { _lodMax: n } = this;
- ({ lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas } = ug(n)), this._blurMaterial = pg(n, e, t), this._ggxMaterial = dg(n, e, t);
+ const { _lodMax: r } = this;
+ ({ lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas } = ug(r)), this._blurMaterial = pg(r, e, t), this._ggxMaterial = dg(r, e, t);
}
return s;
}
_compileMaterial(e) {
- const t = new at(new si(), e);
- this._renderer.compile(t, gr);
+ const t = new ot(new ni(), e);
+ this._renderer.compile(t, vn);
}
- _sceneToCubeUV(e, t, i, s, n) {
+ _sceneToCubeUV(e, t, i, s, r) {
const a = new Tt(90, 1, t, i), o = [1, -1, 1, 1, 1, 1], l = [1, 1, 1, -1, -1, -1], c = this._renderer, h = c.autoClear, u = c.toneMapping;
- c.getClearColor(oc), c.toneMapping = is, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(s), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new at(
+ c.getClearColor(oc), c.toneMapping = is, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(s), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new ot(
new vs(),
- new zt({
+ new Ht({
name: "PMREM.Background",
- side: Ht,
+ side: Vt,
depthWrite: !1,
depthTest: !1
})
@@ -19609,28 +19677,28 @@ class lc {
v ? v.isColor && (m.color.copy(v), e.background = null, g = !0) : (m.color.copy(oc), g = !0);
for (let f = 0; f < 6; f++) {
const p = f % 3;
- p === 0 ? (a.up.set(0, o[f], 0), a.position.set(n.x, n.y, n.z), a.lookAt(n.x + l[f], n.y, n.z)) : p === 1 ? (a.up.set(0, 0, o[f]), a.position.set(n.x, n.y, n.z), a.lookAt(n.x, n.y + l[f], n.z)) : (a.up.set(0, o[f], 0), a.position.set(n.x, n.y, n.z), a.lookAt(n.x, n.y, n.z + l[f]));
- const y = this._cubeSize;
- Os(s, p * y, f > 2 ? y : 0, y, y), c.setRenderTarget(s), g && c.render(d, a), c.render(e, a);
+ p === 0 ? (a.up.set(0, o[f], 0), a.position.set(r.x, r.y, r.z), a.lookAt(r.x + l[f], r.y, r.z)) : p === 1 ? (a.up.set(0, 0, o[f]), a.position.set(r.x, r.y, r.z), a.lookAt(r.x, r.y + l[f], r.z)) : (a.up.set(0, o[f], 0), a.position.set(r.x, r.y, r.z), a.lookAt(r.x, r.y, r.z + l[f]));
+ const b = this._cubeSize;
+ Bs(s, p * b, f > 2 ? b : 0, b, b), c.setRenderTarget(s), g && c.render(d, a), c.render(e, a);
}
c.toneMapping = u, c.autoClear = h, e.background = v;
}
_textureToCubeUV(e, t) {
const i = this._renderer, s = e.mapping === Xs || e.mapping === qs;
s ? (this._cubemapMaterial === null && (this._cubemapMaterial = uc()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = hc());
- const n = s ? this._cubemapMaterial : this._equirectMaterial, a = this._lodMeshes[0];
- a.material = n;
- const o = n.uniforms;
+ const r = s ? this._cubemapMaterial : this._equirectMaterial, a = this._lodMeshes[0];
+ a.material = r;
+ const o = r.uniforms;
o.envMap.value = e;
const l = this._cubeSize;
- Os(t, 0, 0, 3 * l, 2 * l), i.setRenderTarget(t), i.render(a, gr);
+ Bs(t, 0, 0, 3 * l, 2 * l), i.setRenderTarget(t), i.render(a, vn);
}
_applyPMREM(e) {
const t = this._renderer, i = t.autoClear;
t.autoClear = !1;
const s = this._lodMeshes.length;
- for (let n = 1; n < s; n++)
- this._applyGGXFilter(e, n - 1, n);
+ for (let r = 1; r < s; r++)
+ this._applyGGXFilter(e, r - 1, r);
t.autoClear = i;
}
/**
@@ -19645,10 +19713,10 @@ class lc {
* @param {number} lodOut - Target LOD level to write to
*/
_applyGGXFilter(e, t, i) {
- const s = this._renderer, n = this._pingPongRenderTarget, a = this._ggxMaterial, o = this._lodMeshes[i];
+ const s = this._renderer, r = this._pingPongRenderTarget, a = this._ggxMaterial, o = this._lodMeshes[i];
o.material = a;
const l = a.uniforms, c = i / (this._lodMeshes.length - 1), h = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - h * h), d = 0.05 + c * 0.95, m = u * d, { _lodMax: g } = this, v = this._sizeLods[i], f = 3 * v * (i > g - es ? i - g + es : 0), p = 4 * (this._cubeSize - v);
- l.envMap.value = e.texture, l.roughness.value = m, l.mipInt.value = g - t, Os(n, f, p, 3 * v, 2 * v), s.setRenderTarget(n), s.render(o, gr), l.envMap.value = n.texture, l.roughness.value = 0, l.mipInt.value = g - i, Os(e, f, p, 3 * v, 2 * v), s.setRenderTarget(e), s.render(o, gr);
+ l.envMap.value = e.texture, l.roughness.value = m, l.mipInt.value = g - t, Bs(r, f, p, 3 * v, 2 * v), s.setRenderTarget(r), s.render(o, vn), l.envMap.value = r.texture, l.roughness.value = 0, l.mipInt.value = g - i, Bs(e, f, p, 3 * v, 2 * v), s.setRenderTarget(e), s.render(o, vn);
}
/**
* This is a two-pass Gaussian blur for a cubemap. Normally this is done
@@ -19666,7 +19734,7 @@ class lc {
* @param {number} sigma
* @param {Vector3} [poleAxis]
*/
- _blur(e, t, i, s, n) {
+ _blur(e, t, i, s, r) {
const a = this._pingPongRenderTarget;
this._halfBlur(
e,
@@ -19675,7 +19743,7 @@ class lc {
i,
s,
"latitudinal",
- n
+ r
), this._halfBlur(
a,
e,
@@ -19683,43 +19751,43 @@ class lc {
i,
s,
"longitudinal",
- n
+ r
);
}
- _halfBlur(e, t, i, s, n, a, o) {
+ _halfBlur(e, t, i, s, r, a, o) {
const l = this._renderer, c = this._blurMaterial;
a !== "latitudinal" && a !== "longitudinal" && Ve(
"blur direction must be either latitudinal or longitudinal!"
);
const h = 3, u = this._lodMeshes[s];
u.material = c;
- const d = c.uniforms, m = this._sizeLods[i] - 1, g = isFinite(n) ? Math.PI / (2 * m) : 2 * Math.PI / (2 * fs - 1), v = n / g, f = isFinite(n) ? 1 + Math.floor(h * v) : fs;
- f > fs && Se(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${fs}`);
+ const d = c.uniforms, m = this._sizeLods[i] - 1, g = isFinite(r) ? Math.PI / (2 * m) : 2 * Math.PI / (2 * fs - 1), v = r / g, f = isFinite(r) ? 1 + Math.floor(h * v) : fs;
+ f > fs && Se(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${fs}`);
const p = [];
- let y = 0;
+ let b = 0;
for (let A = 0; A < fs; ++A) {
const I = A / v, S = Math.exp(-I * I / 2);
- p.push(S), A === 0 ? y += S : A < f && (y += 2 * S);
+ p.push(S), A === 0 ? b += S : A < f && (b += 2 * S);
}
for (let A = 0; A < p.length; A++)
- p[A] = p[A] / y;
+ p[A] = p[A] / b;
d.envMap.value = e.texture, d.samples.value = f, d.weights.value = p, d.latitudinal.value = a === "latitudinal", o && (d.poleAxis.value = o);
const { _lodMax: _ } = this;
d.dTheta.value = g, d.mipInt.value = _ - i;
const E = this._sizeLods[s], R = 3 * E * (s > _ - es ? s - _ + es : 0), T = 4 * (this._cubeSize - E);
- Os(t, R, T, 3 * E, 2 * E), l.setRenderTarget(t), l.render(u, gr);
+ Bs(t, R, T, 3 * E, 2 * E), l.setRenderTarget(t), l.render(u, vn);
}
}
-function ug(r) {
+function ug(n) {
const e = [], t = [], i = [];
- let s = r;
- const n = r - es + 1 + ac.length;
- for (let a = 0; a < n; a++) {
+ let s = n;
+ const r = n - es + 1 + ac.length;
+ for (let a = 0; a < r; a++) {
const o = Math.pow(2, s);
e.push(o);
let l = 1 / o;
- a > r - es ? l = ac[a - r + es - 1] : a === 0 && (l = 0), t.push(l);
- const c = 1 / (o - 2), h = -c, u = 1 + c, d = [h, h, u, h, u, u, h, h, u, u, h, u], m = 6, g = 6, v = 3, f = 2, p = 1, y = new Float32Array(v * g * m), _ = new Float32Array(f * g * m), E = new Float32Array(p * g * m);
+ a > n - es ? l = ac[a - n + es - 1] : a === 0 && (l = 0), t.push(l);
+ const c = 1 / (o - 2), h = -c, u = 1 + c, d = [h, h, u, h, u, u, h, h, u, u, h, u], m = 6, g = 6, v = 3, f = 2, p = 1, b = new Float32Array(v * g * m), _ = new Float32Array(f * g * m), E = new Float32Array(p * g * m);
for (let T = 0; T < m; T++) {
const A = T % 3 * 2 / 3 - 1, I = T > 2 ? 0 : -1, S = [
A,
@@ -19741,37 +19809,37 @@ function ug(r) {
I + 1,
0
];
- y.set(S, v * g * T), _.set(d, f * g * T);
+ b.set(S, v * g * T), _.set(d, f * g * T);
const M = [T, T, T, T, T, T];
E.set(M, p * g * T);
}
- const R = new si();
- R.setAttribute("position", new Vt(y, v)), R.setAttribute("uv", new Vt(_, f)), R.setAttribute("faceIndex", new Vt(E, p)), i.push(new at(R, null)), s > es && s--;
+ const R = new ni();
+ R.setAttribute("position", new Gt(b, v)), R.setAttribute("uv", new Gt(_, f)), R.setAttribute("faceIndex", new Gt(E, p)), i.push(new ot(R, null)), s > es && s--;
}
return { lodMeshes: i, sizeLods: e, sigmas: t };
}
-function cc(r, e, t) {
- const i = new bt(r, e, t);
- return i.texture.mapping = In, i.texture.name = "PMREM.cubeUv", i.scissorTest = !0, i;
+function cc(n, e, t) {
+ const i = new yt(n, e, t);
+ return i.texture.mapping = Ir, i.texture.name = "PMREM.cubeUv", i.scissorTest = !0, i;
}
-function Os(r, e, t, i, s) {
- r.viewport.set(e, t, i, s), r.scissor.set(e, t, i, s);
+function Bs(n, e, t, i, s) {
+ n.viewport.set(e, t, i, s), n.scissor.set(e, t, i, s);
}
-function dg(r, e, t) {
+function dg(n, e, t) {
return new ut({
name: "PMREMGGXConvolution",
defines: {
GGX_SAMPLES: cg,
CUBEUV_TEXEL_WIDTH: 1 / e,
CUBEUV_TEXEL_HEIGHT: 1 / t,
- CUBEUV_MAX_MIP: `${r}.0`
+ CUBEUV_MAX_MIP: `${n}.0`
},
uniforms: {
envMap: { value: null },
roughness: { value: 0 },
mipInt: { value: 0 }
},
- vertexShader: Nn(),
+ vertexShader: Nr(),
fragmentShader: (
/* glsl */
`
@@ -19884,12 +19952,12 @@ function dg(r, e, t) {
}
`
),
- blending: yt,
+ blending: bt,
depthTest: !1,
depthWrite: !1
});
}
-function pg(r, e, t) {
+function pg(n, e, t) {
const i = new Float32Array(fs), s = new w(0, 1, 0);
return new ut({
name: "SphericalGaussianBlur",
@@ -19897,7 +19965,7 @@ function pg(r, e, t) {
n: fs,
CUBEUV_TEXEL_WIDTH: 1 / e,
CUBEUV_TEXEL_HEIGHT: 1 / t,
- CUBEUV_MAX_MIP: `${r}.0`
+ CUBEUV_MAX_MIP: `${n}.0`
},
uniforms: {
envMap: { value: null },
@@ -19908,7 +19976,7 @@ function pg(r, e, t) {
mipInt: { value: 0 },
poleAxis: { value: s }
},
- vertexShader: Nn(),
+ vertexShader: Nr(),
fragmentShader: (
/* glsl */
`
@@ -19973,7 +20041,7 @@ function pg(r, e, t) {
}
`
),
- blending: yt,
+ blending: bt,
depthTest: !1,
depthWrite: !1
});
@@ -19984,7 +20052,7 @@ function hc() {
uniforms: {
envMap: { value: null }
},
- vertexShader: Nn(),
+ vertexShader: Nr(),
fragmentShader: (
/* glsl */
`
@@ -20008,7 +20076,7 @@ function hc() {
}
`
),
- blending: yt,
+ blending: bt,
depthTest: !1,
depthWrite: !1
});
@@ -20020,7 +20088,7 @@ function uc() {
envMap: { value: null },
flipEnvMap: { value: -1 }
},
- vertexShader: Nn(),
+ vertexShader: Nr(),
fragmentShader: (
/* glsl */
`
@@ -20041,12 +20109,12 @@ function uc() {
}
`
),
- blending: yt,
+ blending: bt,
depthTest: !1,
depthWrite: !1
});
}
-function Nn() {
+function Nr() {
return (
/* glsl */
`
@@ -20107,21 +20175,21 @@ function Nn() {
`
);
}
-function mg(r) {
+function mg(n) {
let e = /* @__PURE__ */ new WeakMap(), t = null;
function i(o) {
if (o && o.isTexture) {
- const l = o.mapping, c = l === Tn || l === ka, h = l === Xs || l === qs;
+ const l = o.mapping, c = l === Tr || l === Fa, h = l === Xs || l === qs;
if (c || h) {
let u = e.get(o);
const d = u !== void 0 ? u.texture.pmremVersion : 0;
if (o.isRenderTargetTexture && o.pmremVersion !== d)
- return t === null && (t = new lc(r)), u = c ? t.fromEquirectangular(o, u) : t.fromCubemap(o, u), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), u.texture;
+ return t === null && (t = new lc(n)), u = c ? t.fromEquirectangular(o, u) : t.fromCubemap(o, u), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), u.texture;
if (u !== void 0)
return u.texture;
{
const m = o.image;
- return c && m && m.height > 0 || h && m && s(m) ? (t === null && (t = new lc(r)), u = c ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", n), u.texture) : null;
+ return c && m && m.height > 0 || h && m && s(m) ? (t === null && (t = new lc(n)), u = c ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", r), u.texture) : null;
}
}
}
@@ -20134,9 +20202,9 @@ function mg(r) {
o[h] !== void 0 && l++;
return l === c;
}
- function n(o) {
+ function r(o) {
const l = o.target;
- l.removeEventListener("dispose", n);
+ l.removeEventListener("dispose", r);
const c = e.get(l);
c !== void 0 && (e.delete(l), c.dispose());
}
@@ -20148,12 +20216,12 @@ function mg(r) {
dispose: a
};
}
-function fg(r) {
+function fg(n) {
const e = {};
function t(i) {
if (e[i] !== void 0)
return e[i];
- const s = r.getExtension(i);
+ const s = n.getExtension(i);
return e[i] = s, s;
}
return {
@@ -20165,20 +20233,20 @@ function fg(r) {
},
get: function(i) {
const s = t(i);
- return s === null && Lr("WebGLRenderer: " + i + " extension not supported."), s;
+ return s === null && Dn("WebGLRenderer: " + i + " extension not supported."), s;
}
};
}
-function gg(r, e, t, i) {
- const s = {}, n = /* @__PURE__ */ new WeakMap();
+function gg(n, e, t, i) {
+ const s = {}, r = /* @__PURE__ */ new WeakMap();
function a(u) {
const d = u.target;
d.index !== null && e.remove(d.index);
for (const g in d.attributes)
e.remove(d.attributes[g]);
d.removeEventListener("dispose", a), delete s[d.id];
- const m = n.get(d);
- m && (e.remove(m), n.delete(d)), i.releaseStatesOfGeometry(d), d.isInstancedBufferGeometry === !0 && delete d._maxInstanceCount, t.memory.geometries--;
+ const m = r.get(d);
+ m && (e.remove(m), r.delete(d)), i.releaseStatesOfGeometry(d), d.isInstancedBufferGeometry === !0 && delete d._maxInstanceCount, t.memory.geometries--;
}
function o(u, d) {
return s[d.id] === !0 || (d.addEventListener("dispose", a), s[d.id] = !0, t.memory.geometries++), d;
@@ -20186,22 +20254,22 @@ function gg(r, e, t, i) {
function l(u) {
const d = u.attributes;
for (const m in d)
- e.update(d[m], r.ARRAY_BUFFER);
+ e.update(d[m], n.ARRAY_BUFFER);
}
function c(u) {
const d = [], m = u.index, g = u.attributes.position;
let v = 0;
if (m !== null) {
- const y = m.array;
+ const b = m.array;
v = m.version;
- for (let _ = 0, E = y.length; _ < E; _ += 3) {
- const R = y[_ + 0], T = y[_ + 1], A = y[_ + 2];
+ for (let _ = 0, E = b.length; _ < E; _ += 3) {
+ const R = b[_ + 0], T = b[_ + 1], A = b[_ + 2];
d.push(R, T, T, A, A, R);
}
} else if (g !== void 0) {
- const y = g.array;
+ const b = g.array;
v = g.version;
- for (let _ = 0, E = y.length / 3 - 1; _ < E; _ += 3) {
+ for (let _ = 0, E = b.length / 3 - 1; _ < E; _ += 3) {
const R = _ + 0, T = _ + 1, A = _ + 2;
d.push(R, T, T, A, A, R);
}
@@ -20209,17 +20277,17 @@ function gg(r, e, t, i) {
return;
const f = new (hh(d) ? mh : ph)(d, 1);
f.version = v;
- const p = n.get(u);
- p && e.remove(p), n.set(u, f);
+ const p = r.get(u);
+ p && e.remove(p), r.set(u, f);
}
function h(u) {
- const d = n.get(u);
+ const d = r.get(u);
if (d) {
const m = u.index;
m !== null && d.version < m.version && c(u);
} else
c(u);
- return n.get(u);
+ return r.get(u);
}
return {
get: o,
@@ -20227,24 +20295,24 @@ function gg(r, e, t, i) {
getWireframeAttribute: h
};
}
-function vg(r, e, t) {
+function vg(n, e, t) {
let i;
function s(d) {
i = d;
}
- let n, a;
+ let r, a;
function o(d) {
- n = d.type, a = d.bytesPerElement;
+ r = d.type, a = d.bytesPerElement;
}
function l(d, m) {
- r.drawElements(i, m, n, d * a), t.update(m, i, 1);
+ n.drawElements(i, m, r, d * a), t.update(m, i, 1);
}
function c(d, m, g) {
- g !== 0 && (r.drawElementsInstanced(i, m, n, d * a, g), t.update(m, i, g));
+ g !== 0 && (n.drawElementsInstanced(i, m, r, d * a, g), t.update(m, i, g));
}
function h(d, m, g) {
if (g === 0) return;
- e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i, m, 0, n, d, 0, g);
+ e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i, m, 0, r, d, 0, g);
let v = 0;
for (let f = 0; f < g; f++)
v += m[f];
@@ -20257,16 +20325,16 @@ function vg(r, e, t) {
for (let p = 0; p < d.length; p++)
c(d[p] / a, m[p], v[p]);
else {
- f.multiDrawElementsInstancedWEBGL(i, m, 0, n, d, 0, v, 0, g);
+ f.multiDrawElementsInstancedWEBGL(i, m, 0, r, d, 0, v, 0, g);
let p = 0;
- for (let y = 0; y < g; y++)
- p += m[y] * v[y];
+ for (let b = 0; b < g; b++)
+ p += m[b] * v[b];
t.update(p, i, 1);
}
}
this.setMode = s, this.setIndex = o, this.render = l, this.renderInstances = c, this.renderMultiDraw = h, this.renderMultiDrawInstances = u;
}
-function _g(r) {
+function _g(n) {
const e = {
geometries: 0,
textures: 0
@@ -20277,22 +20345,22 @@ function _g(r) {
points: 0,
lines: 0
};
- function i(n, a, o) {
+ function i(r, a, o) {
switch (t.calls++, a) {
- case r.TRIANGLES:
- t.triangles += o * (n / 3);
+ case n.TRIANGLES:
+ t.triangles += o * (r / 3);
break;
- case r.LINES:
- t.lines += o * (n / 2);
+ case n.LINES:
+ t.lines += o * (r / 2);
break;
- case r.LINE_STRIP:
- t.lines += o * (n - 1);
+ case n.LINE_STRIP:
+ t.lines += o * (r - 1);
break;
- case r.LINE_LOOP:
- t.lines += o * n;
+ case n.LINE_LOOP:
+ t.lines += o * r;
break;
- case r.POINTS:
- t.points += o * n;
+ case n.POINTS:
+ t.points += o * r;
break;
default:
Ve("WebGLInfo: Unknown draw mode:", a);
@@ -20311,9 +20379,9 @@ function _g(r) {
update: i
};
}
-function xg(r, e, t) {
- const i = /* @__PURE__ */ new WeakMap(), s = new Je();
- function n(a, o, l) {
+function xg(n, e, t) {
+ const i = /* @__PURE__ */ new WeakMap(), s = new Qe();
+ function r(a, o, l) {
const c = a.morphTargetInfluences, h = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, u = h !== void 0 ? h.length : 0;
let d = i.get(o);
if (d === void 0 || d.count !== u) {
@@ -20321,16 +20389,16 @@ function xg(r, e, t) {
I.dispose(), i.delete(o), o.removeEventListener("dispose", m);
};
d !== void 0 && d.texture.dispose();
- const g = o.morphAttributes.position !== void 0, v = o.morphAttributes.normal !== void 0, f = o.morphAttributes.color !== void 0, p = o.morphAttributes.position || [], y = o.morphAttributes.normal || [], _ = o.morphAttributes.color || [];
+ const g = o.morphAttributes.position !== void 0, v = o.morphAttributes.normal !== void 0, f = o.morphAttributes.color !== void 0, p = o.morphAttributes.position || [], b = o.morphAttributes.normal || [], _ = o.morphAttributes.color || [];
let E = 0;
g === !0 && (E = 1), v === !0 && (E = 2), f === !0 && (E = 3);
let R = o.attributes.position.count * E, T = 1;
R > e.maxTextureSize && (T = Math.ceil(R / e.maxTextureSize), R = e.maxTextureSize);
const A = new Float32Array(R * T * 4 * u), I = new uh(A, R, T, u);
- I.type = Xt, I.needsUpdate = !0;
+ I.type = qt, I.needsUpdate = !0;
const S = E * 4;
for (let M = 0; M < u; M++) {
- const L = p[M], N = y[M], z = _[M], H = R * T * 4 * M;
+ const L = p[M], N = b[M], z = _[M], H = R * T * 4 * M;
for (let j = 0; j < L.count; j++) {
const q = j * S;
g === !0 && (s.fromBufferAttribute(L, j), A[H + q + 0] = s.x, A[H + q + 1] = s.y, A[H + q + 2] = s.z, A[H + q + 3] = 0), v === !0 && (s.fromBufferAttribute(N, j), A[H + q + 4] = s.x, A[H + q + 5] = s.y, A[H + q + 6] = s.z, A[H + q + 7] = 0), f === !0 && (s.fromBufferAttribute(z, j), A[H + q + 8] = s.x, A[H + q + 9] = s.y, A[H + q + 10] = s.z, A[H + q + 11] = z.itemSize === 4 ? s.w : 1);
@@ -20343,25 +20411,25 @@ function xg(r, e, t) {
}, i.set(o, d), o.addEventListener("dispose", m);
}
if (a.isInstancedMesh === !0 && a.morphTexture !== null)
- l.getUniforms().setValue(r, "morphTexture", a.morphTexture, t);
+ l.getUniforms().setValue(n, "morphTexture", a.morphTexture, t);
else {
let m = 0;
for (let v = 0; v < c.length; v++)
m += c[v];
const g = o.morphTargetsRelative ? 1 : 1 - m;
- l.getUniforms().setValue(r, "morphTargetBaseInfluence", g), l.getUniforms().setValue(r, "morphTargetInfluences", c);
+ l.getUniforms().setValue(n, "morphTargetBaseInfluence", g), l.getUniforms().setValue(n, "morphTargetInfluences", c);
}
- l.getUniforms().setValue(r, "morphTargetsTexture", d.texture, t), l.getUniforms().setValue(r, "morphTargetsTextureSize", d.size);
+ l.getUniforms().setValue(n, "morphTargetsTexture", d.texture, t), l.getUniforms().setValue(n, "morphTargetsTextureSize", d.size);
}
return {
- update: n
+ update: r
};
}
-function yg(r, e, t, i) {
+function bg(n, e, t, i) {
let s = /* @__PURE__ */ new WeakMap();
- function n(l) {
+ function r(l) {
const c = i.render.frame, h = l.geometry, u = e.get(l, h);
- if (s.get(u) !== c && (e.update(u), s.set(u, c)), l.isInstancedMesh && (l.hasEventListener("dispose", o) === !1 && l.addEventListener("dispose", o), s.get(l) !== c && (t.update(l.instanceMatrix, r.ARRAY_BUFFER), l.instanceColor !== null && t.update(l.instanceColor, r.ARRAY_BUFFER), s.set(l, c))), l.isSkinnedMesh) {
+ if (s.get(u) !== c && (e.update(u), s.set(u, c)), l.isInstancedMesh && (l.hasEventListener("dispose", o) === !1 && l.addEventListener("dispose", o), s.get(l) !== c && (t.update(l.instanceMatrix, n.ARRAY_BUFFER), l.instanceColor !== null && t.update(l.instanceColor, n.ARRAY_BUFFER), s.set(l, c))), l.isSkinnedMesh) {
const d = l.skeleton;
s.get(d) !== c && (d.update(), s.set(d, c));
}
@@ -20375,187 +20443,187 @@ function yg(r, e, t, i) {
c.removeEventListener("dispose", o), t.remove(c.instanceMatrix), c.instanceColor !== null && t.remove(c.instanceColor);
}
return {
- update: n,
+ update: r,
dispose: a
};
}
const Ph = /* @__PURE__ */ new Pt(), dc = /* @__PURE__ */ new Ko(1, 1), Lh = /* @__PURE__ */ new uh(), Dh = /* @__PURE__ */ new ad(), Ih = /* @__PURE__ */ new Go(), pc = [], mc = [], fc = new Float32Array(16), gc = new Float32Array(9), vc = new Float32Array(4);
-function ar(r, e, t) {
- const i = r[0];
- if (i <= 0 || i > 0) return r;
+function on(n, e, t) {
+ const i = n[0];
+ if (i <= 0 || i > 0) return n;
const s = e * t;
- let n = pc[s];
- if (n === void 0 && (n = new Float32Array(s), pc[s] = n), e !== 0) {
- i.toArray(n, 0);
+ let r = pc[s];
+ if (r === void 0 && (r = new Float32Array(s), pc[s] = r), e !== 0) {
+ i.toArray(r, 0);
for (let a = 1, o = 0; a !== e; ++a)
- o += t, r[a].toArray(n, o);
+ o += t, n[a].toArray(r, o);
}
- return n;
+ return r;
}
-function Et(r, e) {
- if (r.length !== e.length) return !1;
- for (let t = 0, i = r.length; t < i; t++)
- if (r[t] !== e[t]) return !1;
+function Et(n, e) {
+ if (n.length !== e.length) return !1;
+ for (let t = 0, i = n.length; t < i; t++)
+ if (n[t] !== e[t]) return !1;
return !0;
}
-function wt(r, e) {
+function wt(n, e) {
for (let t = 0, i = e.length; t < i; t++)
- r[t] = e[t];
+ n[t] = e[t];
}
-function On(r, e) {
+function Br(n, e) {
let t = mc[e];
t === void 0 && (t = new Int32Array(e), mc[e] = t);
for (let i = 0; i !== e; ++i)
- t[i] = r.allocateTextureUnit();
+ t[i] = n.allocateTextureUnit();
return t;
}
-function bg(r, e) {
+function yg(n, e) {
const t = this.cache;
- t[0] !== e && (r.uniform1f(this.addr, e), t[0] = e);
+ t[0] !== e && (n.uniform1f(this.addr, e), t[0] = e);
}
-function Mg(r, e) {
+function Mg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y) && (r.uniform2f(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
+ (t[0] !== e.x || t[1] !== e.y) && (n.uniform2f(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
else {
if (Et(t, e)) return;
- r.uniform2fv(this.addr, e), wt(t, e);
+ n.uniform2fv(this.addr, e), wt(t, e);
}
}
-function Sg(r, e) {
+function Sg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (r.uniform3f(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (n.uniform3f(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
else if (e.r !== void 0)
- (t[0] !== e.r || t[1] !== e.g || t[2] !== e.b) && (r.uniform3f(this.addr, e.r, e.g, e.b), t[0] = e.r, t[1] = e.g, t[2] = e.b);
+ (t[0] !== e.r || t[1] !== e.g || t[2] !== e.b) && (n.uniform3f(this.addr, e.r, e.g, e.b), t[0] = e.r, t[1] = e.g, t[2] = e.b);
else {
if (Et(t, e)) return;
- r.uniform3fv(this.addr, e), wt(t, e);
+ n.uniform3fv(this.addr, e), wt(t, e);
}
}
-function Tg(r, e) {
+function Tg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (r.uniform4f(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (n.uniform4f(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
else {
if (Et(t, e)) return;
- r.uniform4fv(this.addr, e), wt(t, e);
+ n.uniform4fv(this.addr, e), wt(t, e);
}
}
-function Eg(r, e) {
+function Eg(n, e) {
const t = this.cache, i = e.elements;
if (i === void 0) {
if (Et(t, e)) return;
- r.uniformMatrix2fv(this.addr, !1, e), wt(t, e);
+ n.uniformMatrix2fv(this.addr, !1, e), wt(t, e);
} else {
if (Et(t, i)) return;
- vc.set(i), r.uniformMatrix2fv(this.addr, !1, vc), wt(t, i);
+ vc.set(i), n.uniformMatrix2fv(this.addr, !1, vc), wt(t, i);
}
}
-function wg(r, e) {
+function wg(n, e) {
const t = this.cache, i = e.elements;
if (i === void 0) {
if (Et(t, e)) return;
- r.uniformMatrix3fv(this.addr, !1, e), wt(t, e);
+ n.uniformMatrix3fv(this.addr, !1, e), wt(t, e);
} else {
if (Et(t, i)) return;
- gc.set(i), r.uniformMatrix3fv(this.addr, !1, gc), wt(t, i);
+ gc.set(i), n.uniformMatrix3fv(this.addr, !1, gc), wt(t, i);
}
}
-function Cg(r, e) {
+function Cg(n, e) {
const t = this.cache, i = e.elements;
if (i === void 0) {
if (Et(t, e)) return;
- r.uniformMatrix4fv(this.addr, !1, e), wt(t, e);
+ n.uniformMatrix4fv(this.addr, !1, e), wt(t, e);
} else {
if (Et(t, i)) return;
- fc.set(i), r.uniformMatrix4fv(this.addr, !1, fc), wt(t, i);
+ fc.set(i), n.uniformMatrix4fv(this.addr, !1, fc), wt(t, i);
}
}
-function Ag(r, e) {
+function Ag(n, e) {
const t = this.cache;
- t[0] !== e && (r.uniform1i(this.addr, e), t[0] = e);
+ t[0] !== e && (n.uniform1i(this.addr, e), t[0] = e);
}
-function Rg(r, e) {
+function Rg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y) && (r.uniform2i(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
+ (t[0] !== e.x || t[1] !== e.y) && (n.uniform2i(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
else {
if (Et(t, e)) return;
- r.uniform2iv(this.addr, e), wt(t, e);
+ n.uniform2iv(this.addr, e), wt(t, e);
}
}
-function Pg(r, e) {
+function Pg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (r.uniform3i(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (n.uniform3i(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
else {
if (Et(t, e)) return;
- r.uniform3iv(this.addr, e), wt(t, e);
+ n.uniform3iv(this.addr, e), wt(t, e);
}
}
-function Lg(r, e) {
+function Lg(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (r.uniform4i(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (n.uniform4i(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
else {
if (Et(t, e)) return;
- r.uniform4iv(this.addr, e), wt(t, e);
+ n.uniform4iv(this.addr, e), wt(t, e);
}
}
-function Dg(r, e) {
+function Dg(n, e) {
const t = this.cache;
- t[0] !== e && (r.uniform1ui(this.addr, e), t[0] = e);
+ t[0] !== e && (n.uniform1ui(this.addr, e), t[0] = e);
}
-function Ig(r, e) {
+function Ig(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y) && (r.uniform2ui(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
+ (t[0] !== e.x || t[1] !== e.y) && (n.uniform2ui(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);
else {
if (Et(t, e)) return;
- r.uniform2uiv(this.addr, e), wt(t, e);
+ n.uniform2uiv(this.addr, e), wt(t, e);
}
}
-function Ug(r, e) {
+function Ug(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (r.uniform3ui(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (n.uniform3ui(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);
else {
if (Et(t, e)) return;
- r.uniform3uiv(this.addr, e), wt(t, e);
+ n.uniform3uiv(this.addr, e), wt(t, e);
}
}
-function Ng(r, e) {
+function Ng(n, e) {
const t = this.cache;
if (e.x !== void 0)
- (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (r.uniform4ui(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
+ (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (n.uniform4ui(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);
else {
if (Et(t, e)) return;
- r.uniform4uiv(this.addr, e), wt(t, e);
+ n.uniform4uiv(this.addr, e), wt(t, e);
}
}
-function Og(r, e, t) {
+function Bg(n, e, t) {
const i = this.cache, s = t.allocateTextureUnit();
- i[0] !== s && (r.uniform1i(this.addr, s), i[0] = s);
- let n;
- this.type === r.SAMPLER_2D_SHADOW ? (dc.compareFunction = ch, n = dc) : n = Ph, t.setTexture2D(e || n, s);
+ i[0] !== s && (n.uniform1i(this.addr, s), i[0] = s);
+ let r;
+ this.type === n.SAMPLER_2D_SHADOW ? (dc.compareFunction = ch, r = dc) : r = Ph, t.setTexture2D(e || r, s);
}
-function Bg(r, e, t) {
+function Og(n, e, t) {
const i = this.cache, s = t.allocateTextureUnit();
- i[0] !== s && (r.uniform1i(this.addr, s), i[0] = s), t.setTexture3D(e || Dh, s);
+ i[0] !== s && (n.uniform1i(this.addr, s), i[0] = s), t.setTexture3D(e || Dh, s);
}
-function Fg(r, e, t) {
+function kg(n, e, t) {
const i = this.cache, s = t.allocateTextureUnit();
- i[0] !== s && (r.uniform1i(this.addr, s), i[0] = s), t.setTextureCube(e || Ih, s);
+ i[0] !== s && (n.uniform1i(this.addr, s), i[0] = s), t.setTextureCube(e || Ih, s);
}
-function kg(r, e, t) {
+function Fg(n, e, t) {
const i = this.cache, s = t.allocateTextureUnit();
- i[0] !== s && (r.uniform1i(this.addr, s), i[0] = s), t.setTexture2DArray(e || Lh, s);
+ i[0] !== s && (n.uniform1i(this.addr, s), i[0] = s), t.setTexture2DArray(e || Lh, s);
}
-function zg(r) {
- switch (r) {
+function zg(n) {
+ switch (n) {
case 5126:
- return bg;
+ return yg;
// FLOAT
case 35664:
return Mg;
@@ -20612,13 +20680,13 @@ function zg(r) {
case 36306:
// UNSIGNED_INT_SAMPLER_2D
case 35682:
- return Og;
+ return Bg;
case 35679:
// SAMPLER_3D
case 36299:
// INT_SAMPLER_3D
case 36307:
- return Bg;
+ return Og;
case 35680:
// SAMPLER_CUBE
case 36300:
@@ -20626,7 +20694,7 @@ function zg(r) {
case 36308:
// UNSIGNED_INT_SAMPLER_CUBE
case 36293:
- return Fg;
+ return kg;
case 36289:
// SAMPLER_2D_ARRAY
case 36303:
@@ -20634,86 +20702,86 @@ function zg(r) {
case 36311:
// UNSIGNED_INT_SAMPLER_2D_ARRAY
case 36292:
- return kg;
+ return Fg;
}
}
-function Hg(r, e) {
- r.uniform1fv(this.addr, e);
+function Hg(n, e) {
+ n.uniform1fv(this.addr, e);
}
-function Vg(r, e) {
- const t = ar(e, this.size, 2);
- r.uniform2fv(this.addr, t);
+function Vg(n, e) {
+ const t = on(e, this.size, 2);
+ n.uniform2fv(this.addr, t);
}
-function Gg(r, e) {
- const t = ar(e, this.size, 3);
- r.uniform3fv(this.addr, t);
+function Gg(n, e) {
+ const t = on(e, this.size, 3);
+ n.uniform3fv(this.addr, t);
}
-function Wg(r, e) {
- const t = ar(e, this.size, 4);
- r.uniform4fv(this.addr, t);
+function Wg(n, e) {
+ const t = on(e, this.size, 4);
+ n.uniform4fv(this.addr, t);
}
-function jg(r, e) {
- const t = ar(e, this.size, 4);
- r.uniformMatrix2fv(this.addr, !1, t);
+function jg(n, e) {
+ const t = on(e, this.size, 4);
+ n.uniformMatrix2fv(this.addr, !1, t);
}
-function Xg(r, e) {
- const t = ar(e, this.size, 9);
- r.uniformMatrix3fv(this.addr, !1, t);
+function Xg(n, e) {
+ const t = on(e, this.size, 9);
+ n.uniformMatrix3fv(this.addr, !1, t);
}
-function qg(r, e) {
- const t = ar(e, this.size, 16);
- r.uniformMatrix4fv(this.addr, !1, t);
+function qg(n, e) {
+ const t = on(e, this.size, 16);
+ n.uniformMatrix4fv(this.addr, !1, t);
}
-function Yg(r, e) {
- r.uniform1iv(this.addr, e);
+function Yg(n, e) {
+ n.uniform1iv(this.addr, e);
}
-function Kg(r, e) {
- r.uniform2iv(this.addr, e);
+function Kg(n, e) {
+ n.uniform2iv(this.addr, e);
}
-function Zg(r, e) {
- r.uniform3iv(this.addr, e);
+function Zg(n, e) {
+ n.uniform3iv(this.addr, e);
}
-function $g(r, e) {
- r.uniform4iv(this.addr, e);
+function $g(n, e) {
+ n.uniform4iv(this.addr, e);
}
-function Jg(r, e) {
- r.uniform1uiv(this.addr, e);
+function Jg(n, e) {
+ n.uniform1uiv(this.addr, e);
}
-function Qg(r, e) {
- r.uniform2uiv(this.addr, e);
+function Qg(n, e) {
+ n.uniform2uiv(this.addr, e);
}
-function e0(r, e) {
- r.uniform3uiv(this.addr, e);
+function e0(n, e) {
+ n.uniform3uiv(this.addr, e);
}
-function t0(r, e) {
- r.uniform4uiv(this.addr, e);
+function t0(n, e) {
+ n.uniform4uiv(this.addr, e);
}
-function i0(r, e, t) {
- const i = this.cache, s = e.length, n = On(t, s);
- Et(i, n) || (r.uniform1iv(this.addr, n), wt(i, n));
+function i0(n, e, t) {
+ const i = this.cache, s = e.length, r = Br(t, s);
+ Et(i, r) || (n.uniform1iv(this.addr, r), wt(i, r));
for (let a = 0; a !== s; ++a)
- t.setTexture2D(e[a] || Ph, n[a]);
+ t.setTexture2D(e[a] || Ph, r[a]);
}
-function s0(r, e, t) {
- const i = this.cache, s = e.length, n = On(t, s);
- Et(i, n) || (r.uniform1iv(this.addr, n), wt(i, n));
+function s0(n, e, t) {
+ const i = this.cache, s = e.length, r = Br(t, s);
+ Et(i, r) || (n.uniform1iv(this.addr, r), wt(i, r));
for (let a = 0; a !== s; ++a)
- t.setTexture3D(e[a] || Dh, n[a]);
+ t.setTexture3D(e[a] || Dh, r[a]);
}
-function r0(r, e, t) {
- const i = this.cache, s = e.length, n = On(t, s);
- Et(i, n) || (r.uniform1iv(this.addr, n), wt(i, n));
+function n0(n, e, t) {
+ const i = this.cache, s = e.length, r = Br(t, s);
+ Et(i, r) || (n.uniform1iv(this.addr, r), wt(i, r));
for (let a = 0; a !== s; ++a)
- t.setTextureCube(e[a] || Ih, n[a]);
+ t.setTextureCube(e[a] || Ih, r[a]);
}
-function n0(r, e, t) {
- const i = this.cache, s = e.length, n = On(t, s);
- Et(i, n) || (r.uniform1iv(this.addr, n), wt(i, n));
+function r0(n, e, t) {
+ const i = this.cache, s = e.length, r = Br(t, s);
+ Et(i, r) || (n.uniform1iv(this.addr, r), wt(i, r));
for (let a = 0; a !== s; ++a)
- t.setTexture2DArray(e[a] || Lh, n[a]);
+ t.setTexture2DArray(e[a] || Lh, r[a]);
}
-function a0(r) {
- switch (r) {
+function a0(n) {
+ switch (n) {
case 5126:
return Hg;
// FLOAT
@@ -20786,7 +20854,7 @@ function a0(r) {
case 36308:
// UNSIGNED_INT_SAMPLER_CUBE
case 36293:
- return r0;
+ return n0;
case 36289:
// SAMPLER_2D_ARRAY
case 36303:
@@ -20794,7 +20862,7 @@ function a0(r) {
case 36311:
// UNSIGNED_INT_SAMPLER_2D_ARRAY
case 36292:
- return n0;
+ return r0;
}
}
class o0 {
@@ -20813,24 +20881,24 @@ class c0 {
}
setValue(e, t, i) {
const s = this.seq;
- for (let n = 0, a = s.length; n !== a; ++n) {
- const o = s[n];
+ for (let r = 0, a = s.length; r !== a; ++r) {
+ const o = s[r];
o.setValue(e, t[o.id], i);
}
}
}
-const ya = /(\w+)(\])?(\[|\.)?/g;
-function _c(r, e) {
- r.seq.push(e), r.map[e.id] = e;
+const ba = /(\w+)(\])?(\[|\.)?/g;
+function _c(n, e) {
+ n.seq.push(e), n.map[e.id] = e;
}
-function h0(r, e, t) {
- const i = r.name, s = i.length;
- for (ya.lastIndex = 0; ; ) {
- const n = ya.exec(i), a = ya.lastIndex;
- let o = n[1];
- const l = n[2] === "]", c = n[3];
+function h0(n, e, t) {
+ const i = n.name, s = i.length;
+ for (ba.lastIndex = 0; ; ) {
+ const r = ba.exec(i), a = ba.lastIndex;
+ let o = r[1];
+ const l = r[2] === "]", c = r[3];
if (l && (o = o | 0), c === void 0 || c === "[" && a + 2 === s) {
- _c(t, c === void 0 ? new o0(o, r, e) : new l0(o, r, e));
+ _c(t, c === void 0 ? new o0(o, n, e) : new l0(o, n, e));
break;
} else {
let h = t.map[o];
@@ -20838,91 +20906,91 @@ function h0(r, e, t) {
}
}
}
-class Mn {
+class Mr {
constructor(e, t) {
this.seq = [], this.map = {};
const i = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
for (let s = 0; s < i; ++s) {
- const n = e.getActiveUniform(t, s), a = e.getUniformLocation(t, n.name);
- h0(n, a, this);
+ const r = e.getActiveUniform(t, s), a = e.getUniformLocation(t, r.name);
+ h0(r, a, this);
}
}
setValue(e, t, i, s) {
- const n = this.map[t];
- n !== void 0 && n.setValue(e, i, s);
+ const r = this.map[t];
+ r !== void 0 && r.setValue(e, i, s);
}
setOptional(e, t, i) {
const s = t[i];
s !== void 0 && this.setValue(e, i, s);
}
static upload(e, t, i, s) {
- for (let n = 0, a = t.length; n !== a; ++n) {
- const o = t[n], l = i[o.id];
+ for (let r = 0, a = t.length; r !== a; ++r) {
+ const o = t[r], l = i[o.id];
l.needsUpdate !== !1 && o.setValue(e, l.value, s);
}
}
static seqWithValue(e, t) {
const i = [];
- for (let s = 0, n = e.length; s !== n; ++s) {
+ for (let s = 0, r = e.length; s !== r; ++s) {
const a = e[s];
a.id in t && i.push(a);
}
return i;
}
}
-function xc(r, e, t) {
- const i = r.createShader(e);
- return r.shaderSource(i, t), r.compileShader(i), i;
+function xc(n, e, t) {
+ const i = n.createShader(e);
+ return n.shaderSource(i, t), n.compileShader(i), i;
}
const u0 = 37297;
let d0 = 0;
-function p0(r, e) {
- const t = r.split(`
-`), i = [], s = Math.max(e - 6, 0), n = Math.min(e + 6, t.length);
- for (let a = s; a < n; a++) {
+function p0(n, e) {
+ const t = n.split(`
+`), i = [], s = Math.max(e - 6, 0), r = Math.min(e + 6, t.length);
+ for (let a = s; a < r; a++) {
const o = a + 1;
i.push(`${o === e ? ">" : " "} ${o}: ${t[a]}`);
}
return i.join(`
`);
}
-const yc = /* @__PURE__ */ new Fe();
-function m0(r) {
- qe._getMatrix(yc, qe.workingColorSpace, r);
- const e = `mat3( ${yc.elements.map((t) => t.toFixed(4))} )`;
- switch (qe.getTransfer(r)) {
- case wn:
+const bc = /* @__PURE__ */ new ke();
+function m0(n) {
+ qe._getMatrix(bc, qe.workingColorSpace, n);
+ const e = `mat3( ${bc.elements.map((t) => t.toFixed(4))} )`;
+ switch (qe.getTransfer(n)) {
+ case wr:
return [e, "LinearTransferOETF"];
- case tt:
+ case it:
return [e, "sRGBTransferOETF"];
default:
- return Se("WebGLProgram: Unsupported color space: ", r), [e, "LinearTransferOETF"];
+ return Se("WebGLProgram: Unsupported color space: ", n), [e, "LinearTransferOETF"];
}
}
-function bc(r, e, t) {
- const i = r.getShaderParameter(e, r.COMPILE_STATUS), s = (r.getShaderInfoLog(e) || "").trim();
+function yc(n, e, t) {
+ const i = n.getShaderParameter(e, n.COMPILE_STATUS), s = (n.getShaderInfoLog(e) || "").trim();
if (i && s === "") return "";
- const n = /ERROR: 0:(\d+)/.exec(s);
- if (n) {
- const a = parseInt(n[1]);
+ const r = /ERROR: 0:(\d+)/.exec(s);
+ if (r) {
+ const a = parseInt(r[1]);
return t.toUpperCase() + `
` + s + `
-` + p0(r.getShaderSource(e), a);
+` + p0(n.getShaderSource(e), a);
} else
return s;
}
-function f0(r, e) {
+function f0(n, e) {
const t = m0(e);
return [
- `vec4 ${r}( vec4 value ) {`,
+ `vec4 ${n}( vec4 value ) {`,
` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,
"}"
].join(`
`);
}
-function g0(r, e) {
+function g0(n, e) {
let t;
switch (e) {
case qc:
@@ -20949,141 +21017,141 @@ function g0(r, e) {
default:
Se("WebGLProgram: Unsupported toneMapping:", e), t = "Linear";
}
- return "vec3 " + r + "( vec3 color ) { return " + t + "ToneMapping( color ); }";
+ return "vec3 " + n + "( vec3 color ) { return " + t + "ToneMapping( color ); }";
}
-const un = /* @__PURE__ */ new w();
+const ur = /* @__PURE__ */ new w();
function v0() {
- qe.getLuminanceCoefficients(un);
- const r = un.x.toFixed(4), e = un.y.toFixed(4), t = un.z.toFixed(4);
+ qe.getLuminanceCoefficients(ur);
+ const n = ur.x.toFixed(4), e = ur.y.toFixed(4), t = ur.z.toFixed(4);
return [
"float luminance( const in vec3 rgb ) {",
- ` const vec3 weights = vec3( ${r}, ${e}, ${t} );`,
+ ` const vec3 weights = vec3( ${n}, ${e}, ${t} );`,
" return dot( weights, rgb );",
"}"
].join(`
`);
}
-function _0(r) {
+function _0(n) {
return [
- r.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "",
- r.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""
- ].filter(yr).join(`
+ n.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "",
+ n.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""
+ ].filter(yn).join(`
`);
}
-function x0(r) {
+function x0(n) {
const e = [];
- for (const t in r) {
- const i = r[t];
+ for (const t in n) {
+ const i = n[t];
i !== !1 && e.push("#define " + t + " " + i);
}
return e.join(`
`);
}
-function y0(r, e) {
- const t = {}, i = r.getProgramParameter(e, r.ACTIVE_ATTRIBUTES);
+function b0(n, e) {
+ const t = {}, i = n.getProgramParameter(e, n.ACTIVE_ATTRIBUTES);
for (let s = 0; s < i; s++) {
- const n = r.getActiveAttrib(e, s), a = n.name;
+ const r = n.getActiveAttrib(e, s), a = r.name;
let o = 1;
- n.type === r.FLOAT_MAT2 && (o = 2), n.type === r.FLOAT_MAT3 && (o = 3), n.type === r.FLOAT_MAT4 && (o = 4), t[a] = {
- type: n.type,
- location: r.getAttribLocation(e, a),
+ r.type === n.FLOAT_MAT2 && (o = 2), r.type === n.FLOAT_MAT3 && (o = 3), r.type === n.FLOAT_MAT4 && (o = 4), t[a] = {
+ type: r.type,
+ location: n.getAttribLocation(e, a),
locationSize: o
};
}
return t;
}
-function yr(r) {
- return r !== "";
+function yn(n) {
+ return n !== "";
}
-function Mc(r, e) {
+function Mc(n, e) {
const t = e.numSpotLightShadows + e.numSpotLightMaps - e.numSpotLightShadowsWithMaps;
- return r.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, t).replace(/NUM_RECT_AREA_LIGHTS/g, e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, e.numPointLights).replace(/NUM_HEMI_LIGHTS/g, e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows);
+ return n.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, t).replace(/NUM_RECT_AREA_LIGHTS/g, e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, e.numPointLights).replace(/NUM_HEMI_LIGHTS/g, e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows);
}
-function Sc(r, e) {
- return r.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection);
+function Sc(n, e) {
+ return n.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection);
}
-const b0 = /^[ \t]*#include +<([\w\d./]+)>/gm;
-function bo(r) {
- return r.replace(b0, S0);
+const y0 = /^[ \t]*#include +<([\w\d./]+)>/gm;
+function yo(n) {
+ return n.replace(y0, S0);
}
const M0 = /* @__PURE__ */ new Map();
-function S0(r, e) {
- let t = ke[e];
+function S0(n, e) {
+ let t = Fe[e];
if (t === void 0) {
const i = M0.get(e);
if (i !== void 0)
- t = ke[i], Se('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', e, i);
+ t = Fe[i], Se('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', e, i);
else
throw new Error("Can not resolve #include <" + e + ">");
}
- return bo(t);
+ return yo(t);
}
const T0 = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
-function Tc(r) {
- return r.replace(T0, E0);
+function Tc(n) {
+ return n.replace(T0, E0);
}
-function E0(r, e, t, i) {
+function E0(n, e, t, i) {
let s = "";
- for (let n = parseInt(e); n < parseInt(t); n++)
- s += i.replace(/\[\s*i\s*\]/g, "[ " + n + " ]").replace(/UNROLLED_LOOP_INDEX/g, n);
+ for (let r = parseInt(e); r < parseInt(t); r++)
+ s += i.replace(/\[\s*i\s*\]/g, "[ " + r + " ]").replace(/UNROLLED_LOOP_INDEX/g, r);
return s;
}
-function Ec(r) {
- let e = `precision ${r.precision} float;
- precision ${r.precision} int;
- precision ${r.precision} sampler2D;
- precision ${r.precision} samplerCube;
- precision ${r.precision} sampler3D;
- precision ${r.precision} sampler2DArray;
- precision ${r.precision} sampler2DShadow;
- precision ${r.precision} samplerCubeShadow;
- precision ${r.precision} sampler2DArrayShadow;
- precision ${r.precision} isampler2D;
- precision ${r.precision} isampler3D;
- precision ${r.precision} isamplerCube;
- precision ${r.precision} isampler2DArray;
- precision ${r.precision} usampler2D;
- precision ${r.precision} usampler3D;
- precision ${r.precision} usamplerCube;
- precision ${r.precision} usampler2DArray;
+function Ec(n) {
+ let e = `precision ${n.precision} float;
+ precision ${n.precision} int;
+ precision ${n.precision} sampler2D;
+ precision ${n.precision} samplerCube;
+ precision ${n.precision} sampler3D;
+ precision ${n.precision} sampler2DArray;
+ precision ${n.precision} sampler2DShadow;
+ precision ${n.precision} samplerCubeShadow;
+ precision ${n.precision} sampler2DArrayShadow;
+ precision ${n.precision} isampler2D;
+ precision ${n.precision} isampler3D;
+ precision ${n.precision} isamplerCube;
+ precision ${n.precision} isampler2DArray;
+ precision ${n.precision} usampler2D;
+ precision ${n.precision} usampler3D;
+ precision ${n.precision} usamplerCube;
+ precision ${n.precision} usampler2DArray;
`;
- return r.precision === "highp" ? e += `
-#define HIGH_PRECISION` : r.precision === "mediump" ? e += `
-#define MEDIUM_PRECISION` : r.precision === "lowp" && (e += `
+ return n.precision === "highp" ? e += `
+#define HIGH_PRECISION` : n.precision === "mediump" ? e += `
+#define MEDIUM_PRECISION` : n.precision === "lowp" && (e += `
#define LOW_PRECISION`), e;
}
-function w0(r) {
+function w0(n) {
let e = "SHADOWMAP_TYPE_BASIC";
- return r.shadowMapType === Wc ? e = "SHADOWMAP_TYPE_PCF" : r.shadowMapType === jc ? e = "SHADOWMAP_TYPE_PCF_SOFT" : r.shadowMapType === Hi && (e = "SHADOWMAP_TYPE_VSM"), e;
+ return n.shadowMapType === Wc ? e = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === jc ? e = "SHADOWMAP_TYPE_PCF_SOFT" : n.shadowMapType === Hi && (e = "SHADOWMAP_TYPE_VSM"), e;
}
-function C0(r) {
+function C0(n) {
let e = "ENVMAP_TYPE_CUBE";
- if (r.envMap)
- switch (r.envMapMode) {
+ if (n.envMap)
+ switch (n.envMapMode) {
case Xs:
case qs:
e = "ENVMAP_TYPE_CUBE";
break;
- case In:
+ case Ir:
e = "ENVMAP_TYPE_CUBE_UV";
break;
}
return e;
}
-function A0(r) {
+function A0(n) {
let e = "ENVMAP_MODE_REFLECTION";
- if (r.envMap)
- switch (r.envMapMode) {
+ if (n.envMap)
+ switch (n.envMapMode) {
case qs:
e = "ENVMAP_MODE_REFRACTION";
break;
}
return e;
}
-function R0(r) {
+function R0(n) {
let e = "ENVMAP_BLENDING_NONE";
- if (r.envMap)
- switch (r.combine) {
+ if (n.envMap)
+ switch (n.combine) {
case Ro:
e = "ENVMAP_BLENDING_MULTIPLY";
break;
@@ -21096,29 +21164,29 @@ function R0(r) {
}
return e;
}
-function P0(r) {
- const e = r.envMapCubeUVHeight;
+function P0(n) {
+ const e = n.envMapCubeUVHeight;
if (e === null) return null;
const t = Math.log2(e) - 2, i = 1 / e;
return { texelWidth: 1 / (3 * Math.max(Math.pow(2, t), 112)), texelHeight: i, maxMip: t };
}
-function L0(r, e, t, i) {
- const s = r.getContext(), n = t.defines;
+function L0(n, e, t, i) {
+ const s = n.getContext(), r = t.defines;
let a = t.vertexShader, o = t.fragmentShader;
- const l = w0(t), c = C0(t), h = A0(t), u = R0(t), d = P0(t), m = _0(t), g = x0(n), v = s.createProgram();
- let f, p, y = t.glslVersion ? "#version " + t.glslVersion + `
+ const l = w0(t), c = C0(t), h = A0(t), u = R0(t), d = P0(t), m = _0(t), g = x0(r), v = s.createProgram();
+ let f, p, b = t.glslVersion ? "#version " + t.glslVersion + `
` : "";
t.isRawShaderMaterial ? (f = [
"#define SHADER_TYPE " + t.shaderType,
"#define SHADER_NAME " + t.shaderName,
g
- ].filter(yr).join(`
+ ].filter(yn).join(`
`), f.length > 0 && (f += `
`), p = [
"#define SHADER_TYPE " + t.shaderType,
"#define SHADER_NAME " + t.shaderName,
g
- ].filter(yr).join(`
+ ].filter(yn).join(`
`), p.length > 0 && (p += `
`)) : (f = [
Ec(t),
@@ -21252,7 +21320,7 @@ function L0(r, e, t, i) {
"#endif",
`
`
- ].filter(yr).join(`
+ ].filter(yn).join(`
`), p = [
Ec(t),
"#define SHADER_TYPE " + t.shaderType,
@@ -21324,20 +21392,20 @@ function L0(r, e, t, i) {
"uniform vec3 cameraPosition;",
"uniform bool isOrthographic;",
t.toneMapping !== is ? "#define TONE_MAPPING" : "",
- t.toneMapping !== is ? ke.tonemapping_pars_fragment : "",
+ t.toneMapping !== is ? Fe.tonemapping_pars_fragment : "",
// this code is required here because it is used by the toneMapping() function defined below
t.toneMapping !== is ? g0("toneMapping", t.toneMapping) : "",
t.dithering ? "#define DITHERING" : "",
t.opaque ? "#define OPAQUE" : "",
- ke.colorspace_pars_fragment,
+ Fe.colorspace_pars_fragment,
// this code is required here because it is used by the various encoding/decoding function defined below
f0("linearToOutputTexel", t.outputColorSpace),
v0(),
t.useDepthPacking ? "#define DEPTH_PACKING " + t.depthPacking : "",
`
`
- ].filter(yr).join(`
-`)), a = bo(a), a = Mc(a, t), a = Sc(a, t), o = bo(o), o = Mc(o, t), o = Sc(o, t), a = Tc(a), o = Tc(o), t.isRawShaderMaterial !== !0 && (y = `#version 300 es
+ ].filter(yn).join(`
+`)), a = yo(a), a = Mc(a, t), a = Sc(a, t), o = yo(o), o = Mc(o, t), o = Sc(o, t), a = Tc(a), o = Tc(o), t.isRawShaderMaterial !== !0 && (b = `#version 300 es
`, f = [
m,
"#define attribute in",
@@ -21362,17 +21430,17 @@ function L0(r, e, t, i) {
].join(`
`) + `
` + p);
- const _ = y + f + a, E = y + p + o, R = xc(s, s.VERTEX_SHADER, _), T = xc(s, s.FRAGMENT_SHADER, E);
+ const _ = b + f + a, E = b + p + o, R = xc(s, s.VERTEX_SHADER, _), T = xc(s, s.FRAGMENT_SHADER, E);
s.attachShader(v, R), s.attachShader(v, T), t.index0AttributeName !== void 0 ? s.bindAttribLocation(v, 0, t.index0AttributeName) : t.morphTargets === !0 && s.bindAttribLocation(v, 0, "position"), s.linkProgram(v);
function A(L) {
- if (r.debug.checkShaderErrors) {
+ if (n.debug.checkShaderErrors) {
const N = s.getProgramInfoLog(v) || "", z = s.getShaderInfoLog(R) || "", H = s.getShaderInfoLog(T) || "", j = N.trim(), q = z.trim(), te = H.trim();
let G = !0, Z = !0;
if (s.getProgramParameter(v, s.LINK_STATUS) === !1)
- if (G = !1, typeof r.debug.onShaderError == "function")
- r.debug.onShaderError(s, v, R, T);
+ if (G = !1, typeof n.debug.onShaderError == "function")
+ n.debug.onShaderError(s, v, R, T);
else {
- const re = bc(s, R, "vertex"), Le = bc(s, T, "fragment");
+ const ne = yc(s, R, "vertex"), Le = yc(s, T, "fragment");
Ve(
"THREE.WebGLProgram: Shader Error " + s.getError() + " - VALIDATE_STATUS " + s.getProgramParameter(v, s.VALIDATE_STATUS) + `
@@ -21380,7 +21448,7 @@ Material Name: ` + L.name + `
Material Type: ` + L.type + `
Program Info Log: ` + j + `
-` + re + `
+` + ne + `
` + Le
);
}
@@ -21398,7 +21466,7 @@ Program Info Log: ` + j + `
}
});
}
- s.deleteShader(R), s.deleteShader(T), I = new Mn(s, v), S = y0(s, v);
+ s.deleteShader(R), s.deleteShader(T), I = new Mr(s, v), S = b0(s, v);
}
let I;
this.getUniforms = function() {
@@ -21421,8 +21489,8 @@ class I0 {
this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();
}
update(e) {
- const t = e.vertexShader, i = e.fragmentShader, s = this._getShaderStage(t), n = this._getShaderStage(i), a = this._getShaderCacheForMaterial(e);
- return a.has(s) === !1 && (a.add(s), s.usedTimes++), a.has(n) === !1 && (a.add(n), n.usedTimes++), this;
+ const t = e.vertexShader, i = e.fragmentShader, s = this._getShaderStage(t), r = this._getShaderStage(i), a = this._getShaderCacheForMaterial(e);
+ return a.has(s) === !1 && (a.add(s), s.usedTimes++), a.has(r) === !1 && (a.add(r), r.usedTimes++), this;
}
remove(e) {
const t = this.materialCache.get(e);
@@ -21455,7 +21523,7 @@ class U0 {
this.id = D0++, this.code = e, this.usedTimes = 0;
}
}
-function N0(r, e, t, i, s, n, a) {
+function N0(n, e, t, i, s, r, a) {
const o = new Vo(), l = new I0(), c = /* @__PURE__ */ new Set(), h = [], u = s.logarithmicDepthBuffer, d = s.vertexTextures;
let m = s.precision;
const g = {
@@ -21479,28 +21547,28 @@ function N0(r, e, t, i, s, n, a) {
return c.add(S), S === 0 ? "uv" : `uv${S}`;
}
function f(S, M, L, N, z) {
- const H = N.fog, j = z.geometry, q = S.isMeshStandardMaterial ? N.environment : null, te = (S.isMeshStandardMaterial ? t : e).get(S.envMap || q), G = te && te.mapping === In ? te.image.height : null, Z = g[S.type];
+ const H = N.fog, j = z.geometry, q = S.isMeshStandardMaterial ? N.environment : null, te = (S.isMeshStandardMaterial ? t : e).get(S.envMap || q), G = te && te.mapping === Ir ? te.image.height : null, Z = g[S.type];
S.precision !== null && (m = s.getMaxPrecision(S.precision), m !== S.precision && Se("WebGLProgram.getParameters:", S.precision, "not supported, using", m, "instead."));
- const re = j.morphAttributes.position || j.morphAttributes.normal || j.morphAttributes.color, Le = re !== void 0 ? re.length : 0;
+ const ne = j.morphAttributes.position || j.morphAttributes.normal || j.morphAttributes.color, Le = ne !== void 0 ? ne.length : 0;
let He = 0;
j.morphAttributes.position !== void 0 && (He = 1), j.morphAttributes.normal !== void 0 && (He = 2), j.morphAttributes.color !== void 0 && (He = 3);
- let Ye, Ze, $e, W;
+ let Ye, $e, Je, W;
if (Z) {
const rt = Ei[Z];
- Ye = rt.vertexShader, Ze = rt.fragmentShader;
+ Ye = rt.vertexShader, $e = rt.fragmentShader;
} else
- Ye = S.vertexShader, Ze = S.fragmentShader, l.update(S), $e = l.getVertexShaderID(S), W = l.getFragmentShaderID(S);
- const Y = r.getRenderTarget(), ue = r.state.buffers.depth.getReversed(), Ae = z.isInstancedMesh === !0, Te = z.isBatchedMesh === !0, we = !!S.map, Qe = !!S.matcap, Xe = !!te, Ge = !!S.aoMap, D = !!S.lightMap, _t = !!S.bumpMap, je = !!S.normalMap, et = !!S.displacementMap, fe = !!S.emissiveMap, ot = !!S.metalnessMap, Me = !!S.roughnessMap, De = S.anisotropy > 0, C = S.clearcoat > 0, x = S.dispersion > 0, B = S.iridescence > 0, X = S.sheen > 0, K = S.transmission > 0, V = De && !!S.anisotropyMap, ye = C && !!S.clearcoatMap, ne = C && !!S.clearcoatNormalMap, Ee = C && !!S.clearcoatRoughnessMap, de = B && !!S.iridescenceMap, J = B && !!S.iridescenceThicknessMap, se = X && !!S.sheenColorMap, Be = X && !!S.sheenRoughnessMap, Ce = !!S.specularMap, he = !!S.specularColorMap, Re = !!S.specularIntensityMap, P = K && !!S.transmissionMap, ae = K && !!S.thicknessMap, ie = !!S.gradientMap, le = !!S.alphaMap, Q = S.alphaTest > 0, $ = !!S.alphaHash, _e = !!S.extensions;
+ Ye = S.vertexShader, $e = S.fragmentShader, l.update(S), Je = l.getVertexShaderID(S), W = l.getFragmentShaderID(S);
+ const Y = n.getRenderTarget(), de = n.state.buffers.depth.getReversed(), Ae = z.isInstancedMesh === !0, Te = z.isBatchedMesh === !0, we = !!S.map, et = !!S.matcap, Xe = !!te, Ge = !!S.aoMap, D = !!S.lightMap, _t = !!S.bumpMap, je = !!S.normalMap, tt = !!S.displacementMap, fe = !!S.emissiveMap, lt = !!S.metalnessMap, Me = !!S.roughnessMap, De = S.anisotropy > 0, C = S.clearcoat > 0, x = S.dispersion > 0, O = S.iridescence > 0, X = S.sheen > 0, K = S.transmission > 0, V = De && !!S.anisotropyMap, be = C && !!S.clearcoatMap, re = C && !!S.clearcoatNormalMap, Ee = C && !!S.clearcoatRoughnessMap, pe = O && !!S.iridescenceMap, J = O && !!S.iridescenceThicknessMap, se = X && !!S.sheenColorMap, Oe = X && !!S.sheenRoughnessMap, Ce = !!S.specularMap, ue = !!S.specularColorMap, Re = !!S.specularIntensityMap, P = K && !!S.transmissionMap, ae = K && !!S.thicknessMap, ie = !!S.gradientMap, ce = !!S.alphaMap, Q = S.alphaTest > 0, $ = !!S.alphaHash, _e = !!S.extensions;
let Pe = is;
- S.toneMapped && (Y === null || Y.isXRRenderTarget === !0) && (Pe = r.toneMapping);
+ S.toneMapped && (Y === null || Y.isXRRenderTarget === !0) && (Pe = n.toneMapping);
const Ct = {
shaderID: Z,
shaderType: S.type,
shaderName: S.name,
vertexShader: Ye,
- fragmentShader: Ze,
+ fragmentShader: $e,
defines: S.defines,
- customVertexShaderID: $e,
+ customVertexShaderID: Je,
customFragmentShaderID: W,
isRawShaderMaterial: S.isRawShaderMaterial === !0,
glslVersion: S.glslVersion,
@@ -21511,10 +21579,10 @@ function N0(r, e, t, i, s, n, a) {
instancingColor: Ae && z.instanceColor !== null,
instancingMorph: Ae && z.morphTexture !== null,
supportsVertexTextures: d,
- outputColorSpace: Y === null ? r.outputColorSpace : Y.isXRRenderTarget === !0 ? Y.texture.colorSpace : Bt,
+ outputColorSpace: Y === null ? n.outputColorSpace : Y.isXRRenderTarget === !0 ? Y.texture.colorSpace : kt,
alphaToCoverage: !!S.alphaToCoverage,
map: we,
- matcap: Qe,
+ matcap: et,
envMap: Xe,
envMapMode: Xe && te.mapping,
envMapCubeUVHeight: G,
@@ -21522,34 +21590,34 @@ function N0(r, e, t, i, s, n, a) {
lightMap: D,
bumpMap: _t,
normalMap: je,
- displacementMap: d && et,
+ displacementMap: d && tt,
emissiveMap: fe,
normalMapObjectSpace: je && S.normalMapType === Au,
- normalMapTangentSpace: je && S.normalMapType === Un,
- metalnessMap: ot,
+ normalMapTangentSpace: je && S.normalMapType === Ur,
+ metalnessMap: lt,
roughnessMap: Me,
anisotropy: De,
anisotropyMap: V,
clearcoat: C,
- clearcoatMap: ye,
- clearcoatNormalMap: ne,
+ clearcoatMap: be,
+ clearcoatNormalMap: re,
clearcoatRoughnessMap: Ee,
dispersion: x,
- iridescence: B,
- iridescenceMap: de,
+ iridescence: O,
+ iridescenceMap: pe,
iridescenceThicknessMap: J,
sheen: X,
sheenColorMap: se,
- sheenRoughnessMap: Be,
+ sheenRoughnessMap: Oe,
specularMap: Ce,
- specularColorMap: he,
+ specularColorMap: ue,
specularIntensityMap: Re,
transmission: K,
transmissionMap: P,
thicknessMap: ae,
gradientMap: ie,
opaque: S.transparent === !1 && S.blending === zs && S.alphaToCoverage === !1,
- alphaMap: le,
+ alphaMap: ce,
alphaTest: Q,
alphaHash: $,
combine: S.combine,
@@ -21559,36 +21627,36 @@ function N0(r, e, t, i, s, n, a) {
lightMapUv: D && v(S.lightMap.channel),
bumpMapUv: _t && v(S.bumpMap.channel),
normalMapUv: je && v(S.normalMap.channel),
- displacementMapUv: et && v(S.displacementMap.channel),
+ displacementMapUv: tt && v(S.displacementMap.channel),
emissiveMapUv: fe && v(S.emissiveMap.channel),
- metalnessMapUv: ot && v(S.metalnessMap.channel),
+ metalnessMapUv: lt && v(S.metalnessMap.channel),
roughnessMapUv: Me && v(S.roughnessMap.channel),
anisotropyMapUv: V && v(S.anisotropyMap.channel),
- clearcoatMapUv: ye && v(S.clearcoatMap.channel),
- clearcoatNormalMapUv: ne && v(S.clearcoatNormalMap.channel),
+ clearcoatMapUv: be && v(S.clearcoatMap.channel),
+ clearcoatNormalMapUv: re && v(S.clearcoatNormalMap.channel),
clearcoatRoughnessMapUv: Ee && v(S.clearcoatRoughnessMap.channel),
- iridescenceMapUv: de && v(S.iridescenceMap.channel),
+ iridescenceMapUv: pe && v(S.iridescenceMap.channel),
iridescenceThicknessMapUv: J && v(S.iridescenceThicknessMap.channel),
sheenColorMapUv: se && v(S.sheenColorMap.channel),
- sheenRoughnessMapUv: Be && v(S.sheenRoughnessMap.channel),
+ sheenRoughnessMapUv: Oe && v(S.sheenRoughnessMap.channel),
specularMapUv: Ce && v(S.specularMap.channel),
- specularColorMapUv: he && v(S.specularColorMap.channel),
+ specularColorMapUv: ue && v(S.specularColorMap.channel),
specularIntensityMapUv: Re && v(S.specularIntensityMap.channel),
transmissionMapUv: P && v(S.transmissionMap.channel),
thicknessMapUv: ae && v(S.thicknessMap.channel),
- alphaMapUv: le && v(S.alphaMap.channel),
+ alphaMapUv: ce && v(S.alphaMap.channel),
//
vertexTangents: !!j.attributes.tangent && (je || De),
vertexColors: S.vertexColors,
vertexAlphas: S.vertexColors === !0 && !!j.attributes.color && j.attributes.color.itemSize === 4,
- pointsUvs: z.isPoints === !0 && !!j.attributes.uv && (we || le),
+ pointsUvs: z.isPoints === !0 && !!j.attributes.uv && (we || ce),
fog: !!H,
useFog: S.fog === !0,
fogExp2: !!H && H.isFogExp2,
flatShading: S.flatShading === !0 && S.wireframe === !1,
sizeAttenuation: S.sizeAttenuation === !0,
logarithmicDepthBuffer: u,
- reversedDepthBuffer: ue,
+ reversedDepthBuffer: de,
skinning: z.isSkinnedMesh === !0,
morphTargets: j.morphAttributes.position !== void 0,
morphNormals: j.morphAttributes.normal !== void 0,
@@ -21609,14 +21677,14 @@ function N0(r, e, t, i, s, n, a) {
numClippingPlanes: a.numPlanes,
numClipIntersection: a.numIntersection,
dithering: S.dithering,
- shadowMapEnabled: r.shadowMap.enabled && L.length > 0,
- shadowMapType: r.shadowMap.type,
+ shadowMapEnabled: n.shadowMap.enabled && L.length > 0,
+ shadowMapType: n.shadowMap.type,
toneMapping: Pe,
- decodeVideoTexture: we && S.map.isVideoTexture === !0 && qe.getTransfer(S.map.colorSpace) === tt,
- decodeVideoTextureEmissive: fe && S.emissiveMap.isVideoTexture === !0 && qe.getTransfer(S.emissiveMap.colorSpace) === tt,
+ decodeVideoTexture: we && S.map.isVideoTexture === !0 && qe.getTransfer(S.map.colorSpace) === it,
+ decodeVideoTextureEmissive: fe && S.emissiveMap.isVideoTexture === !0 && qe.getTransfer(S.emissiveMap.colorSpace) === it,
premultipliedAlpha: S.premultipliedAlpha,
- doubleSided: S.side === jt,
- flipSided: S.side === Ht,
+ doubleSided: S.side === Xt,
+ flipSided: S.side === Vt,
useDepthPacking: S.depthPacking >= 0,
depthPacking: S.depthPacking || 0,
index0AttributeName: S.index0AttributeName,
@@ -21632,9 +21700,9 @@ function N0(r, e, t, i, s, n, a) {
if (S.shaderID ? M.push(S.shaderID) : (M.push(S.customVertexShaderID), M.push(S.customFragmentShaderID)), S.defines !== void 0)
for (const L in S.defines)
M.push(L), M.push(S.defines[L]);
- return S.isRawShaderMaterial === !1 && (y(M, S), _(M, S), M.push(r.outputColorSpace)), M.push(S.customProgramCacheKey), M.join();
+ return S.isRawShaderMaterial === !1 && (b(M, S), _(M, S), M.push(n.outputColorSpace)), M.push(S.customProgramCacheKey), M.join();
}
- function y(S, M) {
+ function b(S, M) {
S.push(M.precision), S.push(M.outputColorSpace), S.push(M.envMapMode), S.push(M.envMapCubeUVHeight), S.push(M.mapUv), S.push(M.alphaMapUv), S.push(M.lightMapUv), S.push(M.aoMapUv), S.push(M.bumpMapUv), S.push(M.normalMapUv), S.push(M.displacementMapUv), S.push(M.emissiveMapUv), S.push(M.metalnessMapUv), S.push(M.roughnessMapUv), S.push(M.anisotropyMapUv), S.push(M.clearcoatMapUv), S.push(M.clearcoatNormalMapUv), S.push(M.clearcoatRoughnessMapUv), S.push(M.iridescenceMapUv), S.push(M.iridescenceThicknessMapUv), S.push(M.sheenColorMapUv), S.push(M.sheenRoughnessMapUv), S.push(M.specularMapUv), S.push(M.specularColorMapUv), S.push(M.specularIntensityMapUv), S.push(M.transmissionMapUv), S.push(M.thicknessMapUv), S.push(M.combine), S.push(M.fogExp2), S.push(M.sizeAttenuation), S.push(M.morphTargetsCount), S.push(M.morphAttributeCount), S.push(M.numDirLights), S.push(M.numPointLights), S.push(M.numSpotLights), S.push(M.numSpotLightMaps), S.push(M.numHemiLights), S.push(M.numRectAreaLights), S.push(M.numDirLightShadows), S.push(M.numPointLightShadows), S.push(M.numSpotLightShadows), S.push(M.numSpotLightShadowsWithMaps), S.push(M.numLightProbes), S.push(M.shadowMapType), S.push(M.toneMapping), S.push(M.numClippingPlanes), S.push(M.numClipIntersection), S.push(M.depthPacking);
}
function _(S, M) {
@@ -21645,7 +21713,7 @@ function N0(r, e, t, i, s, n, a) {
let L;
if (M) {
const N = Ei[M];
- L = mi.clone(N.uniforms);
+ L = fi.clone(N.uniforms);
} else
L = S.uniforms;
return L;
@@ -21659,7 +21727,7 @@ function N0(r, e, t, i, s, n, a) {
break;
}
}
- return L === void 0 && (L = new L0(r, M, S, n), h.push(L)), L;
+ return L === void 0 && (L = new L0(n, M, S, r), h.push(L)), L;
}
function T(S) {
if (--S.usedTimes === 0) {
@@ -21685,47 +21753,47 @@ function N0(r, e, t, i, s, n, a) {
dispose: I
};
}
-function O0() {
- let r = /* @__PURE__ */ new WeakMap();
+function B0() {
+ let n = /* @__PURE__ */ new WeakMap();
function e(a) {
- return r.has(a);
+ return n.has(a);
}
function t(a) {
- let o = r.get(a);
- return o === void 0 && (o = {}, r.set(a, o)), o;
+ let o = n.get(a);
+ return o === void 0 && (o = {}, n.set(a, o)), o;
}
function i(a) {
- r.delete(a);
+ n.delete(a);
}
function s(a, o, l) {
- r.get(a)[o] = l;
+ n.get(a)[o] = l;
}
- function n() {
- r = /* @__PURE__ */ new WeakMap();
+ function r() {
+ n = /* @__PURE__ */ new WeakMap();
}
return {
has: e,
get: t,
remove: i,
update: s,
- dispose: n
+ dispose: r
};
}
-function B0(r, e) {
- return r.groupOrder !== e.groupOrder ? r.groupOrder - e.groupOrder : r.renderOrder !== e.renderOrder ? r.renderOrder - e.renderOrder : r.material.id !== e.material.id ? r.material.id - e.material.id : r.z !== e.z ? r.z - e.z : r.id - e.id;
+function O0(n, e) {
+ return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.material.id !== e.material.id ? n.material.id - e.material.id : n.z !== e.z ? n.z - e.z : n.id - e.id;
}
-function wc(r, e) {
- return r.groupOrder !== e.groupOrder ? r.groupOrder - e.groupOrder : r.renderOrder !== e.renderOrder ? r.renderOrder - e.renderOrder : r.z !== e.z ? e.z - r.z : r.id - e.id;
+function wc(n, e) {
+ return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.z !== e.z ? e.z - n.z : n.id - e.id;
}
function Cc() {
- const r = [];
+ const n = [];
let e = 0;
const t = [], i = [], s = [];
- function n() {
+ function r() {
e = 0, t.length = 0, i.length = 0, s.length = 0;
}
function a(u, d, m, g, v, f) {
- let p = r[e];
+ let p = n[e];
return p === void 0 ? (p = {
id: u.id,
object: u,
@@ -21735,7 +21803,7 @@ function Cc() {
renderOrder: u.renderOrder,
z: v,
group: f
- }, r[e] = p) : (p.id = u.id, p.object = u, p.geometry = d, p.material = m, p.groupOrder = g, p.renderOrder = u.renderOrder, p.z = v, p.group = f), e++, p;
+ }, n[e] = p) : (p.id = u.id, p.object = u, p.geometry = d, p.material = m, p.groupOrder = g, p.renderOrder = u.renderOrder, p.z = v, p.group = f), e++, p;
}
function o(u, d, m, g, v, f) {
const p = a(u, d, m, g, v, f);
@@ -21746,11 +21814,11 @@ function Cc() {
m.transmission > 0 ? i.unshift(p) : m.transparent === !0 ? s.unshift(p) : t.unshift(p);
}
function c(u, d) {
- t.length > 1 && t.sort(u || B0), i.length > 1 && i.sort(d || wc), s.length > 1 && s.sort(d || wc);
+ t.length > 1 && t.sort(u || O0), i.length > 1 && i.sort(d || wc), s.length > 1 && s.sort(d || wc);
}
function h() {
- for (let u = e, d = r.length; u < d; u++) {
- const m = r[u];
+ for (let u = e, d = n.length; u < d; u++) {
+ const m = n[u];
if (m.id === null) break;
m.id = null, m.object = null, m.geometry = null, m.material = null, m.group = null;
}
@@ -21759,34 +21827,34 @@ function Cc() {
opaque: t,
transmissive: i,
transparent: s,
- init: n,
+ init: r,
push: o,
unshift: l,
finish: h,
sort: c
};
}
-function F0() {
- let r = /* @__PURE__ */ new WeakMap();
+function k0() {
+ let n = /* @__PURE__ */ new WeakMap();
function e(i, s) {
- const n = r.get(i);
+ const r = n.get(i);
let a;
- return n === void 0 ? (a = new Cc(), r.set(i, [a])) : s >= n.length ? (a = new Cc(), n.push(a)) : a = n[s], a;
+ return r === void 0 ? (a = new Cc(), n.set(i, [a])) : s >= r.length ? (a = new Cc(), r.push(a)) : a = r[s], a;
}
function t() {
- r = /* @__PURE__ */ new WeakMap();
+ n = /* @__PURE__ */ new WeakMap();
}
return {
get: e,
dispose: t
};
}
-function k0() {
- const r = {};
+function F0() {
+ const n = {};
return {
get: function(e) {
- if (r[e.id] !== void 0)
- return r[e.id];
+ if (n[e.id] !== void 0)
+ return n[e.id];
let t;
switch (e.type) {
case "DirectionalLight":
@@ -21830,16 +21898,16 @@ function k0() {
};
break;
}
- return r[e.id] = t, t;
+ return n[e.id] = t, t;
}
};
}
function z0() {
- const r = {};
+ const n = {};
return {
get: function(e) {
- if (r[e.id] !== void 0)
- return r[e.id];
+ if (n[e.id] !== void 0)
+ return n[e.id];
let t;
switch (e.type) {
case "DirectionalLight":
@@ -21872,16 +21940,16 @@ function z0() {
};
break;
}
- return r[e.id] = t, t;
+ return n[e.id] = t, t;
}
};
}
let H0 = 0;
-function V0(r, e) {
- return (e.castShadow ? 2 : 0) - (r.castShadow ? 2 : 0) + (e.map ? 1 : 0) - (r.map ? 1 : 0);
+function V0(n, e) {
+ return (e.castShadow ? 2 : 0) - (n.castShadow ? 2 : 0) + (e.map ? 1 : 0) - (n.map ? 1 : 0);
}
-function G0(r) {
- const e = new k0(), t = z0(), i = {
+function G0(n) {
+ const e = new F0(), t = z0(), i = {
version: 0,
hash: {
directionalLength: -1,
@@ -21918,11 +21986,11 @@ function G0(r) {
numLightProbes: 0
};
for (let c = 0; c < 9; c++) i.probe.push(new w());
- const s = new w(), n = new Ne(), a = new Ne();
+ const s = new w(), r = new Ne(), a = new Ne();
function o(c) {
let h = 0, u = 0, d = 0;
for (let S = 0; S < 9; S++) i.probe[S].set(0, 0, 0);
- let m = 0, g = 0, v = 0, f = 0, p = 0, y = 0, _ = 0, E = 0, R = 0, T = 0, A = 0;
+ let m = 0, g = 0, v = 0, f = 0, p = 0, b = 0, _ = 0, E = 0, R = 0, T = 0, A = 0;
c.sort(V0);
for (let S = 0, M = c.length; S < M; S++) {
const L = c[S], N = L.color, z = L.intensity, H = L.distance, j = L.shadow && L.shadow.map ? L.shadow.map.texture : null;
@@ -21936,7 +22004,7 @@ function G0(r) {
const q = e.get(L);
if (q.color.copy(L.color).multiplyScalar(L.intensity), L.castShadow) {
const te = L.shadow, G = t.get(L);
- G.shadowIntensity = te.intensity, G.shadowBias = te.bias, G.shadowNormalBias = te.normalBias, G.shadowRadius = te.radius, G.shadowMapSize = te.mapSize, i.directionalShadow[m] = G, i.directionalShadowMap[m] = j, i.directionalShadowMatrix[m] = L.shadow.matrix, y++;
+ G.shadowIntensity = te.intensity, G.shadowBias = te.bias, G.shadowNormalBias = te.normalBias, G.shadowRadius = te.radius, G.shadowMapSize = te.mapSize, i.directionalShadow[m] = G, i.directionalShadowMap[m] = j, i.directionalShadowMatrix[m] = L.shadow.matrix, b++;
}
i.directional[m] = q, m++;
} else if (L.isSpotLight) {
@@ -21963,14 +22031,14 @@ function G0(r) {
q.skyColor.copy(L.color).multiplyScalar(z), q.groundColor.copy(L.groundColor).multiplyScalar(z), i.hemi[p] = q, p++;
}
}
- f > 0 && (r.has("OES_texture_float_linear") === !0 ? (i.rectAreaLTC1 = ce.LTC_FLOAT_1, i.rectAreaLTC2 = ce.LTC_FLOAT_2) : (i.rectAreaLTC1 = ce.LTC_HALF_1, i.rectAreaLTC2 = ce.LTC_HALF_2)), i.ambient[0] = h, i.ambient[1] = u, i.ambient[2] = d;
+ f > 0 && (n.has("OES_texture_float_linear") === !0 ? (i.rectAreaLTC1 = he.LTC_FLOAT_1, i.rectAreaLTC2 = he.LTC_FLOAT_2) : (i.rectAreaLTC1 = he.LTC_HALF_1, i.rectAreaLTC2 = he.LTC_HALF_2)), i.ambient[0] = h, i.ambient[1] = u, i.ambient[2] = d;
const I = i.hash;
- (I.directionalLength !== m || I.pointLength !== g || I.spotLength !== v || I.rectAreaLength !== f || I.hemiLength !== p || I.numDirectionalShadows !== y || I.numPointShadows !== _ || I.numSpotShadows !== E || I.numSpotMaps !== R || I.numLightProbes !== A) && (i.directional.length = m, i.spot.length = v, i.rectArea.length = f, i.point.length = g, i.hemi.length = p, i.directionalShadow.length = y, i.directionalShadowMap.length = y, i.pointShadow.length = _, i.pointShadowMap.length = _, i.spotShadow.length = E, i.spotShadowMap.length = E, i.directionalShadowMatrix.length = y, i.pointShadowMatrix.length = _, i.spotLightMatrix.length = E + R - T, i.spotLightMap.length = R, i.numSpotLightShadowsWithMaps = T, i.numLightProbes = A, I.directionalLength = m, I.pointLength = g, I.spotLength = v, I.rectAreaLength = f, I.hemiLength = p, I.numDirectionalShadows = y, I.numPointShadows = _, I.numSpotShadows = E, I.numSpotMaps = R, I.numLightProbes = A, i.version = H0++);
+ (I.directionalLength !== m || I.pointLength !== g || I.spotLength !== v || I.rectAreaLength !== f || I.hemiLength !== p || I.numDirectionalShadows !== b || I.numPointShadows !== _ || I.numSpotShadows !== E || I.numSpotMaps !== R || I.numLightProbes !== A) && (i.directional.length = m, i.spot.length = v, i.rectArea.length = f, i.point.length = g, i.hemi.length = p, i.directionalShadow.length = b, i.directionalShadowMap.length = b, i.pointShadow.length = _, i.pointShadowMap.length = _, i.spotShadow.length = E, i.spotShadowMap.length = E, i.directionalShadowMatrix.length = b, i.pointShadowMatrix.length = _, i.spotLightMatrix.length = E + R - T, i.spotLightMap.length = R, i.numSpotLightShadowsWithMaps = T, i.numLightProbes = A, I.directionalLength = m, I.pointLength = g, I.spotLength = v, I.rectAreaLength = f, I.hemiLength = p, I.numDirectionalShadows = b, I.numPointShadows = _, I.numSpotShadows = E, I.numSpotMaps = R, I.numLightProbes = A, i.version = H0++);
}
function l(c, h) {
let u = 0, d = 0, m = 0, g = 0, v = 0;
const f = h.matrixWorldInverse;
- for (let p = 0, y = c.length; p < y; p++) {
+ for (let p = 0, b = c.length; p < b; p++) {
const _ = c[p];
if (_.isDirectionalLight) {
const E = i.directional[u];
@@ -21980,7 +22048,7 @@ function G0(r) {
E.position.setFromMatrixPosition(_.matrixWorld), E.position.applyMatrix4(f), E.direction.setFromMatrixPosition(_.matrixWorld), s.setFromMatrixPosition(_.target.matrixWorld), E.direction.sub(s), E.direction.transformDirection(f), m++;
} else if (_.isRectAreaLight) {
const E = i.rectArea[g];
- E.position.setFromMatrixPosition(_.matrixWorld), E.position.applyMatrix4(f), a.identity(), n.copy(_.matrixWorld), n.premultiply(f), a.extractRotation(n), E.halfWidth.set(_.width * 0.5, 0, 0), E.halfHeight.set(0, _.height * 0.5, 0), E.halfWidth.applyMatrix4(a), E.halfHeight.applyMatrix4(a), g++;
+ E.position.setFromMatrixPosition(_.matrixWorld), E.position.applyMatrix4(f), a.identity(), r.copy(_.matrixWorld), r.premultiply(f), a.extractRotation(r), E.halfWidth.set(_.width * 0.5, 0, 0), E.halfHeight.set(0, _.height * 0.5, 0), E.halfWidth.applyMatrix4(a), E.halfHeight.applyMatrix4(a), g++;
} else if (_.isPointLight) {
const E = i.point[d];
E.position.setFromMatrixPosition(_.matrixWorld), E.position.applyMatrix4(f), d++;
@@ -21996,12 +22064,12 @@ function G0(r) {
state: i
};
}
-function Ac(r) {
- const e = new G0(r), t = [], i = [];
+function Ac(n) {
+ const e = new G0(n), t = [], i = [];
function s(h) {
c.camera = h, t.length = 0, i.length = 0;
}
- function n(h) {
+ function r(h) {
t.push(h);
}
function a(h) {
@@ -22025,16 +22093,16 @@ function Ac(r) {
state: c,
setupLights: o,
setupLightsView: l,
- pushLight: n,
+ pushLight: r,
pushShadow: a
};
}
-function W0(r) {
+function W0(n) {
let e = /* @__PURE__ */ new WeakMap();
- function t(s, n = 0) {
+ function t(s, r = 0) {
const a = e.get(s);
let o;
- return a === void 0 ? (o = new Ac(r), e.set(s, [o])) : n >= a.length ? (o = new Ac(r), a.push(o)) : o = a[n], o;
+ return a === void 0 ? (o = new Ac(n), e.set(s, [o])) : r >= a.length ? (o = new Ac(n), a.push(o)) : o = a[r], o;
}
function i() {
e = /* @__PURE__ */ new WeakMap();
@@ -22073,9 +22141,9 @@ void main() {
float std_dev = sqrt( squared_mean - mean * mean );
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;
-function q0(r, e, t) {
+function q0(n, e, t) {
let i = new qo();
- const s = new oe(), n = new oe(), a = new Je(), o = new bh({ depthPacking: lh }), l = new Vd(), c = {}, h = t.maxTextureSize, u = { [Ai]: Ht, [Ht]: Ai, [jt]: jt }, d = new ut({
+ const s = new oe(), r = new oe(), a = new Qe(), o = new yh({ depthPacking: lh }), l = new Vd(), c = {}, h = t.maxTextureSize, u = { [Ai]: Vt, [Vt]: Ai, [Xt]: Xt }, d = new ut({
defines: {
VSM_SAMPLES: 8
},
@@ -22088,21 +22156,21 @@ function q0(r, e, t) {
fragmentShader: X0
}), m = d.clone();
m.defines.HORIZONTAL_PASS = 1;
- const g = new si();
+ const g = new ni();
g.setAttribute(
"position",
- new Vt(
+ new Gt(
new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]),
3
)
);
- const v = new at(g, d), f = this;
+ const v = new ot(g, d), f = this;
this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Wc;
let p = this.type;
this.render = function(T, A, I) {
if (f.enabled === !1 || f.autoUpdate === !1 && f.needsUpdate === !1 || T.length === 0) return;
- const S = r.getRenderTarget(), M = r.getActiveCubeFace(), L = r.getActiveMipmapLevel(), N = r.state;
- N.setBlending(yt), N.buffers.depth.getReversed() === !0 ? N.buffers.color.setClear(0, 0, 0, 0) : N.buffers.color.setClear(1, 1, 1, 1), N.buffers.depth.setTest(!0), N.setScissorTest(!1);
+ const S = n.getRenderTarget(), M = n.getActiveCubeFace(), L = n.getActiveMipmapLevel(), N = n.state;
+ N.setBlending(bt), N.buffers.depth.getReversed() === !0 ? N.buffers.color.setClear(0, 0, 0, 0) : N.buffers.color.setClear(1, 1, 1, 1), N.buffers.depth.setTest(!0), N.setScissorTest(!1);
const z = p !== Hi && this.type === Hi, H = p === Hi && this.type !== Hi;
for (let j = 0, q = T.length; j < q; j++) {
const te = T[j], G = te.shadow;
@@ -22113,35 +22181,35 @@ function q0(r, e, t) {
if (G.autoUpdate === !1 && G.needsUpdate === !1) continue;
s.copy(G.mapSize);
const Z = G.getFrameExtents();
- if (s.multiply(Z), n.copy(G.mapSize), (s.x > h || s.y > h) && (s.x > h && (n.x = Math.floor(h / Z.x), s.x = n.x * Z.x, G.mapSize.x = n.x), s.y > h && (n.y = Math.floor(h / Z.y), s.y = n.y * Z.y, G.mapSize.y = n.y)), G.map === null || z === !0 || H === !0) {
- const Le = this.type !== Hi ? { minFilter: Ut, magFilter: Ut } : {};
- G.map !== null && G.map.dispose(), G.map = new bt(s.x, s.y, Le), G.map.texture.name = te.name + ".shadowMap", G.camera.updateProjectionMatrix();
+ if (s.multiply(Z), r.copy(G.mapSize), (s.x > h || s.y > h) && (s.x > h && (r.x = Math.floor(h / Z.x), s.x = r.x * Z.x, G.mapSize.x = r.x), s.y > h && (r.y = Math.floor(h / Z.y), s.y = r.y * Z.y, G.mapSize.y = r.y)), G.map === null || z === !0 || H === !0) {
+ const Le = this.type !== Hi ? { minFilter: Nt, magFilter: Nt } : {};
+ G.map !== null && G.map.dispose(), G.map = new yt(s.x, s.y, Le), G.map.texture.name = te.name + ".shadowMap", G.camera.updateProjectionMatrix();
}
- r.setRenderTarget(G.map), r.clear();
- const re = G.getViewportCount();
- for (let Le = 0; Le < re; Le++) {
+ n.setRenderTarget(G.map), n.clear();
+ const ne = G.getViewportCount();
+ for (let Le = 0; Le < ne; Le++) {
const He = G.getViewport(Le);
a.set(
- n.x * He.x,
- n.y * He.y,
- n.x * He.z,
- n.y * He.w
+ r.x * He.x,
+ r.y * He.y,
+ r.x * He.z,
+ r.y * He.w
), N.viewport(a), G.updateMatrices(te, Le), i = G.getFrustum(), E(A, I, G.camera, te, this.type);
}
- G.isPointLightShadow !== !0 && this.type === Hi && y(G, I), G.needsUpdate = !1;
+ G.isPointLightShadow !== !0 && this.type === Hi && b(G, I), G.needsUpdate = !1;
}
- p = this.type, f.needsUpdate = !1, r.setRenderTarget(S, M, L);
+ p = this.type, f.needsUpdate = !1, n.setRenderTarget(S, M, L);
};
- function y(T, A) {
+ function b(T, A) {
const I = e.update(v);
- d.defines.VSM_SAMPLES !== T.blurSamples && (d.defines.VSM_SAMPLES = T.blurSamples, m.defines.VSM_SAMPLES = T.blurSamples, d.needsUpdate = !0, m.needsUpdate = !0), T.mapPass === null && (T.mapPass = new bt(s.x, s.y)), d.uniforms.shadow_pass.value = T.map.texture, d.uniforms.resolution.value = T.mapSize, d.uniforms.radius.value = T.radius, r.setRenderTarget(T.mapPass), r.clear(), r.renderBufferDirect(A, null, I, d, v, null), m.uniforms.shadow_pass.value = T.mapPass.texture, m.uniforms.resolution.value = T.mapSize, m.uniforms.radius.value = T.radius, r.setRenderTarget(T.map), r.clear(), r.renderBufferDirect(A, null, I, m, v, null);
+ d.defines.VSM_SAMPLES !== T.blurSamples && (d.defines.VSM_SAMPLES = T.blurSamples, m.defines.VSM_SAMPLES = T.blurSamples, d.needsUpdate = !0, m.needsUpdate = !0), T.mapPass === null && (T.mapPass = new yt(s.x, s.y)), d.uniforms.shadow_pass.value = T.map.texture, d.uniforms.resolution.value = T.mapSize, d.uniforms.radius.value = T.radius, n.setRenderTarget(T.mapPass), n.clear(), n.renderBufferDirect(A, null, I, d, v, null), m.uniforms.shadow_pass.value = T.mapPass.texture, m.uniforms.resolution.value = T.mapSize, m.uniforms.radius.value = T.radius, n.setRenderTarget(T.map), n.clear(), n.renderBufferDirect(A, null, I, m, v, null);
}
function _(T, A, I, S) {
let M = null;
const L = I.isPointLight === !0 ? T.customDistanceMaterial : T.customDepthMaterial;
if (L !== void 0)
M = L;
- else if (M = I.isPointLight === !0 ? l : o, r.localClippingEnabled && A.clipShadows === !0 && Array.isArray(A.clippingPlanes) && A.clippingPlanes.length !== 0 || A.displacementMap && A.displacementScale !== 0 || A.alphaMap && A.alphaTest > 0 || A.map && A.alphaTest > 0 || A.alphaToCoverage === !0) {
+ else if (M = I.isPointLight === !0 ? l : o, n.localClippingEnabled && A.clipShadows === !0 && Array.isArray(A.clippingPlanes) && A.clippingPlanes.length !== 0 || A.displacementMap && A.displacementScale !== 0 || A.alphaMap && A.alphaTest > 0 || A.map && A.alphaTest > 0 || A.alphaToCoverage === !0) {
const N = M.uuid, z = A.uuid;
let H = c[N];
H === void 0 && (H = {}, c[N] = H);
@@ -22149,7 +22217,7 @@ function q0(r, e, t) {
j === void 0 && (j = M.clone(), H[z] = j, A.addEventListener("dispose", R)), M = j;
}
if (M.visible = A.visible, M.wireframe = A.wireframe, S === Hi ? M.side = A.shadowSide !== null ? A.shadowSide : A.side : M.side = A.shadowSide !== null ? A.shadowSide : u[A.side], M.alphaMap = A.alphaMap, M.alphaTest = A.alphaToCoverage === !0 ? 0.5 : A.alphaTest, M.map = A.map, M.clipShadows = A.clipShadows, M.clippingPlanes = A.clippingPlanes, M.clipIntersection = A.clipIntersection, M.displacementMap = A.displacementMap, M.displacementScale = A.displacementScale, M.displacementBias = A.displacementBias, M.wireframeLinewidth = A.wireframeLinewidth, M.linewidth = A.linewidth, I.isPointLight === !0 && M.isMeshDistanceMaterial === !0) {
- const N = r.properties.get(M);
+ const N = n.properties.get(M);
N.light = I;
}
return M;
@@ -22165,12 +22233,12 @@ function q0(r, e, t) {
const te = H[j], G = z[te.materialIndex];
if (G && G.visible) {
const Z = _(T, G, S, M);
- T.onBeforeShadow(r, T, A, I, N, Z, te), r.renderBufferDirect(I, null, N, Z, T, te), T.onAfterShadow(r, T, A, I, N, Z, te);
+ T.onBeforeShadow(n, T, A, I, N, Z, te), n.renderBufferDirect(I, null, N, Z, T, te), T.onAfterShadow(n, T, A, I, N, Z, te);
}
}
} else if (z.visible) {
const H = _(T, z, S, M);
- T.onBeforeShadow(r, T, A, I, N, H, null), r.renderBufferDirect(I, null, N, H, T, null), T.onAfterShadow(r, T, A, I, N, H, null);
+ T.onBeforeShadow(n, T, A, I, N, H, null), n.renderBufferDirect(I, null, N, H, T, null), T.onAfterShadow(n, T, A, I, N, H, null);
}
}
const L = T.children;
@@ -22187,37 +22255,37 @@ function q0(r, e, t) {
}
const Y0 = {
[Da]: Ia,
- [Ua]: Ba,
- [Na]: Fa,
- [js]: Oa,
+ [Ua]: Oa,
+ [Na]: ka,
+ [js]: Ba,
[Ia]: Da,
- [Ba]: Ua,
- [Fa]: Na,
- [Oa]: js
+ [Oa]: Ua,
+ [ka]: Na,
+ [Ba]: js
};
-function K0(r, e) {
+function K0(n, e) {
function t() {
let P = !1;
- const ae = new Je();
+ const ae = new Qe();
let ie = null;
- const le = new Je(0, 0, 0, 0);
+ const ce = new Qe(0, 0, 0, 0);
return {
setMask: function(Q) {
- ie !== Q && !P && (r.colorMask(Q, Q, Q, Q), ie = Q);
+ ie !== Q && !P && (n.colorMask(Q, Q, Q, Q), ie = Q);
},
setLocked: function(Q) {
P = Q;
},
setClear: function(Q, $, _e, Pe, Ct) {
- Ct === !0 && (Q *= Pe, $ *= Pe, _e *= Pe), ae.set(Q, $, _e, Pe), le.equals(ae) === !1 && (r.clearColor(Q, $, _e, Pe), le.copy(ae));
+ Ct === !0 && (Q *= Pe, $ *= Pe, _e *= Pe), ae.set(Q, $, _e, Pe), ce.equals(ae) === !1 && (n.clearColor(Q, $, _e, Pe), ce.copy(ae));
},
reset: function() {
- P = !1, ie = null, le.set(-1, 0, 0, 0);
+ P = !1, ie = null, ce.set(-1, 0, 0, 0);
}
};
}
function i() {
- let P = !1, ae = !1, ie = null, le = null, Q = null;
+ let P = !1, ae = !1, ie = null, ce = null, Q = null;
return {
setReversed: function($) {
if (ae !== $) {
@@ -22231,167 +22299,167 @@ function K0(r, e) {
return ae;
},
setTest: function($) {
- $ ? Y(r.DEPTH_TEST) : ue(r.DEPTH_TEST);
+ $ ? Y(n.DEPTH_TEST) : de(n.DEPTH_TEST);
},
setMask: function($) {
- ie !== $ && !P && (r.depthMask($), ie = $);
+ ie !== $ && !P && (n.depthMask($), ie = $);
},
setFunc: function($) {
- if (ae && ($ = Y0[$]), le !== $) {
+ if (ae && ($ = Y0[$]), ce !== $) {
switch ($) {
case Da:
- r.depthFunc(r.NEVER);
+ n.depthFunc(n.NEVER);
break;
case Ia:
- r.depthFunc(r.ALWAYS);
+ n.depthFunc(n.ALWAYS);
break;
case Ua:
- r.depthFunc(r.LESS);
+ n.depthFunc(n.LESS);
break;
case js:
- r.depthFunc(r.LEQUAL);
+ n.depthFunc(n.LEQUAL);
break;
case Na:
- r.depthFunc(r.EQUAL);
- break;
- case Oa:
- r.depthFunc(r.GEQUAL);
+ n.depthFunc(n.EQUAL);
break;
case Ba:
- r.depthFunc(r.GREATER);
+ n.depthFunc(n.GEQUAL);
break;
- case Fa:
- r.depthFunc(r.NOTEQUAL);
+ case Oa:
+ n.depthFunc(n.GREATER);
+ break;
+ case ka:
+ n.depthFunc(n.NOTEQUAL);
break;
default:
- r.depthFunc(r.LEQUAL);
+ n.depthFunc(n.LEQUAL);
}
- le = $;
+ ce = $;
}
},
setLocked: function($) {
P = $;
},
setClear: function($) {
- Q !== $ && (ae && ($ = 1 - $), r.clearDepth($), Q = $);
+ Q !== $ && (ae && ($ = 1 - $), n.clearDepth($), Q = $);
},
reset: function() {
- P = !1, ie = null, le = null, Q = null, ae = !1;
+ P = !1, ie = null, ce = null, Q = null, ae = !1;
}
};
}
function s() {
- let P = !1, ae = null, ie = null, le = null, Q = null, $ = null, _e = null, Pe = null, Ct = null;
+ let P = !1, ae = null, ie = null, ce = null, Q = null, $ = null, _e = null, Pe = null, Ct = null;
return {
setTest: function(rt) {
- P || (rt ? Y(r.STENCIL_TEST) : ue(r.STENCIL_TEST));
+ P || (rt ? Y(n.STENCIL_TEST) : de(n.STENCIL_TEST));
},
setMask: function(rt) {
- ae !== rt && !P && (r.stencilMask(rt), ae = rt);
+ ae !== rt && !P && (n.stencilMask(rt), ae = rt);
},
setFunc: function(rt, Mi, ri) {
- (ie !== rt || le !== Mi || Q !== ri) && (r.stencilFunc(rt, Mi, ri), ie = rt, le = Mi, Q = ri);
+ (ie !== rt || ce !== Mi || Q !== ri) && (n.stencilFunc(rt, Mi, ri), ie = rt, ce = Mi, Q = ri);
},
setOp: function(rt, Mi, ri) {
- ($ !== rt || _e !== Mi || Pe !== ri) && (r.stencilOp(rt, Mi, ri), $ = rt, _e = Mi, Pe = ri);
+ ($ !== rt || _e !== Mi || Pe !== ri) && (n.stencilOp(rt, Mi, ri), $ = rt, _e = Mi, Pe = ri);
},
setLocked: function(rt) {
P = rt;
},
setClear: function(rt) {
- Ct !== rt && (r.clearStencil(rt), Ct = rt);
+ Ct !== rt && (n.clearStencil(rt), Ct = rt);
},
reset: function() {
- P = !1, ae = null, ie = null, le = null, Q = null, $ = null, _e = null, Pe = null, Ct = null;
+ P = !1, ae = null, ie = null, ce = null, Q = null, $ = null, _e = null, Pe = null, Ct = null;
}
};
}
- const n = new t(), a = new i(), o = new s(), l = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap();
- let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), m = [], g = null, v = !1, f = null, p = null, y = null, _ = null, E = null, R = null, T = null, A = new xe(0, 0, 0), I = 0, S = !1, M = null, L = null, N = null, z = null, H = null;
- const j = r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ const r = new t(), a = new i(), o = new s(), l = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap();
+ let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), m = [], g = null, v = !1, f = null, p = null, b = null, _ = null, E = null, R = null, T = null, A = new xe(0, 0, 0), I = 0, S = !1, M = null, L = null, N = null, z = null, H = null;
+ const j = n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
let q = !1, te = 0;
- const G = r.getParameter(r.VERSION);
+ const G = n.getParameter(n.VERSION);
G.indexOf("WebGL") !== -1 ? (te = parseFloat(/^WebGL (\d)/.exec(G)[1]), q = te >= 1) : G.indexOf("OpenGL ES") !== -1 && (te = parseFloat(/^OpenGL ES (\d)/.exec(G)[1]), q = te >= 2);
- let Z = null, re = {};
- const Le = r.getParameter(r.SCISSOR_BOX), He = r.getParameter(r.VIEWPORT), Ye = new Je().fromArray(Le), Ze = new Je().fromArray(He);
- function $e(P, ae, ie, le) {
- const Q = new Uint8Array(4), $ = r.createTexture();
- r.bindTexture(P, $), r.texParameteri(P, r.TEXTURE_MIN_FILTER, r.NEAREST), r.texParameteri(P, r.TEXTURE_MAG_FILTER, r.NEAREST);
+ let Z = null, ne = {};
+ const Le = n.getParameter(n.SCISSOR_BOX), He = n.getParameter(n.VIEWPORT), Ye = new Qe().fromArray(Le), $e = new Qe().fromArray(He);
+ function Je(P, ae, ie, ce) {
+ const Q = new Uint8Array(4), $ = n.createTexture();
+ n.bindTexture(P, $), n.texParameteri(P, n.TEXTURE_MIN_FILTER, n.NEAREST), n.texParameteri(P, n.TEXTURE_MAG_FILTER, n.NEAREST);
for (let _e = 0; _e < ie; _e++)
- P === r.TEXTURE_3D || P === r.TEXTURE_2D_ARRAY ? r.texImage3D(ae, 0, r.RGBA, 1, 1, le, 0, r.RGBA, r.UNSIGNED_BYTE, Q) : r.texImage2D(ae + _e, 0, r.RGBA, 1, 1, 0, r.RGBA, r.UNSIGNED_BYTE, Q);
+ P === n.TEXTURE_3D || P === n.TEXTURE_2D_ARRAY ? n.texImage3D(ae, 0, n.RGBA, 1, 1, ce, 0, n.RGBA, n.UNSIGNED_BYTE, Q) : n.texImage2D(ae + _e, 0, n.RGBA, 1, 1, 0, n.RGBA, n.UNSIGNED_BYTE, Q);
return $;
}
const W = {};
- W[r.TEXTURE_2D] = $e(r.TEXTURE_2D, r.TEXTURE_2D, 1), W[r.TEXTURE_CUBE_MAP] = $e(r.TEXTURE_CUBE_MAP, r.TEXTURE_CUBE_MAP_POSITIVE_X, 6), W[r.TEXTURE_2D_ARRAY] = $e(r.TEXTURE_2D_ARRAY, r.TEXTURE_2D_ARRAY, 1, 1), W[r.TEXTURE_3D] = $e(r.TEXTURE_3D, r.TEXTURE_3D, 1, 1), n.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), Y(r.DEPTH_TEST), a.setFunc(js), _t(!1), je(ul), Y(r.CULL_FACE), Ge(yt);
+ W[n.TEXTURE_2D] = Je(n.TEXTURE_2D, n.TEXTURE_2D, 1), W[n.TEXTURE_CUBE_MAP] = Je(n.TEXTURE_CUBE_MAP, n.TEXTURE_CUBE_MAP_POSITIVE_X, 6), W[n.TEXTURE_2D_ARRAY] = Je(n.TEXTURE_2D_ARRAY, n.TEXTURE_2D_ARRAY, 1, 1), W[n.TEXTURE_3D] = Je(n.TEXTURE_3D, n.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), Y(n.DEPTH_TEST), a.setFunc(js), _t(!1), je(ul), Y(n.CULL_FACE), Ge(bt);
function Y(P) {
- h[P] !== !0 && (r.enable(P), h[P] = !0);
+ h[P] !== !0 && (n.enable(P), h[P] = !0);
}
- function ue(P) {
- h[P] !== !1 && (r.disable(P), h[P] = !1);
+ function de(P) {
+ h[P] !== !1 && (n.disable(P), h[P] = !1);
}
function Ae(P, ae) {
- return u[P] !== ae ? (r.bindFramebuffer(P, ae), u[P] = ae, P === r.DRAW_FRAMEBUFFER && (u[r.FRAMEBUFFER] = ae), P === r.FRAMEBUFFER && (u[r.DRAW_FRAMEBUFFER] = ae), !0) : !1;
+ return u[P] !== ae ? (n.bindFramebuffer(P, ae), u[P] = ae, P === n.DRAW_FRAMEBUFFER && (u[n.FRAMEBUFFER] = ae), P === n.FRAMEBUFFER && (u[n.DRAW_FRAMEBUFFER] = ae), !0) : !1;
}
function Te(P, ae) {
- let ie = m, le = !1;
+ let ie = m, ce = !1;
if (P) {
ie = d.get(ae), ie === void 0 && (ie = [], d.set(ae, ie));
const Q = P.textures;
- if (ie.length !== Q.length || ie[0] !== r.COLOR_ATTACHMENT0) {
+ if (ie.length !== Q.length || ie[0] !== n.COLOR_ATTACHMENT0) {
for (let $ = 0, _e = Q.length; $ < _e; $++)
- ie[$] = r.COLOR_ATTACHMENT0 + $;
- ie.length = Q.length, le = !0;
+ ie[$] = n.COLOR_ATTACHMENT0 + $;
+ ie.length = Q.length, ce = !0;
}
} else
- ie[0] !== r.BACK && (ie[0] = r.BACK, le = !0);
- le && r.drawBuffers(ie);
+ ie[0] !== n.BACK && (ie[0] = n.BACK, ce = !0);
+ ce && n.drawBuffers(ie);
}
function we(P) {
- return g !== P ? (r.useProgram(P), g = P, !0) : !1;
+ return g !== P ? (n.useProgram(P), g = P, !0) : !1;
}
- const Qe = {
- [ui]: r.FUNC_ADD,
- [lu]: r.FUNC_SUBTRACT,
- [cu]: r.FUNC_REVERSE_SUBTRACT
+ const et = {
+ [di]: n.FUNC_ADD,
+ [lu]: n.FUNC_SUBTRACT,
+ [cu]: n.FUNC_REVERSE_SUBTRACT
};
- Qe[hu] = r.MIN, Qe[uu] = r.MAX;
+ et[hu] = n.MIN, et[uu] = n.MAX;
const Xe = {
- [_r]: r.ZERO,
- [du]: r.ONE,
- [pu]: r.SRC_COLOR,
- [Aa]: r.SRC_ALPHA,
- [vu]: r.SRC_ALPHA_SATURATE,
- [La]: r.DST_COLOR,
- [Pa]: r.DST_ALPHA,
- [mu]: r.ONE_MINUS_SRC_COLOR,
- [Ra]: r.ONE_MINUS_SRC_ALPHA,
- [gu]: r.ONE_MINUS_DST_COLOR,
- [fu]: r.ONE_MINUS_DST_ALPHA,
- [_u]: r.CONSTANT_COLOR,
- [xu]: r.ONE_MINUS_CONSTANT_COLOR,
- [yu]: r.CONSTANT_ALPHA,
- [bu]: r.ONE_MINUS_CONSTANT_ALPHA
+ [xn]: n.ZERO,
+ [du]: n.ONE,
+ [pu]: n.SRC_COLOR,
+ [Aa]: n.SRC_ALPHA,
+ [vu]: n.SRC_ALPHA_SATURATE,
+ [La]: n.DST_COLOR,
+ [Pa]: n.DST_ALPHA,
+ [mu]: n.ONE_MINUS_SRC_COLOR,
+ [Ra]: n.ONE_MINUS_SRC_ALPHA,
+ [gu]: n.ONE_MINUS_DST_COLOR,
+ [fu]: n.ONE_MINUS_DST_ALPHA,
+ [_u]: n.CONSTANT_COLOR,
+ [xu]: n.ONE_MINUS_CONSTANT_COLOR,
+ [bu]: n.CONSTANT_ALPHA,
+ [yu]: n.ONE_MINUS_CONSTANT_ALPHA
};
- function Ge(P, ae, ie, le, Q, $, _e, Pe, Ct, rt) {
- if (P === yt) {
- v === !0 && (ue(r.BLEND), v = !1);
+ function Ge(P, ae, ie, ce, Q, $, _e, Pe, Ct, rt) {
+ if (P === bt) {
+ v === !0 && (de(n.BLEND), v = !1);
return;
}
- if (v === !1 && (Y(r.BLEND), v = !0), P !== Xc) {
+ if (v === !1 && (Y(n.BLEND), v = !0), P !== Xc) {
if (P !== f || rt !== S) {
- if ((p !== ui || E !== ui) && (r.blendEquation(r.FUNC_ADD), p = ui, E = ui), rt)
+ if ((p !== di || E !== di) && (n.blendEquation(n.FUNC_ADD), p = di, E = di), rt)
switch (P) {
case zs:
- r.blendFuncSeparate(r.ONE, r.ONE_MINUS_SRC_ALPHA, r.ONE, r.ONE_MINUS_SRC_ALPHA);
+ n.blendFuncSeparate(n.ONE, n.ONE_MINUS_SRC_ALPHA, n.ONE, n.ONE_MINUS_SRC_ALPHA);
break;
- case Sn:
- r.blendFunc(r.ONE, r.ONE);
+ case Sr:
+ n.blendFunc(n.ONE, n.ONE);
break;
case dl:
- r.blendFuncSeparate(r.ZERO, r.ONE_MINUS_SRC_COLOR, r.ZERO, r.ONE);
+ n.blendFuncSeparate(n.ZERO, n.ONE_MINUS_SRC_COLOR, n.ZERO, n.ONE);
break;
case pl:
- r.blendFuncSeparate(r.DST_COLOR, r.ONE_MINUS_SRC_ALPHA, r.ZERO, r.ONE);
+ n.blendFuncSeparate(n.DST_COLOR, n.ONE_MINUS_SRC_ALPHA, n.ZERO, n.ONE);
break;
default:
Ve("WebGLState: Invalid blending: ", P);
@@ -22400,10 +22468,10 @@ function K0(r, e) {
else
switch (P) {
case zs:
- r.blendFuncSeparate(r.SRC_ALPHA, r.ONE_MINUS_SRC_ALPHA, r.ONE, r.ONE_MINUS_SRC_ALPHA);
+ n.blendFuncSeparate(n.SRC_ALPHA, n.ONE_MINUS_SRC_ALPHA, n.ONE, n.ONE_MINUS_SRC_ALPHA);
break;
- case Sn:
- r.blendFuncSeparate(r.SRC_ALPHA, r.ONE, r.ONE, r.ONE);
+ case Sr:
+ n.blendFuncSeparate(n.SRC_ALPHA, n.ONE, n.ONE, n.ONE);
break;
case dl:
Ve("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");
@@ -22415,143 +22483,143 @@ function K0(r, e) {
Ve("WebGLState: Invalid blending: ", P);
break;
}
- y = null, _ = null, R = null, T = null, A.set(0, 0, 0), I = 0, f = P, S = rt;
+ b = null, _ = null, R = null, T = null, A.set(0, 0, 0), I = 0, f = P, S = rt;
}
return;
}
- Q = Q || ae, $ = $ || ie, _e = _e || le, (ae !== p || Q !== E) && (r.blendEquationSeparate(Qe[ae], Qe[Q]), p = ae, E = Q), (ie !== y || le !== _ || $ !== R || _e !== T) && (r.blendFuncSeparate(Xe[ie], Xe[le], Xe[$], Xe[_e]), y = ie, _ = le, R = $, T = _e), (Pe.equals(A) === !1 || Ct !== I) && (r.blendColor(Pe.r, Pe.g, Pe.b, Ct), A.copy(Pe), I = Ct), f = P, S = !1;
+ Q = Q || ae, $ = $ || ie, _e = _e || ce, (ae !== p || Q !== E) && (n.blendEquationSeparate(et[ae], et[Q]), p = ae, E = Q), (ie !== b || ce !== _ || $ !== R || _e !== T) && (n.blendFuncSeparate(Xe[ie], Xe[ce], Xe[$], Xe[_e]), b = ie, _ = ce, R = $, T = _e), (Pe.equals(A) === !1 || Ct !== I) && (n.blendColor(Pe.r, Pe.g, Pe.b, Ct), A.copy(Pe), I = Ct), f = P, S = !1;
}
function D(P, ae) {
- P.side === jt ? ue(r.CULL_FACE) : Y(r.CULL_FACE);
- let ie = P.side === Ht;
- ae && (ie = !ie), _t(ie), P.blending === zs && P.transparent === !1 ? Ge(yt) : Ge(P.blending, P.blendEquation, P.blendSrc, P.blendDst, P.blendEquationAlpha, P.blendSrcAlpha, P.blendDstAlpha, P.blendColor, P.blendAlpha, P.premultipliedAlpha), a.setFunc(P.depthFunc), a.setTest(P.depthTest), a.setMask(P.depthWrite), n.setMask(P.colorWrite);
- const le = P.stencilWrite;
- o.setTest(le), le && (o.setMask(P.stencilWriteMask), o.setFunc(P.stencilFunc, P.stencilRef, P.stencilFuncMask), o.setOp(P.stencilFail, P.stencilZFail, P.stencilZPass)), fe(P.polygonOffset, P.polygonOffsetFactor, P.polygonOffsetUnits), P.alphaToCoverage === !0 ? Y(r.SAMPLE_ALPHA_TO_COVERAGE) : ue(r.SAMPLE_ALPHA_TO_COVERAGE);
+ P.side === Xt ? de(n.CULL_FACE) : Y(n.CULL_FACE);
+ let ie = P.side === Vt;
+ ae && (ie = !ie), _t(ie), P.blending === zs && P.transparent === !1 ? Ge(bt) : Ge(P.blending, P.blendEquation, P.blendSrc, P.blendDst, P.blendEquationAlpha, P.blendSrcAlpha, P.blendDstAlpha, P.blendColor, P.blendAlpha, P.premultipliedAlpha), a.setFunc(P.depthFunc), a.setTest(P.depthTest), a.setMask(P.depthWrite), r.setMask(P.colorWrite);
+ const ce = P.stencilWrite;
+ o.setTest(ce), ce && (o.setMask(P.stencilWriteMask), o.setFunc(P.stencilFunc, P.stencilRef, P.stencilFuncMask), o.setOp(P.stencilFail, P.stencilZFail, P.stencilZPass)), fe(P.polygonOffset, P.polygonOffsetFactor, P.polygonOffsetUnits), P.alphaToCoverage === !0 ? Y(n.SAMPLE_ALPHA_TO_COVERAGE) : de(n.SAMPLE_ALPHA_TO_COVERAGE);
}
function _t(P) {
- M !== P && (P ? r.frontFace(r.CW) : r.frontFace(r.CCW), M = P);
+ M !== P && (P ? n.frontFace(n.CW) : n.frontFace(n.CCW), M = P);
}
function je(P) {
- P !== au ? (Y(r.CULL_FACE), P !== L && (P === ul ? r.cullFace(r.BACK) : P === ou ? r.cullFace(r.FRONT) : r.cullFace(r.FRONT_AND_BACK))) : ue(r.CULL_FACE), L = P;
+ P !== au ? (Y(n.CULL_FACE), P !== L && (P === ul ? n.cullFace(n.BACK) : P === ou ? n.cullFace(n.FRONT) : n.cullFace(n.FRONT_AND_BACK))) : de(n.CULL_FACE), L = P;
}
- function et(P) {
- P !== N && (q && r.lineWidth(P), N = P);
+ function tt(P) {
+ P !== N && (q && n.lineWidth(P), N = P);
}
function fe(P, ae, ie) {
- P ? (Y(r.POLYGON_OFFSET_FILL), (z !== ae || H !== ie) && (r.polygonOffset(ae, ie), z = ae, H = ie)) : ue(r.POLYGON_OFFSET_FILL);
+ P ? (Y(n.POLYGON_OFFSET_FILL), (z !== ae || H !== ie) && (n.polygonOffset(ae, ie), z = ae, H = ie)) : de(n.POLYGON_OFFSET_FILL);
}
- function ot(P) {
- P ? Y(r.SCISSOR_TEST) : ue(r.SCISSOR_TEST);
+ function lt(P) {
+ P ? Y(n.SCISSOR_TEST) : de(n.SCISSOR_TEST);
}
function Me(P) {
- P === void 0 && (P = r.TEXTURE0 + j - 1), Z !== P && (r.activeTexture(P), Z = P);
+ P === void 0 && (P = n.TEXTURE0 + j - 1), Z !== P && (n.activeTexture(P), Z = P);
}
function De(P, ae, ie) {
- ie === void 0 && (Z === null ? ie = r.TEXTURE0 + j - 1 : ie = Z);
- let le = re[ie];
- le === void 0 && (le = { type: void 0, texture: void 0 }, re[ie] = le), (le.type !== P || le.texture !== ae) && (Z !== ie && (r.activeTexture(ie), Z = ie), r.bindTexture(P, ae || W[P]), le.type = P, le.texture = ae);
+ ie === void 0 && (Z === null ? ie = n.TEXTURE0 + j - 1 : ie = Z);
+ let ce = ne[ie];
+ ce === void 0 && (ce = { type: void 0, texture: void 0 }, ne[ie] = ce), (ce.type !== P || ce.texture !== ae) && (Z !== ie && (n.activeTexture(ie), Z = ie), n.bindTexture(P, ae || W[P]), ce.type = P, ce.texture = ae);
}
function C() {
- const P = re[Z];
- P !== void 0 && P.type !== void 0 && (r.bindTexture(P.type, null), P.type = void 0, P.texture = void 0);
+ const P = ne[Z];
+ P !== void 0 && P.type !== void 0 && (n.bindTexture(P.type, null), P.type = void 0, P.texture = void 0);
}
function x() {
try {
- r.compressedTexImage2D(...arguments);
+ n.compressedTexImage2D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
- function B() {
+ function O() {
try {
- r.compressedTexImage3D(...arguments);
+ n.compressedTexImage3D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function X() {
try {
- r.texSubImage2D(...arguments);
+ n.texSubImage2D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function K() {
try {
- r.texSubImage3D(...arguments);
+ n.texSubImage3D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function V() {
try {
- r.compressedTexSubImage2D(...arguments);
+ n.compressedTexSubImage2D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
- function ye() {
+ function be() {
try {
- r.compressedTexSubImage3D(...arguments);
+ n.compressedTexSubImage3D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
- function ne() {
+ function re() {
try {
- r.texStorage2D(...arguments);
+ n.texStorage2D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function Ee() {
try {
- r.texStorage3D(...arguments);
+ n.texStorage3D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
- function de() {
+ function pe() {
try {
- r.texImage2D(...arguments);
+ n.texImage2D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function J() {
try {
- r.texImage3D(...arguments);
+ n.texImage3D(...arguments);
} catch (P) {
P("WebGLState:", P);
}
}
function se(P) {
- Ye.equals(P) === !1 && (r.scissor(P.x, P.y, P.z, P.w), Ye.copy(P));
+ Ye.equals(P) === !1 && (n.scissor(P.x, P.y, P.z, P.w), Ye.copy(P));
}
- function Be(P) {
- Ze.equals(P) === !1 && (r.viewport(P.x, P.y, P.z, P.w), Ze.copy(P));
+ function Oe(P) {
+ $e.equals(P) === !1 && (n.viewport(P.x, P.y, P.z, P.w), $e.copy(P));
}
function Ce(P, ae) {
let ie = c.get(ae);
ie === void 0 && (ie = /* @__PURE__ */ new WeakMap(), c.set(ae, ie));
- let le = ie.get(P);
- le === void 0 && (le = r.getUniformBlockIndex(ae, P.name), ie.set(P, le));
+ let ce = ie.get(P);
+ ce === void 0 && (ce = n.getUniformBlockIndex(ae, P.name), ie.set(P, ce));
}
- function he(P, ae) {
+ function ue(P, ae) {
const ie = c.get(ae).get(P);
- l.get(ae) !== ie && (r.uniformBlockBinding(ae, ie, P.__bindingPointIndex), l.set(ae, ie));
+ l.get(ae) !== ie && (n.uniformBlockBinding(ae, ie, P.__bindingPointIndex), l.set(ae, ie));
}
function Re() {
- r.disable(r.BLEND), r.disable(r.CULL_FACE), r.disable(r.DEPTH_TEST), r.disable(r.POLYGON_OFFSET_FILL), r.disable(r.SCISSOR_TEST), r.disable(r.STENCIL_TEST), r.disable(r.SAMPLE_ALPHA_TO_COVERAGE), r.blendEquation(r.FUNC_ADD), r.blendFunc(r.ONE, r.ZERO), r.blendFuncSeparate(r.ONE, r.ZERO, r.ONE, r.ZERO), r.blendColor(0, 0, 0, 0), r.colorMask(!0, !0, !0, !0), r.clearColor(0, 0, 0, 0), r.depthMask(!0), r.depthFunc(r.LESS), a.setReversed(!1), r.clearDepth(1), r.stencilMask(4294967295), r.stencilFunc(r.ALWAYS, 0, 4294967295), r.stencilOp(r.KEEP, r.KEEP, r.KEEP), r.clearStencil(0), r.cullFace(r.BACK), r.frontFace(r.CCW), r.polygonOffset(0, 0), r.activeTexture(r.TEXTURE0), r.bindFramebuffer(r.FRAMEBUFFER, null), r.bindFramebuffer(r.DRAW_FRAMEBUFFER, null), r.bindFramebuffer(r.READ_FRAMEBUFFER, null), r.useProgram(null), r.lineWidth(1), r.scissor(0, 0, r.canvas.width, r.canvas.height), r.viewport(0, 0, r.canvas.width, r.canvas.height), h = {}, Z = null, re = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), m = [], g = null, v = !1, f = null, p = null, y = null, _ = null, E = null, R = null, T = null, A = new xe(0, 0, 0), I = 0, S = !1, M = null, L = null, N = null, z = null, H = null, Ye.set(0, 0, r.canvas.width, r.canvas.height), Ze.set(0, 0, r.canvas.width, r.canvas.height), n.reset(), a.reset(), o.reset();
+ n.disable(n.BLEND), n.disable(n.CULL_FACE), n.disable(n.DEPTH_TEST), n.disable(n.POLYGON_OFFSET_FILL), n.disable(n.SCISSOR_TEST), n.disable(n.STENCIL_TEST), n.disable(n.SAMPLE_ALPHA_TO_COVERAGE), n.blendEquation(n.FUNC_ADD), n.blendFunc(n.ONE, n.ZERO), n.blendFuncSeparate(n.ONE, n.ZERO, n.ONE, n.ZERO), n.blendColor(0, 0, 0, 0), n.colorMask(!0, !0, !0, !0), n.clearColor(0, 0, 0, 0), n.depthMask(!0), n.depthFunc(n.LESS), a.setReversed(!1), n.clearDepth(1), n.stencilMask(4294967295), n.stencilFunc(n.ALWAYS, 0, 4294967295), n.stencilOp(n.KEEP, n.KEEP, n.KEEP), n.clearStencil(0), n.cullFace(n.BACK), n.frontFace(n.CCW), n.polygonOffset(0, 0), n.activeTexture(n.TEXTURE0), n.bindFramebuffer(n.FRAMEBUFFER, null), n.bindFramebuffer(n.DRAW_FRAMEBUFFER, null), n.bindFramebuffer(n.READ_FRAMEBUFFER, null), n.useProgram(null), n.lineWidth(1), n.scissor(0, 0, n.canvas.width, n.canvas.height), n.viewport(0, 0, n.canvas.width, n.canvas.height), h = {}, Z = null, ne = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), m = [], g = null, v = !1, f = null, p = null, b = null, _ = null, E = null, R = null, T = null, A = new xe(0, 0, 0), I = 0, S = !1, M = null, L = null, N = null, z = null, H = null, Ye.set(0, 0, n.canvas.width, n.canvas.height), $e.set(0, 0, n.canvas.width, n.canvas.height), r.reset(), a.reset(), o.reset();
}
return {
buffers: {
- color: n,
+ color: r,
depth: a,
stencil: o
},
enable: Y,
- disable: ue,
+ disable: de,
bindFramebuffer: Ae,
drawBuffers: Te,
useProgram: we,
@@ -22559,30 +22627,30 @@ function K0(r, e) {
setMaterial: D,
setFlipSided: _t,
setCullFace: je,
- setLineWidth: et,
+ setLineWidth: tt,
setPolygonOffset: fe,
- setScissorTest: ot,
+ setScissorTest: lt,
activeTexture: Me,
bindTexture: De,
unbindTexture: C,
compressedTexImage2D: x,
- compressedTexImage3D: B,
- texImage2D: de,
+ compressedTexImage3D: O,
+ texImage2D: pe,
texImage3D: J,
updateUBOMapping: Ce,
- uniformBlockBinding: he,
- texStorage2D: ne,
+ uniformBlockBinding: ue,
+ texStorage2D: re,
texStorage3D: Ee,
texSubImage2D: X,
texSubImage3D: K,
compressedTexSubImage2D: V,
- compressedTexSubImage3D: ye,
+ compressedTexSubImage3D: be,
scissor: se,
- viewport: Be,
+ viewport: Oe,
reset: Re
};
}
-function Z0(r, e, t, i, s, n, a) {
+function Z0(n, e, t, i, s, r, a) {
const o = e.has("WEBGL_multisampled_render_to_texture") ? e.get("WEBGL_multisampled_render_to_texture") : null, l = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), c = new oe(), h = /* @__PURE__ */ new WeakMap();
let u;
const d = /* @__PURE__ */ new WeakMap();
@@ -22595,17 +22663,17 @@ function Z0(r, e, t, i, s, n, a) {
return m ? (
// eslint-disable-next-line compat/compat
new OffscreenCanvas(C, x)
- ) : Pr("canvas");
+ ) : Ln("canvas");
}
- function v(C, x, B) {
+ function v(C, x, O) {
let X = 1;
const K = De(C);
- if ((K.width > B || K.height > B) && (X = B / Math.max(K.width, K.height)), X < 1)
+ if ((K.width > O || K.height > O) && (X = O / Math.max(K.width, K.height)), X < 1)
if (typeof HTMLImageElement < "u" && C instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && C instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && C instanceof ImageBitmap || typeof VideoFrame < "u" && C instanceof VideoFrame) {
- const V = Math.floor(X * K.width), ye = Math.floor(X * K.height);
- u === void 0 && (u = g(V, ye));
- const ne = x ? g(V, ye) : u;
- return ne.width = V, ne.height = ye, ne.getContext("2d").drawImage(C, 0, 0, V, ye), Se("WebGLRenderer: Texture has been resized from (" + K.width + "x" + K.height + ") to (" + V + "x" + ye + ")."), ne;
+ const V = Math.floor(X * K.width), be = Math.floor(X * K.height);
+ u === void 0 && (u = g(V, be));
+ const re = x ? g(V, be) : u;
+ return re.width = V, re.height = be, re.getContext("2d").drawImage(C, 0, 0, V, be), Se("WebGLRenderer: Texture has been resized from (" + K.width + "x" + K.height + ") to (" + V + "x" + be + ")."), re;
} else
return "data" in C && Se("WebGLRenderer: Image in DataTexture is too big (" + K.width + "x" + K.height + ")."), C;
return C;
@@ -22614,29 +22682,29 @@ function Z0(r, e, t, i, s, n, a) {
return C.generateMipmaps;
}
function p(C) {
- r.generateMipmap(C);
+ n.generateMipmap(C);
}
- function y(C) {
- return C.isWebGLCubeRenderTarget ? r.TEXTURE_CUBE_MAP : C.isWebGL3DRenderTarget ? r.TEXTURE_3D : C.isWebGLArrayRenderTarget || C.isCompressedArrayTexture ? r.TEXTURE_2D_ARRAY : r.TEXTURE_2D;
+ function b(C) {
+ return C.isWebGLCubeRenderTarget ? n.TEXTURE_CUBE_MAP : C.isWebGL3DRenderTarget ? n.TEXTURE_3D : C.isWebGLArrayRenderTarget || C.isCompressedArrayTexture ? n.TEXTURE_2D_ARRAY : n.TEXTURE_2D;
}
- function _(C, x, B, X, K = !1) {
+ function _(C, x, O, X, K = !1) {
if (C !== null) {
- if (r[C] !== void 0) return r[C];
+ if (n[C] !== void 0) return n[C];
Se("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + C + "'");
}
let V = x;
- if (x === r.RED && (B === r.FLOAT && (V = r.R32F), B === r.HALF_FLOAT && (V = r.R16F), B === r.UNSIGNED_BYTE && (V = r.R8)), x === r.RED_INTEGER && (B === r.UNSIGNED_BYTE && (V = r.R8UI), B === r.UNSIGNED_SHORT && (V = r.R16UI), B === r.UNSIGNED_INT && (V = r.R32UI), B === r.BYTE && (V = r.R8I), B === r.SHORT && (V = r.R16I), B === r.INT && (V = r.R32I)), x === r.RG && (B === r.FLOAT && (V = r.RG32F), B === r.HALF_FLOAT && (V = r.RG16F), B === r.UNSIGNED_BYTE && (V = r.RG8)), x === r.RG_INTEGER && (B === r.UNSIGNED_BYTE && (V = r.RG8UI), B === r.UNSIGNED_SHORT && (V = r.RG16UI), B === r.UNSIGNED_INT && (V = r.RG32UI), B === r.BYTE && (V = r.RG8I), B === r.SHORT && (V = r.RG16I), B === r.INT && (V = r.RG32I)), x === r.RGB_INTEGER && (B === r.UNSIGNED_BYTE && (V = r.RGB8UI), B === r.UNSIGNED_SHORT && (V = r.RGB16UI), B === r.UNSIGNED_INT && (V = r.RGB32UI), B === r.BYTE && (V = r.RGB8I), B === r.SHORT && (V = r.RGB16I), B === r.INT && (V = r.RGB32I)), x === r.RGBA_INTEGER && (B === r.UNSIGNED_BYTE && (V = r.RGBA8UI), B === r.UNSIGNED_SHORT && (V = r.RGBA16UI), B === r.UNSIGNED_INT && (V = r.RGBA32UI), B === r.BYTE && (V = r.RGBA8I), B === r.SHORT && (V = r.RGBA16I), B === r.INT && (V = r.RGBA32I)), x === r.RGB && (B === r.UNSIGNED_INT_5_9_9_9_REV && (V = r.RGB9_E5), B === r.UNSIGNED_INT_10F_11F_11F_REV && (V = r.R11F_G11F_B10F)), x === r.RGBA) {
- const ye = K ? wn : qe.getTransfer(X);
- B === r.FLOAT && (V = r.RGBA32F), B === r.HALF_FLOAT && (V = r.RGBA16F), B === r.UNSIGNED_BYTE && (V = ye === tt ? r.SRGB8_ALPHA8 : r.RGBA8), B === r.UNSIGNED_SHORT_4_4_4_4 && (V = r.RGBA4), B === r.UNSIGNED_SHORT_5_5_5_1 && (V = r.RGB5_A1);
+ if (x === n.RED && (O === n.FLOAT && (V = n.R32F), O === n.HALF_FLOAT && (V = n.R16F), O === n.UNSIGNED_BYTE && (V = n.R8)), x === n.RED_INTEGER && (O === n.UNSIGNED_BYTE && (V = n.R8UI), O === n.UNSIGNED_SHORT && (V = n.R16UI), O === n.UNSIGNED_INT && (V = n.R32UI), O === n.BYTE && (V = n.R8I), O === n.SHORT && (V = n.R16I), O === n.INT && (V = n.R32I)), x === n.RG && (O === n.FLOAT && (V = n.RG32F), O === n.HALF_FLOAT && (V = n.RG16F), O === n.UNSIGNED_BYTE && (V = n.RG8)), x === n.RG_INTEGER && (O === n.UNSIGNED_BYTE && (V = n.RG8UI), O === n.UNSIGNED_SHORT && (V = n.RG16UI), O === n.UNSIGNED_INT && (V = n.RG32UI), O === n.BYTE && (V = n.RG8I), O === n.SHORT && (V = n.RG16I), O === n.INT && (V = n.RG32I)), x === n.RGB_INTEGER && (O === n.UNSIGNED_BYTE && (V = n.RGB8UI), O === n.UNSIGNED_SHORT && (V = n.RGB16UI), O === n.UNSIGNED_INT && (V = n.RGB32UI), O === n.BYTE && (V = n.RGB8I), O === n.SHORT && (V = n.RGB16I), O === n.INT && (V = n.RGB32I)), x === n.RGBA_INTEGER && (O === n.UNSIGNED_BYTE && (V = n.RGBA8UI), O === n.UNSIGNED_SHORT && (V = n.RGBA16UI), O === n.UNSIGNED_INT && (V = n.RGBA32UI), O === n.BYTE && (V = n.RGBA8I), O === n.SHORT && (V = n.RGBA16I), O === n.INT && (V = n.RGBA32I)), x === n.RGB && (O === n.UNSIGNED_INT_5_9_9_9_REV && (V = n.RGB9_E5), O === n.UNSIGNED_INT_10F_11F_11F_REV && (V = n.R11F_G11F_B10F)), x === n.RGBA) {
+ const be = K ? wr : qe.getTransfer(X);
+ O === n.FLOAT && (V = n.RGBA32F), O === n.HALF_FLOAT && (V = n.RGBA16F), O === n.UNSIGNED_BYTE && (V = be === it ? n.SRGB8_ALPHA8 : n.RGBA8), O === n.UNSIGNED_SHORT_4_4_4_4 && (V = n.RGBA4), O === n.UNSIGNED_SHORT_5_5_5_1 && (V = n.RGB5_A1);
}
- return (V === r.R16F || V === r.R32F || V === r.RG16F || V === r.RG32F || V === r.RGBA16F || V === r.RGBA32F) && e.get("EXT_color_buffer_float"), V;
+ return (V === n.R16F || V === n.R32F || V === n.RG16F || V === n.RG32F || V === n.RGBA16F || V === n.RGBA32F) && e.get("EXT_color_buffer_float"), V;
}
function E(C, x) {
- let B;
- return C ? x === null || x === gs || x === Ys ? B = r.DEPTH24_STENCIL8 : x === Xt ? B = r.DEPTH32F_STENCIL8 : x === wr && (B = r.DEPTH24_STENCIL8, Se("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : x === null || x === gs || x === Ys ? B = r.DEPTH_COMPONENT24 : x === Xt ? B = r.DEPTH_COMPONENT32F : x === wr && (B = r.DEPTH_COMPONENT16), B;
+ let O;
+ return C ? x === null || x === gs || x === Ys ? O = n.DEPTH24_STENCIL8 : x === qt ? O = n.DEPTH32F_STENCIL8 : x === Cn && (O = n.DEPTH24_STENCIL8, Se("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : x === null || x === gs || x === Ys ? O = n.DEPTH_COMPONENT24 : x === qt ? O = n.DEPTH_COMPONENT32F : x === Cn && (O = n.DEPTH_COMPONENT16), O;
}
function R(C, x) {
- return f(C) === !0 || C.isFramebufferTexture && C.minFilter !== Ut && C.minFilter !== Mt ? Math.log2(Math.max(x.width, x.height)) + 1 : C.mipmaps !== void 0 && C.mipmaps.length > 0 ? C.mipmaps.length : C.isCompressedTexture && Array.isArray(C.image) ? x.mipmaps.length : 1;
+ return f(C) === !0 || C.isFramebufferTexture && C.minFilter !== Nt && C.minFilter !== Mt ? Math.log2(Math.max(x.width, x.height)) + 1 : C.mipmaps !== void 0 && C.mipmaps.length > 0 ? C.mipmaps.length : C.isCompressedTexture && Array.isArray(C.image) ? x.mipmaps.length : 1;
}
function T(C) {
const x = C.target;
@@ -22649,17 +22717,17 @@ function Z0(r, e, t, i, s, n, a) {
function I(C) {
const x = i.get(C);
if (x.__webglInit === void 0) return;
- const B = C.source, X = d.get(B);
+ const O = C.source, X = d.get(O);
if (X) {
const K = X[x.__cacheKey];
- K.usedTimes--, K.usedTimes === 0 && S(C), Object.keys(X).length === 0 && d.delete(B);
+ K.usedTimes--, K.usedTimes === 0 && S(C), Object.keys(X).length === 0 && d.delete(O);
}
i.remove(C);
}
function S(C) {
const x = i.get(C);
- r.deleteTexture(x.__webglTexture);
- const B = C.source, X = d.get(B);
+ n.deleteTexture(x.__webglTexture);
+ const O = C.source, X = d.get(O);
delete X[x.__cacheKey], a.memory.textures--;
}
function M(C) {
@@ -22667,25 +22735,25 @@ function Z0(r, e, t, i, s, n, a) {
if (C.depthTexture && (C.depthTexture.dispose(), i.remove(C.depthTexture)), C.isWebGLCubeRenderTarget)
for (let X = 0; X < 6; X++) {
if (Array.isArray(x.__webglFramebuffer[X]))
- for (let K = 0; K < x.__webglFramebuffer[X].length; K++) r.deleteFramebuffer(x.__webglFramebuffer[X][K]);
+ for (let K = 0; K < x.__webglFramebuffer[X].length; K++) n.deleteFramebuffer(x.__webglFramebuffer[X][K]);
else
- r.deleteFramebuffer(x.__webglFramebuffer[X]);
- x.__webglDepthbuffer && r.deleteRenderbuffer(x.__webglDepthbuffer[X]);
+ n.deleteFramebuffer(x.__webglFramebuffer[X]);
+ x.__webglDepthbuffer && n.deleteRenderbuffer(x.__webglDepthbuffer[X]);
}
else {
if (Array.isArray(x.__webglFramebuffer))
- for (let X = 0; X < x.__webglFramebuffer.length; X++) r.deleteFramebuffer(x.__webglFramebuffer[X]);
+ for (let X = 0; X < x.__webglFramebuffer.length; X++) n.deleteFramebuffer(x.__webglFramebuffer[X]);
else
- r.deleteFramebuffer(x.__webglFramebuffer);
- if (x.__webglDepthbuffer && r.deleteRenderbuffer(x.__webglDepthbuffer), x.__webglMultisampledFramebuffer && r.deleteFramebuffer(x.__webglMultisampledFramebuffer), x.__webglColorRenderbuffer)
+ n.deleteFramebuffer(x.__webglFramebuffer);
+ if (x.__webglDepthbuffer && n.deleteRenderbuffer(x.__webglDepthbuffer), x.__webglMultisampledFramebuffer && n.deleteFramebuffer(x.__webglMultisampledFramebuffer), x.__webglColorRenderbuffer)
for (let X = 0; X < x.__webglColorRenderbuffer.length; X++)
- x.__webglColorRenderbuffer[X] && r.deleteRenderbuffer(x.__webglColorRenderbuffer[X]);
- x.__webglDepthRenderbuffer && r.deleteRenderbuffer(x.__webglDepthRenderbuffer);
+ x.__webglColorRenderbuffer[X] && n.deleteRenderbuffer(x.__webglColorRenderbuffer[X]);
+ x.__webglDepthRenderbuffer && n.deleteRenderbuffer(x.__webglDepthRenderbuffer);
}
- const B = C.textures;
- for (let X = 0, K = B.length; X < K; X++) {
- const V = i.get(B[X]);
- V.__webglTexture && (r.deleteTexture(V.__webglTexture), a.memory.textures--), i.remove(B[X]);
+ const O = C.textures;
+ for (let X = 0, K = O.length; X < K; X++) {
+ const V = i.get(O[X]);
+ V.__webglTexture && (n.deleteTexture(V.__webglTexture), a.memory.textures--), i.remove(O[X]);
}
i.remove(C);
}
@@ -22702,76 +22770,76 @@ function Z0(r, e, t, i, s, n, a) {
return x.push(C.wrapS), x.push(C.wrapT), x.push(C.wrapR || 0), x.push(C.magFilter), x.push(C.minFilter), x.push(C.anisotropy), x.push(C.internalFormat), x.push(C.format), x.push(C.type), x.push(C.generateMipmaps), x.push(C.premultiplyAlpha), x.push(C.flipY), x.push(C.unpackAlignment), x.push(C.colorSpace), x.join();
}
function j(C, x) {
- const B = i.get(C);
- if (C.isVideoTexture && ot(C), C.isRenderTargetTexture === !1 && C.isExternalTexture !== !0 && C.version > 0 && B.__version !== C.version) {
+ const O = i.get(C);
+ if (C.isVideoTexture && lt(C), C.isRenderTargetTexture === !1 && C.isExternalTexture !== !0 && C.version > 0 && O.__version !== C.version) {
const X = C.image;
if (X === null)
Se("WebGLRenderer: Texture marked for update but no image data found.");
else if (X.complete === !1)
Se("WebGLRenderer: Texture marked for update but image is incomplete");
else {
- W(B, C, x);
+ W(O, C, x);
return;
}
- } else C.isExternalTexture && (B.__webglTexture = C.sourceTexture ? C.sourceTexture : null);
- t.bindTexture(r.TEXTURE_2D, B.__webglTexture, r.TEXTURE0 + x);
+ } else C.isExternalTexture && (O.__webglTexture = C.sourceTexture ? C.sourceTexture : null);
+ t.bindTexture(n.TEXTURE_2D, O.__webglTexture, n.TEXTURE0 + x);
}
function q(C, x) {
- const B = i.get(C);
- if (C.isRenderTargetTexture === !1 && C.version > 0 && B.__version !== C.version) {
- W(B, C, x);
+ const O = i.get(C);
+ if (C.isRenderTargetTexture === !1 && C.version > 0 && O.__version !== C.version) {
+ W(O, C, x);
return;
- } else C.isExternalTexture && (B.__webglTexture = C.sourceTexture ? C.sourceTexture : null);
- t.bindTexture(r.TEXTURE_2D_ARRAY, B.__webglTexture, r.TEXTURE0 + x);
+ } else C.isExternalTexture && (O.__webglTexture = C.sourceTexture ? C.sourceTexture : null);
+ t.bindTexture(n.TEXTURE_2D_ARRAY, O.__webglTexture, n.TEXTURE0 + x);
}
function te(C, x) {
- const B = i.get(C);
- if (C.isRenderTargetTexture === !1 && C.version > 0 && B.__version !== C.version) {
- W(B, C, x);
+ const O = i.get(C);
+ if (C.isRenderTargetTexture === !1 && C.version > 0 && O.__version !== C.version) {
+ W(O, C, x);
return;
}
- t.bindTexture(r.TEXTURE_3D, B.__webglTexture, r.TEXTURE0 + x);
+ t.bindTexture(n.TEXTURE_3D, O.__webglTexture, n.TEXTURE0 + x);
}
function G(C, x) {
- const B = i.get(C);
- if (C.version > 0 && B.__version !== C.version) {
- Y(B, C, x);
+ const O = i.get(C);
+ if (C.version > 0 && O.__version !== C.version) {
+ Y(O, C, x);
return;
}
- t.bindTexture(r.TEXTURE_CUBE_MAP, B.__webglTexture, r.TEXTURE0 + x);
+ t.bindTexture(n.TEXTURE_CUBE_MAP, O.__webglTexture, n.TEXTURE0 + x);
}
const Z = {
- [Ri]: r.REPEAT,
- [ti]: r.CLAMP_TO_EDGE,
- [En]: r.MIRRORED_REPEAT
- }, re = {
- [Ut]: r.NEAREST,
- [eh]: r.NEAREST_MIPMAP_NEAREST,
- [xr]: r.NEAREST_MIPMAP_LINEAR,
- [Mt]: r.LINEAR,
- [vn]: r.LINEAR_MIPMAP_NEAREST,
- [wi]: r.LINEAR_MIPMAP_LINEAR
+ [Ri]: n.REPEAT,
+ [ii]: n.CLAMP_TO_EDGE,
+ [Er]: n.MIRRORED_REPEAT
+ }, ne = {
+ [Nt]: n.NEAREST,
+ [eh]: n.NEAREST_MIPMAP_NEAREST,
+ [bn]: n.NEAREST_MIPMAP_LINEAR,
+ [Mt]: n.LINEAR,
+ [vr]: n.LINEAR_MIPMAP_NEAREST,
+ [wi]: n.LINEAR_MIPMAP_LINEAR
}, Le = {
- [Pu]: r.NEVER,
- [Ou]: r.ALWAYS,
- [Lu]: r.LESS,
- [ch]: r.LEQUAL,
- [Du]: r.EQUAL,
- [Nu]: r.GEQUAL,
- [Iu]: r.GREATER,
- [Uu]: r.NOTEQUAL
+ [Pu]: n.NEVER,
+ [Bu]: n.ALWAYS,
+ [Lu]: n.LESS,
+ [ch]: n.LEQUAL,
+ [Du]: n.EQUAL,
+ [Nu]: n.GEQUAL,
+ [Iu]: n.GREATER,
+ [Uu]: n.NOTEQUAL
};
function He(C, x) {
- if (x.type === Xt && e.has("OES_texture_float_linear") === !1 && (x.magFilter === Mt || x.magFilter === vn || x.magFilter === xr || x.magFilter === wi || x.minFilter === Mt || x.minFilter === vn || x.minFilter === xr || x.minFilter === wi) && Se("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), r.texParameteri(C, r.TEXTURE_WRAP_S, Z[x.wrapS]), r.texParameteri(C, r.TEXTURE_WRAP_T, Z[x.wrapT]), (C === r.TEXTURE_3D || C === r.TEXTURE_2D_ARRAY) && r.texParameteri(C, r.TEXTURE_WRAP_R, Z[x.wrapR]), r.texParameteri(C, r.TEXTURE_MAG_FILTER, re[x.magFilter]), r.texParameteri(C, r.TEXTURE_MIN_FILTER, re[x.minFilter]), x.compareFunction && (r.texParameteri(C, r.TEXTURE_COMPARE_MODE, r.COMPARE_REF_TO_TEXTURE), r.texParameteri(C, r.TEXTURE_COMPARE_FUNC, Le[x.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
- if (x.magFilter === Ut || x.minFilter !== xr && x.minFilter !== wi || x.type === Xt && e.has("OES_texture_float_linear") === !1) return;
+ if (x.type === qt && e.has("OES_texture_float_linear") === !1 && (x.magFilter === Mt || x.magFilter === vr || x.magFilter === bn || x.magFilter === wi || x.minFilter === Mt || x.minFilter === vr || x.minFilter === bn || x.minFilter === wi) && Se("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), n.texParameteri(C, n.TEXTURE_WRAP_S, Z[x.wrapS]), n.texParameteri(C, n.TEXTURE_WRAP_T, Z[x.wrapT]), (C === n.TEXTURE_3D || C === n.TEXTURE_2D_ARRAY) && n.texParameteri(C, n.TEXTURE_WRAP_R, Z[x.wrapR]), n.texParameteri(C, n.TEXTURE_MAG_FILTER, ne[x.magFilter]), n.texParameteri(C, n.TEXTURE_MIN_FILTER, ne[x.minFilter]), x.compareFunction && (n.texParameteri(C, n.TEXTURE_COMPARE_MODE, n.COMPARE_REF_TO_TEXTURE), n.texParameteri(C, n.TEXTURE_COMPARE_FUNC, Le[x.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
+ if (x.magFilter === Nt || x.minFilter !== bn && x.minFilter !== wi || x.type === qt && e.has("OES_texture_float_linear") === !1) return;
if (x.anisotropy > 1 || i.get(x).__currentAnisotropy) {
- const B = e.get("EXT_texture_filter_anisotropic");
- r.texParameterf(C, B.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(x.anisotropy, s.getMaxAnisotropy())), i.get(x).__currentAnisotropy = x.anisotropy;
+ const O = e.get("EXT_texture_filter_anisotropic");
+ n.texParameterf(C, O.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(x.anisotropy, s.getMaxAnisotropy())), i.get(x).__currentAnisotropy = x.anisotropy;
}
}
}
function Ye(C, x) {
- let B = !1;
+ let O = !1;
C.__webglInit === void 0 && (C.__webglInit = !0, x.addEventListener("dispose", T));
const X = x.source;
let K = d.get(X);
@@ -22779,234 +22847,234 @@ function Z0(r, e, t, i, s, n, a) {
const V = H(x);
if (V !== C.__cacheKey) {
K[V] === void 0 && (K[V] = {
- texture: r.createTexture(),
+ texture: n.createTexture(),
usedTimes: 0
- }, a.memory.textures++, B = !0), K[V].usedTimes++;
- const ye = K[C.__cacheKey];
- ye !== void 0 && (K[C.__cacheKey].usedTimes--, ye.usedTimes === 0 && S(x)), C.__cacheKey = V, C.__webglTexture = K[V].texture;
+ }, a.memory.textures++, O = !0), K[V].usedTimes++;
+ const be = K[C.__cacheKey];
+ be !== void 0 && (K[C.__cacheKey].usedTimes--, be.usedTimes === 0 && S(x)), C.__cacheKey = V, C.__webglTexture = K[V].texture;
}
- return B;
+ return O;
}
- function Ze(C, x, B) {
- return Math.floor(Math.floor(C / B) / x);
+ function $e(C, x, O) {
+ return Math.floor(Math.floor(C / O) / x);
}
- function $e(C, x, B, X) {
+ function Je(C, x, O, X) {
const K = C.updateRanges;
if (K.length === 0)
- t.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, x.width, x.height, B, X, x.data);
+ t.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, x.width, x.height, O, X, x.data);
else {
- K.sort((de, J) => de.start - J.start);
+ K.sort((pe, J) => pe.start - J.start);
let V = 0;
- for (let de = 1; de < K.length; de++) {
- const J = K[V], se = K[de], Be = J.start + J.count, Ce = Ze(se.start, x.width, 4), he = Ze(J.start, x.width, 4);
- se.start <= Be + 1 && Ce === he && Ze(se.start + se.count - 1, x.width, 4) === Ce ? J.count = Math.max(
+ for (let pe = 1; pe < K.length; pe++) {
+ const J = K[V], se = K[pe], Oe = J.start + J.count, Ce = $e(se.start, x.width, 4), ue = $e(J.start, x.width, 4);
+ se.start <= Oe + 1 && Ce === ue && $e(se.start + se.count - 1, x.width, 4) === Ce ? J.count = Math.max(
J.count,
se.start + se.count - J.start
) : (++V, K[V] = se);
}
K.length = V + 1;
- const ye = r.getParameter(r.UNPACK_ROW_LENGTH), ne = r.getParameter(r.UNPACK_SKIP_PIXELS), Ee = r.getParameter(r.UNPACK_SKIP_ROWS);
- r.pixelStorei(r.UNPACK_ROW_LENGTH, x.width);
- for (let de = 0, J = K.length; de < J; de++) {
- const se = K[de], Be = Math.floor(se.start / 4), Ce = Math.ceil(se.count / 4), he = Be % x.width, Re = Math.floor(Be / x.width), P = Ce;
- r.pixelStorei(r.UNPACK_SKIP_PIXELS, he), r.pixelStorei(r.UNPACK_SKIP_ROWS, Re), t.texSubImage2D(r.TEXTURE_2D, 0, he, Re, P, 1, B, X, x.data);
+ const be = n.getParameter(n.UNPACK_ROW_LENGTH), re = n.getParameter(n.UNPACK_SKIP_PIXELS), Ee = n.getParameter(n.UNPACK_SKIP_ROWS);
+ n.pixelStorei(n.UNPACK_ROW_LENGTH, x.width);
+ for (let pe = 0, J = K.length; pe < J; pe++) {
+ const se = K[pe], Oe = Math.floor(se.start / 4), Ce = Math.ceil(se.count / 4), ue = Oe % x.width, Re = Math.floor(Oe / x.width), P = Ce;
+ n.pixelStorei(n.UNPACK_SKIP_PIXELS, ue), n.pixelStorei(n.UNPACK_SKIP_ROWS, Re), t.texSubImage2D(n.TEXTURE_2D, 0, ue, Re, P, 1, O, X, x.data);
}
- C.clearUpdateRanges(), r.pixelStorei(r.UNPACK_ROW_LENGTH, ye), r.pixelStorei(r.UNPACK_SKIP_PIXELS, ne), r.pixelStorei(r.UNPACK_SKIP_ROWS, Ee);
+ C.clearUpdateRanges(), n.pixelStorei(n.UNPACK_ROW_LENGTH, be), n.pixelStorei(n.UNPACK_SKIP_PIXELS, re), n.pixelStorei(n.UNPACK_SKIP_ROWS, Ee);
}
}
- function W(C, x, B) {
- let X = r.TEXTURE_2D;
- (x.isDataArrayTexture || x.isCompressedArrayTexture) && (X = r.TEXTURE_2D_ARRAY), x.isData3DTexture && (X = r.TEXTURE_3D);
+ function W(C, x, O) {
+ let X = n.TEXTURE_2D;
+ (x.isDataArrayTexture || x.isCompressedArrayTexture) && (X = n.TEXTURE_2D_ARRAY), x.isData3DTexture && (X = n.TEXTURE_3D);
const K = Ye(C, x), V = x.source;
- t.bindTexture(X, C.__webglTexture, r.TEXTURE0 + B);
- const ye = i.get(V);
- if (V.version !== ye.__version || K === !0) {
- t.activeTexture(r.TEXTURE0 + B);
- const ne = qe.getPrimaries(qe.workingColorSpace), Ee = x.colorSpace === Qi ? null : qe.getPrimaries(x.colorSpace), de = x.colorSpace === Qi || ne === Ee ? r.NONE : r.BROWSER_DEFAULT_WEBGL;
- r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, x.flipY), r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, x.premultiplyAlpha), r.pixelStorei(r.UNPACK_ALIGNMENT, x.unpackAlignment), r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL, de);
+ t.bindTexture(X, C.__webglTexture, n.TEXTURE0 + O);
+ const be = i.get(V);
+ if (V.version !== be.__version || K === !0) {
+ t.activeTexture(n.TEXTURE0 + O);
+ const re = qe.getPrimaries(qe.workingColorSpace), Ee = x.colorSpace === Qi ? null : qe.getPrimaries(x.colorSpace), pe = x.colorSpace === Qi || re === Ee ? n.NONE : n.BROWSER_DEFAULT_WEBGL;
+ n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, x.flipY), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, x.premultiplyAlpha), n.pixelStorei(n.UNPACK_ALIGNMENT, x.unpackAlignment), n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL, pe);
let J = v(x.image, !1, s.maxTextureSize);
J = Me(x, J);
- const se = n.convert(x.format, x.colorSpace), Be = n.convert(x.type);
- let Ce = _(x.internalFormat, se, Be, x.colorSpace, x.isVideoTexture);
+ const se = r.convert(x.format, x.colorSpace), Oe = r.convert(x.type);
+ let Ce = _(x.internalFormat, se, Oe, x.colorSpace, x.isVideoTexture);
He(X, x);
- let he;
- const Re = x.mipmaps, P = x.isVideoTexture !== !0, ae = ye.__version === void 0 || K === !0, ie = V.dataReady, le = R(x, J);
+ let ue;
+ const Re = x.mipmaps, P = x.isVideoTexture !== !0, ae = be.__version === void 0 || K === !0, ie = V.dataReady, ce = R(x, J);
if (x.isDepthTexture)
- Ce = E(x.format === Ks, x.type), ae && (P ? t.texStorage2D(r.TEXTURE_2D, 1, Ce, J.width, J.height) : t.texImage2D(r.TEXTURE_2D, 0, Ce, J.width, J.height, 0, se, Be, null));
+ Ce = E(x.format === Ks, x.type), ae && (P ? t.texStorage2D(n.TEXTURE_2D, 1, Ce, J.width, J.height) : t.texImage2D(n.TEXTURE_2D, 0, Ce, J.width, J.height, 0, se, Oe, null));
else if (x.isDataTexture)
if (Re.length > 0) {
- P && ae && t.texStorage2D(r.TEXTURE_2D, le, Ce, Re[0].width, Re[0].height);
+ P && ae && t.texStorage2D(n.TEXTURE_2D, ce, Ce, Re[0].width, Re[0].height);
for (let Q = 0, $ = Re.length; Q < $; Q++)
- he = Re[Q], P ? ie && t.texSubImage2D(r.TEXTURE_2D, Q, 0, 0, he.width, he.height, se, Be, he.data) : t.texImage2D(r.TEXTURE_2D, Q, Ce, he.width, he.height, 0, se, Be, he.data);
+ ue = Re[Q], P ? ie && t.texSubImage2D(n.TEXTURE_2D, Q, 0, 0, ue.width, ue.height, se, Oe, ue.data) : t.texImage2D(n.TEXTURE_2D, Q, Ce, ue.width, ue.height, 0, se, Oe, ue.data);
x.generateMipmaps = !1;
} else
- P ? (ae && t.texStorage2D(r.TEXTURE_2D, le, Ce, J.width, J.height), ie && $e(x, J, se, Be)) : t.texImage2D(r.TEXTURE_2D, 0, Ce, J.width, J.height, 0, se, Be, J.data);
+ P ? (ae && t.texStorage2D(n.TEXTURE_2D, ce, Ce, J.width, J.height), ie && Je(x, J, se, Oe)) : t.texImage2D(n.TEXTURE_2D, 0, Ce, J.width, J.height, 0, se, Oe, J.data);
else if (x.isCompressedTexture)
if (x.isCompressedArrayTexture) {
- P && ae && t.texStorage3D(r.TEXTURE_2D_ARRAY, le, Ce, Re[0].width, Re[0].height, J.depth);
+ P && ae && t.texStorage3D(n.TEXTURE_2D_ARRAY, ce, Ce, Re[0].width, Re[0].height, J.depth);
for (let Q = 0, $ = Re.length; Q < $; Q++)
- if (he = Re[Q], x.format !== $t)
+ if (ue = Re[Q], x.format !== Jt)
if (se !== null)
if (P) {
if (ie)
if (x.layerUpdates.size > 0) {
- const _e = nc(he.width, he.height, x.format, x.type);
+ const _e = rc(ue.width, ue.height, x.format, x.type);
for (const Pe of x.layerUpdates) {
- const Ct = he.data.subarray(
- Pe * _e / he.data.BYTES_PER_ELEMENT,
- (Pe + 1) * _e / he.data.BYTES_PER_ELEMENT
+ const Ct = ue.data.subarray(
+ Pe * _e / ue.data.BYTES_PER_ELEMENT,
+ (Pe + 1) * _e / ue.data.BYTES_PER_ELEMENT
);
- t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY, Q, 0, 0, Pe, he.width, he.height, 1, se, Ct);
+ t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY, Q, 0, 0, Pe, ue.width, ue.height, 1, se, Ct);
}
x.clearLayerUpdates();
} else
- t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY, Q, 0, 0, 0, he.width, he.height, J.depth, se, he.data);
+ t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY, Q, 0, 0, 0, ue.width, ue.height, J.depth, se, ue.data);
} else
- t.compressedTexImage3D(r.TEXTURE_2D_ARRAY, Q, Ce, he.width, he.height, J.depth, 0, he.data, 0, 0);
+ t.compressedTexImage3D(n.TEXTURE_2D_ARRAY, Q, Ce, ue.width, ue.height, J.depth, 0, ue.data, 0, 0);
else
Se("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
else
- P ? ie && t.texSubImage3D(r.TEXTURE_2D_ARRAY, Q, 0, 0, 0, he.width, he.height, J.depth, se, Be, he.data) : t.texImage3D(r.TEXTURE_2D_ARRAY, Q, Ce, he.width, he.height, J.depth, 0, se, Be, he.data);
+ P ? ie && t.texSubImage3D(n.TEXTURE_2D_ARRAY, Q, 0, 0, 0, ue.width, ue.height, J.depth, se, Oe, ue.data) : t.texImage3D(n.TEXTURE_2D_ARRAY, Q, Ce, ue.width, ue.height, J.depth, 0, se, Oe, ue.data);
} else {
- P && ae && t.texStorage2D(r.TEXTURE_2D, le, Ce, Re[0].width, Re[0].height);
+ P && ae && t.texStorage2D(n.TEXTURE_2D, ce, Ce, Re[0].width, Re[0].height);
for (let Q = 0, $ = Re.length; Q < $; Q++)
- he = Re[Q], x.format !== $t ? se !== null ? P ? ie && t.compressedTexSubImage2D(r.TEXTURE_2D, Q, 0, 0, he.width, he.height, se, he.data) : t.compressedTexImage2D(r.TEXTURE_2D, Q, Ce, he.width, he.height, 0, he.data) : Se("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : P ? ie && t.texSubImage2D(r.TEXTURE_2D, Q, 0, 0, he.width, he.height, se, Be, he.data) : t.texImage2D(r.TEXTURE_2D, Q, Ce, he.width, he.height, 0, se, Be, he.data);
+ ue = Re[Q], x.format !== Jt ? se !== null ? P ? ie && t.compressedTexSubImage2D(n.TEXTURE_2D, Q, 0, 0, ue.width, ue.height, se, ue.data) : t.compressedTexImage2D(n.TEXTURE_2D, Q, Ce, ue.width, ue.height, 0, ue.data) : Se("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : P ? ie && t.texSubImage2D(n.TEXTURE_2D, Q, 0, 0, ue.width, ue.height, se, Oe, ue.data) : t.texImage2D(n.TEXTURE_2D, Q, Ce, ue.width, ue.height, 0, se, Oe, ue.data);
}
else if (x.isDataArrayTexture)
if (P) {
- if (ae && t.texStorage3D(r.TEXTURE_2D_ARRAY, le, Ce, J.width, J.height, J.depth), ie)
+ if (ae && t.texStorage3D(n.TEXTURE_2D_ARRAY, ce, Ce, J.width, J.height, J.depth), ie)
if (x.layerUpdates.size > 0) {
- const Q = nc(J.width, J.height, x.format, x.type);
+ const Q = rc(J.width, J.height, x.format, x.type);
for (const $ of x.layerUpdates) {
const _e = J.data.subarray(
$ * Q / J.data.BYTES_PER_ELEMENT,
($ + 1) * Q / J.data.BYTES_PER_ELEMENT
);
- t.texSubImage3D(r.TEXTURE_2D_ARRAY, 0, 0, 0, $, J.width, J.height, 1, se, Be, _e);
+ t.texSubImage3D(n.TEXTURE_2D_ARRAY, 0, 0, 0, $, J.width, J.height, 1, se, Oe, _e);
}
x.clearLayerUpdates();
} else
- t.texSubImage3D(r.TEXTURE_2D_ARRAY, 0, 0, 0, 0, J.width, J.height, J.depth, se, Be, J.data);
+ t.texSubImage3D(n.TEXTURE_2D_ARRAY, 0, 0, 0, 0, J.width, J.height, J.depth, se, Oe, J.data);
} else
- t.texImage3D(r.TEXTURE_2D_ARRAY, 0, Ce, J.width, J.height, J.depth, 0, se, Be, J.data);
+ t.texImage3D(n.TEXTURE_2D_ARRAY, 0, Ce, J.width, J.height, J.depth, 0, se, Oe, J.data);
else if (x.isData3DTexture)
- P ? (ae && t.texStorage3D(r.TEXTURE_3D, le, Ce, J.width, J.height, J.depth), ie && t.texSubImage3D(r.TEXTURE_3D, 0, 0, 0, 0, J.width, J.height, J.depth, se, Be, J.data)) : t.texImage3D(r.TEXTURE_3D, 0, Ce, J.width, J.height, J.depth, 0, se, Be, J.data);
+ P ? (ae && t.texStorage3D(n.TEXTURE_3D, ce, Ce, J.width, J.height, J.depth), ie && t.texSubImage3D(n.TEXTURE_3D, 0, 0, 0, 0, J.width, J.height, J.depth, se, Oe, J.data)) : t.texImage3D(n.TEXTURE_3D, 0, Ce, J.width, J.height, J.depth, 0, se, Oe, J.data);
else if (x.isFramebufferTexture) {
if (ae)
if (P)
- t.texStorage2D(r.TEXTURE_2D, le, Ce, J.width, J.height);
+ t.texStorage2D(n.TEXTURE_2D, ce, Ce, J.width, J.height);
else {
let Q = J.width, $ = J.height;
- for (let _e = 0; _e < le; _e++)
- t.texImage2D(r.TEXTURE_2D, _e, Ce, Q, $, 0, se, Be, null), Q >>= 1, $ >>= 1;
+ for (let _e = 0; _e < ce; _e++)
+ t.texImage2D(n.TEXTURE_2D, _e, Ce, Q, $, 0, se, Oe, null), Q >>= 1, $ >>= 1;
}
} else if (Re.length > 0) {
if (P && ae) {
const Q = De(Re[0]);
- t.texStorage2D(r.TEXTURE_2D, le, Ce, Q.width, Q.height);
+ t.texStorage2D(n.TEXTURE_2D, ce, Ce, Q.width, Q.height);
}
for (let Q = 0, $ = Re.length; Q < $; Q++)
- he = Re[Q], P ? ie && t.texSubImage2D(r.TEXTURE_2D, Q, 0, 0, se, Be, he) : t.texImage2D(r.TEXTURE_2D, Q, Ce, se, Be, he);
+ ue = Re[Q], P ? ie && t.texSubImage2D(n.TEXTURE_2D, Q, 0, 0, se, Oe, ue) : t.texImage2D(n.TEXTURE_2D, Q, Ce, se, Oe, ue);
x.generateMipmaps = !1;
} else if (P) {
if (ae) {
const Q = De(J);
- t.texStorage2D(r.TEXTURE_2D, le, Ce, Q.width, Q.height);
+ t.texStorage2D(n.TEXTURE_2D, ce, Ce, Q.width, Q.height);
}
- ie && t.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, se, Be, J);
+ ie && t.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, se, Oe, J);
} else
- t.texImage2D(r.TEXTURE_2D, 0, Ce, se, Be, J);
- f(x) && p(X), ye.__version = V.version, x.onUpdate && x.onUpdate(x);
+ t.texImage2D(n.TEXTURE_2D, 0, Ce, se, Oe, J);
+ f(x) && p(X), be.__version = V.version, x.onUpdate && x.onUpdate(x);
}
C.__version = x.version;
}
- function Y(C, x, B) {
+ function Y(C, x, O) {
if (x.image.length !== 6) return;
const X = Ye(C, x), K = x.source;
- t.bindTexture(r.TEXTURE_CUBE_MAP, C.__webglTexture, r.TEXTURE0 + B);
+ t.bindTexture(n.TEXTURE_CUBE_MAP, C.__webglTexture, n.TEXTURE0 + O);
const V = i.get(K);
if (K.version !== V.__version || X === !0) {
- t.activeTexture(r.TEXTURE0 + B);
- const ye = qe.getPrimaries(qe.workingColorSpace), ne = x.colorSpace === Qi ? null : qe.getPrimaries(x.colorSpace), Ee = x.colorSpace === Qi || ye === ne ? r.NONE : r.BROWSER_DEFAULT_WEBGL;
- r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, x.flipY), r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, x.premultiplyAlpha), r.pixelStorei(r.UNPACK_ALIGNMENT, x.unpackAlignment), r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL, Ee);
- const de = x.isCompressedTexture || x.image[0].isCompressedTexture, J = x.image[0] && x.image[0].isDataTexture, se = [];
+ t.activeTexture(n.TEXTURE0 + O);
+ const be = qe.getPrimaries(qe.workingColorSpace), re = x.colorSpace === Qi ? null : qe.getPrimaries(x.colorSpace), Ee = x.colorSpace === Qi || be === re ? n.NONE : n.BROWSER_DEFAULT_WEBGL;
+ n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, x.flipY), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, x.premultiplyAlpha), n.pixelStorei(n.UNPACK_ALIGNMENT, x.unpackAlignment), n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL, Ee);
+ const pe = x.isCompressedTexture || x.image[0].isCompressedTexture, J = x.image[0] && x.image[0].isDataTexture, se = [];
for (let $ = 0; $ < 6; $++)
- !de && !J ? se[$] = v(x.image[$], !0, s.maxCubemapSize) : se[$] = J ? x.image[$].image : x.image[$], se[$] = Me(x, se[$]);
- const Be = se[0], Ce = n.convert(x.format, x.colorSpace), he = n.convert(x.type), Re = _(x.internalFormat, Ce, he, x.colorSpace), P = x.isVideoTexture !== !0, ae = V.__version === void 0 || X === !0, ie = K.dataReady;
- let le = R(x, Be);
- He(r.TEXTURE_CUBE_MAP, x);
+ !pe && !J ? se[$] = v(x.image[$], !0, s.maxCubemapSize) : se[$] = J ? x.image[$].image : x.image[$], se[$] = Me(x, se[$]);
+ const Oe = se[0], Ce = r.convert(x.format, x.colorSpace), ue = r.convert(x.type), Re = _(x.internalFormat, Ce, ue, x.colorSpace), P = x.isVideoTexture !== !0, ae = V.__version === void 0 || X === !0, ie = K.dataReady;
+ let ce = R(x, Oe);
+ He(n.TEXTURE_CUBE_MAP, x);
let Q;
- if (de) {
- P && ae && t.texStorage2D(r.TEXTURE_CUBE_MAP, le, Re, Be.width, Be.height);
+ if (pe) {
+ P && ae && t.texStorage2D(n.TEXTURE_CUBE_MAP, ce, Re, Oe.width, Oe.height);
for (let $ = 0; $ < 6; $++) {
Q = se[$].mipmaps;
for (let _e = 0; _e < Q.length; _e++) {
const Pe = Q[_e];
- x.format !== $t ? Ce !== null ? P ? ie && t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, 0, 0, Pe.width, Pe.height, Ce, Pe.data) : t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, Re, Pe.width, Pe.height, 0, Pe.data) : Se("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : P ? ie && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, 0, 0, Pe.width, Pe.height, Ce, he, Pe.data) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, Re, Pe.width, Pe.height, 0, Ce, he, Pe.data);
+ x.format !== Jt ? Ce !== null ? P ? ie && t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, 0, 0, Pe.width, Pe.height, Ce, Pe.data) : t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, Re, Pe.width, Pe.height, 0, Pe.data) : Se("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : P ? ie && t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, 0, 0, Pe.width, Pe.height, Ce, ue, Pe.data) : t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e, Re, Pe.width, Pe.height, 0, Ce, ue, Pe.data);
}
}
} else {
if (Q = x.mipmaps, P && ae) {
- Q.length > 0 && le++;
+ Q.length > 0 && ce++;
const $ = De(se[0]);
- t.texStorage2D(r.TEXTURE_CUBE_MAP, le, Re, $.width, $.height);
+ t.texStorage2D(n.TEXTURE_CUBE_MAP, ce, Re, $.width, $.height);
}
for (let $ = 0; $ < 6; $++)
if (J) {
- P ? ie && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, 0, 0, se[$].width, se[$].height, Ce, he, se[$].data) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, Re, se[$].width, se[$].height, 0, Ce, he, se[$].data);
+ P ? ie && t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, 0, 0, se[$].width, se[$].height, Ce, ue, se[$].data) : t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, Re, se[$].width, se[$].height, 0, Ce, ue, se[$].data);
for (let _e = 0; _e < Q.length; _e++) {
const Pe = Q[_e].image[$].image;
- P ? ie && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, 0, 0, Pe.width, Pe.height, Ce, he, Pe.data) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, Re, Pe.width, Pe.height, 0, Ce, he, Pe.data);
+ P ? ie && t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, 0, 0, Pe.width, Pe.height, Ce, ue, Pe.data) : t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, Re, Pe.width, Pe.height, 0, Ce, ue, Pe.data);
}
} else {
- P ? ie && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, 0, 0, Ce, he, se[$]) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, Re, Ce, he, se[$]);
+ P ? ie && t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, 0, 0, Ce, ue, se[$]) : t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, 0, Re, Ce, ue, se[$]);
for (let _e = 0; _e < Q.length; _e++) {
const Pe = Q[_e];
- P ? ie && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, 0, 0, Ce, he, Pe.image[$]) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, Re, Ce, he, Pe.image[$]);
+ P ? ie && t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, 0, 0, Ce, ue, Pe.image[$]) : t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + $, _e + 1, Re, Ce, ue, Pe.image[$]);
}
}
}
- f(x) && p(r.TEXTURE_CUBE_MAP), V.__version = K.version, x.onUpdate && x.onUpdate(x);
+ f(x) && p(n.TEXTURE_CUBE_MAP), V.__version = K.version, x.onUpdate && x.onUpdate(x);
}
C.__version = x.version;
}
- function ue(C, x, B, X, K, V) {
- const ye = n.convert(B.format, B.colorSpace), ne = n.convert(B.type), Ee = _(B.internalFormat, ye, ne, B.colorSpace), de = i.get(x), J = i.get(B);
- if (J.__renderTarget = x, !de.__hasExternalTextures) {
- const se = Math.max(1, x.width >> V), Be = Math.max(1, x.height >> V);
- K === r.TEXTURE_3D || K === r.TEXTURE_2D_ARRAY ? t.texImage3D(K, V, Ee, se, Be, x.depth, 0, ye, ne, null) : t.texImage2D(K, V, Ee, se, Be, 0, ye, ne, null);
+ function de(C, x, O, X, K, V) {
+ const be = r.convert(O.format, O.colorSpace), re = r.convert(O.type), Ee = _(O.internalFormat, be, re, O.colorSpace), pe = i.get(x), J = i.get(O);
+ if (J.__renderTarget = x, !pe.__hasExternalTextures) {
+ const se = Math.max(1, x.width >> V), Oe = Math.max(1, x.height >> V);
+ K === n.TEXTURE_3D || K === n.TEXTURE_2D_ARRAY ? t.texImage3D(K, V, Ee, se, Oe, x.depth, 0, be, re, null) : t.texImage2D(K, V, Ee, se, Oe, 0, be, re, null);
}
- t.bindFramebuffer(r.FRAMEBUFFER, C), fe(x) ? o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER, X, K, J.__webglTexture, 0, et(x)) : (K === r.TEXTURE_2D || K >= r.TEXTURE_CUBE_MAP_POSITIVE_X && K <= r.TEXTURE_CUBE_MAP_NEGATIVE_Z) && r.framebufferTexture2D(r.FRAMEBUFFER, X, K, J.__webglTexture, V), t.bindFramebuffer(r.FRAMEBUFFER, null);
+ t.bindFramebuffer(n.FRAMEBUFFER, C), fe(x) ? o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER, X, K, J.__webglTexture, 0, tt(x)) : (K === n.TEXTURE_2D || K >= n.TEXTURE_CUBE_MAP_POSITIVE_X && K <= n.TEXTURE_CUBE_MAP_NEGATIVE_Z) && n.framebufferTexture2D(n.FRAMEBUFFER, X, K, J.__webglTexture, V), t.bindFramebuffer(n.FRAMEBUFFER, null);
}
- function Ae(C, x, B) {
- if (r.bindRenderbuffer(r.RENDERBUFFER, C), x.depthBuffer) {
- const X = x.depthTexture, K = X && X.isDepthTexture ? X.type : null, V = E(x.stencilBuffer, K), ye = x.stencilBuffer ? r.DEPTH_STENCIL_ATTACHMENT : r.DEPTH_ATTACHMENT, ne = et(x);
- fe(x) ? o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER, ne, V, x.width, x.height) : B ? r.renderbufferStorageMultisample(r.RENDERBUFFER, ne, V, x.width, x.height) : r.renderbufferStorage(r.RENDERBUFFER, V, x.width, x.height), r.framebufferRenderbuffer(r.FRAMEBUFFER, ye, r.RENDERBUFFER, C);
+ function Ae(C, x, O) {
+ if (n.bindRenderbuffer(n.RENDERBUFFER, C), x.depthBuffer) {
+ const X = x.depthTexture, K = X && X.isDepthTexture ? X.type : null, V = E(x.stencilBuffer, K), be = x.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT, re = tt(x);
+ fe(x) ? o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, re, V, x.width, x.height) : O ? n.renderbufferStorageMultisample(n.RENDERBUFFER, re, V, x.width, x.height) : n.renderbufferStorage(n.RENDERBUFFER, V, x.width, x.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, be, n.RENDERBUFFER, C);
} else {
const X = x.textures;
for (let K = 0; K < X.length; K++) {
- const V = X[K], ye = n.convert(V.format, V.colorSpace), ne = n.convert(V.type), Ee = _(V.internalFormat, ye, ne, V.colorSpace), de = et(x);
- B && fe(x) === !1 ? r.renderbufferStorageMultisample(r.RENDERBUFFER, de, Ee, x.width, x.height) : fe(x) ? o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER, de, Ee, x.width, x.height) : r.renderbufferStorage(r.RENDERBUFFER, Ee, x.width, x.height);
+ const V = X[K], be = r.convert(V.format, V.colorSpace), re = r.convert(V.type), Ee = _(V.internalFormat, be, re, V.colorSpace), pe = tt(x);
+ O && fe(x) === !1 ? n.renderbufferStorageMultisample(n.RENDERBUFFER, pe, Ee, x.width, x.height) : fe(x) ? o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, pe, Ee, x.width, x.height) : n.renderbufferStorage(n.RENDERBUFFER, Ee, x.width, x.height);
}
}
- r.bindRenderbuffer(r.RENDERBUFFER, null);
+ n.bindRenderbuffer(n.RENDERBUFFER, null);
}
function Te(C, x) {
if (x && x.isWebGLCubeRenderTarget) throw new Error("Depth Texture with cube render targets is not supported");
- if (t.bindFramebuffer(r.FRAMEBUFFER, C), !(x.depthTexture && x.depthTexture.isDepthTexture))
+ if (t.bindFramebuffer(n.FRAMEBUFFER, C), !(x.depthTexture && x.depthTexture.isDepthTexture))
throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
- const B = i.get(x.depthTexture);
- B.__renderTarget = x, (!B.__webglTexture || x.depthTexture.image.width !== x.width || x.depthTexture.image.height !== x.height) && (x.depthTexture.image.width = x.width, x.depthTexture.image.height = x.height, x.depthTexture.needsUpdate = !0), j(x.depthTexture, 0);
- const X = B.__webglTexture, K = et(x);
- if (x.depthTexture.format === Cr)
- fe(x) ? o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER, r.DEPTH_ATTACHMENT, r.TEXTURE_2D, X, 0, K) : r.framebufferTexture2D(r.FRAMEBUFFER, r.DEPTH_ATTACHMENT, r.TEXTURE_2D, X, 0);
+ const O = i.get(x.depthTexture);
+ O.__renderTarget = x, (!O.__webglTexture || x.depthTexture.image.width !== x.width || x.depthTexture.image.height !== x.height) && (x.depthTexture.image.width = x.width, x.depthTexture.image.height = x.height, x.depthTexture.needsUpdate = !0), j(x.depthTexture, 0);
+ const X = O.__webglTexture, K = tt(x);
+ if (x.depthTexture.format === An)
+ fe(x) ? o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER, n.DEPTH_ATTACHMENT, n.TEXTURE_2D, X, 0, K) : n.framebufferTexture2D(n.FRAMEBUFFER, n.DEPTH_ATTACHMENT, n.TEXTURE_2D, X, 0);
else if (x.depthTexture.format === Ks)
- fe(x) ? o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER, r.DEPTH_STENCIL_ATTACHMENT, r.TEXTURE_2D, X, 0, K) : r.framebufferTexture2D(r.FRAMEBUFFER, r.DEPTH_STENCIL_ATTACHMENT, r.TEXTURE_2D, X, 0);
+ fe(x) ? o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER, n.DEPTH_STENCIL_ATTACHMENT, n.TEXTURE_2D, X, 0, K) : n.framebufferTexture2D(n.FRAMEBUFFER, n.DEPTH_STENCIL_ATTACHMENT, n.TEXTURE_2D, X, 0);
else
throw new Error("Unknown depthTexture format");
}
function we(C) {
- const x = i.get(C), B = C.isWebGLCubeRenderTarget === !0;
+ const x = i.get(C), O = C.isWebGLCubeRenderTarget === !0;
if (x.__boundDepthTexture !== C.depthTexture) {
const X = C.depthTexture;
if (x.__depthDisposeCallback && x.__depthDisposeCallback(), X) {
@@ -23018,103 +23086,103 @@ function Z0(r, e, t, i, s, n, a) {
x.__boundDepthTexture = X;
}
if (C.depthTexture && !x.__autoAllocateDepthBuffer) {
- if (B) throw new Error("target.depthTexture not supported in Cube render targets");
+ if (O) throw new Error("target.depthTexture not supported in Cube render targets");
const X = C.texture.mipmaps;
X && X.length > 0 ? Te(x.__webglFramebuffer[0], C) : Te(x.__webglFramebuffer, C);
- } else if (B) {
+ } else if (O) {
x.__webglDepthbuffer = [];
for (let X = 0; X < 6; X++)
- if (t.bindFramebuffer(r.FRAMEBUFFER, x.__webglFramebuffer[X]), x.__webglDepthbuffer[X] === void 0)
- x.__webglDepthbuffer[X] = r.createRenderbuffer(), Ae(x.__webglDepthbuffer[X], C, !1);
+ if (t.bindFramebuffer(n.FRAMEBUFFER, x.__webglFramebuffer[X]), x.__webglDepthbuffer[X] === void 0)
+ x.__webglDepthbuffer[X] = n.createRenderbuffer(), Ae(x.__webglDepthbuffer[X], C, !1);
else {
- const K = C.stencilBuffer ? r.DEPTH_STENCIL_ATTACHMENT : r.DEPTH_ATTACHMENT, V = x.__webglDepthbuffer[X];
- r.bindRenderbuffer(r.RENDERBUFFER, V), r.framebufferRenderbuffer(r.FRAMEBUFFER, K, r.RENDERBUFFER, V);
+ const K = C.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT, V = x.__webglDepthbuffer[X];
+ n.bindRenderbuffer(n.RENDERBUFFER, V), n.framebufferRenderbuffer(n.FRAMEBUFFER, K, n.RENDERBUFFER, V);
}
} else {
const X = C.texture.mipmaps;
- if (X && X.length > 0 ? t.bindFramebuffer(r.FRAMEBUFFER, x.__webglFramebuffer[0]) : t.bindFramebuffer(r.FRAMEBUFFER, x.__webglFramebuffer), x.__webglDepthbuffer === void 0)
- x.__webglDepthbuffer = r.createRenderbuffer(), Ae(x.__webglDepthbuffer, C, !1);
+ if (X && X.length > 0 ? t.bindFramebuffer(n.FRAMEBUFFER, x.__webglFramebuffer[0]) : t.bindFramebuffer(n.FRAMEBUFFER, x.__webglFramebuffer), x.__webglDepthbuffer === void 0)
+ x.__webglDepthbuffer = n.createRenderbuffer(), Ae(x.__webglDepthbuffer, C, !1);
else {
- const K = C.stencilBuffer ? r.DEPTH_STENCIL_ATTACHMENT : r.DEPTH_ATTACHMENT, V = x.__webglDepthbuffer;
- r.bindRenderbuffer(r.RENDERBUFFER, V), r.framebufferRenderbuffer(r.FRAMEBUFFER, K, r.RENDERBUFFER, V);
+ const K = C.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT, V = x.__webglDepthbuffer;
+ n.bindRenderbuffer(n.RENDERBUFFER, V), n.framebufferRenderbuffer(n.FRAMEBUFFER, K, n.RENDERBUFFER, V);
}
}
- t.bindFramebuffer(r.FRAMEBUFFER, null);
+ t.bindFramebuffer(n.FRAMEBUFFER, null);
}
- function Qe(C, x, B) {
+ function et(C, x, O) {
const X = i.get(C);
- x !== void 0 && ue(X.__webglFramebuffer, C, C.texture, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, 0), B !== void 0 && we(C);
+ x !== void 0 && de(X.__webglFramebuffer, C, C.texture, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, 0), O !== void 0 && we(C);
}
function Xe(C) {
- const x = C.texture, B = i.get(C), X = i.get(x);
+ const x = C.texture, O = i.get(C), X = i.get(x);
C.addEventListener("dispose", A);
- const K = C.textures, V = C.isWebGLCubeRenderTarget === !0, ye = K.length > 1;
- if (ye || (X.__webglTexture === void 0 && (X.__webglTexture = r.createTexture()), X.__version = x.version, a.memory.textures++), V) {
- B.__webglFramebuffer = [];
- for (let ne = 0; ne < 6; ne++)
+ const K = C.textures, V = C.isWebGLCubeRenderTarget === !0, be = K.length > 1;
+ if (be || (X.__webglTexture === void 0 && (X.__webglTexture = n.createTexture()), X.__version = x.version, a.memory.textures++), V) {
+ O.__webglFramebuffer = [];
+ for (let re = 0; re < 6; re++)
if (x.mipmaps && x.mipmaps.length > 0) {
- B.__webglFramebuffer[ne] = [];
+ O.__webglFramebuffer[re] = [];
for (let Ee = 0; Ee < x.mipmaps.length; Ee++)
- B.__webglFramebuffer[ne][Ee] = r.createFramebuffer();
+ O.__webglFramebuffer[re][Ee] = n.createFramebuffer();
} else
- B.__webglFramebuffer[ne] = r.createFramebuffer();
+ O.__webglFramebuffer[re] = n.createFramebuffer();
} else {
if (x.mipmaps && x.mipmaps.length > 0) {
- B.__webglFramebuffer = [];
- for (let ne = 0; ne < x.mipmaps.length; ne++)
- B.__webglFramebuffer[ne] = r.createFramebuffer();
+ O.__webglFramebuffer = [];
+ for (let re = 0; re < x.mipmaps.length; re++)
+ O.__webglFramebuffer[re] = n.createFramebuffer();
} else
- B.__webglFramebuffer = r.createFramebuffer();
- if (ye)
- for (let ne = 0, Ee = K.length; ne < Ee; ne++) {
- const de = i.get(K[ne]);
- de.__webglTexture === void 0 && (de.__webglTexture = r.createTexture(), a.memory.textures++);
+ O.__webglFramebuffer = n.createFramebuffer();
+ if (be)
+ for (let re = 0, Ee = K.length; re < Ee; re++) {
+ const pe = i.get(K[re]);
+ pe.__webglTexture === void 0 && (pe.__webglTexture = n.createTexture(), a.memory.textures++);
}
if (C.samples > 0 && fe(C) === !1) {
- B.__webglMultisampledFramebuffer = r.createFramebuffer(), B.__webglColorRenderbuffer = [], t.bindFramebuffer(r.FRAMEBUFFER, B.__webglMultisampledFramebuffer);
- for (let ne = 0; ne < K.length; ne++) {
- const Ee = K[ne];
- B.__webglColorRenderbuffer[ne] = r.createRenderbuffer(), r.bindRenderbuffer(r.RENDERBUFFER, B.__webglColorRenderbuffer[ne]);
- const de = n.convert(Ee.format, Ee.colorSpace), J = n.convert(Ee.type), se = _(Ee.internalFormat, de, J, Ee.colorSpace, C.isXRRenderTarget === !0), Be = et(C);
- r.renderbufferStorageMultisample(r.RENDERBUFFER, Be, se, C.width, C.height), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0 + ne, r.RENDERBUFFER, B.__webglColorRenderbuffer[ne]);
+ O.__webglMultisampledFramebuffer = n.createFramebuffer(), O.__webglColorRenderbuffer = [], t.bindFramebuffer(n.FRAMEBUFFER, O.__webglMultisampledFramebuffer);
+ for (let re = 0; re < K.length; re++) {
+ const Ee = K[re];
+ O.__webglColorRenderbuffer[re] = n.createRenderbuffer(), n.bindRenderbuffer(n.RENDERBUFFER, O.__webglColorRenderbuffer[re]);
+ const pe = r.convert(Ee.format, Ee.colorSpace), J = r.convert(Ee.type), se = _(Ee.internalFormat, pe, J, Ee.colorSpace, C.isXRRenderTarget === !0), Oe = tt(C);
+ n.renderbufferStorageMultisample(n.RENDERBUFFER, Oe, se, C.width, C.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0 + re, n.RENDERBUFFER, O.__webglColorRenderbuffer[re]);
}
- r.bindRenderbuffer(r.RENDERBUFFER, null), C.depthBuffer && (B.__webglDepthRenderbuffer = r.createRenderbuffer(), Ae(B.__webglDepthRenderbuffer, C, !0)), t.bindFramebuffer(r.FRAMEBUFFER, null);
+ n.bindRenderbuffer(n.RENDERBUFFER, null), C.depthBuffer && (O.__webglDepthRenderbuffer = n.createRenderbuffer(), Ae(O.__webglDepthRenderbuffer, C, !0)), t.bindFramebuffer(n.FRAMEBUFFER, null);
}
}
if (V) {
- t.bindTexture(r.TEXTURE_CUBE_MAP, X.__webglTexture), He(r.TEXTURE_CUBE_MAP, x);
- for (let ne = 0; ne < 6; ne++)
+ t.bindTexture(n.TEXTURE_CUBE_MAP, X.__webglTexture), He(n.TEXTURE_CUBE_MAP, x);
+ for (let re = 0; re < 6; re++)
if (x.mipmaps && x.mipmaps.length > 0)
for (let Ee = 0; Ee < x.mipmaps.length; Ee++)
- ue(B.__webglFramebuffer[ne][Ee], C, x, r.COLOR_ATTACHMENT0, r.TEXTURE_CUBE_MAP_POSITIVE_X + ne, Ee);
+ de(O.__webglFramebuffer[re][Ee], C, x, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + re, Ee);
else
- ue(B.__webglFramebuffer[ne], C, x, r.COLOR_ATTACHMENT0, r.TEXTURE_CUBE_MAP_POSITIVE_X + ne, 0);
- f(x) && p(r.TEXTURE_CUBE_MAP), t.unbindTexture();
- } else if (ye) {
- for (let ne = 0, Ee = K.length; ne < Ee; ne++) {
- const de = K[ne], J = i.get(de);
- let se = r.TEXTURE_2D;
- (C.isWebGL3DRenderTarget || C.isWebGLArrayRenderTarget) && (se = C.isWebGL3DRenderTarget ? r.TEXTURE_3D : r.TEXTURE_2D_ARRAY), t.bindTexture(se, J.__webglTexture), He(se, de), ue(B.__webglFramebuffer, C, de, r.COLOR_ATTACHMENT0 + ne, se, 0), f(de) && p(se);
+ de(O.__webglFramebuffer[re], C, x, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + re, 0);
+ f(x) && p(n.TEXTURE_CUBE_MAP), t.unbindTexture();
+ } else if (be) {
+ for (let re = 0, Ee = K.length; re < Ee; re++) {
+ const pe = K[re], J = i.get(pe);
+ let se = n.TEXTURE_2D;
+ (C.isWebGL3DRenderTarget || C.isWebGLArrayRenderTarget) && (se = C.isWebGL3DRenderTarget ? n.TEXTURE_3D : n.TEXTURE_2D_ARRAY), t.bindTexture(se, J.__webglTexture), He(se, pe), de(O.__webglFramebuffer, C, pe, n.COLOR_ATTACHMENT0 + re, se, 0), f(pe) && p(se);
}
t.unbindTexture();
} else {
- let ne = r.TEXTURE_2D;
- if ((C.isWebGL3DRenderTarget || C.isWebGLArrayRenderTarget) && (ne = C.isWebGL3DRenderTarget ? r.TEXTURE_3D : r.TEXTURE_2D_ARRAY), t.bindTexture(ne, X.__webglTexture), He(ne, x), x.mipmaps && x.mipmaps.length > 0)
+ let re = n.TEXTURE_2D;
+ if ((C.isWebGL3DRenderTarget || C.isWebGLArrayRenderTarget) && (re = C.isWebGL3DRenderTarget ? n.TEXTURE_3D : n.TEXTURE_2D_ARRAY), t.bindTexture(re, X.__webglTexture), He(re, x), x.mipmaps && x.mipmaps.length > 0)
for (let Ee = 0; Ee < x.mipmaps.length; Ee++)
- ue(B.__webglFramebuffer[Ee], C, x, r.COLOR_ATTACHMENT0, ne, Ee);
+ de(O.__webglFramebuffer[Ee], C, x, n.COLOR_ATTACHMENT0, re, Ee);
else
- ue(B.__webglFramebuffer, C, x, r.COLOR_ATTACHMENT0, ne, 0);
- f(x) && p(ne), t.unbindTexture();
+ de(O.__webglFramebuffer, C, x, n.COLOR_ATTACHMENT0, re, 0);
+ f(x) && p(re), t.unbindTexture();
}
C.depthBuffer && we(C);
}
function Ge(C) {
const x = C.textures;
- for (let B = 0, X = x.length; B < X; B++) {
- const K = x[B];
+ for (let O = 0, X = x.length; O < X; O++) {
+ const K = x[O];
if (f(K)) {
- const V = y(C), ye = i.get(K).__webglTexture;
- t.bindTexture(V, ye), p(V), t.unbindTexture();
+ const V = b(C), be = i.get(K).__webglTexture;
+ t.bindTexture(V, be), p(V), t.unbindTexture();
}
}
}
@@ -23122,146 +23190,146 @@ function Z0(r, e, t, i, s, n, a) {
function je(C) {
if (C.samples > 0) {
if (fe(C) === !1) {
- const x = C.textures, B = C.width, X = C.height;
- let K = r.COLOR_BUFFER_BIT;
- const V = C.stencilBuffer ? r.DEPTH_STENCIL_ATTACHMENT : r.DEPTH_ATTACHMENT, ye = i.get(C), ne = x.length > 1;
- if (ne)
- for (let de = 0; de < x.length; de++)
- t.bindFramebuffer(r.FRAMEBUFFER, ye.__webglMultisampledFramebuffer), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0 + de, r.RENDERBUFFER, null), t.bindFramebuffer(r.FRAMEBUFFER, ye.__webglFramebuffer), r.framebufferTexture2D(r.DRAW_FRAMEBUFFER, r.COLOR_ATTACHMENT0 + de, r.TEXTURE_2D, null, 0);
- t.bindFramebuffer(r.READ_FRAMEBUFFER, ye.__webglMultisampledFramebuffer);
+ const x = C.textures, O = C.width, X = C.height;
+ let K = n.COLOR_BUFFER_BIT;
+ const V = C.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT, be = i.get(C), re = x.length > 1;
+ if (re)
+ for (let pe = 0; pe < x.length; pe++)
+ t.bindFramebuffer(n.FRAMEBUFFER, be.__webglMultisampledFramebuffer), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0 + pe, n.RENDERBUFFER, null), t.bindFramebuffer(n.FRAMEBUFFER, be.__webglFramebuffer), n.framebufferTexture2D(n.DRAW_FRAMEBUFFER, n.COLOR_ATTACHMENT0 + pe, n.TEXTURE_2D, null, 0);
+ t.bindFramebuffer(n.READ_FRAMEBUFFER, be.__webglMultisampledFramebuffer);
const Ee = C.texture.mipmaps;
- Ee && Ee.length > 0 ? t.bindFramebuffer(r.DRAW_FRAMEBUFFER, ye.__webglFramebuffer[0]) : t.bindFramebuffer(r.DRAW_FRAMEBUFFER, ye.__webglFramebuffer);
- for (let de = 0; de < x.length; de++) {
- if (C.resolveDepthBuffer && (C.depthBuffer && (K |= r.DEPTH_BUFFER_BIT), C.stencilBuffer && C.resolveStencilBuffer && (K |= r.STENCIL_BUFFER_BIT)), ne) {
- r.framebufferRenderbuffer(r.READ_FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.RENDERBUFFER, ye.__webglColorRenderbuffer[de]);
- const J = i.get(x[de]).__webglTexture;
- r.framebufferTexture2D(r.DRAW_FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, J, 0);
+ Ee && Ee.length > 0 ? t.bindFramebuffer(n.DRAW_FRAMEBUFFER, be.__webglFramebuffer[0]) : t.bindFramebuffer(n.DRAW_FRAMEBUFFER, be.__webglFramebuffer);
+ for (let pe = 0; pe < x.length; pe++) {
+ if (C.resolveDepthBuffer && (C.depthBuffer && (K |= n.DEPTH_BUFFER_BIT), C.stencilBuffer && C.resolveStencilBuffer && (K |= n.STENCIL_BUFFER_BIT)), re) {
+ n.framebufferRenderbuffer(n.READ_FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.RENDERBUFFER, be.__webglColorRenderbuffer[pe]);
+ const J = i.get(x[pe]).__webglTexture;
+ n.framebufferTexture2D(n.DRAW_FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, J, 0);
}
- r.blitFramebuffer(0, 0, B, X, 0, 0, B, X, K, r.NEAREST), l === !0 && (D.length = 0, _t.length = 0, D.push(r.COLOR_ATTACHMENT0 + de), C.depthBuffer && C.resolveDepthBuffer === !1 && (D.push(V), _t.push(V), r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER, _t)), r.invalidateFramebuffer(r.READ_FRAMEBUFFER, D));
+ n.blitFramebuffer(0, 0, O, X, 0, 0, O, X, K, n.NEAREST), l === !0 && (D.length = 0, _t.length = 0, D.push(n.COLOR_ATTACHMENT0 + pe), C.depthBuffer && C.resolveDepthBuffer === !1 && (D.push(V), _t.push(V), n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER, _t)), n.invalidateFramebuffer(n.READ_FRAMEBUFFER, D));
}
- if (t.bindFramebuffer(r.READ_FRAMEBUFFER, null), t.bindFramebuffer(r.DRAW_FRAMEBUFFER, null), ne)
- for (let de = 0; de < x.length; de++) {
- t.bindFramebuffer(r.FRAMEBUFFER, ye.__webglMultisampledFramebuffer), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0 + de, r.RENDERBUFFER, ye.__webglColorRenderbuffer[de]);
- const J = i.get(x[de]).__webglTexture;
- t.bindFramebuffer(r.FRAMEBUFFER, ye.__webglFramebuffer), r.framebufferTexture2D(r.DRAW_FRAMEBUFFER, r.COLOR_ATTACHMENT0 + de, r.TEXTURE_2D, J, 0);
+ if (t.bindFramebuffer(n.READ_FRAMEBUFFER, null), t.bindFramebuffer(n.DRAW_FRAMEBUFFER, null), re)
+ for (let pe = 0; pe < x.length; pe++) {
+ t.bindFramebuffer(n.FRAMEBUFFER, be.__webglMultisampledFramebuffer), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0 + pe, n.RENDERBUFFER, be.__webglColorRenderbuffer[pe]);
+ const J = i.get(x[pe]).__webglTexture;
+ t.bindFramebuffer(n.FRAMEBUFFER, be.__webglFramebuffer), n.framebufferTexture2D(n.DRAW_FRAMEBUFFER, n.COLOR_ATTACHMENT0 + pe, n.TEXTURE_2D, J, 0);
}
- t.bindFramebuffer(r.DRAW_FRAMEBUFFER, ye.__webglMultisampledFramebuffer);
+ t.bindFramebuffer(n.DRAW_FRAMEBUFFER, be.__webglMultisampledFramebuffer);
} else if (C.depthBuffer && C.resolveDepthBuffer === !1 && l) {
- const x = C.stencilBuffer ? r.DEPTH_STENCIL_ATTACHMENT : r.DEPTH_ATTACHMENT;
- r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER, [x]);
+ const x = C.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT;
+ n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER, [x]);
}
}
}
- function et(C) {
+ function tt(C) {
return Math.min(s.maxSamples, C.samples);
}
function fe(C) {
const x = i.get(C);
return C.samples > 0 && e.has("WEBGL_multisampled_render_to_texture") === !0 && x.__useRenderToTexture !== !1;
}
- function ot(C) {
+ function lt(C) {
const x = a.render.frame;
h.get(C) !== x && (h.set(C, x), C.update());
}
function Me(C, x) {
- const B = C.colorSpace, X = C.format, K = C.type;
- return C.isCompressedTexture === !0 || C.isVideoTexture === !0 || B !== Bt && B !== Qi && (qe.getTransfer(B) === tt ? (X !== $t || K !== vi) && Se("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : Ve("WebGLTextures: Unsupported texture color space:", B)), x;
+ const O = C.colorSpace, X = C.format, K = C.type;
+ return C.isCompressedTexture === !0 || C.isVideoTexture === !0 || O !== kt && O !== Qi && (qe.getTransfer(O) === it ? (X !== Jt || K !== _i) && Se("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : Ve("WebGLTextures: Unsupported texture color space:", O)), x;
}
function De(C) {
return typeof HTMLImageElement < "u" && C instanceof HTMLImageElement ? (c.width = C.naturalWidth || C.width, c.height = C.naturalHeight || C.height) : typeof VideoFrame < "u" && C instanceof VideoFrame ? (c.width = C.displayWidth, c.height = C.displayHeight) : (c.width = C.width, c.height = C.height), c;
}
- this.allocateTextureUnit = z, this.resetTextureUnits = N, this.setTexture2D = j, this.setTexture2DArray = q, this.setTexture3D = te, this.setTextureCube = G, this.rebindTextures = Qe, this.setupRenderTarget = Xe, this.updateRenderTargetMipmap = Ge, this.updateMultisampleRenderTarget = je, this.setupDepthRenderbuffer = we, this.setupFrameBufferTexture = ue, this.useMultisampledRTT = fe;
+ this.allocateTextureUnit = z, this.resetTextureUnits = N, this.setTexture2D = j, this.setTexture2DArray = q, this.setTexture3D = te, this.setTextureCube = G, this.rebindTextures = et, this.setupRenderTarget = Xe, this.updateRenderTargetMipmap = Ge, this.updateMultisampleRenderTarget = je, this.setupDepthRenderbuffer = we, this.setupFrameBufferTexture = de, this.useMultisampledRTT = fe;
}
-function $0(r, e) {
+function $0(n, e) {
function t(i, s = Qi) {
- let n;
+ let r;
const a = qe.getTransfer(s);
- if (i === vi) return r.UNSIGNED_BYTE;
- if (i === Do) return r.UNSIGNED_SHORT_4_4_4_4;
- if (i === Io) return r.UNSIGNED_SHORT_5_5_5_1;
- if (i === sh) return r.UNSIGNED_INT_5_9_9_9_REV;
- if (i === rh) return r.UNSIGNED_INT_10F_11F_11F_REV;
- if (i === th) return r.BYTE;
- if (i === ih) return r.SHORT;
- if (i === wr) return r.UNSIGNED_SHORT;
- if (i === Lo) return r.INT;
- if (i === gs) return r.UNSIGNED_INT;
- if (i === Xt) return r.FLOAT;
- if (i === vt) return r.HALF_FLOAT;
- if (i === nh) return r.ALPHA;
- if (i === ah) return r.RGB;
- if (i === $t) return r.RGBA;
- if (i === Cr) return r.DEPTH_COMPONENT;
- if (i === Ks) return r.DEPTH_STENCIL;
- if (i === Uo) return r.RED;
- if (i === No) return r.RED_INTEGER;
- if (i === Oo) return r.RG;
- if (i === Bo) return r.RG_INTEGER;
- if (i === Fo) return r.RGBA_INTEGER;
- if (i === _n || i === xn || i === yn || i === bn)
- if (a === tt)
- if (n = e.get("WEBGL_compressed_texture_s3tc_srgb"), n !== null) {
- if (i === _n) return n.COMPRESSED_SRGB_S3TC_DXT1_EXT;
- if (i === xn) return n.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
- if (i === yn) return n.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
- if (i === bn) return n.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+ if (i === _i) return n.UNSIGNED_BYTE;
+ if (i === Do) return n.UNSIGNED_SHORT_4_4_4_4;
+ if (i === Io) return n.UNSIGNED_SHORT_5_5_5_1;
+ if (i === sh) return n.UNSIGNED_INT_5_9_9_9_REV;
+ if (i === nh) return n.UNSIGNED_INT_10F_11F_11F_REV;
+ if (i === th) return n.BYTE;
+ if (i === ih) return n.SHORT;
+ if (i === Cn) return n.UNSIGNED_SHORT;
+ if (i === Lo) return n.INT;
+ if (i === gs) return n.UNSIGNED_INT;
+ if (i === qt) return n.FLOAT;
+ if (i === vt) return n.HALF_FLOAT;
+ if (i === rh) return n.ALPHA;
+ if (i === ah) return n.RGB;
+ if (i === Jt) return n.RGBA;
+ if (i === An) return n.DEPTH_COMPONENT;
+ if (i === Ks) return n.DEPTH_STENCIL;
+ if (i === Uo) return n.RED;
+ if (i === No) return n.RED_INTEGER;
+ if (i === Bo) return n.RG;
+ if (i === Oo) return n.RG_INTEGER;
+ if (i === ko) return n.RGBA_INTEGER;
+ if (i === _r || i === xr || i === br || i === yr)
+ if (a === it)
+ if (r = e.get("WEBGL_compressed_texture_s3tc_srgb"), r !== null) {
+ if (i === _r) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ if (i === xr) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ if (i === br) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ if (i === yr) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
} else
return null;
- else if (n = e.get("WEBGL_compressed_texture_s3tc"), n !== null) {
- if (i === _n) return n.COMPRESSED_RGB_S3TC_DXT1_EXT;
- if (i === xn) return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;
- if (i === yn) return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- if (i === bn) return n.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ else if (r = e.get("WEBGL_compressed_texture_s3tc"), r !== null) {
+ if (i === _r) return r.COMPRESSED_RGB_S3TC_DXT1_EXT;
+ if (i === xr) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ if (i === br) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ if (i === yr) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT;
} else
return null;
if (i === za || i === Ha || i === Va || i === Ga)
- if (n = e.get("WEBGL_compressed_texture_pvrtc"), n !== null) {
- if (i === za) return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- if (i === Ha) return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- if (i === Va) return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- if (i === Ga) return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
+ if (r = e.get("WEBGL_compressed_texture_pvrtc"), r !== null) {
+ if (i === za) return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
+ if (i === Ha) return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
+ if (i === Va) return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
+ if (i === Ga) return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
} else
return null;
if (i === Wa || i === ja || i === Xa)
- if (n = e.get("WEBGL_compressed_texture_etc"), n !== null) {
- if (i === Wa || i === ja) return a === tt ? n.COMPRESSED_SRGB8_ETC2 : n.COMPRESSED_RGB8_ETC2;
- if (i === Xa) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : n.COMPRESSED_RGBA8_ETC2_EAC;
+ if (r = e.get("WEBGL_compressed_texture_etc"), r !== null) {
+ if (i === Wa || i === ja) return a === it ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
+ if (i === Xa) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;
} else
return null;
- if (i === qa || i === Ya || i === Ka || i === Za || i === $a || i === Ja || i === Qa || i === eo || i === to || i === io || i === so || i === ro || i === no || i === ao)
- if (n = e.get("WEBGL_compressed_texture_astc"), n !== null) {
- if (i === qa) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : n.COMPRESSED_RGBA_ASTC_4x4_KHR;
- if (i === Ya) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : n.COMPRESSED_RGBA_ASTC_5x4_KHR;
- if (i === Ka) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : n.COMPRESSED_RGBA_ASTC_5x5_KHR;
- if (i === Za) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : n.COMPRESSED_RGBA_ASTC_6x5_KHR;
- if (i === $a) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : n.COMPRESSED_RGBA_ASTC_6x6_KHR;
- if (i === Ja) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : n.COMPRESSED_RGBA_ASTC_8x5_KHR;
- if (i === Qa) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : n.COMPRESSED_RGBA_ASTC_8x6_KHR;
- if (i === eo) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : n.COMPRESSED_RGBA_ASTC_8x8_KHR;
- if (i === to) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : n.COMPRESSED_RGBA_ASTC_10x5_KHR;
- if (i === io) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : n.COMPRESSED_RGBA_ASTC_10x6_KHR;
- if (i === so) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : n.COMPRESSED_RGBA_ASTC_10x8_KHR;
- if (i === ro) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : n.COMPRESSED_RGBA_ASTC_10x10_KHR;
- if (i === no) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : n.COMPRESSED_RGBA_ASTC_12x10_KHR;
- if (i === ao) return a === tt ? n.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : n.COMPRESSED_RGBA_ASTC_12x12_KHR;
+ if (i === qa || i === Ya || i === Ka || i === Za || i === $a || i === Ja || i === Qa || i === eo || i === to || i === io || i === so || i === no || i === ro || i === ao)
+ if (r = e.get("WEBGL_compressed_texture_astc"), r !== null) {
+ if (i === qa) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
+ if (i === Ya) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
+ if (i === Ka) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
+ if (i === Za) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
+ if (i === $a) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
+ if (i === Ja) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
+ if (i === Qa) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
+ if (i === eo) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
+ if (i === to) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
+ if (i === io) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
+ if (i === so) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
+ if (i === no) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
+ if (i === ro) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
+ if (i === ao) return a === it ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;
} else
return null;
if (i === oo || i === lo || i === co)
- if (n = e.get("EXT_texture_compression_bptc"), n !== null) {
- if (i === oo) return a === tt ? n.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : n.COMPRESSED_RGBA_BPTC_UNORM_EXT;
- if (i === lo) return n.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
- if (i === co) return n.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
+ if (r = e.get("EXT_texture_compression_bptc"), r !== null) {
+ if (i === oo) return a === it ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
+ if (i === lo) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
+ if (i === co) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
} else
return null;
if (i === ho || i === uo || i === po || i === mo)
- if (n = e.get("EXT_texture_compression_rgtc"), n !== null) {
- if (i === ho) return n.COMPRESSED_RED_RGTC1_EXT;
- if (i === uo) return n.COMPRESSED_SIGNED_RED_RGTC1_EXT;
- if (i === po) return n.COMPRESSED_RED_GREEN_RGTC2_EXT;
- if (i === mo) return n.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
+ if (r = e.get("EXT_texture_compression_rgtc"), r !== null) {
+ if (i === ho) return r.COMPRESSED_RED_RGTC1_EXT;
+ if (i === uo) return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;
+ if (i === po) return r.COMPRESSED_RED_GREEN_RGTC2_EXT;
+ if (i === mo) return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
} else
return null;
- return i === Ys ? r.UNSIGNED_INT_24_8 : r[i] !== void 0 ? r[i] : null;
+ return i === Ys ? n.UNSIGNED_INT_24_8 : n[i] !== void 0 ? n[i] : null;
}
return { convert: t };
}
@@ -23305,7 +23373,7 @@ class ev {
*/
init(e, t) {
if (this.texture === null) {
- const i = new yh(e.texture);
+ const i = new bh(e.texture);
(e.depthNear !== t.depthNear || e.depthFar !== t.depthFar) && (this.depthNear = e.depthNear, this.depthFar = e.depthFar), this.texture = i;
}
}
@@ -23326,7 +23394,7 @@ class ev {
depthHeight: { value: t.w }
}
});
- this.mesh = new at(new Dr(20, 20), i);
+ this.mesh = new ot(new In(20, 20), i);
}
return this.mesh;
}
@@ -23355,15 +23423,15 @@ class tv extends xs {
constructor(e, t) {
super();
const i = this;
- let s = null, n = 1, a = null, o = "local-floor", l = 1, c = null, h = null, u = null, d = null, m = null, g = null;
- const v = typeof XRWebGLBinding < "u", f = new ev(), p = {}, y = t.getContextAttributes();
+ let s = null, r = 1, a = null, o = "local-floor", l = 1, c = null, h = null, u = null, d = null, m = null, g = null;
+ const v = typeof XRWebGLBinding < "u", f = new ev(), p = {}, b = t.getContextAttributes();
let _ = null, E = null;
const R = [], T = [], A = new oe();
let I = null;
const S = new Tt();
- S.viewport = new Je();
+ S.viewport = new Qe();
const M = new Tt();
- M.viewport = new Je();
+ M.viewport = new Qe();
const L = [S, M], N = new lp();
let z = null, H = null;
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(W) {
@@ -23380,8 +23448,8 @@ class tv extends xs {
const Y = T.indexOf(W.inputSource);
if (Y === -1)
return;
- const ue = R[Y];
- ue !== void 0 && (ue.update(W.inputSource, W.frame, c || a), ue.dispatchEvent({ type: W.type, data: W.inputSource }));
+ const de = R[Y];
+ de !== void 0 && (de.update(W.inputSource, W.frame, c || a), de.dispatchEvent({ type: W.type, data: W.inputSource }));
}
function q() {
s.removeEventListener("select", j), s.removeEventListener("selectstart", j), s.removeEventListener("selectend", j), s.removeEventListener("squeeze", j), s.removeEventListener("squeezestart", j), s.removeEventListener("squeezeend", j), s.removeEventListener("end", q), s.removeEventListener("inputsourceschange", te);
@@ -23392,10 +23460,10 @@ class tv extends xs {
z = null, H = null, f.reset();
for (const W in p)
delete p[W];
- e.setRenderTarget(_), m = null, d = null, u = null, s = null, E = null, $e.stop(), i.isPresenting = !1, e.setPixelRatio(I), e.setSize(A.width, A.height, !1), i.dispatchEvent({ type: "sessionend" });
+ e.setRenderTarget(_), m = null, d = null, u = null, s = null, E = null, Je.stop(), i.isPresenting = !1, e.setPixelRatio(I), e.setSize(A.width, A.height, !1), i.dispatchEvent({ type: "sessionend" });
}
this.setFramebufferScaleFactor = function(W) {
- n = W, i.isPresenting === !0 && Se("WebXRManager: Cannot change framebuffer scale while presenting.");
+ r = W, i.isPresenting === !0 && Se("WebXRManager: Cannot change framebuffer scale while presenting.");
}, this.setReferenceSpaceType = function(W) {
o = W, i.isPresenting === !0 && Se("WebXRManager: Cannot change reference space type while presenting.");
}, this.getReferenceSpace = function() {
@@ -23412,50 +23480,50 @@ class tv extends xs {
return s;
}, this.setSession = async function(W) {
if (s = W, s !== null) {
- if (_ = e.getRenderTarget(), s.addEventListener("select", j), s.addEventListener("selectstart", j), s.addEventListener("selectend", j), s.addEventListener("squeeze", j), s.addEventListener("squeezestart", j), s.addEventListener("squeezeend", j), s.addEventListener("end", q), s.addEventListener("inputsourceschange", te), y.xrCompatible !== !0 && await t.makeXRCompatible(), I = e.getPixelRatio(), e.getSize(A), v && "createProjectionLayer" in XRWebGLBinding.prototype) {
- let Y = null, ue = null, Ae = null;
- y.depth && (Ae = y.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Y = y.stencil ? Ks : Cr, ue = y.stencil ? Ys : gs);
+ if (_ = e.getRenderTarget(), s.addEventListener("select", j), s.addEventListener("selectstart", j), s.addEventListener("selectend", j), s.addEventListener("squeeze", j), s.addEventListener("squeezestart", j), s.addEventListener("squeezeend", j), s.addEventListener("end", q), s.addEventListener("inputsourceschange", te), b.xrCompatible !== !0 && await t.makeXRCompatible(), I = e.getPixelRatio(), e.getSize(A), v && "createProjectionLayer" in XRWebGLBinding.prototype) {
+ let Y = null, de = null, Ae = null;
+ b.depth && (Ae = b.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Y = b.stencil ? Ks : An, de = b.stencil ? Ys : gs);
const Te = {
colorFormat: t.RGBA8,
depthFormat: Ae,
- scaleFactor: n
+ scaleFactor: r
};
- u = this.getBinding(), d = u.createProjectionLayer(Te), s.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), E = new bt(
+ u = this.getBinding(), d = u.createProjectionLayer(Te), s.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), E = new yt(
d.textureWidth,
d.textureHeight,
{
- format: $t,
- type: vi,
- depthTexture: new Ko(d.textureWidth, d.textureHeight, ue, void 0, void 0, void 0, void 0, void 0, void 0, Y),
- stencilBuffer: y.stencil,
+ format: Jt,
+ type: _i,
+ depthTexture: new Ko(d.textureWidth, d.textureHeight, de, void 0, void 0, void 0, void 0, void 0, void 0, Y),
+ stencilBuffer: b.stencil,
colorSpace: e.outputColorSpace,
- samples: y.antialias ? 4 : 0,
+ samples: b.antialias ? 4 : 0,
resolveDepthBuffer: d.ignoreDepthValues === !1,
resolveStencilBuffer: d.ignoreDepthValues === !1
}
);
} else {
const Y = {
- antialias: y.antialias,
+ antialias: b.antialias,
alpha: !0,
- depth: y.depth,
- stencil: y.stencil,
- framebufferScaleFactor: n
+ depth: b.depth,
+ stencil: b.stencil,
+ framebufferScaleFactor: r
};
- m = new XRWebGLLayer(s, t, Y), s.updateRenderState({ baseLayer: m }), e.setPixelRatio(1), e.setSize(m.framebufferWidth, m.framebufferHeight, !1), E = new bt(
+ m = new XRWebGLLayer(s, t, Y), s.updateRenderState({ baseLayer: m }), e.setPixelRatio(1), e.setSize(m.framebufferWidth, m.framebufferHeight, !1), E = new yt(
m.framebufferWidth,
m.framebufferHeight,
{
- format: $t,
- type: vi,
+ format: Jt,
+ type: _i,
colorSpace: e.outputColorSpace,
- stencilBuffer: y.stencil,
+ stencilBuffer: b.stencil,
resolveDepthBuffer: m.ignoreDepthValues === !1,
resolveStencilBuffer: m.ignoreDepthValues === !1
}
);
}
- E.isXRRenderTarget = !0, this.setFoveation(l), c = null, a = await s.requestReferenceSpace(o), $e.setContext(s), $e.start(), i.isPresenting = !0, i.dispatchEvent({ type: "sessionstart" });
+ E.isXRRenderTarget = !0, this.setFoveation(l), c = null, a = await s.requestReferenceSpace(o), Je.setContext(s), Je.start(), i.isPresenting = !0, i.dispatchEvent({ type: "sessionstart" });
}
}, this.getEnvironmentBlendMode = function() {
if (s !== null)
@@ -23465,36 +23533,36 @@ class tv extends xs {
};
function te(W) {
for (let Y = 0; Y < W.removed.length; Y++) {
- const ue = W.removed[Y], Ae = T.indexOf(ue);
- Ae >= 0 && (T[Ae] = null, R[Ae].disconnect(ue));
+ const de = W.removed[Y], Ae = T.indexOf(de);
+ Ae >= 0 && (T[Ae] = null, R[Ae].disconnect(de));
}
for (let Y = 0; Y < W.added.length; Y++) {
- const ue = W.added[Y];
- let Ae = T.indexOf(ue);
+ const de = W.added[Y];
+ let Ae = T.indexOf(de);
if (Ae === -1) {
for (let we = 0; we < R.length; we++)
if (we >= T.length) {
- T.push(ue), Ae = we;
+ T.push(de), Ae = we;
break;
} else if (T[we] === null) {
- T[we] = ue, Ae = we;
+ T[we] = de, Ae = we;
break;
}
if (Ae === -1) break;
}
const Te = R[Ae];
- Te && Te.connect(ue);
+ Te && Te.connect(de);
}
}
const G = new w(), Z = new w();
- function re(W, Y, ue) {
- G.setFromMatrixPosition(Y.matrixWorld), Z.setFromMatrixPosition(ue.matrixWorld);
- const Ae = G.distanceTo(Z), Te = Y.projectionMatrix.elements, we = ue.projectionMatrix.elements, Qe = Te[14] / (Te[10] - 1), Xe = Te[14] / (Te[10] + 1), Ge = (Te[9] + 1) / Te[5], D = (Te[9] - 1) / Te[5], _t = (Te[8] - 1) / Te[0], je = (we[8] + 1) / we[0], et = Qe * _t, fe = Qe * je, ot = Ae / (-_t + je), Me = ot * -_t;
- if (Y.matrixWorld.decompose(W.position, W.quaternion, W.scale), W.translateX(Me), W.translateZ(ot), W.matrixWorld.compose(W.position, W.quaternion, W.scale), W.matrixWorldInverse.copy(W.matrixWorld).invert(), Te[10] === -1)
+ function ne(W, Y, de) {
+ G.setFromMatrixPosition(Y.matrixWorld), Z.setFromMatrixPosition(de.matrixWorld);
+ const Ae = G.distanceTo(Z), Te = Y.projectionMatrix.elements, we = de.projectionMatrix.elements, et = Te[14] / (Te[10] - 1), Xe = Te[14] / (Te[10] + 1), Ge = (Te[9] + 1) / Te[5], D = (Te[9] - 1) / Te[5], _t = (Te[8] - 1) / Te[0], je = (we[8] + 1) / we[0], tt = et * _t, fe = et * je, lt = Ae / (-_t + je), Me = lt * -_t;
+ if (Y.matrixWorld.decompose(W.position, W.quaternion, W.scale), W.translateX(Me), W.translateZ(lt), W.matrixWorld.compose(W.position, W.quaternion, W.scale), W.matrixWorldInverse.copy(W.matrixWorld).invert(), Te[10] === -1)
W.projectionMatrix.copy(Y.projectionMatrix), W.projectionMatrixInverse.copy(Y.projectionMatrixInverse);
else {
- const De = Qe + ot, C = Xe + ot, x = et - Me, B = fe + (Ae - Me), X = Ge * Xe / C * De, K = D * Xe / C * De;
- W.projectionMatrix.makePerspective(x, B, X, K, De, C), W.projectionMatrixInverse.copy(W.projectionMatrix).invert();
+ const De = et + lt, C = Xe + lt, x = tt - Me, O = fe + (Ae - Me), X = Ge * Xe / C * De, K = D * Xe / C * De;
+ W.projectionMatrix.makePerspective(x, O, X, K, De, C), W.projectionMatrixInverse.copy(W.projectionMatrix).invert();
}
}
function Le(W, Y) {
@@ -23502,8 +23570,8 @@ class tv extends xs {
}
this.updateCamera = function(W) {
if (s === null) return;
- let Y = W.near, ue = W.far;
- f.texture !== null && (f.depthNear > 0 && (Y = f.depthNear), f.depthFar > 0 && (ue = f.depthFar)), N.near = M.near = S.near = Y, N.far = M.far = S.far = ue, (z !== N.near || H !== N.far) && (s.updateRenderState({
+ let Y = W.near, de = W.far;
+ f.texture !== null && (f.depthNear > 0 && (Y = f.depthNear), f.depthFar > 0 && (de = f.depthFar)), N.near = M.near = S.near = Y, N.far = M.far = S.far = de, (z !== N.near || H !== N.far) && (s.updateRenderState({
depthNear: N.near,
depthFar: N.far
}), z = N.near, H = N.far), N.layers.mask = W.layers.mask | 6, S.layers.mask = N.layers.mask & 3, M.layers.mask = N.layers.mask & 5;
@@ -23511,10 +23579,10 @@ class tv extends xs {
Le(N, Ae);
for (let we = 0; we < Te.length; we++)
Le(Te[we], Ae);
- Te.length === 2 ? re(N, S, M) : N.projectionMatrix.copy(S.projectionMatrix), He(W, N, Ae);
+ Te.length === 2 ? ne(N, S, M) : N.projectionMatrix.copy(S.projectionMatrix), He(W, N, Ae);
};
- function He(W, Y, ue) {
- ue === null ? W.matrix.copy(Y.matrixWorld) : (W.matrix.copy(ue.matrixWorld), W.matrix.invert(), W.matrix.multiply(Y.matrixWorld)), W.matrix.decompose(W.position, W.quaternion, W.scale), W.updateMatrixWorld(!0), W.projectionMatrix.copy(Y.projectionMatrix), W.projectionMatrixInverse.copy(Y.projectionMatrixInverse), W.isPerspectiveCamera && (W.fov = Zs * 2 * Math.atan(1 / W.projectionMatrix.elements[5]), W.zoom = 1);
+ function He(W, Y, de) {
+ de === null ? W.matrix.copy(Y.matrixWorld) : (W.matrix.copy(de.matrixWorld), W.matrix.invert(), W.matrix.multiply(Y.matrixWorld)), W.matrix.decompose(W.position, W.quaternion, W.scale), W.updateMatrixWorld(!0), W.projectionMatrix.copy(Y.projectionMatrix), W.projectionMatrixInverse.copy(Y.projectionMatrixInverse), W.isPerspectiveCamera && (W.fov = Zs * 2 * Math.atan(1 / W.projectionMatrix.elements[5]), W.zoom = 1);
}
this.getCamera = function() {
return N;
@@ -23531,19 +23599,19 @@ class tv extends xs {
return p[W];
};
let Ye = null;
- function Ze(W, Y) {
+ function $e(W, Y) {
if (h = Y.getViewerPose(c || a), g = Y, h !== null) {
- const ue = h.views;
+ const de = h.views;
m !== null && (e.setRenderTargetFramebuffer(E, m.framebuffer), e.setRenderTarget(E));
let Ae = !1;
- ue.length !== N.cameras.length && (N.cameras.length = 0, Ae = !0);
- for (let we = 0; we < ue.length; we++) {
- const Qe = ue[we];
+ de.length !== N.cameras.length && (N.cameras.length = 0, Ae = !0);
+ for (let we = 0; we < de.length; we++) {
+ const et = de[we];
let Xe = null;
if (m !== null)
- Xe = m.getViewport(Qe);
+ Xe = m.getViewport(et);
else {
- const D = u.getViewSubImage(d, Qe);
+ const D = u.getViewSubImage(d, et);
Xe = D.viewport, we === 0 && (e.setRenderTargetTextures(
E,
D.colorTexture,
@@ -23551,54 +23619,54 @@ class tv extends xs {
), e.setRenderTarget(E));
}
let Ge = L[we];
- Ge === void 0 && (Ge = new Tt(), Ge.layers.enable(we), Ge.viewport = new Je(), L[we] = Ge), Ge.matrix.fromArray(Qe.transform.matrix), Ge.matrix.decompose(Ge.position, Ge.quaternion, Ge.scale), Ge.projectionMatrix.fromArray(Qe.projectionMatrix), Ge.projectionMatrixInverse.copy(Ge.projectionMatrix).invert(), Ge.viewport.set(Xe.x, Xe.y, Xe.width, Xe.height), we === 0 && (N.matrix.copy(Ge.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), Ae === !0 && N.cameras.push(Ge);
+ Ge === void 0 && (Ge = new Tt(), Ge.layers.enable(we), Ge.viewport = new Qe(), L[we] = Ge), Ge.matrix.fromArray(et.transform.matrix), Ge.matrix.decompose(Ge.position, Ge.quaternion, Ge.scale), Ge.projectionMatrix.fromArray(et.projectionMatrix), Ge.projectionMatrixInverse.copy(Ge.projectionMatrix).invert(), Ge.viewport.set(Xe.x, Xe.y, Xe.width, Xe.height), we === 0 && (N.matrix.copy(Ge.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), Ae === !0 && N.cameras.push(Ge);
}
const Te = s.enabledFeatures;
if (Te && Te.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && v) {
u = i.getBinding();
- const we = u.getDepthInformation(ue[0]);
+ const we = u.getDepthInformation(de[0]);
we && we.isValid && we.texture && f.init(we, s.renderState);
}
if (Te && Te.includes("camera-access") && v) {
e.state.unbindTexture(), u = i.getBinding();
- for (let we = 0; we < ue.length; we++) {
- const Qe = ue[we].camera;
- if (Qe) {
- let Xe = p[Qe];
- Xe || (Xe = new yh(), p[Qe] = Xe);
- const Ge = u.getCameraImage(Qe);
+ for (let we = 0; we < de.length; we++) {
+ const et = de[we].camera;
+ if (et) {
+ let Xe = p[et];
+ Xe || (Xe = new bh(), p[et] = Xe);
+ const Ge = u.getCameraImage(et);
Xe.sourceTexture = Ge;
}
}
}
}
- for (let ue = 0; ue < R.length; ue++) {
- const Ae = T[ue], Te = R[ue];
+ for (let de = 0; de < R.length; de++) {
+ const Ae = T[de], Te = R[de];
Ae !== null && Te !== void 0 && Te.update(Ae, Y, c || a);
}
Ye && Ye(W, Y), Y.detectedPlanes && i.dispatchEvent({ type: "planesdetected", data: Y }), g = null;
}
- const $e = new Rh();
- $e.setAnimationLoop(Ze), this.setAnimationLoop = function(W) {
+ const Je = new Rh();
+ Je.setAnimationLoop($e), this.setAnimationLoop = function(W) {
Ye = W;
}, this.dispose = function() {
};
}
}
-const ps = /* @__PURE__ */ new xi(), iv = /* @__PURE__ */ new Ne();
-function sv(r, e) {
+const ps = /* @__PURE__ */ new bi(), iv = /* @__PURE__ */ new Ne();
+function sv(n, e) {
function t(f, p) {
f.matrixAutoUpdate === !0 && f.updateMatrix(), p.value.copy(f.matrix);
}
function i(f, p) {
- p.color.getRGB(f.fogColor.value, fh(r)), p.isFog ? (f.fogNear.value = p.near, f.fogFar.value = p.far) : p.isFogExp2 && (f.fogDensity.value = p.density);
+ p.color.getRGB(f.fogColor.value, fh(n)), p.isFog ? (f.fogNear.value = p.near, f.fogFar.value = p.far) : p.isFogExp2 && (f.fogDensity.value = p.density);
}
- function s(f, p, y, _, E) {
- p.isMeshBasicMaterial || p.isMeshLambertMaterial ? n(f, p) : p.isMeshToonMaterial ? (n(f, p), u(f, p)) : p.isMeshPhongMaterial ? (n(f, p), h(f, p)) : p.isMeshStandardMaterial ? (n(f, p), d(f, p), p.isMeshPhysicalMaterial && m(f, p, E)) : p.isMeshMatcapMaterial ? (n(f, p), g(f, p)) : p.isMeshDepthMaterial ? n(f, p) : p.isMeshDistanceMaterial ? (n(f, p), v(f, p)) : p.isMeshNormalMaterial ? n(f, p) : p.isLineBasicMaterial ? (a(f, p), p.isLineDashedMaterial && o(f, p)) : p.isPointsMaterial ? l(f, p, y, _) : p.isSpriteMaterial ? c(f, p) : p.isShadowMaterial ? (f.color.value.copy(p.color), f.opacity.value = p.opacity) : p.isShaderMaterial && (p.uniformsNeedUpdate = !1);
+ function s(f, p, b, _, E) {
+ p.isMeshBasicMaterial || p.isMeshLambertMaterial ? r(f, p) : p.isMeshToonMaterial ? (r(f, p), u(f, p)) : p.isMeshPhongMaterial ? (r(f, p), h(f, p)) : p.isMeshStandardMaterial ? (r(f, p), d(f, p), p.isMeshPhysicalMaterial && m(f, p, E)) : p.isMeshMatcapMaterial ? (r(f, p), g(f, p)) : p.isMeshDepthMaterial ? r(f, p) : p.isMeshDistanceMaterial ? (r(f, p), v(f, p)) : p.isMeshNormalMaterial ? r(f, p) : p.isLineBasicMaterial ? (a(f, p), p.isLineDashedMaterial && o(f, p)) : p.isPointsMaterial ? l(f, p, b, _) : p.isSpriteMaterial ? c(f, p) : p.isShadowMaterial ? (f.color.value.copy(p.color), f.opacity.value = p.opacity) : p.isShaderMaterial && (p.uniformsNeedUpdate = !1);
}
- function n(f, p) {
- f.opacity.value = p.opacity, p.color && f.diffuse.value.copy(p.color), p.emissive && f.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity), p.map && (f.map.value = p.map, t(p.map, f.mapTransform)), p.alphaMap && (f.alphaMap.value = p.alphaMap, t(p.alphaMap, f.alphaMapTransform)), p.bumpMap && (f.bumpMap.value = p.bumpMap, t(p.bumpMap, f.bumpMapTransform), f.bumpScale.value = p.bumpScale, p.side === Ht && (f.bumpScale.value *= -1)), p.normalMap && (f.normalMap.value = p.normalMap, t(p.normalMap, f.normalMapTransform), f.normalScale.value.copy(p.normalScale), p.side === Ht && f.normalScale.value.negate()), p.displacementMap && (f.displacementMap.value = p.displacementMap, t(p.displacementMap, f.displacementMapTransform), f.displacementScale.value = p.displacementScale, f.displacementBias.value = p.displacementBias), p.emissiveMap && (f.emissiveMap.value = p.emissiveMap, t(p.emissiveMap, f.emissiveMapTransform)), p.specularMap && (f.specularMap.value = p.specularMap, t(p.specularMap, f.specularMapTransform)), p.alphaTest > 0 && (f.alphaTest.value = p.alphaTest);
- const y = e.get(p), _ = y.envMap, E = y.envMapRotation;
+ function r(f, p) {
+ f.opacity.value = p.opacity, p.color && f.diffuse.value.copy(p.color), p.emissive && f.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity), p.map && (f.map.value = p.map, t(p.map, f.mapTransform)), p.alphaMap && (f.alphaMap.value = p.alphaMap, t(p.alphaMap, f.alphaMapTransform)), p.bumpMap && (f.bumpMap.value = p.bumpMap, t(p.bumpMap, f.bumpMapTransform), f.bumpScale.value = p.bumpScale, p.side === Vt && (f.bumpScale.value *= -1)), p.normalMap && (f.normalMap.value = p.normalMap, t(p.normalMap, f.normalMapTransform), f.normalScale.value.copy(p.normalScale), p.side === Vt && f.normalScale.value.negate()), p.displacementMap && (f.displacementMap.value = p.displacementMap, t(p.displacementMap, f.displacementMapTransform), f.displacementScale.value = p.displacementScale, f.displacementBias.value = p.displacementBias), p.emissiveMap && (f.emissiveMap.value = p.emissiveMap, t(p.emissiveMap, f.emissiveMapTransform)), p.specularMap && (f.specularMap.value = p.specularMap, t(p.specularMap, f.specularMapTransform)), p.alphaTest > 0 && (f.alphaTest.value = p.alphaTest);
+ const b = e.get(p), _ = b.envMap, E = b.envMapRotation;
_ && (f.envMap.value = _, ps.copy(E), ps.x *= -1, ps.y *= -1, ps.z *= -1, _.isCubeTexture && _.isRenderTargetTexture === !1 && (ps.y *= -1, ps.z *= -1), f.envMapRotation.value.setFromMatrix4(iv.makeRotationFromEuler(ps)), f.flipEnvMap.value = _.isCubeTexture && _.isRenderTargetTexture === !1 ? -1 : 1, f.reflectivity.value = p.reflectivity, f.ior.value = p.ior, f.refractionRatio.value = p.refractionRatio), p.lightMap && (f.lightMap.value = p.lightMap, f.lightMapIntensity.value = p.lightMapIntensity, t(p.lightMap, f.lightMapTransform)), p.aoMap && (f.aoMap.value = p.aoMap, f.aoMapIntensity.value = p.aoMapIntensity, t(p.aoMap, f.aoMapTransform));
}
function a(f, p) {
@@ -23607,8 +23675,8 @@ function sv(r, e) {
function o(f, p) {
f.dashSize.value = p.dashSize, f.totalSize.value = p.dashSize + p.gapSize, f.scale.value = p.scale;
}
- function l(f, p, y, _) {
- f.diffuse.value.copy(p.color), f.opacity.value = p.opacity, f.size.value = p.size * y, f.scale.value = _ * 0.5, p.map && (f.map.value = p.map, t(p.map, f.uvTransform)), p.alphaMap && (f.alphaMap.value = p.alphaMap, t(p.alphaMap, f.alphaMapTransform)), p.alphaTest > 0 && (f.alphaTest.value = p.alphaTest);
+ function l(f, p, b, _) {
+ f.diffuse.value.copy(p.color), f.opacity.value = p.opacity, f.size.value = p.size * b, f.scale.value = _ * 0.5, p.map && (f.map.value = p.map, t(p.map, f.uvTransform)), p.alphaMap && (f.alphaMap.value = p.alphaMap, t(p.alphaMap, f.alphaMapTransform)), p.alphaTest > 0 && (f.alphaTest.value = p.alphaTest);
}
function c(f, p) {
f.diffuse.value.copy(p.color), f.opacity.value = p.opacity, f.rotation.value = p.rotation, p.map && (f.map.value = p.map, t(p.map, f.mapTransform)), p.alphaMap && (f.alphaMap.value = p.alphaMap, t(p.alphaMap, f.alphaMapTransform)), p.alphaTest > 0 && (f.alphaTest.value = p.alphaTest);
@@ -23622,51 +23690,51 @@ function sv(r, e) {
function d(f, p) {
f.metalness.value = p.metalness, p.metalnessMap && (f.metalnessMap.value = p.metalnessMap, t(p.metalnessMap, f.metalnessMapTransform)), f.roughness.value = p.roughness, p.roughnessMap && (f.roughnessMap.value = p.roughnessMap, t(p.roughnessMap, f.roughnessMapTransform)), p.envMap && (f.envMapIntensity.value = p.envMapIntensity);
}
- function m(f, p, y) {
- f.ior.value = p.ior, p.sheen > 0 && (f.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen), f.sheenRoughness.value = p.sheenRoughness, p.sheenColorMap && (f.sheenColorMap.value = p.sheenColorMap, t(p.sheenColorMap, f.sheenColorMapTransform)), p.sheenRoughnessMap && (f.sheenRoughnessMap.value = p.sheenRoughnessMap, t(p.sheenRoughnessMap, f.sheenRoughnessMapTransform))), p.clearcoat > 0 && (f.clearcoat.value = p.clearcoat, f.clearcoatRoughness.value = p.clearcoatRoughness, p.clearcoatMap && (f.clearcoatMap.value = p.clearcoatMap, t(p.clearcoatMap, f.clearcoatMapTransform)), p.clearcoatRoughnessMap && (f.clearcoatRoughnessMap.value = p.clearcoatRoughnessMap, t(p.clearcoatRoughnessMap, f.clearcoatRoughnessMapTransform)), p.clearcoatNormalMap && (f.clearcoatNormalMap.value = p.clearcoatNormalMap, t(p.clearcoatNormalMap, f.clearcoatNormalMapTransform), f.clearcoatNormalScale.value.copy(p.clearcoatNormalScale), p.side === Ht && f.clearcoatNormalScale.value.negate())), p.dispersion > 0 && (f.dispersion.value = p.dispersion), p.iridescence > 0 && (f.iridescence.value = p.iridescence, f.iridescenceIOR.value = p.iridescenceIOR, f.iridescenceThicknessMinimum.value = p.iridescenceThicknessRange[0], f.iridescenceThicknessMaximum.value = p.iridescenceThicknessRange[1], p.iridescenceMap && (f.iridescenceMap.value = p.iridescenceMap, t(p.iridescenceMap, f.iridescenceMapTransform)), p.iridescenceThicknessMap && (f.iridescenceThicknessMap.value = p.iridescenceThicknessMap, t(p.iridescenceThicknessMap, f.iridescenceThicknessMapTransform))), p.transmission > 0 && (f.transmission.value = p.transmission, f.transmissionSamplerMap.value = y.texture, f.transmissionSamplerSize.value.set(y.width, y.height), p.transmissionMap && (f.transmissionMap.value = p.transmissionMap, t(p.transmissionMap, f.transmissionMapTransform)), f.thickness.value = p.thickness, p.thicknessMap && (f.thicknessMap.value = p.thicknessMap, t(p.thicknessMap, f.thicknessMapTransform)), f.attenuationDistance.value = p.attenuationDistance, f.attenuationColor.value.copy(p.attenuationColor)), p.anisotropy > 0 && (f.anisotropyVector.value.set(p.anisotropy * Math.cos(p.anisotropyRotation), p.anisotropy * Math.sin(p.anisotropyRotation)), p.anisotropyMap && (f.anisotropyMap.value = p.anisotropyMap, t(p.anisotropyMap, f.anisotropyMapTransform))), f.specularIntensity.value = p.specularIntensity, f.specularColor.value.copy(p.specularColor), p.specularColorMap && (f.specularColorMap.value = p.specularColorMap, t(p.specularColorMap, f.specularColorMapTransform)), p.specularIntensityMap && (f.specularIntensityMap.value = p.specularIntensityMap, t(p.specularIntensityMap, f.specularIntensityMapTransform));
+ function m(f, p, b) {
+ f.ior.value = p.ior, p.sheen > 0 && (f.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen), f.sheenRoughness.value = p.sheenRoughness, p.sheenColorMap && (f.sheenColorMap.value = p.sheenColorMap, t(p.sheenColorMap, f.sheenColorMapTransform)), p.sheenRoughnessMap && (f.sheenRoughnessMap.value = p.sheenRoughnessMap, t(p.sheenRoughnessMap, f.sheenRoughnessMapTransform))), p.clearcoat > 0 && (f.clearcoat.value = p.clearcoat, f.clearcoatRoughness.value = p.clearcoatRoughness, p.clearcoatMap && (f.clearcoatMap.value = p.clearcoatMap, t(p.clearcoatMap, f.clearcoatMapTransform)), p.clearcoatRoughnessMap && (f.clearcoatRoughnessMap.value = p.clearcoatRoughnessMap, t(p.clearcoatRoughnessMap, f.clearcoatRoughnessMapTransform)), p.clearcoatNormalMap && (f.clearcoatNormalMap.value = p.clearcoatNormalMap, t(p.clearcoatNormalMap, f.clearcoatNormalMapTransform), f.clearcoatNormalScale.value.copy(p.clearcoatNormalScale), p.side === Vt && f.clearcoatNormalScale.value.negate())), p.dispersion > 0 && (f.dispersion.value = p.dispersion), p.iridescence > 0 && (f.iridescence.value = p.iridescence, f.iridescenceIOR.value = p.iridescenceIOR, f.iridescenceThicknessMinimum.value = p.iridescenceThicknessRange[0], f.iridescenceThicknessMaximum.value = p.iridescenceThicknessRange[1], p.iridescenceMap && (f.iridescenceMap.value = p.iridescenceMap, t(p.iridescenceMap, f.iridescenceMapTransform)), p.iridescenceThicknessMap && (f.iridescenceThicknessMap.value = p.iridescenceThicknessMap, t(p.iridescenceThicknessMap, f.iridescenceThicknessMapTransform))), p.transmission > 0 && (f.transmission.value = p.transmission, f.transmissionSamplerMap.value = b.texture, f.transmissionSamplerSize.value.set(b.width, b.height), p.transmissionMap && (f.transmissionMap.value = p.transmissionMap, t(p.transmissionMap, f.transmissionMapTransform)), f.thickness.value = p.thickness, p.thicknessMap && (f.thicknessMap.value = p.thicknessMap, t(p.thicknessMap, f.thicknessMapTransform)), f.attenuationDistance.value = p.attenuationDistance, f.attenuationColor.value.copy(p.attenuationColor)), p.anisotropy > 0 && (f.anisotropyVector.value.set(p.anisotropy * Math.cos(p.anisotropyRotation), p.anisotropy * Math.sin(p.anisotropyRotation)), p.anisotropyMap && (f.anisotropyMap.value = p.anisotropyMap, t(p.anisotropyMap, f.anisotropyMapTransform))), f.specularIntensity.value = p.specularIntensity, f.specularColor.value.copy(p.specularColor), p.specularColorMap && (f.specularColorMap.value = p.specularColorMap, t(p.specularColorMap, f.specularColorMapTransform)), p.specularIntensityMap && (f.specularIntensityMap.value = p.specularIntensityMap, t(p.specularIntensityMap, f.specularIntensityMapTransform));
}
function g(f, p) {
p.matcap && (f.matcap.value = p.matcap);
}
function v(f, p) {
- const y = e.get(p).light;
- f.referencePosition.value.setFromMatrixPosition(y.matrixWorld), f.nearDistance.value = y.shadow.camera.near, f.farDistance.value = y.shadow.camera.far;
+ const b = e.get(p).light;
+ f.referencePosition.value.setFromMatrixPosition(b.matrixWorld), f.nearDistance.value = b.shadow.camera.near, f.farDistance.value = b.shadow.camera.far;
}
return {
refreshFogUniforms: i,
refreshMaterialUniforms: s
};
}
-function rv(r, e, t, i) {
- let s = {}, n = {}, a = [];
- const o = r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);
- function l(y, _) {
+function nv(n, e, t, i) {
+ let s = {}, r = {}, a = [];
+ const o = n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);
+ function l(b, _) {
const E = _.program;
- i.uniformBlockBinding(y, E);
+ i.uniformBlockBinding(b, E);
}
- function c(y, _) {
- let E = s[y.id];
- E === void 0 && (g(y), E = h(y), s[y.id] = E, y.addEventListener("dispose", f));
+ function c(b, _) {
+ let E = s[b.id];
+ E === void 0 && (g(b), E = h(b), s[b.id] = E, b.addEventListener("dispose", f));
const R = _.program;
- i.updateUBOMapping(y, R);
+ i.updateUBOMapping(b, R);
const T = e.render.frame;
- n[y.id] !== T && (d(y), n[y.id] = T);
+ r[b.id] !== T && (d(b), r[b.id] = T);
}
- function h(y) {
+ function h(b) {
const _ = u();
- y.__bindingPointIndex = _;
- const E = r.createBuffer(), R = y.__size, T = y.usage;
- return r.bindBuffer(r.UNIFORM_BUFFER, E), r.bufferData(r.UNIFORM_BUFFER, R, T), r.bindBuffer(r.UNIFORM_BUFFER, null), r.bindBufferBase(r.UNIFORM_BUFFER, _, E), E;
+ b.__bindingPointIndex = _;
+ const E = n.createBuffer(), R = b.__size, T = b.usage;
+ return n.bindBuffer(n.UNIFORM_BUFFER, E), n.bufferData(n.UNIFORM_BUFFER, R, T), n.bindBuffer(n.UNIFORM_BUFFER, null), n.bindBufferBase(n.UNIFORM_BUFFER, _, E), E;
}
function u() {
- for (let y = 0; y < o; y++)
- if (a.indexOf(y) === -1)
- return a.push(y), y;
+ for (let b = 0; b < o; b++)
+ if (a.indexOf(b) === -1)
+ return a.push(b), b;
return Ve("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."), 0;
}
- function d(y) {
- const _ = s[y.id], E = y.uniforms, R = y.__cache;
- r.bindBuffer(r.UNIFORM_BUFFER, _);
+ function d(b) {
+ const _ = s[b.id], E = b.uniforms, R = b.__cache;
+ n.bindBuffer(n.UNIFORM_BUFFER, _);
for (let T = 0, A = E.length; T < A; T++) {
const I = Array.isArray(E[T]) ? E[T] : [E[T]];
for (let S = 0, M = I.length; S < M; S++) {
@@ -23676,16 +23744,16 @@ function rv(r, e, t, i) {
let H = 0;
for (let j = 0; j < z.length; j++) {
const q = z[j], te = v(q);
- typeof q == "number" || typeof q == "boolean" ? (L.__data[0] = q, r.bufferSubData(r.UNIFORM_BUFFER, N + H, L.__data)) : q.isMatrix3 ? (L.__data[0] = q.elements[0], L.__data[1] = q.elements[1], L.__data[2] = q.elements[2], L.__data[3] = 0, L.__data[4] = q.elements[3], L.__data[5] = q.elements[4], L.__data[6] = q.elements[5], L.__data[7] = 0, L.__data[8] = q.elements[6], L.__data[9] = q.elements[7], L.__data[10] = q.elements[8], L.__data[11] = 0) : (q.toArray(L.__data, H), H += te.storage / Float32Array.BYTES_PER_ELEMENT);
+ typeof q == "number" || typeof q == "boolean" ? (L.__data[0] = q, n.bufferSubData(n.UNIFORM_BUFFER, N + H, L.__data)) : q.isMatrix3 ? (L.__data[0] = q.elements[0], L.__data[1] = q.elements[1], L.__data[2] = q.elements[2], L.__data[3] = 0, L.__data[4] = q.elements[3], L.__data[5] = q.elements[4], L.__data[6] = q.elements[5], L.__data[7] = 0, L.__data[8] = q.elements[6], L.__data[9] = q.elements[7], L.__data[10] = q.elements[8], L.__data[11] = 0) : (q.toArray(L.__data, H), H += te.storage / Float32Array.BYTES_PER_ELEMENT);
}
- r.bufferSubData(r.UNIFORM_BUFFER, N, L.__data);
+ n.bufferSubData(n.UNIFORM_BUFFER, N, L.__data);
}
}
}
- r.bindBuffer(r.UNIFORM_BUFFER, null);
+ n.bindBuffer(n.UNIFORM_BUFFER, null);
}
- function m(y, _, E, R) {
- const T = y.value, A = _ + "_" + E;
+ function m(b, _, E, R) {
+ const T = b.value, A = _ + "_" + E;
if (R[A] === void 0)
return typeof T == "number" || typeof T == "boolean" ? R[A] = T : R[A] = T.clone(), !0;
{
@@ -23698,8 +23766,8 @@ function rv(r, e, t, i) {
}
return !1;
}
- function g(y) {
- const _ = y.uniforms;
+ function g(b) {
+ const _ = b.uniforms;
let E = 0;
const R = 16;
for (let A = 0, I = _.length; A < I; A++) {
@@ -23707,33 +23775,33 @@ function rv(r, e, t, i) {
for (let M = 0, L = S.length; M < L; M++) {
const N = S[M], z = Array.isArray(N.value) ? N.value : [N.value];
for (let H = 0, j = z.length; H < j; H++) {
- const q = z[H], te = v(q), G = E % R, Z = G % te.boundary, re = G + Z;
- E += Z, re !== 0 && R - re < te.storage && (E += R - re), N.__data = new Float32Array(te.storage / Float32Array.BYTES_PER_ELEMENT), N.__offset = E, E += te.storage;
+ const q = z[H], te = v(q), G = E % R, Z = G % te.boundary, ne = G + Z;
+ E += Z, ne !== 0 && R - ne < te.storage && (E += R - ne), N.__data = new Float32Array(te.storage / Float32Array.BYTES_PER_ELEMENT), N.__offset = E, E += te.storage;
}
}
}
const T = E % R;
- return T > 0 && (E += R - T), y.__size = E, y.__cache = {}, this;
+ return T > 0 && (E += R - T), b.__size = E, b.__cache = {}, this;
}
- function v(y) {
+ function v(b) {
const _ = {
boundary: 0,
// bytes
storage: 0
// bytes
};
- return typeof y == "number" || typeof y == "boolean" ? (_.boundary = 4, _.storage = 4) : y.isVector2 ? (_.boundary = 8, _.storage = 8) : y.isVector3 || y.isColor ? (_.boundary = 16, _.storage = 12) : y.isVector4 ? (_.boundary = 16, _.storage = 16) : y.isMatrix3 ? (_.boundary = 48, _.storage = 48) : y.isMatrix4 ? (_.boundary = 64, _.storage = 64) : y.isTexture ? Se("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : Se("WebGLRenderer: Unsupported uniform value type.", y), _;
+ return typeof b == "number" || typeof b == "boolean" ? (_.boundary = 4, _.storage = 4) : b.isVector2 ? (_.boundary = 8, _.storage = 8) : b.isVector3 || b.isColor ? (_.boundary = 16, _.storage = 12) : b.isVector4 ? (_.boundary = 16, _.storage = 16) : b.isMatrix3 ? (_.boundary = 48, _.storage = 48) : b.isMatrix4 ? (_.boundary = 64, _.storage = 64) : b.isTexture ? Se("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : Se("WebGLRenderer: Unsupported uniform value type.", b), _;
}
- function f(y) {
- const _ = y.target;
+ function f(b) {
+ const _ = b.target;
_.removeEventListener("dispose", f);
const E = a.indexOf(_.__bindingPointIndex);
- a.splice(E, 1), r.deleteBuffer(s[_.id]), delete s[_.id], delete n[_.id];
+ a.splice(E, 1), n.deleteBuffer(s[_.id]), delete s[_.id], delete r[_.id];
}
function p() {
- for (const y in s)
- r.deleteBuffer(s[y]);
- a = [], s = {}, n = {};
+ for (const b in s)
+ n.deleteBuffer(s[b]);
+ a = [], s = {}, r = {};
}
return {
bind: l,
@@ -23741,7 +23809,7 @@ function rv(r, e, t, i) {
dispose: p
};
}
-const nv = new Uint16Array([
+const rv = new Uint16Array([
11481,
15204,
11534,
@@ -25793,9 +25861,9 @@ const nv = new Uint16Array([
]);
let zi = null;
function av() {
- return zi === null && (zi = new sr(nv, 32, 32, Oo, vt), zi.minFilter = Mt, zi.magFilter = Mt, zi.wrapS = ti, zi.wrapT = ti, zi.generateMipmaps = !1, zi.needsUpdate = !0), zi;
+ return zi === null && (zi = new nn(rv, 32, 32, Bo, vt), zi.minFilter = Mt, zi.magFilter = Mt, zi.wrapS = ii, zi.wrapT = ii, zi.generateMipmaps = !1, zi.needsUpdate = !0), zi;
}
-class Ln {
+class Lr {
/**
* Constructs a new WebGL renderer.
*
@@ -25803,10 +25871,10 @@ class Ln {
*/
constructor(e = {}) {
const {
- canvas: t = Bu(),
+ canvas: t = Ou(),
context: i = null,
depth: s = !0,
- stencil: n = !1,
+ stencil: r = !1,
alpha: a = !1,
antialias: o = !1,
premultipliedAlpha: l = !0,
@@ -25824,18 +25892,18 @@ class Ln {
} else
m = a;
const g = /* @__PURE__ */ new Set([
- Fo,
- Bo,
+ ko,
+ Oo,
No
]), v = /* @__PURE__ */ new Set([
- vi,
+ _i,
gs,
- wr,
+ Cn,
Ys,
Do,
Io
]), f = new Uint32Array(4), p = new Int32Array(4);
- let y = null, _ = null;
+ let b = null, _ = null;
const E = [], R = [];
this.domElement = t, this.debug = {
/**
@@ -25853,28 +25921,28 @@ class Ln {
let A = !1;
this._outputColorSpace = Rt;
let I = 0, S = 0, M = null, L = -1, N = null;
- const z = new Je(), H = new Je();
+ const z = new Qe(), H = new Qe();
let j = null;
const q = new xe(0);
- let te = 0, G = t.width, Z = t.height, re = 1, Le = null, He = null;
- const Ye = new Je(0, 0, G, Z), Ze = new Je(0, 0, G, Z);
- let $e = !1;
+ let te = 0, G = t.width, Z = t.height, ne = 1, Le = null, He = null;
+ const Ye = new Qe(0, 0, G, Z), $e = new Qe(0, 0, G, Z);
+ let Je = !1;
const W = new qo();
- let Y = !1, ue = !1;
- const Ae = new Ne(), Te = new w(), we = new Je(), Qe = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
+ let Y = !1, de = !1;
+ const Ae = new Ne(), Te = new w(), we = new Qe(), et = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
let Xe = !1;
function Ge() {
- return M === null ? re : 1;
+ return M === null ? ne : 1;
}
let D = i;
- function _t(b, O) {
- return t.getContext(b, O);
+ function _t(y, B) {
+ return t.getContext(y, B);
}
try {
- const b = {
+ const y = {
alpha: !0,
depth: s,
- stencil: n,
+ stencil: r,
antialias: o,
premultipliedAlpha: l,
preserveDrawingBuffer: c,
@@ -25882,86 +25950,86 @@ class Ln {
failIfMajorPerformanceCaveat: u
};
if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r181"), t.addEventListener("webglcontextlost", Q, !1), t.addEventListener("webglcontextrestored", $, !1), t.addEventListener("webglcontextcreationerror", _e, !1), D === null) {
- const O = "webgl2";
- if (D = _t(O, b), D === null)
- throw _t(O) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
+ const B = "webgl2";
+ if (D = _t(B, y), D === null)
+ throw _t(B) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
}
- } catch (b) {
- throw b("WebGLRenderer: " + b.message), b;
+ } catch (y) {
+ throw y("WebGLRenderer: " + y.message), y;
}
- let je, et, fe, ot, Me, De, C, x, B, X, K, V, ye, ne, Ee, de, J, se, Be, Ce, he, Re, P, ae;
+ let je, tt, fe, lt, Me, De, C, x, O, X, K, V, be, re, Ee, pe, J, se, Oe, Ce, ue, Re, P, ae;
function ie() {
- je = new fg(D), je.init(), Re = new $0(D, je), et = new ag(D, je, e, Re), fe = new K0(D, je), et.reversedDepthBuffer && d && fe.buffers.depth.setReversed(!0), ot = new _g(D), Me = new O0(), De = new Z0(D, je, fe, Me, et, Re, ot), C = new lg(T), x = new mg(T), B = new bp(D), P = new rg(D, B), X = new gg(D, B, ot, P), K = new yg(D, X, B, ot), Be = new xg(D, et, De), de = new og(Me), V = new N0(T, C, x, je, et, P, de), ye = new sv(T, Me), ne = new F0(), Ee = new W0(je), se = new sg(T, C, x, fe, K, m, l), J = new q0(T, K, et), ae = new rv(D, ot, et, fe), Ce = new ng(D, je, ot), he = new vg(D, je, ot), ot.programs = V.programs, T.capabilities = et, T.extensions = je, T.properties = Me, T.renderLists = ne, T.shadowMap = J, T.state = fe, T.info = ot;
+ je = new fg(D), je.init(), Re = new $0(D, je), tt = new ag(D, je, e, Re), fe = new K0(D, je), tt.reversedDepthBuffer && d && fe.buffers.depth.setReversed(!0), lt = new _g(D), Me = new B0(), De = new Z0(D, je, fe, Me, tt, Re, lt), C = new lg(T), x = new mg(T), O = new yp(D), P = new ng(D, O), X = new gg(D, O, lt, P), K = new bg(D, X, O, lt), Oe = new xg(D, tt, De), pe = new og(Me), V = new N0(T, C, x, je, tt, P, pe), be = new sv(T, Me), re = new k0(), Ee = new W0(je), se = new sg(T, C, x, fe, K, m, l), J = new q0(T, K, tt), ae = new nv(D, lt, tt, fe), Ce = new rg(D, je, lt), ue = new vg(D, je, lt), lt.programs = V.programs, T.capabilities = tt, T.extensions = je, T.properties = Me, T.renderLists = re, T.shadowMap = J, T.state = fe, T.info = lt;
}
ie();
- const le = new tv(T, D);
- this.xr = le, this.getContext = function() {
+ const ce = new tv(T, D);
+ this.xr = ce, this.getContext = function() {
return D;
}, this.getContextAttributes = function() {
return D.getContextAttributes();
}, this.forceContextLoss = function() {
- const b = je.get("WEBGL_lose_context");
- b && b.loseContext();
+ const y = je.get("WEBGL_lose_context");
+ y && y.loseContext();
}, this.forceContextRestore = function() {
- const b = je.get("WEBGL_lose_context");
- b && b.restoreContext();
+ const y = je.get("WEBGL_lose_context");
+ y && y.restoreContext();
}, this.getPixelRatio = function() {
- return re;
- }, this.setPixelRatio = function(b) {
- b !== void 0 && (re = b, this.setSize(G, Z, !1));
- }, this.getSize = function(b) {
- return b.set(G, Z);
- }, this.setSize = function(b, O, F = !0) {
- if (le.isPresenting) {
+ return ne;
+ }, this.setPixelRatio = function(y) {
+ y !== void 0 && (ne = y, this.setSize(G, Z, !1));
+ }, this.getSize = function(y) {
+ return y.set(G, Z);
+ }, this.setSize = function(y, B, k = !0) {
+ if (ce.isPresenting) {
Se("WebGLRenderer: Can't change size while VR device is presenting.");
return;
}
- G = b, Z = O, t.width = Math.floor(b * re), t.height = Math.floor(O * re), F === !0 && (t.style.width = b + "px", t.style.height = O + "px"), this.setViewport(0, 0, b, O);
- }, this.getDrawingBufferSize = function(b) {
- return b.set(G * re, Z * re).floor();
- }, this.setDrawingBufferSize = function(b, O, F) {
- G = b, Z = O, re = F, t.width = Math.floor(b * F), t.height = Math.floor(O * F), this.setViewport(0, 0, b, O);
- }, this.getCurrentViewport = function(b) {
- return b.copy(z);
- }, this.getViewport = function(b) {
- return b.copy(Ye);
- }, this.setViewport = function(b, O, F, k) {
- b.isVector4 ? Ye.set(b.x, b.y, b.z, b.w) : Ye.set(b, O, F, k), fe.viewport(z.copy(Ye).multiplyScalar(re).round());
- }, this.getScissor = function(b) {
- return b.copy(Ze);
- }, this.setScissor = function(b, O, F, k) {
- b.isVector4 ? Ze.set(b.x, b.y, b.z, b.w) : Ze.set(b, O, F, k), fe.scissor(H.copy(Ze).multiplyScalar(re).round());
+ G = y, Z = B, t.width = Math.floor(y * ne), t.height = Math.floor(B * ne), k === !0 && (t.style.width = y + "px", t.style.height = B + "px"), this.setViewport(0, 0, y, B);
+ }, this.getDrawingBufferSize = function(y) {
+ return y.set(G * ne, Z * ne).floor();
+ }, this.setDrawingBufferSize = function(y, B, k) {
+ G = y, Z = B, ne = k, t.width = Math.floor(y * k), t.height = Math.floor(B * k), this.setViewport(0, 0, y, B);
+ }, this.getCurrentViewport = function(y) {
+ return y.copy(z);
+ }, this.getViewport = function(y) {
+ return y.copy(Ye);
+ }, this.setViewport = function(y, B, k, F) {
+ y.isVector4 ? Ye.set(y.x, y.y, y.z, y.w) : Ye.set(y, B, k, F), fe.viewport(z.copy(Ye).multiplyScalar(ne).round());
+ }, this.getScissor = function(y) {
+ return y.copy($e);
+ }, this.setScissor = function(y, B, k, F) {
+ y.isVector4 ? $e.set(y.x, y.y, y.z, y.w) : $e.set(y, B, k, F), fe.scissor(H.copy($e).multiplyScalar(ne).round());
}, this.getScissorTest = function() {
- return $e;
- }, this.setScissorTest = function(b) {
- fe.setScissorTest($e = b);
- }, this.setOpaqueSort = function(b) {
- Le = b;
- }, this.setTransparentSort = function(b) {
- He = b;
- }, this.getClearColor = function(b) {
- return b.copy(se.getClearColor());
+ return Je;
+ }, this.setScissorTest = function(y) {
+ fe.setScissorTest(Je = y);
+ }, this.setOpaqueSort = function(y) {
+ Le = y;
+ }, this.setTransparentSort = function(y) {
+ He = y;
+ }, this.getClearColor = function(y) {
+ return y.copy(se.getClearColor());
}, this.setClearColor = function() {
se.setClearColor(...arguments);
}, this.getClearAlpha = function() {
return se.getClearAlpha();
}, this.setClearAlpha = function() {
se.setClearAlpha(...arguments);
- }, this.clear = function(b = !0, O = !0, F = !0) {
- let k = 0;
- if (b) {
+ }, this.clear = function(y = !0, B = !0, k = !0) {
+ let F = 0;
+ if (y) {
let U = !1;
if (M !== null) {
const ee = M.texture.format;
U = g.has(ee);
}
if (U) {
- const ee = M.texture.type, pe = v.has(ee), ge = se.getClearColor(), ve = se.getClearAlpha(), Ie = ge.r, Oe = ge.g, Ue = ge.b;
- pe ? (f[0] = Ie, f[1] = Oe, f[2] = Ue, f[3] = ve, D.clearBufferuiv(D.COLOR, 0, f)) : (p[0] = Ie, p[1] = Oe, p[2] = Ue, p[3] = ve, D.clearBufferiv(D.COLOR, 0, p));
+ const ee = M.texture.type, me = v.has(ee), ge = se.getClearColor(), ve = se.getClearAlpha(), Ie = ge.r, Be = ge.g, Ue = ge.b;
+ me ? (f[0] = Ie, f[1] = Be, f[2] = Ue, f[3] = ve, D.clearBufferuiv(D.COLOR, 0, f)) : (p[0] = Ie, p[1] = Be, p[2] = Ue, p[3] = ve, D.clearBufferiv(D.COLOR, 0, p));
} else
- k |= D.COLOR_BUFFER_BIT;
+ F |= D.COLOR_BUFFER_BIT;
}
- O && (k |= D.DEPTH_BUFFER_BIT), F && (k |= D.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), D.clear(k);
+ B && (F |= D.DEPTH_BUFFER_BIT), k && (F |= D.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), D.clear(F);
}, this.clearColor = function() {
this.clear(!0, !1, !1);
}, this.clearDepth = function() {
@@ -25969,103 +26037,103 @@ class Ln {
}, this.clearStencil = function() {
this.clear(!1, !1, !0);
}, this.dispose = function() {
- t.removeEventListener("webglcontextlost", Q, !1), t.removeEventListener("webglcontextrestored", $, !1), t.removeEventListener("webglcontextcreationerror", _e, !1), se.dispose(), ne.dispose(), Ee.dispose(), Me.dispose(), C.dispose(), x.dispose(), K.dispose(), P.dispose(), ae.dispose(), V.dispose(), le.dispose(), le.removeEventListener("sessionstart", sl), le.removeEventListener("sessionend", rl), as.stop();
+ t.removeEventListener("webglcontextlost", Q, !1), t.removeEventListener("webglcontextrestored", $, !1), t.removeEventListener("webglcontextcreationerror", _e, !1), se.dispose(), re.dispose(), Ee.dispose(), Me.dispose(), C.dispose(), x.dispose(), K.dispose(), P.dispose(), ae.dispose(), V.dispose(), ce.dispose(), ce.removeEventListener("sessionstart", sl), ce.removeEventListener("sessionend", nl), as.stop();
};
- function Q(b) {
- b.preventDefault(), An("WebGLRenderer: Context Lost."), A = !0;
+ function Q(y) {
+ y.preventDefault(), Ar("WebGLRenderer: Context Lost."), A = !0;
}
function $() {
- An("WebGLRenderer: Context Restored."), A = !1;
- const b = ot.autoReset, O = J.enabled, F = J.autoUpdate, k = J.needsUpdate, U = J.type;
- ie(), ot.autoReset = b, J.enabled = O, J.autoUpdate = F, J.needsUpdate = k, J.type = U;
+ Ar("WebGLRenderer: Context Restored."), A = !1;
+ const y = lt.autoReset, B = J.enabled, k = J.autoUpdate, F = J.needsUpdate, U = J.type;
+ ie(), lt.autoReset = y, J.enabled = B, J.autoUpdate = k, J.needsUpdate = F, J.type = U;
}
- function _e(b) {
- Ve("WebGLRenderer: A WebGL context could not be created. Reason: ", b.statusMessage);
+ function _e(y) {
+ Ve("WebGLRenderer: A WebGL context could not be created. Reason: ", y.statusMessage);
}
- function Pe(b) {
- const O = b.target;
- O.removeEventListener("dispose", Pe), Ct(O);
+ function Pe(y) {
+ const B = y.target;
+ B.removeEventListener("dispose", Pe), Ct(B);
}
- function Ct(b) {
- rt(b), Me.remove(b);
+ function Ct(y) {
+ rt(y), Me.remove(y);
}
- function rt(b) {
- const O = Me.get(b).programs;
- O !== void 0 && (O.forEach(function(F) {
- V.releaseProgram(F);
- }), b.isShaderMaterial && V.releaseShaderCache(b));
+ function rt(y) {
+ const B = Me.get(y).programs;
+ B !== void 0 && (B.forEach(function(k) {
+ V.releaseProgram(k);
+ }), y.isShaderMaterial && V.releaseShaderCache(y));
}
- this.renderBufferDirect = function(b, O, F, k, U, ee) {
- O === null && (O = Qe);
- const pe = U.isMesh && U.matrixWorld.determinant() < 0, ge = Wh(b, O, F, k, U);
- fe.setMaterial(k, pe);
- let ve = F.index, Ie = 1;
- if (k.wireframe === !0) {
- if (ve = X.getWireframeAttribute(F), ve === void 0) return;
+ this.renderBufferDirect = function(y, B, k, F, U, ee) {
+ B === null && (B = et);
+ const me = U.isMesh && U.matrixWorld.determinant() < 0, ge = Wh(y, B, k, F, U);
+ fe.setMaterial(F, me);
+ let ve = k.index, Ie = 1;
+ if (F.wireframe === !0) {
+ if (ve = X.getWireframeAttribute(k), ve === void 0) return;
Ie = 2;
}
- const Oe = F.drawRange, Ue = F.attributes.position;
- let Ke = Oe.start * Ie, ct = (Oe.start + Oe.count) * Ie;
+ const Be = k.drawRange, Ue = k.attributes.position;
+ let Ke = Be.start * Ie, ct = (Be.start + Be.count) * Ie;
ee !== null && (Ke = Math.max(Ke, ee.start * Ie), ct = Math.min(ct, (ee.start + ee.count) * Ie)), ve !== null ? (Ke = Math.max(Ke, 0), ct = Math.min(ct, ve.count)) : Ue != null && (Ke = Math.max(Ke, 0), ct = Math.min(ct, Ue.count));
const ft = ct - Ke;
if (ft < 0 || ft === 1 / 0) return;
- P.setup(U, k, ge, F, ve);
+ P.setup(U, F, ge, k, ve);
let dt, ht = Ce;
- if (ve !== null && (dt = B.get(ve), ht = he, ht.setIndex(dt)), U.isMesh)
- k.wireframe === !0 ? (fe.setLineWidth(k.wireframeLinewidth * Ge()), ht.setMode(D.LINES)) : ht.setMode(D.TRIANGLES);
+ if (ve !== null && (dt = O.get(ve), ht = ue, ht.setIndex(dt)), U.isMesh)
+ F.wireframe === !0 ? (fe.setLineWidth(F.wireframeLinewidth * Ge()), ht.setMode(D.LINES)) : ht.setMode(D.TRIANGLES);
else if (U.isLine) {
- let be = k.linewidth;
- be === void 0 && (be = 1), fe.setLineWidth(be * Ge()), U.isLineSegments ? ht.setMode(D.LINES) : U.isLineLoop ? ht.setMode(D.LINE_LOOP) : ht.setMode(D.LINE_STRIP);
+ let ye = F.linewidth;
+ ye === void 0 && (ye = 1), fe.setLineWidth(ye * Ge()), U.isLineSegments ? ht.setMode(D.LINES) : U.isLineLoop ? ht.setMode(D.LINE_LOOP) : ht.setMode(D.LINE_STRIP);
} else U.isPoints ? ht.setMode(D.POINTS) : U.isSprite && ht.setMode(D.TRIANGLES);
if (U.isBatchedMesh)
if (U._multiDrawInstances !== null)
- Lr("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), ht.renderMultiDrawInstances(U._multiDrawStarts, U._multiDrawCounts, U._multiDrawCount, U._multiDrawInstances);
+ Dn("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), ht.renderMultiDrawInstances(U._multiDrawStarts, U._multiDrawCounts, U._multiDrawCount, U._multiDrawInstances);
else if (je.get("WEBGL_multi_draw"))
ht.renderMultiDraw(U._multiDrawStarts, U._multiDrawCounts, U._multiDrawCount);
else {
- const be = U._multiDrawStarts, Dt = U._multiDrawCounts, Ii = U._multiDrawCount, ni = ve ? B.get(ve).bytesPerElement : 1, ys = Me.get(k).currentProgram.getUniforms();
- for (let Yt = 0; Yt < Ii; Yt++)
- ys.setValue(D, "_gl_DrawID", Yt), ht.render(be[Yt] / ni, Dt[Yt]);
+ const ye = U._multiDrawStarts, Dt = U._multiDrawCounts, Ii = U._multiDrawCount, ai = ve ? O.get(ve).bytesPerElement : 1, bs = Me.get(F).currentProgram.getUniforms();
+ for (let Kt = 0; Kt < Ii; Kt++)
+ bs.setValue(D, "_gl_DrawID", Kt), ht.render(ye[Kt] / ai, Dt[Kt]);
}
else if (U.isInstancedMesh)
ht.renderInstances(Ke, ft, U.count);
- else if (F.isInstancedBufferGeometry) {
- const be = F._maxInstanceCount !== void 0 ? F._maxInstanceCount : 1 / 0, Dt = Math.min(F.instanceCount, be);
+ else if (k.isInstancedBufferGeometry) {
+ const ye = k._maxInstanceCount !== void 0 ? k._maxInstanceCount : 1 / 0, Dt = Math.min(k.instanceCount, ye);
ht.renderInstances(Ke, ft, Dt);
} else
ht.render(Ke, ft);
};
- function Mi(b, O, F) {
- b.transparent === !0 && b.side === jt && b.forceSinglePass === !1 ? (b.side = Ht, b.needsUpdate = !0, Br(b, O, F), b.side = Ai, b.needsUpdate = !0, Br(b, O, F), b.side = jt) : Br(b, O, F);
+ function Mi(y, B, k) {
+ y.transparent === !0 && y.side === Xt && y.forceSinglePass === !1 ? (y.side = Vt, y.needsUpdate = !0, kn(y, B, k), y.side = Ai, y.needsUpdate = !0, kn(y, B, k), y.side = Xt) : kn(y, B, k);
}
- this.compile = function(b, O, F = null) {
- F === null && (F = b), _ = Ee.get(F), _.init(O), R.push(_), F.traverseVisible(function(U) {
- U.isLight && U.layers.test(O.layers) && (_.pushLight(U), U.castShadow && _.pushShadow(U));
- }), b !== F && b.traverseVisible(function(U) {
- U.isLight && U.layers.test(O.layers) && (_.pushLight(U), U.castShadow && _.pushShadow(U));
+ this.compile = function(y, B, k = null) {
+ k === null && (k = y), _ = Ee.get(k), _.init(B), R.push(_), k.traverseVisible(function(U) {
+ U.isLight && U.layers.test(B.layers) && (_.pushLight(U), U.castShadow && _.pushShadow(U));
+ }), y !== k && y.traverseVisible(function(U) {
+ U.isLight && U.layers.test(B.layers) && (_.pushLight(U), U.castShadow && _.pushShadow(U));
}), _.setupLights();
- const k = /* @__PURE__ */ new Set();
- return b.traverse(function(U) {
+ const F = /* @__PURE__ */ new Set();
+ return y.traverse(function(U) {
if (!(U.isMesh || U.isPoints || U.isLine || U.isSprite))
return;
const ee = U.material;
if (ee)
if (Array.isArray(ee))
- for (let pe = 0; pe < ee.length; pe++) {
- const ge = ee[pe];
- Mi(ge, F, U), k.add(ge);
+ for (let me = 0; me < ee.length; me++) {
+ const ge = ee[me];
+ Mi(ge, k, U), F.add(ge);
}
else
- Mi(ee, F, U), k.add(ee);
- }), _ = R.pop(), k;
- }, this.compileAsync = function(b, O, F = null) {
- const k = this.compile(b, O, F);
+ Mi(ee, k, U), F.add(ee);
+ }), _ = R.pop(), F;
+ }, this.compileAsync = function(y, B, k = null) {
+ const F = this.compile(y, B, k);
return new Promise((U) => {
function ee() {
- if (k.forEach(function(pe) {
- Me.get(pe).currentProgram.isReady() && k.delete(pe);
- }), k.size === 0) {
- U(b);
+ if (F.forEach(function(me) {
+ Me.get(me).currentProgram.isReady() && F.delete(me);
+ }), F.size === 0) {
+ U(y);
return;
}
setTimeout(ee, 10);
@@ -26074,175 +26142,175 @@ class Ln {
});
};
let ri = null;
- function Gh(b) {
- ri && ri(b);
+ function Gh(y) {
+ ri && ri(y);
}
function sl() {
as.stop();
}
- function rl() {
+ function nl() {
as.start();
}
const as = new Rh();
- as.setAnimationLoop(Gh), typeof self < "u" && as.setContext(self), this.setAnimationLoop = function(b) {
- ri = b, le.setAnimationLoop(b), b === null ? as.stop() : as.start();
- }, le.addEventListener("sessionstart", sl), le.addEventListener("sessionend", rl), this.render = function(b, O) {
- if (O !== void 0 && O.isCamera !== !0) {
+ as.setAnimationLoop(Gh), typeof self < "u" && as.setContext(self), this.setAnimationLoop = function(y) {
+ ri = y, ce.setAnimationLoop(y), y === null ? as.stop() : as.start();
+ }, ce.addEventListener("sessionstart", sl), ce.addEventListener("sessionend", nl), this.render = function(y, B) {
+ if (B !== void 0 && B.isCamera !== !0) {
Ve("WebGLRenderer.render: camera is not an instance of THREE.Camera.");
return;
}
if (A === !0) return;
- if (b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), O.parent === null && O.matrixWorldAutoUpdate === !0 && O.updateMatrixWorld(), le.enabled === !0 && le.isPresenting === !0 && (le.cameraAutoUpdate === !0 && le.updateCamera(O), O = le.getCamera()), b.isScene === !0 && b.onBeforeRender(T, b, O, M), _ = Ee.get(b, R.length), _.init(O), R.push(_), Ae.multiplyMatrices(O.projectionMatrix, O.matrixWorldInverse), W.setFromProjectionMatrix(Ae, Ci, O.reversedDepth), ue = this.localClippingEnabled, Y = de.init(this.clippingPlanes, ue), y = ne.get(b, E.length), y.init(), E.push(y), le.enabled === !0 && le.isPresenting === !0) {
+ if (y.matrixWorldAutoUpdate === !0 && y.updateMatrixWorld(), B.parent === null && B.matrixWorldAutoUpdate === !0 && B.updateMatrixWorld(), ce.enabled === !0 && ce.isPresenting === !0 && (ce.cameraAutoUpdate === !0 && ce.updateCamera(B), B = ce.getCamera()), y.isScene === !0 && y.onBeforeRender(T, y, B, M), _ = Ee.get(y, R.length), _.init(B), R.push(_), Ae.multiplyMatrices(B.projectionMatrix, B.matrixWorldInverse), W.setFromProjectionMatrix(Ae, Ci, B.reversedDepth), de = this.localClippingEnabled, Y = pe.init(this.clippingPlanes, de), b = re.get(y, E.length), b.init(), E.push(b), ce.enabled === !0 && ce.isPresenting === !0) {
const ee = T.xr.getDepthSensingMesh();
- ee !== null && Bn(ee, O, -1 / 0, T.sortObjects);
+ ee !== null && Or(ee, B, -1 / 0, T.sortObjects);
}
- Bn(b, O, 0, T.sortObjects), y.finish(), T.sortObjects === !0 && y.sort(Le, He), Xe = le.enabled === !1 || le.isPresenting === !1 || le.hasDepthSensing() === !1, Xe && se.addToRenderList(y, b), this.info.render.frame++, Y === !0 && de.beginShadows();
- const F = _.state.shadowsArray;
- J.render(F, b, O), Y === !0 && de.endShadows(), this.info.autoReset === !0 && this.info.reset();
- const k = y.opaque, U = y.transmissive;
- if (_.setupLights(), O.isArrayCamera) {
- const ee = O.cameras;
+ Or(y, B, 0, T.sortObjects), b.finish(), T.sortObjects === !0 && b.sort(Le, He), Xe = ce.enabled === !1 || ce.isPresenting === !1 || ce.hasDepthSensing() === !1, Xe && se.addToRenderList(b, y), this.info.render.frame++, Y === !0 && pe.beginShadows();
+ const k = _.state.shadowsArray;
+ J.render(k, y, B), Y === !0 && pe.endShadows(), this.info.autoReset === !0 && this.info.reset();
+ const F = b.opaque, U = b.transmissive;
+ if (_.setupLights(), B.isArrayCamera) {
+ const ee = B.cameras;
if (U.length > 0)
- for (let pe = 0, ge = ee.length; pe < ge; pe++) {
- const ve = ee[pe];
- al(k, U, b, ve);
+ for (let me = 0, ge = ee.length; me < ge; me++) {
+ const ve = ee[me];
+ al(F, U, y, ve);
}
- Xe && se.render(b);
- for (let pe = 0, ge = ee.length; pe < ge; pe++) {
- const ve = ee[pe];
- nl(y, b, ve, ve.viewport);
+ Xe && se.render(y);
+ for (let me = 0, ge = ee.length; me < ge; me++) {
+ const ve = ee[me];
+ rl(b, y, ve, ve.viewport);
}
} else
- U.length > 0 && al(k, U, b, O), Xe && se.render(b), nl(y, b, O);
- M !== null && S === 0 && (De.updateMultisampleRenderTarget(M), De.updateRenderTargetMipmap(M)), b.isScene === !0 && b.onAfterRender(T, b, O), P.resetDefaultState(), L = -1, N = null, R.pop(), R.length > 0 ? (_ = R[R.length - 1], Y === !0 && de.setGlobalState(T.clippingPlanes, _.state.camera)) : _ = null, E.pop(), E.length > 0 ? y = E[E.length - 1] : y = null;
+ U.length > 0 && al(F, U, y, B), Xe && se.render(y), rl(b, y, B);
+ M !== null && S === 0 && (De.updateMultisampleRenderTarget(M), De.updateRenderTargetMipmap(M)), y.isScene === !0 && y.onAfterRender(T, y, B), P.resetDefaultState(), L = -1, N = null, R.pop(), R.length > 0 ? (_ = R[R.length - 1], Y === !0 && pe.setGlobalState(T.clippingPlanes, _.state.camera)) : _ = null, E.pop(), E.length > 0 ? b = E[E.length - 1] : b = null;
};
- function Bn(b, O, F, k) {
- if (b.visible === !1) return;
- if (b.layers.test(O.layers)) {
- if (b.isGroup)
- F = b.renderOrder;
- else if (b.isLOD)
- b.autoUpdate === !0 && b.update(O);
- else if (b.isLight)
- _.pushLight(b), b.castShadow && _.pushShadow(b);
- else if (b.isSprite) {
- if (!b.frustumCulled || W.intersectsSprite(b)) {
- k && we.setFromMatrixPosition(b.matrixWorld).applyMatrix4(Ae);
- const ee = K.update(b), pe = b.material;
- pe.visible && y.push(b, ee, pe, F, we.z, null);
+ function Or(y, B, k, F) {
+ if (y.visible === !1) return;
+ if (y.layers.test(B.layers)) {
+ if (y.isGroup)
+ k = y.renderOrder;
+ else if (y.isLOD)
+ y.autoUpdate === !0 && y.update(B);
+ else if (y.isLight)
+ _.pushLight(y), y.castShadow && _.pushShadow(y);
+ else if (y.isSprite) {
+ if (!y.frustumCulled || W.intersectsSprite(y)) {
+ F && we.setFromMatrixPosition(y.matrixWorld).applyMatrix4(Ae);
+ const ee = K.update(y), me = y.material;
+ me.visible && b.push(y, ee, me, k, we.z, null);
}
- } else if ((b.isMesh || b.isLine || b.isPoints) && (!b.frustumCulled || W.intersectsObject(b))) {
- const ee = K.update(b), pe = b.material;
- if (k && (b.boundingSphere !== void 0 ? (b.boundingSphere === null && b.computeBoundingSphere(), we.copy(b.boundingSphere.center)) : (ee.boundingSphere === null && ee.computeBoundingSphere(), we.copy(ee.boundingSphere.center)), we.applyMatrix4(b.matrixWorld).applyMatrix4(Ae)), Array.isArray(pe)) {
+ } else if ((y.isMesh || y.isLine || y.isPoints) && (!y.frustumCulled || W.intersectsObject(y))) {
+ const ee = K.update(y), me = y.material;
+ if (F && (y.boundingSphere !== void 0 ? (y.boundingSphere === null && y.computeBoundingSphere(), we.copy(y.boundingSphere.center)) : (ee.boundingSphere === null && ee.computeBoundingSphere(), we.copy(ee.boundingSphere.center)), we.applyMatrix4(y.matrixWorld).applyMatrix4(Ae)), Array.isArray(me)) {
const ge = ee.groups;
for (let ve = 0, Ie = ge.length; ve < Ie; ve++) {
- const Oe = ge[ve], Ue = pe[Oe.materialIndex];
- Ue && Ue.visible && y.push(b, ee, Ue, F, we.z, Oe);
+ const Be = ge[ve], Ue = me[Be.materialIndex];
+ Ue && Ue.visible && b.push(y, ee, Ue, k, we.z, Be);
}
- } else pe.visible && y.push(b, ee, pe, F, we.z, null);
+ } else me.visible && b.push(y, ee, me, k, we.z, null);
}
}
- const U = b.children;
- for (let ee = 0, pe = U.length; ee < pe; ee++)
- Bn(U[ee], O, F, k);
+ const U = y.children;
+ for (let ee = 0, me = U.length; ee < me; ee++)
+ Or(U[ee], B, k, F);
}
- function nl(b, O, F, k) {
- const { opaque: U, transmissive: ee, transparent: pe } = b;
- _.setupLightsView(F), Y === !0 && de.setGlobalState(T.clippingPlanes, F), k && fe.viewport(z.copy(k)), U.length > 0 && Or(U, O, F), ee.length > 0 && Or(ee, O, F), pe.length > 0 && Or(pe, O, F), fe.buffers.depth.setTest(!0), fe.buffers.depth.setMask(!0), fe.buffers.color.setMask(!0), fe.setPolygonOffset(!1);
+ function rl(y, B, k, F) {
+ const { opaque: U, transmissive: ee, transparent: me } = y;
+ _.setupLightsView(k), Y === !0 && pe.setGlobalState(T.clippingPlanes, k), F && fe.viewport(z.copy(F)), U.length > 0 && On(U, B, k), ee.length > 0 && On(ee, B, k), me.length > 0 && On(me, B, k), fe.buffers.depth.setTest(!0), fe.buffers.depth.setMask(!0), fe.buffers.color.setMask(!0), fe.setPolygonOffset(!1);
}
- function al(b, O, F, k) {
- if ((F.isScene === !0 ? F.overrideMaterial : null) !== null)
+ function al(y, B, k, F) {
+ if ((k.isScene === !0 ? k.overrideMaterial : null) !== null)
return;
- _.state.transmissionRenderTarget[k.id] === void 0 && (_.state.transmissionRenderTarget[k.id] = new bt(1, 1, {
+ _.state.transmissionRenderTarget[F.id] === void 0 && (_.state.transmissionRenderTarget[F.id] = new yt(1, 1, {
generateMipmaps: !0,
- type: je.has("EXT_color_buffer_half_float") || je.has("EXT_color_buffer_float") ? vt : vi,
+ type: je.has("EXT_color_buffer_half_float") || je.has("EXT_color_buffer_float") ? vt : _i,
minFilter: wi,
samples: 4,
- stencilBuffer: n,
+ stencilBuffer: r,
resolveDepthBuffer: !1,
resolveStencilBuffer: !1,
colorSpace: qe.workingColorSpace
}));
- const U = _.state.transmissionRenderTarget[k.id], ee = k.viewport || z;
+ const U = _.state.transmissionRenderTarget[F.id], ee = F.viewport || z;
U.setSize(ee.z * T.transmissionResolutionScale, ee.w * T.transmissionResolutionScale);
- const pe = T.getRenderTarget(), ge = T.getActiveCubeFace(), ve = T.getActiveMipmapLevel();
- T.setRenderTarget(U), T.getClearColor(q), te = T.getClearAlpha(), te < 1 && T.setClearColor(16777215, 0.5), T.clear(), Xe && se.render(F);
+ const me = T.getRenderTarget(), ge = T.getActiveCubeFace(), ve = T.getActiveMipmapLevel();
+ T.setRenderTarget(U), T.getClearColor(q), te = T.getClearAlpha(), te < 1 && T.setClearColor(16777215, 0.5), T.clear(), Xe && se.render(k);
const Ie = T.toneMapping;
T.toneMapping = is;
- const Oe = k.viewport;
- if (k.viewport !== void 0 && (k.viewport = void 0), _.setupLightsView(k), Y === !0 && de.setGlobalState(T.clippingPlanes, k), Or(b, F, k), De.updateMultisampleRenderTarget(U), De.updateRenderTargetMipmap(U), je.has("WEBGL_multisampled_render_to_texture") === !1) {
+ const Be = F.viewport;
+ if (F.viewport !== void 0 && (F.viewport = void 0), _.setupLightsView(F), Y === !0 && pe.setGlobalState(T.clippingPlanes, F), On(y, k, F), De.updateMultisampleRenderTarget(U), De.updateRenderTargetMipmap(U), je.has("WEBGL_multisampled_render_to_texture") === !1) {
let Ue = !1;
- for (let Ke = 0, ct = O.length; Ke < ct; Ke++) {
- const ft = O[Ke], { object: dt, geometry: ht, material: be, group: Dt } = ft;
- if (be.side === jt && dt.layers.test(k.layers)) {
- const Ii = be.side;
- be.side = Ht, be.needsUpdate = !0, ol(dt, F, k, ht, be, Dt), be.side = Ii, be.needsUpdate = !0, Ue = !0;
+ for (let Ke = 0, ct = B.length; Ke < ct; Ke++) {
+ const ft = B[Ke], { object: dt, geometry: ht, material: ye, group: Dt } = ft;
+ if (ye.side === Xt && dt.layers.test(F.layers)) {
+ const Ii = ye.side;
+ ye.side = Vt, ye.needsUpdate = !0, ol(dt, k, F, ht, ye, Dt), ye.side = Ii, ye.needsUpdate = !0, Ue = !0;
}
}
Ue === !0 && (De.updateMultisampleRenderTarget(U), De.updateRenderTargetMipmap(U));
}
- T.setRenderTarget(pe, ge, ve), T.setClearColor(q, te), Oe !== void 0 && (k.viewport = Oe), T.toneMapping = Ie;
+ T.setRenderTarget(me, ge, ve), T.setClearColor(q, te), Be !== void 0 && (F.viewport = Be), T.toneMapping = Ie;
}
- function Or(b, O, F) {
- const k = O.isScene === !0 ? O.overrideMaterial : null;
- for (let U = 0, ee = b.length; U < ee; U++) {
- const pe = b[U], { object: ge, geometry: ve, group: Ie } = pe;
- let Oe = pe.material;
- Oe.allowOverride === !0 && k !== null && (Oe = k), ge.layers.test(F.layers) && ol(ge, O, F, ve, Oe, Ie);
+ function On(y, B, k) {
+ const F = B.isScene === !0 ? B.overrideMaterial : null;
+ for (let U = 0, ee = y.length; U < ee; U++) {
+ const me = y[U], { object: ge, geometry: ve, group: Ie } = me;
+ let Be = me.material;
+ Be.allowOverride === !0 && F !== null && (Be = F), ge.layers.test(k.layers) && ol(ge, B, k, ve, Be, Ie);
}
}
- function ol(b, O, F, k, U, ee) {
- b.onBeforeRender(T, O, F, k, U, ee), b.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse, b.matrixWorld), b.normalMatrix.getNormalMatrix(b.modelViewMatrix), U.onBeforeRender(T, O, F, k, b, ee), U.transparent === !0 && U.side === jt && U.forceSinglePass === !1 ? (U.side = Ht, U.needsUpdate = !0, T.renderBufferDirect(F, O, k, U, b, ee), U.side = Ai, U.needsUpdate = !0, T.renderBufferDirect(F, O, k, U, b, ee), U.side = jt) : T.renderBufferDirect(F, O, k, U, b, ee), b.onAfterRender(T, O, F, k, U, ee);
+ function ol(y, B, k, F, U, ee) {
+ y.onBeforeRender(T, B, k, F, U, ee), y.modelViewMatrix.multiplyMatrices(k.matrixWorldInverse, y.matrixWorld), y.normalMatrix.getNormalMatrix(y.modelViewMatrix), U.onBeforeRender(T, B, k, F, y, ee), U.transparent === !0 && U.side === Xt && U.forceSinglePass === !1 ? (U.side = Vt, U.needsUpdate = !0, T.renderBufferDirect(k, B, F, U, y, ee), U.side = Ai, U.needsUpdate = !0, T.renderBufferDirect(k, B, F, U, y, ee), U.side = Xt) : T.renderBufferDirect(k, B, F, U, y, ee), y.onAfterRender(T, B, k, F, U, ee);
}
- function Br(b, O, F) {
- O.isScene !== !0 && (O = Qe);
- const k = Me.get(b), U = _.state.lights, ee = _.state.shadowsArray, pe = U.state.version, ge = V.getParameters(b, U.state, ee, O, F), ve = V.getProgramCacheKey(ge);
- let Ie = k.programs;
- k.environment = b.isMeshStandardMaterial ? O.environment : null, k.fog = O.fog, k.envMap = (b.isMeshStandardMaterial ? x : C).get(b.envMap || k.environment), k.envMapRotation = k.environment !== null && b.envMap === null ? O.environmentRotation : b.envMapRotation, Ie === void 0 && (b.addEventListener("dispose", Pe), Ie = /* @__PURE__ */ new Map(), k.programs = Ie);
- let Oe = Ie.get(ve);
- if (Oe !== void 0) {
- if (k.currentProgram === Oe && k.lightsStateVersion === pe)
- return cl(b, ge), Oe;
+ function kn(y, B, k) {
+ B.isScene !== !0 && (B = et);
+ const F = Me.get(y), U = _.state.lights, ee = _.state.shadowsArray, me = U.state.version, ge = V.getParameters(y, U.state, ee, B, k), ve = V.getProgramCacheKey(ge);
+ let Ie = F.programs;
+ F.environment = y.isMeshStandardMaterial ? B.environment : null, F.fog = B.fog, F.envMap = (y.isMeshStandardMaterial ? x : C).get(y.envMap || F.environment), F.envMapRotation = F.environment !== null && y.envMap === null ? B.environmentRotation : y.envMapRotation, Ie === void 0 && (y.addEventListener("dispose", Pe), Ie = /* @__PURE__ */ new Map(), F.programs = Ie);
+ let Be = Ie.get(ve);
+ if (Be !== void 0) {
+ if (F.currentProgram === Be && F.lightsStateVersion === me)
+ return cl(y, ge), Be;
} else
- ge.uniforms = V.getUniforms(b), b.onBeforeCompile(ge, T), Oe = V.acquireProgram(ge, ve), Ie.set(ve, Oe), k.uniforms = ge.uniforms;
- const Ue = k.uniforms;
- return (!b.isShaderMaterial && !b.isRawShaderMaterial || b.clipping === !0) && (Ue.clippingPlanes = de.uniform), cl(b, ge), k.needsLights = Xh(b), k.lightsStateVersion = pe, k.needsLights && (Ue.ambientLightColor.value = U.state.ambient, Ue.lightProbe.value = U.state.probe, Ue.directionalLights.value = U.state.directional, Ue.directionalLightShadows.value = U.state.directionalShadow, Ue.spotLights.value = U.state.spot, Ue.spotLightShadows.value = U.state.spotShadow, Ue.rectAreaLights.value = U.state.rectArea, Ue.ltc_1.value = U.state.rectAreaLTC1, Ue.ltc_2.value = U.state.rectAreaLTC2, Ue.pointLights.value = U.state.point, Ue.pointLightShadows.value = U.state.pointShadow, Ue.hemisphereLights.value = U.state.hemi, Ue.directionalShadowMap.value = U.state.directionalShadowMap, Ue.directionalShadowMatrix.value = U.state.directionalShadowMatrix, Ue.spotShadowMap.value = U.state.spotShadowMap, Ue.spotLightMatrix.value = U.state.spotLightMatrix, Ue.spotLightMap.value = U.state.spotLightMap, Ue.pointShadowMap.value = U.state.pointShadowMap, Ue.pointShadowMatrix.value = U.state.pointShadowMatrix), k.currentProgram = Oe, k.uniformsList = null, Oe;
+ ge.uniforms = V.getUniforms(y), y.onBeforeCompile(ge, T), Be = V.acquireProgram(ge, ve), Ie.set(ve, Be), F.uniforms = ge.uniforms;
+ const Ue = F.uniforms;
+ return (!y.isShaderMaterial && !y.isRawShaderMaterial || y.clipping === !0) && (Ue.clippingPlanes = pe.uniform), cl(y, ge), F.needsLights = Xh(y), F.lightsStateVersion = me, F.needsLights && (Ue.ambientLightColor.value = U.state.ambient, Ue.lightProbe.value = U.state.probe, Ue.directionalLights.value = U.state.directional, Ue.directionalLightShadows.value = U.state.directionalShadow, Ue.spotLights.value = U.state.spot, Ue.spotLightShadows.value = U.state.spotShadow, Ue.rectAreaLights.value = U.state.rectArea, Ue.ltc_1.value = U.state.rectAreaLTC1, Ue.ltc_2.value = U.state.rectAreaLTC2, Ue.pointLights.value = U.state.point, Ue.pointLightShadows.value = U.state.pointShadow, Ue.hemisphereLights.value = U.state.hemi, Ue.directionalShadowMap.value = U.state.directionalShadowMap, Ue.directionalShadowMatrix.value = U.state.directionalShadowMatrix, Ue.spotShadowMap.value = U.state.spotShadowMap, Ue.spotLightMatrix.value = U.state.spotLightMatrix, Ue.spotLightMap.value = U.state.spotLightMap, Ue.pointShadowMap.value = U.state.pointShadowMap, Ue.pointShadowMatrix.value = U.state.pointShadowMatrix), F.currentProgram = Be, F.uniformsList = null, Be;
}
- function ll(b) {
- if (b.uniformsList === null) {
- const O = b.currentProgram.getUniforms();
- b.uniformsList = Mn.seqWithValue(O.seq, b.uniforms);
+ function ll(y) {
+ if (y.uniformsList === null) {
+ const B = y.currentProgram.getUniforms();
+ y.uniformsList = Mr.seqWithValue(B.seq, y.uniforms);
}
- return b.uniformsList;
+ return y.uniformsList;
}
- function cl(b, O) {
- const F = Me.get(b);
- F.outputColorSpace = O.outputColorSpace, F.batching = O.batching, F.batchingColor = O.batchingColor, F.instancing = O.instancing, F.instancingColor = O.instancingColor, F.instancingMorph = O.instancingMorph, F.skinning = O.skinning, F.morphTargets = O.morphTargets, F.morphNormals = O.morphNormals, F.morphColors = O.morphColors, F.morphTargetsCount = O.morphTargetsCount, F.numClippingPlanes = O.numClippingPlanes, F.numIntersection = O.numClipIntersection, F.vertexAlphas = O.vertexAlphas, F.vertexTangents = O.vertexTangents, F.toneMapping = O.toneMapping;
+ function cl(y, B) {
+ const k = Me.get(y);
+ k.outputColorSpace = B.outputColorSpace, k.batching = B.batching, k.batchingColor = B.batchingColor, k.instancing = B.instancing, k.instancingColor = B.instancingColor, k.instancingMorph = B.instancingMorph, k.skinning = B.skinning, k.morphTargets = B.morphTargets, k.morphNormals = B.morphNormals, k.morphColors = B.morphColors, k.morphTargetsCount = B.morphTargetsCount, k.numClippingPlanes = B.numClippingPlanes, k.numIntersection = B.numClipIntersection, k.vertexAlphas = B.vertexAlphas, k.vertexTangents = B.vertexTangents, k.toneMapping = B.toneMapping;
}
- function Wh(b, O, F, k, U) {
- O.isScene !== !0 && (O = Qe), De.resetTextureUnits();
- const ee = O.fog, pe = k.isMeshStandardMaterial ? O.environment : null, ge = M === null ? T.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : Bt, ve = (k.isMeshStandardMaterial ? x : C).get(k.envMap || pe), Ie = k.vertexColors === !0 && !!F.attributes.color && F.attributes.color.itemSize === 4, Oe = !!F.attributes.tangent && (!!k.normalMap || k.anisotropy > 0), Ue = !!F.morphAttributes.position, Ke = !!F.morphAttributes.normal, ct = !!F.morphAttributes.color;
+ function Wh(y, B, k, F, U) {
+ B.isScene !== !0 && (B = et), De.resetTextureUnits();
+ const ee = B.fog, me = F.isMeshStandardMaterial ? B.environment : null, ge = M === null ? T.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : kt, ve = (F.isMeshStandardMaterial ? x : C).get(F.envMap || me), Ie = F.vertexColors === !0 && !!k.attributes.color && k.attributes.color.itemSize === 4, Be = !!k.attributes.tangent && (!!F.normalMap || F.anisotropy > 0), Ue = !!k.morphAttributes.position, Ke = !!k.morphAttributes.normal, ct = !!k.morphAttributes.color;
let ft = is;
- k.toneMapped && (M === null || M.isXRRenderTarget === !0) && (ft = T.toneMapping);
- const dt = F.morphAttributes.position || F.morphAttributes.normal || F.morphAttributes.color, ht = dt !== void 0 ? dt.length : 0, be = Me.get(k), Dt = _.state.lights;
- if (Y === !0 && (ue === !0 || b !== N)) {
- const It = b === N && k.id === L;
- de.setState(k, b, It);
+ F.toneMapped && (M === null || M.isXRRenderTarget === !0) && (ft = T.toneMapping);
+ const dt = k.morphAttributes.position || k.morphAttributes.normal || k.morphAttributes.color, ht = dt !== void 0 ? dt.length : 0, ye = Me.get(F), Dt = _.state.lights;
+ if (Y === !0 && (de === !0 || y !== N)) {
+ const It = y === N && F.id === L;
+ pe.setState(F, y, It);
}
let Ii = !1;
- k.version === be.__version ? (be.needsLights && be.lightsStateVersion !== Dt.state.version || be.outputColorSpace !== ge || U.isBatchedMesh && be.batching === !1 || !U.isBatchedMesh && be.batching === !0 || U.isBatchedMesh && be.batchingColor === !0 && U.colorTexture === null || U.isBatchedMesh && be.batchingColor === !1 && U.colorTexture !== null || U.isInstancedMesh && be.instancing === !1 || !U.isInstancedMesh && be.instancing === !0 || U.isSkinnedMesh && be.skinning === !1 || !U.isSkinnedMesh && be.skinning === !0 || U.isInstancedMesh && be.instancingColor === !0 && U.instanceColor === null || U.isInstancedMesh && be.instancingColor === !1 && U.instanceColor !== null || U.isInstancedMesh && be.instancingMorph === !0 && U.morphTexture === null || U.isInstancedMesh && be.instancingMorph === !1 && U.morphTexture !== null || be.envMap !== ve || k.fog === !0 && be.fog !== ee || be.numClippingPlanes !== void 0 && (be.numClippingPlanes !== de.numPlanes || be.numIntersection !== de.numIntersection) || be.vertexAlphas !== Ie || be.vertexTangents !== Oe || be.morphTargets !== Ue || be.morphNormals !== Ke || be.morphColors !== ct || be.toneMapping !== ft || be.morphTargetsCount !== ht) && (Ii = !0) : (Ii = !0, be.__version = k.version);
- let ni = be.currentProgram;
- Ii === !0 && (ni = Br(k, O, U));
- let ys = !1, Yt = !1, or = !1;
- const pt = ni.getUniforms(), Gt = be.uniforms;
- if (fe.useProgram(ni.program) && (ys = !0, Yt = !0, or = !0), k.id !== L && (L = k.id, Yt = !0), ys || N !== b) {
- fe.buffers.depth.getReversed() && b.reversedDepth !== !0 && (b._reversedDepth = !0, b.updateProjectionMatrix()), pt.setValue(D, "projectionMatrix", b.projectionMatrix), pt.setValue(D, "viewMatrix", b.matrixWorldInverse);
+ F.version === ye.__version ? (ye.needsLights && ye.lightsStateVersion !== Dt.state.version || ye.outputColorSpace !== ge || U.isBatchedMesh && ye.batching === !1 || !U.isBatchedMesh && ye.batching === !0 || U.isBatchedMesh && ye.batchingColor === !0 && U.colorTexture === null || U.isBatchedMesh && ye.batchingColor === !1 && U.colorTexture !== null || U.isInstancedMesh && ye.instancing === !1 || !U.isInstancedMesh && ye.instancing === !0 || U.isSkinnedMesh && ye.skinning === !1 || !U.isSkinnedMesh && ye.skinning === !0 || U.isInstancedMesh && ye.instancingColor === !0 && U.instanceColor === null || U.isInstancedMesh && ye.instancingColor === !1 && U.instanceColor !== null || U.isInstancedMesh && ye.instancingMorph === !0 && U.morphTexture === null || U.isInstancedMesh && ye.instancingMorph === !1 && U.morphTexture !== null || ye.envMap !== ve || F.fog === !0 && ye.fog !== ee || ye.numClippingPlanes !== void 0 && (ye.numClippingPlanes !== pe.numPlanes || ye.numIntersection !== pe.numIntersection) || ye.vertexAlphas !== Ie || ye.vertexTangents !== Be || ye.morphTargets !== Ue || ye.morphNormals !== Ke || ye.morphColors !== ct || ye.toneMapping !== ft || ye.morphTargetsCount !== ht) && (Ii = !0) : (Ii = !0, ye.__version = F.version);
+ let ai = ye.currentProgram;
+ Ii === !0 && (ai = kn(F, B, U));
+ let bs = !1, Kt = !1, ln = !1;
+ const pt = ai.getUniforms(), Wt = ye.uniforms;
+ if (fe.useProgram(ai.program) && (bs = !0, Kt = !0, ln = !0), F.id !== L && (L = F.id, Kt = !0), bs || N !== y) {
+ fe.buffers.depth.getReversed() && y.reversedDepth !== !0 && (y._reversedDepth = !0, y.updateProjectionMatrix()), pt.setValue(D, "projectionMatrix", y.projectionMatrix), pt.setValue(D, "viewMatrix", y.matrixWorldInverse);
const It = pt.map.cameraPosition;
- It !== void 0 && It.setValue(D, Te.setFromMatrixPosition(b.matrixWorld)), et.logarithmicDepthBuffer && pt.setValue(
+ It !== void 0 && It.setValue(D, Te.setFromMatrixPosition(y.matrixWorld)), tt.logarithmicDepthBuffer && pt.setValue(
D,
"logDepthBufFC",
- 2 / (Math.log(b.far + 1) / Math.LN2)
- ), (k.isMeshPhongMaterial || k.isMeshToonMaterial || k.isMeshLambertMaterial || k.isMeshBasicMaterial || k.isMeshStandardMaterial || k.isShaderMaterial) && pt.setValue(D, "isOrthographic", b.isOrthographicCamera === !0), N !== b && (N = b, Yt = !0, or = !0);
+ 2 / (Math.log(y.far + 1) / Math.LN2)
+ ), (F.isMeshPhongMaterial || F.isMeshToonMaterial || F.isMeshLambertMaterial || F.isMeshBasicMaterial || F.isMeshStandardMaterial || F.isShaderMaterial) && pt.setValue(D, "isOrthographic", y.isOrthographicCamera === !0), N !== y && (N = y, Kt = !0, ln = !0);
}
if (U.isSkinnedMesh) {
pt.setOptional(D, U, "bindMatrix"), pt.setOptional(D, U, "bindMatrixInverse");
@@ -26250,21 +26318,21 @@ class Ln {
It && (It.boneTexture === null && It.computeBoneTexture(), pt.setValue(D, "boneTexture", It.boneTexture, De));
}
U.isBatchedMesh && (pt.setOptional(D, U, "batchingTexture"), pt.setValue(D, "batchingTexture", U._matricesTexture, De), pt.setOptional(D, U, "batchingIdTexture"), pt.setValue(D, "batchingIdTexture", U._indirectTexture, De), pt.setOptional(D, U, "batchingColorTexture"), U._colorsTexture !== null && pt.setValue(D, "batchingColorTexture", U._colorsTexture, De));
- const Jt = F.morphAttributes;
- if ((Jt.position !== void 0 || Jt.normal !== void 0 || Jt.color !== void 0) && Be.update(U, F, ni), (Yt || be.receiveShadow !== U.receiveShadow) && (be.receiveShadow = U.receiveShadow, pt.setValue(D, "receiveShadow", U.receiveShadow)), k.isMeshGouraudMaterial && k.envMap !== null && (Gt.envMap.value = ve, Gt.flipEnvMap.value = ve.isCubeTexture && ve.isRenderTargetTexture === !1 ? -1 : 1), k.isMeshStandardMaterial && k.envMap === null && O.environment !== null && (Gt.envMapIntensity.value = O.environmentIntensity), Gt.dfgLUT !== void 0 && (Gt.dfgLUT.value = av()), Yt && (pt.setValue(D, "toneMappingExposure", T.toneMappingExposure), be.needsLights && jh(Gt, or), ee && k.fog === !0 && ye.refreshFogUniforms(Gt, ee), ye.refreshMaterialUniforms(Gt, k, re, Z, _.state.transmissionRenderTarget[b.id]), Mn.upload(D, ll(be), Gt, De)), k.isShaderMaterial && k.uniformsNeedUpdate === !0 && (Mn.upload(D, ll(be), Gt, De), k.uniformsNeedUpdate = !1), k.isSpriteMaterial && pt.setValue(D, "center", U.center), pt.setValue(D, "modelViewMatrix", U.modelViewMatrix), pt.setValue(D, "normalMatrix", U.normalMatrix), pt.setValue(D, "modelMatrix", U.matrixWorld), k.isShaderMaterial || k.isRawShaderMaterial) {
- const It = k.uniformsGroups;
- for (let ai = 0, Fn = It.length; ai < Fn; ai++) {
- const os = It[ai];
- ae.update(os, ni), ae.bind(os, ni);
+ const Qt = k.morphAttributes;
+ if ((Qt.position !== void 0 || Qt.normal !== void 0 || Qt.color !== void 0) && Oe.update(U, k, ai), (Kt || ye.receiveShadow !== U.receiveShadow) && (ye.receiveShadow = U.receiveShadow, pt.setValue(D, "receiveShadow", U.receiveShadow)), F.isMeshGouraudMaterial && F.envMap !== null && (Wt.envMap.value = ve, Wt.flipEnvMap.value = ve.isCubeTexture && ve.isRenderTargetTexture === !1 ? -1 : 1), F.isMeshStandardMaterial && F.envMap === null && B.environment !== null && (Wt.envMapIntensity.value = B.environmentIntensity), Wt.dfgLUT !== void 0 && (Wt.dfgLUT.value = av()), Kt && (pt.setValue(D, "toneMappingExposure", T.toneMappingExposure), ye.needsLights && jh(Wt, ln), ee && F.fog === !0 && be.refreshFogUniforms(Wt, ee), be.refreshMaterialUniforms(Wt, F, ne, Z, _.state.transmissionRenderTarget[y.id]), Mr.upload(D, ll(ye), Wt, De)), F.isShaderMaterial && F.uniformsNeedUpdate === !0 && (Mr.upload(D, ll(ye), Wt, De), F.uniformsNeedUpdate = !1), F.isSpriteMaterial && pt.setValue(D, "center", U.center), pt.setValue(D, "modelViewMatrix", U.modelViewMatrix), pt.setValue(D, "normalMatrix", U.normalMatrix), pt.setValue(D, "modelMatrix", U.matrixWorld), F.isShaderMaterial || F.isRawShaderMaterial) {
+ const It = F.uniformsGroups;
+ for (let oi = 0, kr = It.length; oi < kr; oi++) {
+ const os = It[oi];
+ ae.update(os, ai), ae.bind(os, ai);
}
}
- return ni;
+ return ai;
}
- function jh(b, O) {
- b.ambientLightColor.needsUpdate = O, b.lightProbe.needsUpdate = O, b.directionalLights.needsUpdate = O, b.directionalLightShadows.needsUpdate = O, b.pointLights.needsUpdate = O, b.pointLightShadows.needsUpdate = O, b.spotLights.needsUpdate = O, b.spotLightShadows.needsUpdate = O, b.rectAreaLights.needsUpdate = O, b.hemisphereLights.needsUpdate = O;
+ function jh(y, B) {
+ y.ambientLightColor.needsUpdate = B, y.lightProbe.needsUpdate = B, y.directionalLights.needsUpdate = B, y.directionalLightShadows.needsUpdate = B, y.pointLights.needsUpdate = B, y.pointLightShadows.needsUpdate = B, y.spotLights.needsUpdate = B, y.spotLightShadows.needsUpdate = B, y.rectAreaLights.needsUpdate = B, y.hemisphereLights.needsUpdate = B;
}
- function Xh(b) {
- return b.isMeshLambertMaterial || b.isMeshToonMaterial || b.isMeshPhongMaterial || b.isMeshStandardMaterial || b.isShadowMaterial || b.isShaderMaterial && b.lights === !0;
+ function Xh(y) {
+ return y.isMeshLambertMaterial || y.isMeshToonMaterial || y.isMeshPhongMaterial || y.isMeshStandardMaterial || y.isShadowMaterial || y.isShaderMaterial && y.lights === !0;
}
this.getActiveCubeFace = function() {
return I;
@@ -26272,138 +26340,138 @@ class Ln {
return S;
}, this.getRenderTarget = function() {
return M;
- }, this.setRenderTargetTextures = function(b, O, F) {
- const k = Me.get(b);
- k.__autoAllocateDepthBuffer = b.resolveDepthBuffer === !1, k.__autoAllocateDepthBuffer === !1 && (k.__useRenderToTexture = !1), Me.get(b.texture).__webglTexture = O, Me.get(b.depthTexture).__webglTexture = k.__autoAllocateDepthBuffer ? void 0 : F, k.__hasExternalTextures = !0;
- }, this.setRenderTargetFramebuffer = function(b, O) {
- const F = Me.get(b);
- F.__webglFramebuffer = O, F.__useDefaultFramebuffer = O === void 0;
+ }, this.setRenderTargetTextures = function(y, B, k) {
+ const F = Me.get(y);
+ F.__autoAllocateDepthBuffer = y.resolveDepthBuffer === !1, F.__autoAllocateDepthBuffer === !1 && (F.__useRenderToTexture = !1), Me.get(y.texture).__webglTexture = B, Me.get(y.depthTexture).__webglTexture = F.__autoAllocateDepthBuffer ? void 0 : k, F.__hasExternalTextures = !0;
+ }, this.setRenderTargetFramebuffer = function(y, B) {
+ const k = Me.get(y);
+ k.__webglFramebuffer = B, k.__useDefaultFramebuffer = B === void 0;
};
const qh = D.createFramebuffer();
- this.setRenderTarget = function(b, O = 0, F = 0) {
- M = b, I = O, S = F;
- let k = !0, U = null, ee = !1, pe = !1;
- if (b) {
- const ge = Me.get(b);
+ this.setRenderTarget = function(y, B = 0, k = 0) {
+ M = y, I = B, S = k;
+ let F = !0, U = null, ee = !1, me = !1;
+ if (y) {
+ const ge = Me.get(y);
if (ge.__useDefaultFramebuffer !== void 0)
- fe.bindFramebuffer(D.FRAMEBUFFER, null), k = !1;
+ fe.bindFramebuffer(D.FRAMEBUFFER, null), F = !1;
else if (ge.__webglFramebuffer === void 0)
- De.setupRenderTarget(b);
+ De.setupRenderTarget(y);
else if (ge.__hasExternalTextures)
- De.rebindTextures(b, Me.get(b.texture).__webglTexture, Me.get(b.depthTexture).__webglTexture);
- else if (b.depthBuffer) {
- const Oe = b.depthTexture;
- if (ge.__boundDepthTexture !== Oe) {
- if (Oe !== null && Me.has(Oe) && (b.width !== Oe.image.width || b.height !== Oe.image.height))
+ De.rebindTextures(y, Me.get(y.texture).__webglTexture, Me.get(y.depthTexture).__webglTexture);
+ else if (y.depthBuffer) {
+ const Be = y.depthTexture;
+ if (ge.__boundDepthTexture !== Be) {
+ if (Be !== null && Me.has(Be) && (y.width !== Be.image.width || y.height !== Be.image.height))
throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");
- De.setupDepthRenderbuffer(b);
+ De.setupDepthRenderbuffer(y);
}
}
- const ve = b.texture;
- (ve.isData3DTexture || ve.isDataArrayTexture || ve.isCompressedArrayTexture) && (pe = !0);
- const Ie = Me.get(b).__webglFramebuffer;
- b.isWebGLCubeRenderTarget ? (Array.isArray(Ie[O]) ? U = Ie[O][F] : U = Ie[O], ee = !0) : b.samples > 0 && De.useMultisampledRTT(b) === !1 ? U = Me.get(b).__webglMultisampledFramebuffer : Array.isArray(Ie) ? U = Ie[F] : U = Ie, z.copy(b.viewport), H.copy(b.scissor), j = b.scissorTest;
+ const ve = y.texture;
+ (ve.isData3DTexture || ve.isDataArrayTexture || ve.isCompressedArrayTexture) && (me = !0);
+ const Ie = Me.get(y).__webglFramebuffer;
+ y.isWebGLCubeRenderTarget ? (Array.isArray(Ie[B]) ? U = Ie[B][k] : U = Ie[B], ee = !0) : y.samples > 0 && De.useMultisampledRTT(y) === !1 ? U = Me.get(y).__webglMultisampledFramebuffer : Array.isArray(Ie) ? U = Ie[k] : U = Ie, z.copy(y.viewport), H.copy(y.scissor), j = y.scissorTest;
} else
- z.copy(Ye).multiplyScalar(re).floor(), H.copy(Ze).multiplyScalar(re).floor(), j = $e;
- if (F !== 0 && (U = qh), fe.bindFramebuffer(D.FRAMEBUFFER, U) && k && fe.drawBuffers(b, U), fe.viewport(z), fe.scissor(H), fe.setScissorTest(j), ee) {
- const ge = Me.get(b.texture);
- D.framebufferTexture2D(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_CUBE_MAP_POSITIVE_X + O, ge.__webglTexture, F);
- } else if (pe) {
- const ge = O;
- for (let ve = 0; ve < b.textures.length; ve++) {
- const Ie = Me.get(b.textures[ve]);
- D.framebufferTextureLayer(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0 + ve, Ie.__webglTexture, F, ge);
+ z.copy(Ye).multiplyScalar(ne).floor(), H.copy($e).multiplyScalar(ne).floor(), j = Je;
+ if (k !== 0 && (U = qh), fe.bindFramebuffer(D.FRAMEBUFFER, U) && F && fe.drawBuffers(y, U), fe.viewport(z), fe.scissor(H), fe.setScissorTest(j), ee) {
+ const ge = Me.get(y.texture);
+ D.framebufferTexture2D(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_CUBE_MAP_POSITIVE_X + B, ge.__webglTexture, k);
+ } else if (me) {
+ const ge = B;
+ for (let ve = 0; ve < y.textures.length; ve++) {
+ const Ie = Me.get(y.textures[ve]);
+ D.framebufferTextureLayer(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0 + ve, Ie.__webglTexture, k, ge);
}
- } else if (b !== null && F !== 0) {
- const ge = Me.get(b.texture);
- D.framebufferTexture2D(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, ge.__webglTexture, F);
+ } else if (y !== null && k !== 0) {
+ const ge = Me.get(y.texture);
+ D.framebufferTexture2D(D.FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, ge.__webglTexture, k);
}
L = -1;
- }, this.readRenderTargetPixels = function(b, O, F, k, U, ee, pe, ge = 0) {
- if (!(b && b.isWebGLRenderTarget)) {
+ }, this.readRenderTargetPixels = function(y, B, k, F, U, ee, me, ge = 0) {
+ if (!(y && y.isWebGLRenderTarget)) {
Ve("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
return;
}
- let ve = Me.get(b).__webglFramebuffer;
- if (b.isWebGLCubeRenderTarget && pe !== void 0 && (ve = ve[pe]), ve) {
+ let ve = Me.get(y).__webglFramebuffer;
+ if (y.isWebGLCubeRenderTarget && me !== void 0 && (ve = ve[me]), ve) {
fe.bindFramebuffer(D.FRAMEBUFFER, ve);
try {
- const Ie = b.textures[ge], Oe = Ie.format, Ue = Ie.type;
- if (!et.textureFormatReadable(Oe)) {
+ const Ie = y.textures[ge], Be = Ie.format, Ue = Ie.type;
+ if (!tt.textureFormatReadable(Be)) {
Ve("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
return;
}
- if (!et.textureTypeReadable(Ue)) {
+ if (!tt.textureTypeReadable(Ue)) {
Ve("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
return;
}
- O >= 0 && O <= b.width - k && F >= 0 && F <= b.height - U && (b.textures.length > 1 && D.readBuffer(D.COLOR_ATTACHMENT0 + ge), D.readPixels(O, F, k, U, Re.convert(Oe), Re.convert(Ue), ee));
+ B >= 0 && B <= y.width - F && k >= 0 && k <= y.height - U && (y.textures.length > 1 && D.readBuffer(D.COLOR_ATTACHMENT0 + ge), D.readPixels(B, k, F, U, Re.convert(Be), Re.convert(Ue), ee));
} finally {
const Ie = M !== null ? Me.get(M).__webglFramebuffer : null;
fe.bindFramebuffer(D.FRAMEBUFFER, Ie);
}
}
- }, this.readRenderTargetPixelsAsync = async function(b, O, F, k, U, ee, pe, ge = 0) {
- if (!(b && b.isWebGLRenderTarget))
+ }, this.readRenderTargetPixelsAsync = async function(y, B, k, F, U, ee, me, ge = 0) {
+ if (!(y && y.isWebGLRenderTarget))
throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
- let ve = Me.get(b).__webglFramebuffer;
- if (b.isWebGLCubeRenderTarget && pe !== void 0 && (ve = ve[pe]), ve)
- if (O >= 0 && O <= b.width - k && F >= 0 && F <= b.height - U) {
+ let ve = Me.get(y).__webglFramebuffer;
+ if (y.isWebGLCubeRenderTarget && me !== void 0 && (ve = ve[me]), ve)
+ if (B >= 0 && B <= y.width - F && k >= 0 && k <= y.height - U) {
fe.bindFramebuffer(D.FRAMEBUFFER, ve);
- const Ie = b.textures[ge], Oe = Ie.format, Ue = Ie.type;
- if (!et.textureFormatReadable(Oe))
+ const Ie = y.textures[ge], Be = Ie.format, Ue = Ie.type;
+ if (!tt.textureFormatReadable(Be))
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
- if (!et.textureTypeReadable(Ue))
+ if (!tt.textureTypeReadable(Ue))
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
const Ke = D.createBuffer();
- D.bindBuffer(D.PIXEL_PACK_BUFFER, Ke), D.bufferData(D.PIXEL_PACK_BUFFER, ee.byteLength, D.STREAM_READ), b.textures.length > 1 && D.readBuffer(D.COLOR_ATTACHMENT0 + ge), D.readPixels(O, F, k, U, Re.convert(Oe), Re.convert(Ue), 0);
+ D.bindBuffer(D.PIXEL_PACK_BUFFER, Ke), D.bufferData(D.PIXEL_PACK_BUFFER, ee.byteLength, D.STREAM_READ), y.textures.length > 1 && D.readBuffer(D.COLOR_ATTACHMENT0 + ge), D.readPixels(B, k, F, U, Re.convert(Be), Re.convert(Ue), 0);
const ct = M !== null ? Me.get(M).__webglFramebuffer : null;
fe.bindFramebuffer(D.FRAMEBUFFER, ct);
const ft = D.fenceSync(D.SYNC_GPU_COMMANDS_COMPLETE, 0);
- return D.flush(), await Fu(D, ft, 4), D.bindBuffer(D.PIXEL_PACK_BUFFER, Ke), D.getBufferSubData(D.PIXEL_PACK_BUFFER, 0, ee), D.deleteBuffer(Ke), D.deleteSync(ft), ee;
+ return D.flush(), await ku(D, ft, 4), D.bindBuffer(D.PIXEL_PACK_BUFFER, Ke), D.getBufferSubData(D.PIXEL_PACK_BUFFER, 0, ee), D.deleteBuffer(Ke), D.deleteSync(ft), ee;
} else
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
- }, this.copyFramebufferToTexture = function(b, O = null, F = 0) {
- const k = Math.pow(2, -F), U = Math.floor(b.image.width * k), ee = Math.floor(b.image.height * k), pe = O !== null ? O.x : 0, ge = O !== null ? O.y : 0;
- De.setTexture2D(b, 0), D.copyTexSubImage2D(D.TEXTURE_2D, F, 0, 0, pe, ge, U, ee), fe.unbindTexture();
+ }, this.copyFramebufferToTexture = function(y, B = null, k = 0) {
+ const F = Math.pow(2, -k), U = Math.floor(y.image.width * F), ee = Math.floor(y.image.height * F), me = B !== null ? B.x : 0, ge = B !== null ? B.y : 0;
+ De.setTexture2D(y, 0), D.copyTexSubImage2D(D.TEXTURE_2D, k, 0, 0, me, ge, U, ee), fe.unbindTexture();
};
const Yh = D.createFramebuffer(), Kh = D.createFramebuffer();
- this.copyTextureToTexture = function(b, O, F = null, k = null, U = 0, ee = null) {
- ee === null && (U !== 0 ? (Lr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), ee = U, U = 0) : ee = 0);
- let pe, ge, ve, Ie, Oe, Ue, Ke, ct, ft;
- const dt = b.isCompressedTexture ? b.mipmaps[ee] : b.image;
- if (F !== null)
- pe = F.max.x - F.min.x, ge = F.max.y - F.min.y, ve = F.isBox3 ? F.max.z - F.min.z : 1, Ie = F.min.x, Oe = F.min.y, Ue = F.isBox3 ? F.min.z : 0;
+ this.copyTextureToTexture = function(y, B, k = null, F = null, U = 0, ee = null) {
+ ee === null && (U !== 0 ? (Dn("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), ee = U, U = 0) : ee = 0);
+ let me, ge, ve, Ie, Be, Ue, Ke, ct, ft;
+ const dt = y.isCompressedTexture ? y.mipmaps[ee] : y.image;
+ if (k !== null)
+ me = k.max.x - k.min.x, ge = k.max.y - k.min.y, ve = k.isBox3 ? k.max.z - k.min.z : 1, Ie = k.min.x, Be = k.min.y, Ue = k.isBox3 ? k.min.z : 0;
else {
- const Jt = Math.pow(2, -U);
- pe = Math.floor(dt.width * Jt), ge = Math.floor(dt.height * Jt), b.isDataArrayTexture ? ve = dt.depth : b.isData3DTexture ? ve = Math.floor(dt.depth * Jt) : ve = 1, Ie = 0, Oe = 0, Ue = 0;
+ const Qt = Math.pow(2, -U);
+ me = Math.floor(dt.width * Qt), ge = Math.floor(dt.height * Qt), y.isDataArrayTexture ? ve = dt.depth : y.isData3DTexture ? ve = Math.floor(dt.depth * Qt) : ve = 1, Ie = 0, Be = 0, Ue = 0;
}
- k !== null ? (Ke = k.x, ct = k.y, ft = k.z) : (Ke = 0, ct = 0, ft = 0);
- const ht = Re.convert(O.format), be = Re.convert(O.type);
+ F !== null ? (Ke = F.x, ct = F.y, ft = F.z) : (Ke = 0, ct = 0, ft = 0);
+ const ht = Re.convert(B.format), ye = Re.convert(B.type);
let Dt;
- O.isData3DTexture ? (De.setTexture3D(O, 0), Dt = D.TEXTURE_3D) : O.isDataArrayTexture || O.isCompressedArrayTexture ? (De.setTexture2DArray(O, 0), Dt = D.TEXTURE_2D_ARRAY) : (De.setTexture2D(O, 0), Dt = D.TEXTURE_2D), D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL, O.flipY), D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL, O.premultiplyAlpha), D.pixelStorei(D.UNPACK_ALIGNMENT, O.unpackAlignment);
- const Ii = D.getParameter(D.UNPACK_ROW_LENGTH), ni = D.getParameter(D.UNPACK_IMAGE_HEIGHT), ys = D.getParameter(D.UNPACK_SKIP_PIXELS), Yt = D.getParameter(D.UNPACK_SKIP_ROWS), or = D.getParameter(D.UNPACK_SKIP_IMAGES);
- D.pixelStorei(D.UNPACK_ROW_LENGTH, dt.width), D.pixelStorei(D.UNPACK_IMAGE_HEIGHT, dt.height), D.pixelStorei(D.UNPACK_SKIP_PIXELS, Ie), D.pixelStorei(D.UNPACK_SKIP_ROWS, Oe), D.pixelStorei(D.UNPACK_SKIP_IMAGES, Ue);
- const pt = b.isDataArrayTexture || b.isData3DTexture, Gt = O.isDataArrayTexture || O.isData3DTexture;
- if (b.isDepthTexture) {
- const Jt = Me.get(b), It = Me.get(O), ai = Me.get(Jt.__renderTarget), Fn = Me.get(It.__renderTarget);
- fe.bindFramebuffer(D.READ_FRAMEBUFFER, ai.__webglFramebuffer), fe.bindFramebuffer(D.DRAW_FRAMEBUFFER, Fn.__webglFramebuffer);
+ B.isData3DTexture ? (De.setTexture3D(B, 0), Dt = D.TEXTURE_3D) : B.isDataArrayTexture || B.isCompressedArrayTexture ? (De.setTexture2DArray(B, 0), Dt = D.TEXTURE_2D_ARRAY) : (De.setTexture2D(B, 0), Dt = D.TEXTURE_2D), D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL, B.flipY), D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL, B.premultiplyAlpha), D.pixelStorei(D.UNPACK_ALIGNMENT, B.unpackAlignment);
+ const Ii = D.getParameter(D.UNPACK_ROW_LENGTH), ai = D.getParameter(D.UNPACK_IMAGE_HEIGHT), bs = D.getParameter(D.UNPACK_SKIP_PIXELS), Kt = D.getParameter(D.UNPACK_SKIP_ROWS), ln = D.getParameter(D.UNPACK_SKIP_IMAGES);
+ D.pixelStorei(D.UNPACK_ROW_LENGTH, dt.width), D.pixelStorei(D.UNPACK_IMAGE_HEIGHT, dt.height), D.pixelStorei(D.UNPACK_SKIP_PIXELS, Ie), D.pixelStorei(D.UNPACK_SKIP_ROWS, Be), D.pixelStorei(D.UNPACK_SKIP_IMAGES, Ue);
+ const pt = y.isDataArrayTexture || y.isData3DTexture, Wt = B.isDataArrayTexture || B.isData3DTexture;
+ if (y.isDepthTexture) {
+ const Qt = Me.get(y), It = Me.get(B), oi = Me.get(Qt.__renderTarget), kr = Me.get(It.__renderTarget);
+ fe.bindFramebuffer(D.READ_FRAMEBUFFER, oi.__webglFramebuffer), fe.bindFramebuffer(D.DRAW_FRAMEBUFFER, kr.__webglFramebuffer);
for (let os = 0; os < ve; os++)
- pt && (D.framebufferTextureLayer(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Me.get(b).__webglTexture, U, Ue + os), D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Me.get(O).__webglTexture, ee, ft + os)), D.blitFramebuffer(Ie, Oe, pe, ge, Ke, ct, pe, ge, D.DEPTH_BUFFER_BIT, D.NEAREST);
+ pt && (D.framebufferTextureLayer(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Me.get(y).__webglTexture, U, Ue + os), D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Me.get(B).__webglTexture, ee, ft + os)), D.blitFramebuffer(Ie, Be, me, ge, Ke, ct, me, ge, D.DEPTH_BUFFER_BIT, D.NEAREST);
fe.bindFramebuffer(D.READ_FRAMEBUFFER, null), fe.bindFramebuffer(D.DRAW_FRAMEBUFFER, null);
- } else if (U !== 0 || b.isRenderTargetTexture || Me.has(b)) {
- const Jt = Me.get(b), It = Me.get(O);
+ } else if (U !== 0 || y.isRenderTargetTexture || Me.has(y)) {
+ const Qt = Me.get(y), It = Me.get(B);
fe.bindFramebuffer(D.READ_FRAMEBUFFER, Yh), fe.bindFramebuffer(D.DRAW_FRAMEBUFFER, Kh);
- for (let ai = 0; ai < ve; ai++)
- pt ? D.framebufferTextureLayer(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Jt.__webglTexture, U, Ue + ai) : D.framebufferTexture2D(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, Jt.__webglTexture, U), Gt ? D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, It.__webglTexture, ee, ft + ai) : D.framebufferTexture2D(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, It.__webglTexture, ee), U !== 0 ? D.blitFramebuffer(Ie, Oe, pe, ge, Ke, ct, pe, ge, D.COLOR_BUFFER_BIT, D.NEAREST) : Gt ? D.copyTexSubImage3D(Dt, ee, Ke, ct, ft + ai, Ie, Oe, pe, ge) : D.copyTexSubImage2D(Dt, ee, Ke, ct, Ie, Oe, pe, ge);
+ for (let oi = 0; oi < ve; oi++)
+ pt ? D.framebufferTextureLayer(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, Qt.__webglTexture, U, Ue + oi) : D.framebufferTexture2D(D.READ_FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, Qt.__webglTexture, U), Wt ? D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, It.__webglTexture, ee, ft + oi) : D.framebufferTexture2D(D.DRAW_FRAMEBUFFER, D.COLOR_ATTACHMENT0, D.TEXTURE_2D, It.__webglTexture, ee), U !== 0 ? D.blitFramebuffer(Ie, Be, me, ge, Ke, ct, me, ge, D.COLOR_BUFFER_BIT, D.NEAREST) : Wt ? D.copyTexSubImage3D(Dt, ee, Ke, ct, ft + oi, Ie, Be, me, ge) : D.copyTexSubImage2D(Dt, ee, Ke, ct, Ie, Be, me, ge);
fe.bindFramebuffer(D.READ_FRAMEBUFFER, null), fe.bindFramebuffer(D.DRAW_FRAMEBUFFER, null);
} else
- Gt ? b.isDataTexture || b.isData3DTexture ? D.texSubImage3D(Dt, ee, Ke, ct, ft, pe, ge, ve, ht, be, dt.data) : O.isCompressedArrayTexture ? D.compressedTexSubImage3D(Dt, ee, Ke, ct, ft, pe, ge, ve, ht, dt.data) : D.texSubImage3D(Dt, ee, Ke, ct, ft, pe, ge, ve, ht, be, dt) : b.isDataTexture ? D.texSubImage2D(D.TEXTURE_2D, ee, Ke, ct, pe, ge, ht, be, dt.data) : b.isCompressedTexture ? D.compressedTexSubImage2D(D.TEXTURE_2D, ee, Ke, ct, dt.width, dt.height, ht, dt.data) : D.texSubImage2D(D.TEXTURE_2D, ee, Ke, ct, pe, ge, ht, be, dt);
- D.pixelStorei(D.UNPACK_ROW_LENGTH, Ii), D.pixelStorei(D.UNPACK_IMAGE_HEIGHT, ni), D.pixelStorei(D.UNPACK_SKIP_PIXELS, ys), D.pixelStorei(D.UNPACK_SKIP_ROWS, Yt), D.pixelStorei(D.UNPACK_SKIP_IMAGES, or), ee === 0 && O.generateMipmaps && D.generateMipmap(Dt), fe.unbindTexture();
- }, this.initRenderTarget = function(b) {
- Me.get(b).__webglFramebuffer === void 0 && De.setupRenderTarget(b);
- }, this.initTexture = function(b) {
- b.isCubeTexture ? De.setTextureCube(b, 0) : b.isData3DTexture ? De.setTexture3D(b, 0) : b.isDataArrayTexture || b.isCompressedArrayTexture ? De.setTexture2DArray(b, 0) : De.setTexture2D(b, 0), fe.unbindTexture();
+ Wt ? y.isDataTexture || y.isData3DTexture ? D.texSubImage3D(Dt, ee, Ke, ct, ft, me, ge, ve, ht, ye, dt.data) : B.isCompressedArrayTexture ? D.compressedTexSubImage3D(Dt, ee, Ke, ct, ft, me, ge, ve, ht, dt.data) : D.texSubImage3D(Dt, ee, Ke, ct, ft, me, ge, ve, ht, ye, dt) : y.isDataTexture ? D.texSubImage2D(D.TEXTURE_2D, ee, Ke, ct, me, ge, ht, ye, dt.data) : y.isCompressedTexture ? D.compressedTexSubImage2D(D.TEXTURE_2D, ee, Ke, ct, dt.width, dt.height, ht, dt.data) : D.texSubImage2D(D.TEXTURE_2D, ee, Ke, ct, me, ge, ht, ye, dt);
+ D.pixelStorei(D.UNPACK_ROW_LENGTH, Ii), D.pixelStorei(D.UNPACK_IMAGE_HEIGHT, ai), D.pixelStorei(D.UNPACK_SKIP_PIXELS, bs), D.pixelStorei(D.UNPACK_SKIP_ROWS, Kt), D.pixelStorei(D.UNPACK_SKIP_IMAGES, ln), ee === 0 && B.generateMipmaps && D.generateMipmap(Dt), fe.unbindTexture();
+ }, this.initRenderTarget = function(y) {
+ Me.get(y).__webglFramebuffer === void 0 && De.setupRenderTarget(y);
+ }, this.initTexture = function(y) {
+ y.isCubeTexture ? De.setTextureCube(y, 0) : y.isData3DTexture ? De.setTexture3D(y, 0) : y.isDataArrayTexture || y.isCompressedArrayTexture ? De.setTexture2DArray(y, 0) : De.setTexture2D(y, 0), fe.unbindTexture();
}, this.resetState = function() {
I = 0, S = 0, M = null, fe.reset(), P.reset();
}, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
@@ -26463,7 +26531,7 @@ class ov extends tp {
case 4:
throw new Error("THREE.HDRLoader: Memory Error: " + (p || ""));
}
- }, i = function(f, p, y) {
+ }, i = function(f, p, b) {
p = p || 1024;
let _ = f.pos, E = -1, R = 0, T = "", A = String.fromCharCode.apply(null, new Uint16Array(f.subarray(_, _ + 128)));
for (; 0 > (E = A.indexOf(`
@@ -26471,7 +26539,7 @@ class ov extends tp {
T += A, R += A.length, _ += 128, A += String.fromCharCode.apply(null, new Uint16Array(f.subarray(_, _ + 128)));
return -1 < E ? (f.pos += R + E + 1, T + A.slice(0, E)) : !1;
}, s = function(f) {
- const p = /^#\?(\S+)/, y = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, _ = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, E = /^\s*FORMAT=(\S+)\s*$/, R = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, T = {
+ const p = /^#\?(\S+)/, b = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, _ = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, E = /^\s*FORMAT=(\S+)\s*$/, R = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, T = {
valid: 0,
/* indicate which fields are valid */
string: "",
@@ -26499,10 +26567,10 @@ class ov extends tp {
`;
continue;
}
- if ((I = A.match(y)) && (T.gamma = parseFloat(I[1])), (I = A.match(_)) && (T.exposure = parseFloat(I[1])), (I = A.match(E)) && (T.valid |= 2, T.format = I[1]), (I = A.match(R)) && (T.valid |= 4, T.height = parseInt(I[1], 10), T.width = parseInt(I[2], 10)), T.valid & 2 && T.valid & 4) break;
+ if ((I = A.match(b)) && (T.gamma = parseFloat(I[1])), (I = A.match(_)) && (T.exposure = parseFloat(I[1])), (I = A.match(E)) && (T.valid |= 2, T.format = I[1]), (I = A.match(R)) && (T.valid |= 4, T.height = parseInt(I[1], 10), T.width = parseInt(I[2], 10)), T.valid & 2 && T.valid & 4) break;
}
return T.valid & 2 || t(3, "missing format specifier"), T.valid & 4 || t(3, "missing image size specifier"), T;
- }, n = function(f, p, y) {
+ }, r = function(f, p, b) {
const _ = p;
if (
// run length encoding is not allowed so read flat
@@ -26511,11 +26579,11 @@ class ov extends tp {
)
return new Uint8Array(f);
_ !== (f[2] << 8 | f[3]) && t(3, "wrong scanline width");
- const E = new Uint8Array(4 * p * y);
+ const E = new Uint8Array(4 * p * b);
E.length || t(4, "unable to allocate buffer space");
let R = 0, T = 0;
const A = 4 * _, I = new Uint8Array(4), S = new Uint8Array(A);
- let M = y;
+ let M = b;
for (; M > 0 && T < f.byteLength; ) {
T + 4 > f.byteLength && t(1), I[0] = f[T++], I[1] = f[T++], I[2] = f[T++], I[3] = f[T++], (I[0] != 2 || I[1] != 2 || (I[2] << 8 | I[3]) != _) && t(3, "bad rgbe scanline format");
let L = 0, N;
@@ -26537,29 +26605,29 @@ class ov extends tp {
M--;
}
return E;
- }, a = function(f, p, y, _) {
+ }, a = function(f, p, b, _) {
const E = f[p + 3], R = Math.pow(2, E - 128) / 255;
- y[_ + 0] = f[p + 0] * R, y[_ + 1] = f[p + 1] * R, y[_ + 2] = f[p + 2] * R, y[_ + 3] = 1;
- }, o = function(f, p, y, _) {
+ b[_ + 0] = f[p + 0] * R, b[_ + 1] = f[p + 1] * R, b[_ + 2] = f[p + 2] * R, b[_ + 3] = 1;
+ }, o = function(f, p, b, _) {
const E = f[p + 3], R = Math.pow(2, E - 128) / 255;
- y[_ + 0] = Xr.toHalfFloat(Math.min(f[p + 0] * R, 65504)), y[_ + 1] = Xr.toHalfFloat(Math.min(f[p + 1] * R, 65504)), y[_ + 2] = Xr.toHalfFloat(Math.min(f[p + 2] * R, 65504)), y[_ + 3] = Xr.toHalfFloat(1);
+ b[_ + 0] = qn.toHalfFloat(Math.min(f[p + 0] * R, 65504)), b[_ + 1] = qn.toHalfFloat(Math.min(f[p + 1] * R, 65504)), b[_ + 2] = qn.toHalfFloat(Math.min(f[p + 2] * R, 65504)), b[_ + 3] = qn.toHalfFloat(1);
}, l = new Uint8Array(e);
l.pos = 0;
- const c = s(l), h = c.width, u = c.height, d = n(l.subarray(l.pos), h, u);
+ const c = s(l), h = c.width, u = c.height, d = r(l.subarray(l.pos), h, u);
let m, g, v;
switch (this.type) {
- case Xt:
+ case qt:
v = d.length / 4;
const f = new Float32Array(v * 4);
- for (let y = 0; y < v; y++)
- a(d, y * 4, f, y * 4);
- m = f, g = Xt;
+ for (let b = 0; b < v; b++)
+ a(d, b * 4, f, b * 4);
+ m = f, g = qt;
break;
case vt:
v = d.length / 4;
const p = new Uint16Array(v * 4);
- for (let y = 0; y < v; y++)
- o(d, y * 4, p, y * 4);
+ for (let b = 0; b < v; b++)
+ o(d, b * 4, p, b * 4);
m = p, g = vt;
break;
default:
@@ -26585,16 +26653,16 @@ class ov extends tp {
return this.type = e, this;
}
load(e, t, i, s) {
- function n(a, o) {
+ function r(a, o) {
switch (a.type) {
- case Xt:
+ case qt:
case vt:
- a.colorSpace = Bt, a.minFilter = Mt, a.magFilter = Mt, a.generateMipmaps = !1, a.flipY = !0;
+ a.colorSpace = kt, a.minFilter = Mt, a.magFilter = Mt, a.generateMipmaps = !1, a.flipY = !0;
break;
}
t && t(a, o);
}
- return super.load(e, n, i, s);
+ return super.load(e, r, i, s);
}
}
class lv extends ov {
@@ -26640,7 +26708,7 @@ const ss = {
}`
)
};
-class ns {
+class rs {
/**
* Constructs a new pass.
*/
@@ -26681,20 +26749,20 @@ class ns {
}
}
const cv = new _s(-1, 1, 1, -1, 0, 1);
-class hv extends si {
+class hv extends ni {
constructor() {
- super(), this.setAttribute("position", new gi([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new gi([0, 2, 0, 0, 2, 0], 2));
+ super(), this.setAttribute("position", new vi([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new vi([0, 2, 0, 0, 2, 0], 2));
}
}
const uv = new hv();
-class Nr {
+class Bn {
/**
* Constructs a new full screen quad.
*
* @param {?Material} material - The material to render te full screen quad with.
*/
constructor(e) {
- this._mesh = new at(uv, e);
+ this._mesh = new ot(uv, e);
}
/**
* Frees the GPU-related resources allocated by this instance. Call this
@@ -26723,7 +26791,7 @@ class Nr {
this._mesh.material = e;
}
}
-class Mo extends ns {
+class Mo extends rs {
/**
* Constructs a new shader pass.
*
@@ -26733,13 +26801,13 @@ class Mo extends ns {
* the read buffer.
*/
constructor(e, t = "tDiffuse") {
- super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof ut ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = mi.clone(e.uniforms), this.material = new ut({
+ super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof ut ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = fi.clone(e.uniforms), this.material = new ut({
name: e.name !== void 0 ? e.name : "unspecified",
defines: Object.assign({}, e.defines),
uniforms: this.uniforms,
vertexShader: e.vertexShader,
fragmentShader: e.fragmentShader
- })), this._fsQuad = new Nr(this.material);
+ })), this._fsQuad = new Bn(this.material);
}
/**
* Performs the shader pass.
@@ -26763,7 +26831,7 @@ class Mo extends ns {
this.material.dispose(), this._fsQuad.dispose();
}
}
-class Rc extends ns {
+class Rc extends rs {
/**
* Constructs a new mask pass.
*
@@ -26785,13 +26853,13 @@ class Rc extends ns {
* @param {boolean} maskActive - Whether masking is active or not.
*/
render(e, t, i) {
- const s = e.getContext(), n = e.state;
- n.buffers.color.setMask(!1), n.buffers.depth.setMask(!1), n.buffers.color.setLocked(!0), n.buffers.depth.setLocked(!0);
+ const s = e.getContext(), r = e.state;
+ r.buffers.color.setMask(!1), r.buffers.depth.setMask(!1), r.buffers.color.setLocked(!0), r.buffers.depth.setLocked(!0);
let a, o;
- this.inverse ? (a = 0, o = 1) : (a = 1, o = 0), n.buffers.stencil.setTest(!0), n.buffers.stencil.setOp(s.REPLACE, s.REPLACE, s.REPLACE), n.buffers.stencil.setFunc(s.ALWAYS, a, 4294967295), n.buffers.stencil.setClear(o), n.buffers.stencil.setLocked(!0), e.setRenderTarget(i), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), n.buffers.color.setLocked(!1), n.buffers.depth.setLocked(!1), n.buffers.color.setMask(!0), n.buffers.depth.setMask(!0), n.buffers.stencil.setLocked(!1), n.buffers.stencil.setFunc(s.EQUAL, 1, 4294967295), n.buffers.stencil.setOp(s.KEEP, s.KEEP, s.KEEP), n.buffers.stencil.setLocked(!0);
+ this.inverse ? (a = 0, o = 1) : (a = 1, o = 0), r.buffers.stencil.setTest(!0), r.buffers.stencil.setOp(s.REPLACE, s.REPLACE, s.REPLACE), r.buffers.stencil.setFunc(s.ALWAYS, a, 4294967295), r.buffers.stencil.setClear(o), r.buffers.stencil.setLocked(!0), e.setRenderTarget(i), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), r.buffers.color.setLocked(!1), r.buffers.depth.setLocked(!1), r.buffers.color.setMask(!0), r.buffers.depth.setMask(!0), r.buffers.stencil.setLocked(!1), r.buffers.stencil.setFunc(s.EQUAL, 1, 4294967295), r.buffers.stencil.setOp(s.KEEP, s.KEEP, s.KEEP), r.buffers.stencil.setLocked(!0);
}
}
-class dv extends ns {
+class dv extends rs {
/**
* Constructs a new clear mask pass.
*/
@@ -26825,10 +26893,10 @@ class pv {
constructor(e, t) {
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
const i = e.getSize(new oe());
- this._width = i.width, this._height = i.height, t = new bt(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: vt }), t.texture.name = "EffectComposer.rt1";
+ this._width = i.width, this._height = i.height, t = new yt(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: vt }), t.texture.name = "EffectComposer.rt1";
} else
this._width = t.width, this._height = t.height;
- this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Mo(ss), this.copyPass.material.blending = yt, this.clock = new cp();
+ this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Mo(ss), this.copyPass.material.blending = bt, this.clock = new cp();
}
/**
* Swaps the internal read/write buffers.
@@ -26885,7 +26953,7 @@ class pv {
e === void 0 && (e = this.clock.getDelta());
const t = this.renderer.getRenderTarget();
let i = !1;
- for (let s = 0, n = this.passes.length; s < n; s++) {
+ for (let s = 0, r = this.passes.length; s < r; s++) {
const a = this.passes[s];
if (a.enabled !== !1) {
if (a.renderToScreen = this.renderToScreen && this.isLastEnabledPass(s), a.render(this.renderer, this.writeBuffer, this.readBuffer, e, i), a.needsSwap) {
@@ -26924,8 +26992,8 @@ class pv {
this._width = e, this._height = t;
const i = this._width * this._pixelRatio, s = this._height * this._pixelRatio;
this.renderTarget1.setSize(i, s), this.renderTarget2.setSize(i, s);
- for (let n = 0; n < this.passes.length; n++)
- this.passes[n].setSize(i, s);
+ for (let r = 0; r < this.passes.length; r++)
+ this.passes[r].setSize(i, s);
}
/**
* Sets device pixel ratio. This is usually used for HiDPI device to prevent blurring output.
@@ -26944,7 +27012,7 @@ class pv {
this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.copyPass.dispose();
}
}
-class mv extends ns {
+class mv extends rs {
/**
* Constructs a new render pass.
*
@@ -26955,8 +27023,8 @@ class mv extends ns {
* @param {?(number|Color|string)} [clearColor=null] - The clear color of the render pass.
* @param {?number} [clearAlpha=null] - The clear alpha of the render pass.
*/
- constructor(e, t, i = null, s = null, n = null) {
- super(), this.scene = e, this.camera = t, this.overrideMaterial = i, this.clearColor = s, this.clearAlpha = n, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this._oldClearColor = new xe();
+ constructor(e, t, i = null, s = null, r = null) {
+ super(), this.scene = e, this.camera = t, this.overrideMaterial = i, this.clearColor = s, this.clearAlpha = r, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this._oldClearColor = new xe();
}
/**
* Performs a beauty pass with the configured scene and camera.
@@ -26972,11 +27040,11 @@ class mv extends ns {
render(e, t, i) {
const s = e.autoClear;
e.autoClear = !1;
- let n, a;
- this.overrideMaterial !== null && (a = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (n = e.getClearAlpha(), e.setClearAlpha(this.clearAlpha)), this.clearDepth == !0 && e.clearDepth(), e.setRenderTarget(this.renderToScreen ? null : i), this.clear === !0 && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), e.render(this.scene, this.camera), this.clearColor !== null && e.setClearColor(this._oldClearColor), this.clearAlpha !== null && e.setClearAlpha(n), this.overrideMaterial !== null && (this.scene.overrideMaterial = a), e.autoClear = s;
+ let r, a;
+ this.overrideMaterial !== null && (a = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (r = e.getClearAlpha(), e.setClearAlpha(this.clearAlpha)), this.clearDepth == !0 && e.clearDepth(), e.setRenderTarget(this.renderToScreen ? null : i), this.clear === !0 && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), e.render(this.scene, this.camera), this.clearColor !== null && e.setClearColor(this._oldClearColor), this.clearAlpha !== null && e.setClearAlpha(r), this.overrideMaterial !== null && (this.scene.overrideMaterial = a), e.autoClear = s;
}
}
-const dn = {
+const dr = {
defines: {
PERSPECTIVE_CAMERA: 1,
SAMPLES: 16,
@@ -27195,7 +27263,7 @@ const dn = {
gl_FragColor = FRAGMENT_OUTPUT;
}`
)
-}, pn = {
+}, pr = {
defines: {
PERSPECTIVE_CAMERA: 1
},
@@ -27240,7 +27308,7 @@ const dn = {
}`
)
-}, ba = {
+}, ya = {
uniforms: {
tDiffuse: { value: null },
intensity: { value: 1 }
@@ -27268,8 +27336,8 @@ const dn = {
}`
)
};
-function fv(r = 5) {
- const e = Math.floor(r) % 2 === 0 ? Math.floor(r) + 1 : Math.floor(r), t = gv(e), i = t.length, s = new Uint8Array(i * 4);
+function fv(n = 5) {
+ const e = Math.floor(n) % 2 === 0 ? Math.floor(n) + 1 : Math.floor(n), t = gv(e), i = t.length, s = new Uint8Array(i * 4);
for (let a = 0; a < i; ++a) {
const o = t[a], l = 2 * Math.PI * o / i, c = new w(
Math.cos(l),
@@ -27278,23 +27346,23 @@ function fv(r = 5) {
).normalize();
s[a * 4] = (c.x * 0.5 + 0.5) * 255, s[a * 4 + 1] = (c.y * 0.5 + 0.5) * 255, s[a * 4 + 2] = 127, s[a * 4 + 3] = 255;
}
- const n = new sr(s, e, e);
- return n.wrapS = Ri, n.wrapT = Ri, n.needsUpdate = !0, n;
+ const r = new nn(s, e, e);
+ return r.wrapS = Ri, r.wrapT = Ri, r.needsUpdate = !0, r;
}
-function gv(r) {
- const e = Math.floor(r) % 2 === 0 ? Math.floor(r) + 1 : Math.floor(r), t = e * e, i = Array(t).fill(0);
- let s = Math.floor(e / 2), n = e - 1;
+function gv(n) {
+ const e = Math.floor(n) % 2 === 0 ? Math.floor(n) + 1 : Math.floor(n), t = e * e, i = Array(t).fill(0);
+ let s = Math.floor(e / 2), r = e - 1;
for (let a = 1; a <= t; ) {
- if (s === -1 && n === e ? (n = e - 2, s = 0) : (n === e && (n = 0), s < 0 && (s = e - 1)), i[s * e + n] !== 0) {
- n -= 2, s++;
+ if (s === -1 && r === e ? (r = e - 2, s = 0) : (r === e && (r = 0), s < 0 && (s = e - 1)), i[s * e + r] !== 0) {
+ r -= 2, s++;
continue;
} else
- i[s * e + n] = a++;
- n++, s--;
+ i[s * e + r] = a++;
+ r++, s--;
}
return i;
}
-const mn = {
+const mr = {
defines: {
SAMPLES: 16,
SAMPLE_VECTORS: Uh(16, 2, 1),
@@ -27468,24 +27536,24 @@ const mn = {
}`
)
};
-function Uh(r, e, t) {
+function Uh(n, e, t) {
const i = vv(
- r,
+ n,
e,
t
);
let s = "vec3[SAMPLES](";
- for (let n = 0; n < r; n++) {
- const a = i[n];
- s += `vec3(${a.x}, ${a.y}, ${a.z})${n < r - 1 ? "," : ")"}`;
+ for (let r = 0; r < n; r++) {
+ const a = i[r];
+ s += `vec3(${a.x}, ${a.y}, ${a.z})${r < n - 1 ? "," : ")"}`;
}
return s;
}
-function vv(r, e, t) {
+function vv(n, e, t) {
const i = [];
- for (let s = 0; s < r; s++) {
- const n = 2 * Math.PI * e * s / r, a = Math.pow(s / (r - 1), t);
- i.push(new w(Math.cos(n), Math.sin(n), a));
+ for (let s = 0; s < n; s++) {
+ const r = 2 * Math.PI * e * s / n, a = Math.pow(s / (n - 1), t);
+ i.push(new w(Math.cos(r), Math.sin(r), a));
}
return i;
}
@@ -27624,17 +27692,17 @@ class _v {
* @return {number} The noise value.
*/
noise(e, t) {
- let i, s, n;
+ let i, s, r;
const a = 0.5 * (Math.sqrt(3) - 1), o = (e + t) * a, l = Math.floor(e + o), c = Math.floor(t + o), h = (3 - Math.sqrt(3)) / 6, u = (l + c) * h, d = l - u, m = c - u, g = e - d, v = t - m;
let f, p;
g > v ? (f = 1, p = 0) : (f = 0, p = 1);
- const y = g - f + h, _ = v - p + h, E = g - 1 + 2 * h, R = v - 1 + 2 * h, T = l & 255, A = c & 255, I = this.perm[T + this.perm[A]] % 12, S = this.perm[T + f + this.perm[A + p]] % 12, M = this.perm[T + 1 + this.perm[A + 1]] % 12;
+ const b = g - f + h, _ = v - p + h, E = g - 1 + 2 * h, R = v - 1 + 2 * h, T = l & 255, A = c & 255, I = this.perm[T + this.perm[A]] % 12, S = this.perm[T + f + this.perm[A + p]] % 12, M = this.perm[T + 1 + this.perm[A + 1]] % 12;
let L = 0.5 - g * g - v * v;
L < 0 ? i = 0 : (L *= L, i = L * L * this._dot(this.grad3[I], g, v));
- let N = 0.5 - y * y - _ * _;
- N < 0 ? s = 0 : (N *= N, s = N * N * this._dot(this.grad3[S], y, _));
+ let N = 0.5 - b * b - _ * _;
+ N < 0 ? s = 0 : (N *= N, s = N * N * this._dot(this.grad3[S], b, _));
let z = 0.5 - E * E - R * R;
- return z < 0 ? n = 0 : (z *= z, n = z * z * this._dot(this.grad3[M], E, R)), 70 * (i + s + n);
+ return z < 0 ? r = 0 : (z *= z, r = z * z * this._dot(this.grad3[M], E, R)), 70 * (i + s + r);
}
/**
* A 3D simplex noise method.
@@ -27645,19 +27713,19 @@ class _v {
* @return {number} The noise value.
*/
noise3d(e, t, i) {
- let s, n, a, o;
- const l = (e + t + i) * 0.3333333333333333, c = Math.floor(e + l), h = Math.floor(t + l), u = Math.floor(i + l), d = 1 / 6, m = (c + h + u) * d, g = c - m, v = h - m, f = u - m, p = e - g, y = t - v, _ = i - f;
+ let s, r, a, o;
+ const l = (e + t + i) * 0.3333333333333333, c = Math.floor(e + l), h = Math.floor(t + l), u = Math.floor(i + l), d = 1 / 6, m = (c + h + u) * d, g = c - m, v = h - m, f = u - m, p = e - g, b = t - v, _ = i - f;
let E, R, T, A, I, S;
- p >= y ? y >= _ ? (E = 1, R = 0, T = 0, A = 1, I = 1, S = 0) : p >= _ ? (E = 1, R = 0, T = 0, A = 1, I = 0, S = 1) : (E = 0, R = 0, T = 1, A = 1, I = 0, S = 1) : y < _ ? (E = 0, R = 0, T = 1, A = 0, I = 1, S = 1) : p < _ ? (E = 0, R = 1, T = 0, A = 0, I = 1, S = 1) : (E = 0, R = 1, T = 0, A = 1, I = 1, S = 0);
- const M = p - E + d, L = y - R + d, N = _ - T + d, z = p - A + 2 * d, H = y - I + 2 * d, j = _ - S + 2 * d, q = p - 1 + 3 * d, te = y - 1 + 3 * d, G = _ - 1 + 3 * d, Z = c & 255, re = h & 255, Le = u & 255, He = this.perm[Z + this.perm[re + this.perm[Le]]] % 12, Ye = this.perm[Z + E + this.perm[re + R + this.perm[Le + T]]] % 12, Ze = this.perm[Z + A + this.perm[re + I + this.perm[Le + S]]] % 12, $e = this.perm[Z + 1 + this.perm[re + 1 + this.perm[Le + 1]]] % 12;
- let W = 0.6 - p * p - y * y - _ * _;
- W < 0 ? s = 0 : (W *= W, s = W * W * this._dot3(this.grad3[He], p, y, _));
+ p >= b ? b >= _ ? (E = 1, R = 0, T = 0, A = 1, I = 1, S = 0) : p >= _ ? (E = 1, R = 0, T = 0, A = 1, I = 0, S = 1) : (E = 0, R = 0, T = 1, A = 1, I = 0, S = 1) : b < _ ? (E = 0, R = 0, T = 1, A = 0, I = 1, S = 1) : p < _ ? (E = 0, R = 1, T = 0, A = 0, I = 1, S = 1) : (E = 0, R = 1, T = 0, A = 1, I = 1, S = 0);
+ const M = p - E + d, L = b - R + d, N = _ - T + d, z = p - A + 2 * d, H = b - I + 2 * d, j = _ - S + 2 * d, q = p - 1 + 3 * d, te = b - 1 + 3 * d, G = _ - 1 + 3 * d, Z = c & 255, ne = h & 255, Le = u & 255, He = this.perm[Z + this.perm[ne + this.perm[Le]]] % 12, Ye = this.perm[Z + E + this.perm[ne + R + this.perm[Le + T]]] % 12, $e = this.perm[Z + A + this.perm[ne + I + this.perm[Le + S]]] % 12, Je = this.perm[Z + 1 + this.perm[ne + 1 + this.perm[Le + 1]]] % 12;
+ let W = 0.6 - p * p - b * b - _ * _;
+ W < 0 ? s = 0 : (W *= W, s = W * W * this._dot3(this.grad3[He], p, b, _));
let Y = 0.6 - M * M - L * L - N * N;
- Y < 0 ? n = 0 : (Y *= Y, n = Y * Y * this._dot3(this.grad3[Ye], M, L, N));
- let ue = 0.6 - z * z - H * H - j * j;
- ue < 0 ? a = 0 : (ue *= ue, a = ue * ue * this._dot3(this.grad3[Ze], z, H, j));
+ Y < 0 ? r = 0 : (Y *= Y, r = Y * Y * this._dot3(this.grad3[Ye], M, L, N));
+ let de = 0.6 - z * z - H * H - j * j;
+ de < 0 ? a = 0 : (de *= de, a = de * de * this._dot3(this.grad3[$e], z, H, j));
let Ae = 0.6 - q * q - te * te - G * G;
- return Ae < 0 ? o = 0 : (Ae *= Ae, o = Ae * Ae * this._dot3(this.grad3[$e], q, te, G)), 32 * (s + n + a + o);
+ return Ae < 0 ? o = 0 : (Ae *= Ae, o = Ae * Ae * this._dot3(this.grad3[Je], q, te, G)), 32 * (s + r + a + o);
}
/**
* A 4D simplex noise method.
@@ -27669,19 +27737,19 @@ class _v {
* @return {number} The noise value.
*/
noise4d(e, t, i, s) {
- const n = this.grad4, a = this.simplex, o = this.perm, l = (Math.sqrt(5) - 1) / 4, c = (5 - Math.sqrt(5)) / 20;
+ const r = this.grad4, a = this.simplex, o = this.perm, l = (Math.sqrt(5) - 1) / 4, c = (5 - Math.sqrt(5)) / 20;
let h, u, d, m, g;
- const v = (e + t + i + s) * l, f = Math.floor(e + v), p = Math.floor(t + v), y = Math.floor(i + v), _ = Math.floor(s + v), E = (f + p + y + _) * c, R = f - E, T = p - E, A = y - E, I = _ - E, S = e - R, M = t - T, L = i - A, N = s - I, z = S > M ? 32 : 0, H = S > L ? 16 : 0, j = M > L ? 8 : 0, q = S > N ? 4 : 0, te = M > N ? 2 : 0, G = L > N ? 1 : 0, Z = z + H + j + q + te + G, re = a[Z][0] >= 3 ? 1 : 0, Le = a[Z][1] >= 3 ? 1 : 0, He = a[Z][2] >= 3 ? 1 : 0, Ye = a[Z][3] >= 3 ? 1 : 0, Ze = a[Z][0] >= 2 ? 1 : 0, $e = a[Z][1] >= 2 ? 1 : 0, W = a[Z][2] >= 2 ? 1 : 0, Y = a[Z][3] >= 2 ? 1 : 0, ue = a[Z][0] >= 1 ? 1 : 0, Ae = a[Z][1] >= 1 ? 1 : 0, Te = a[Z][2] >= 1 ? 1 : 0, we = a[Z][3] >= 1 ? 1 : 0, Qe = S - re + c, Xe = M - Le + c, Ge = L - He + c, D = N - Ye + c, _t = S - Ze + 2 * c, je = M - $e + 2 * c, et = L - W + 2 * c, fe = N - Y + 2 * c, ot = S - ue + 3 * c, Me = M - Ae + 3 * c, De = L - Te + 3 * c, C = N - we + 3 * c, x = S - 1 + 4 * c, B = M - 1 + 4 * c, X = L - 1 + 4 * c, K = N - 1 + 4 * c, V = f & 255, ye = p & 255, ne = y & 255, Ee = _ & 255, de = o[V + o[ye + o[ne + o[Ee]]]] % 32, J = o[V + re + o[ye + Le + o[ne + He + o[Ee + Ye]]]] % 32, se = o[V + Ze + o[ye + $e + o[ne + W + o[Ee + Y]]]] % 32, Be = o[V + ue + o[ye + Ae + o[ne + Te + o[Ee + we]]]] % 32, Ce = o[V + 1 + o[ye + 1 + o[ne + 1 + o[Ee + 1]]]] % 32;
- let he = 0.6 - S * S - M * M - L * L - N * N;
- he < 0 ? h = 0 : (he *= he, h = he * he * this._dot4(n[de], S, M, L, N));
- let Re = 0.6 - Qe * Qe - Xe * Xe - Ge * Ge - D * D;
- Re < 0 ? u = 0 : (Re *= Re, u = Re * Re * this._dot4(n[J], Qe, Xe, Ge, D));
- let P = 0.6 - _t * _t - je * je - et * et - fe * fe;
- P < 0 ? d = 0 : (P *= P, d = P * P * this._dot4(n[se], _t, je, et, fe));
- let ae = 0.6 - ot * ot - Me * Me - De * De - C * C;
- ae < 0 ? m = 0 : (ae *= ae, m = ae * ae * this._dot4(n[Be], ot, Me, De, C));
- let ie = 0.6 - x * x - B * B - X * X - K * K;
- return ie < 0 ? g = 0 : (ie *= ie, g = ie * ie * this._dot4(n[Ce], x, B, X, K)), 27 * (h + u + d + m + g);
+ const v = (e + t + i + s) * l, f = Math.floor(e + v), p = Math.floor(t + v), b = Math.floor(i + v), _ = Math.floor(s + v), E = (f + p + b + _) * c, R = f - E, T = p - E, A = b - E, I = _ - E, S = e - R, M = t - T, L = i - A, N = s - I, z = S > M ? 32 : 0, H = S > L ? 16 : 0, j = M > L ? 8 : 0, q = S > N ? 4 : 0, te = M > N ? 2 : 0, G = L > N ? 1 : 0, Z = z + H + j + q + te + G, ne = a[Z][0] >= 3 ? 1 : 0, Le = a[Z][1] >= 3 ? 1 : 0, He = a[Z][2] >= 3 ? 1 : 0, Ye = a[Z][3] >= 3 ? 1 : 0, $e = a[Z][0] >= 2 ? 1 : 0, Je = a[Z][1] >= 2 ? 1 : 0, W = a[Z][2] >= 2 ? 1 : 0, Y = a[Z][3] >= 2 ? 1 : 0, de = a[Z][0] >= 1 ? 1 : 0, Ae = a[Z][1] >= 1 ? 1 : 0, Te = a[Z][2] >= 1 ? 1 : 0, we = a[Z][3] >= 1 ? 1 : 0, et = S - ne + c, Xe = M - Le + c, Ge = L - He + c, D = N - Ye + c, _t = S - $e + 2 * c, je = M - Je + 2 * c, tt = L - W + 2 * c, fe = N - Y + 2 * c, lt = S - de + 3 * c, Me = M - Ae + 3 * c, De = L - Te + 3 * c, C = N - we + 3 * c, x = S - 1 + 4 * c, O = M - 1 + 4 * c, X = L - 1 + 4 * c, K = N - 1 + 4 * c, V = f & 255, be = p & 255, re = b & 255, Ee = _ & 255, pe = o[V + o[be + o[re + o[Ee]]]] % 32, J = o[V + ne + o[be + Le + o[re + He + o[Ee + Ye]]]] % 32, se = o[V + $e + o[be + Je + o[re + W + o[Ee + Y]]]] % 32, Oe = o[V + de + o[be + Ae + o[re + Te + o[Ee + we]]]] % 32, Ce = o[V + 1 + o[be + 1 + o[re + 1 + o[Ee + 1]]]] % 32;
+ let ue = 0.6 - S * S - M * M - L * L - N * N;
+ ue < 0 ? h = 0 : (ue *= ue, h = ue * ue * this._dot4(r[pe], S, M, L, N));
+ let Re = 0.6 - et * et - Xe * Xe - Ge * Ge - D * D;
+ Re < 0 ? u = 0 : (Re *= Re, u = Re * Re * this._dot4(r[J], et, Xe, Ge, D));
+ let P = 0.6 - _t * _t - je * je - tt * tt - fe * fe;
+ P < 0 ? d = 0 : (P *= P, d = P * P * this._dot4(r[se], _t, je, tt, fe));
+ let ae = 0.6 - lt * lt - Me * Me - De * De - C * C;
+ ae < 0 ? m = 0 : (ae *= ae, m = ae * ae * this._dot4(r[Oe], lt, Me, De, C));
+ let ie = 0.6 - x * x - O * O - X * X - K * K;
+ return ie < 0 ? g = 0 : (ie *= ie, g = ie * ie * this._dot4(r[Ce], x, O, X, K)), 27 * (h + u + d + m + g);
}
// private
_dot(e, t, i) {
@@ -27690,11 +27758,11 @@ class _v {
_dot3(e, t, i, s) {
return e[0] * t + e[1] * i + e[2] * s;
}
- _dot4(e, t, i, s, n) {
- return e[0] * t + e[1] * i + e[2] * s + e[3] * n;
+ _dot4(e, t, i, s, r) {
+ return e[0] * t + e[1] * i + e[2] * s + e[3] * r;
}
}
-class hi extends ns {
+class ui extends rs {
/**
* Constructs a new GTAO pass.
*
@@ -27706,56 +27774,56 @@ class hi extends ns {
* @param {Object} [aoParameters] - The AO parameters.
* @param {Object} [pdParameters] - The denoise parameters.
*/
- constructor(e, t, i = 512, s = 512, n, a, o) {
- super(), this.width = i, this.height = s, this.clear = !0, this.camera = t, this.scene = e, this.output = 0, this._renderGBuffer = !0, this._visibilityCache = [], this.blendIntensity = 1, this.pdRings = 2, this.pdRadiusExponent = 2, this.pdSamples = 16, this.gtaoNoiseTexture = fv(), this.pdNoiseTexture = this._generateNoise(), this.gtaoRenderTarget = new bt(this.width, this.height, { type: vt }), this.pdRenderTarget = this.gtaoRenderTarget.clone(), this.gtaoMaterial = new ut({
- defines: Object.assign({}, dn.defines),
- uniforms: mi.clone(dn.uniforms),
- vertexShader: dn.vertexShader,
- fragmentShader: dn.fragmentShader,
- blending: yt,
+ constructor(e, t, i = 512, s = 512, r, a, o) {
+ super(), this.width = i, this.height = s, this.clear = !0, this.camera = t, this.scene = e, this.output = 0, this._renderGBuffer = !0, this._visibilityCache = [], this.blendIntensity = 1, this.pdRings = 2, this.pdRadiusExponent = 2, this.pdSamples = 16, this.gtaoNoiseTexture = fv(), this.pdNoiseTexture = this._generateNoise(), this.gtaoRenderTarget = new yt(this.width, this.height, { type: vt }), this.pdRenderTarget = this.gtaoRenderTarget.clone(), this.gtaoMaterial = new ut({
+ defines: Object.assign({}, dr.defines),
+ uniforms: fi.clone(dr.uniforms),
+ vertexShader: dr.vertexShader,
+ fragmentShader: dr.fragmentShader,
+ blending: bt,
depthTest: !1,
depthWrite: !1
- }), this.gtaoMaterial.defines.PERSPECTIVE_CAMERA = this.camera.isPerspectiveCamera ? 1 : 0, this.gtaoMaterial.uniforms.tNoise.value = this.gtaoNoiseTexture, this.gtaoMaterial.uniforms.resolution.value.set(this.width, this.height), this.gtaoMaterial.uniforms.cameraNear.value = this.camera.near, this.gtaoMaterial.uniforms.cameraFar.value = this.camera.far, this.normalMaterial = new zd(), this.normalMaterial.blending = yt, this.pdMaterial = new ut({
- defines: Object.assign({}, mn.defines),
- uniforms: mi.clone(mn.uniforms),
- vertexShader: mn.vertexShader,
- fragmentShader: mn.fragmentShader,
+ }), this.gtaoMaterial.defines.PERSPECTIVE_CAMERA = this.camera.isPerspectiveCamera ? 1 : 0, this.gtaoMaterial.uniforms.tNoise.value = this.gtaoNoiseTexture, this.gtaoMaterial.uniforms.resolution.value.set(this.width, this.height), this.gtaoMaterial.uniforms.cameraNear.value = this.camera.near, this.gtaoMaterial.uniforms.cameraFar.value = this.camera.far, this.normalMaterial = new zd(), this.normalMaterial.blending = bt, this.pdMaterial = new ut({
+ defines: Object.assign({}, mr.defines),
+ uniforms: fi.clone(mr.uniforms),
+ vertexShader: mr.vertexShader,
+ fragmentShader: mr.fragmentShader,
depthTest: !1,
depthWrite: !1
}), this.pdMaterial.uniforms.tDiffuse.value = this.gtaoRenderTarget.texture, this.pdMaterial.uniforms.tNoise.value = this.pdNoiseTexture, this.pdMaterial.uniforms.resolution.value.set(this.width, this.height), this.pdMaterial.uniforms.lumaPhi.value = 10, this.pdMaterial.uniforms.depthPhi.value = 2, this.pdMaterial.uniforms.normalPhi.value = 3, this.pdMaterial.uniforms.radius.value = 8, this.depthRenderMaterial = new ut({
- defines: Object.assign({}, pn.defines),
- uniforms: mi.clone(pn.uniforms),
- vertexShader: pn.vertexShader,
- fragmentShader: pn.fragmentShader,
- blending: yt
+ defines: Object.assign({}, pr.defines),
+ uniforms: fi.clone(pr.uniforms),
+ vertexShader: pr.vertexShader,
+ fragmentShader: pr.fragmentShader,
+ blending: bt
}), this.depthRenderMaterial.uniforms.cameraNear.value = this.camera.near, this.depthRenderMaterial.uniforms.cameraFar.value = this.camera.far, this.copyMaterial = new ut({
- uniforms: mi.clone(ss.uniforms),
+ uniforms: fi.clone(ss.uniforms),
vertexShader: ss.vertexShader,
fragmentShader: ss.fragmentShader,
transparent: !0,
depthTest: !1,
depthWrite: !1,
blendSrc: La,
- blendDst: _r,
- blendEquation: ui,
+ blendDst: xn,
+ blendEquation: di,
blendSrcAlpha: Pa,
- blendDstAlpha: _r,
- blendEquationAlpha: ui
+ blendDstAlpha: xn,
+ blendEquationAlpha: di
}), this.blendMaterial = new ut({
- uniforms: mi.clone(ba.uniforms),
- vertexShader: ba.vertexShader,
- fragmentShader: ba.fragmentShader,
+ uniforms: fi.clone(ya.uniforms),
+ vertexShader: ya.vertexShader,
+ fragmentShader: ya.fragmentShader,
transparent: !0,
depthTest: !1,
depthWrite: !1,
blending: Xc,
blendSrc: La,
- blendDst: _r,
- blendEquation: ui,
+ blendDst: xn,
+ blendEquation: di,
blendSrcAlpha: Pa,
- blendDstAlpha: _r,
- blendEquationAlpha: ui
- }), this._fsQuad = new Nr(null), this._originalClearColor = new xe(), this.setGBuffer(n ? n.depthTexture : void 0, n ? n.normalTexture : void 0), a !== void 0 && this.updateGtaoMaterial(a), o !== void 0 && this.updatePdMaterial(o);
+ blendDstAlpha: xn,
+ blendEquationAlpha: di
+ }), this._fsQuad = new Bn(null), this._originalClearColor = new xe(), this.setGBuffer(r ? r.depthTexture : void 0, r ? r.normalTexture : void 0), a !== void 0 && this.updateGtaoMaterial(a), o !== void 0 && this.updatePdMaterial(o);
}
/**
* Sets the size of the pass.
@@ -27791,9 +27859,9 @@ class hi extends ns {
* @param {DepthTexture} [normalTexture] - The normal texture.
*/
setGBuffer(e, t) {
- e !== void 0 ? (this.depthTexture = e, this.normalTexture = t, this._renderGBuffer = !1) : (this.depthTexture = new Ko(), this.depthTexture.format = Ks, this.depthTexture.type = Ys, this.normalRenderTarget = new bt(this.width, this.height, {
- minFilter: Ut,
- magFilter: Ut,
+ e !== void 0 ? (this.depthTexture = e, this.normalTexture = t, this._renderGBuffer = !1) : (this.depthTexture = new Ko(), this.depthTexture.format = Ks, this.depthTexture.type = Ys, this.normalRenderTarget = new yt(this.width, this.height, {
+ minFilter: Nt,
+ magFilter: Nt,
type: vt,
depthTexture: this.depthTexture
}), this.normalTexture = this.normalRenderTarget.texture, this._renderGBuffer = !0);
@@ -27839,40 +27907,40 @@ class hi extends ns {
*/
render(e, t, i) {
switch (this._renderGBuffer && (this._overrideVisibility(), this._renderOverride(e, this.normalMaterial, this.normalRenderTarget, 7829503, 1), this._restoreVisibility()), this.gtaoMaterial.uniforms.cameraNear.value = this.camera.near, this.gtaoMaterial.uniforms.cameraFar.value = this.camera.far, this.gtaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix), this.gtaoMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse), this.gtaoMaterial.uniforms.cameraWorldMatrix.value.copy(this.camera.matrixWorld), this._renderPass(e, this.gtaoMaterial, this.gtaoRenderTarget, 16777215, 1), this.pdMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse), this._renderPass(e, this.pdMaterial, this.pdRenderTarget, 16777215, 1), this.output) {
- case hi.OUTPUT.Off:
+ case ui.OUTPUT.Off:
break;
- case hi.OUTPUT.Diffuse:
- this.copyMaterial.uniforms.tDiffuse.value = i.texture, this.copyMaterial.blending = yt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
+ case ui.OUTPUT.Diffuse:
+ this.copyMaterial.uniforms.tDiffuse.value = i.texture, this.copyMaterial.blending = bt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
break;
- case hi.OUTPUT.AO:
- this.copyMaterial.uniforms.tDiffuse.value = this.gtaoRenderTarget.texture, this.copyMaterial.blending = yt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
+ case ui.OUTPUT.AO:
+ this.copyMaterial.uniforms.tDiffuse.value = this.gtaoRenderTarget.texture, this.copyMaterial.blending = bt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
break;
- case hi.OUTPUT.Denoise:
- this.copyMaterial.uniforms.tDiffuse.value = this.pdRenderTarget.texture, this.copyMaterial.blending = yt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
+ case ui.OUTPUT.Denoise:
+ this.copyMaterial.uniforms.tDiffuse.value = this.pdRenderTarget.texture, this.copyMaterial.blending = bt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
break;
- case hi.OUTPUT.Depth:
+ case ui.OUTPUT.Depth:
this.depthRenderMaterial.uniforms.cameraNear.value = this.camera.near, this.depthRenderMaterial.uniforms.cameraFar.value = this.camera.far, this._renderPass(e, this.depthRenderMaterial, this.renderToScreen ? null : t);
break;
- case hi.OUTPUT.Normal:
- this.copyMaterial.uniforms.tDiffuse.value = this.normalRenderTarget.texture, this.copyMaterial.blending = yt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
+ case ui.OUTPUT.Normal:
+ this.copyMaterial.uniforms.tDiffuse.value = this.normalRenderTarget.texture, this.copyMaterial.blending = bt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t);
break;
- case hi.OUTPUT.Default:
- this.copyMaterial.uniforms.tDiffuse.value = i.texture, this.copyMaterial.blending = yt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t), this.blendMaterial.uniforms.intensity.value = this.blendIntensity, this.blendMaterial.uniforms.tDiffuse.value = this.pdRenderTarget.texture, this._renderPass(e, this.blendMaterial, this.renderToScreen ? null : t);
+ case ui.OUTPUT.Default:
+ this.copyMaterial.uniforms.tDiffuse.value = i.texture, this.copyMaterial.blending = bt, this._renderPass(e, this.copyMaterial, this.renderToScreen ? null : t), this.blendMaterial.uniforms.intensity.value = this.blendIntensity, this.blendMaterial.uniforms.tDiffuse.value = this.pdRenderTarget.texture, this._renderPass(e, this.blendMaterial, this.renderToScreen ? null : t);
break;
default:
console.warn("THREE.GTAOPass: Unknown output type.");
}
}
// internals
- _renderPass(e, t, i, s, n) {
+ _renderPass(e, t, i, s, r) {
e.getClearColor(this._originalClearColor);
const a = e.getClearAlpha(), o = e.autoClear;
- e.setRenderTarget(i), e.autoClear = !1, s != null && (e.setClearColor(s), e.setClearAlpha(n || 0), e.clear()), this._fsQuad.material = t, this._fsQuad.render(e), e.autoClear = o, e.setClearColor(this._originalClearColor), e.setClearAlpha(a);
+ e.setRenderTarget(i), e.autoClear = !1, s != null && (e.setClearColor(s), e.setClearAlpha(r || 0), e.clear()), this._fsQuad.material = t, this._fsQuad.render(e), e.autoClear = o, e.setClearColor(this._originalClearColor), e.setClearAlpha(a);
}
- _renderOverride(e, t, i, s, n) {
+ _renderOverride(e, t, i, s, r) {
e.getClearColor(this._originalClearColor);
const a = e.getClearAlpha(), o = e.autoClear;
- e.setRenderTarget(i), e.autoClear = !1, s = t.clearColor || s, n = t.clearAlpha || n, s != null && (e.setClearColor(s), e.setClearAlpha(n || 0), e.clear()), this.scene.overrideMaterial = t, e.render(this.scene, this.camera), this.scene.overrideMaterial = null, e.autoClear = o, e.setClearColor(this._originalClearColor), e.setClearAlpha(a);
+ e.setRenderTarget(i), e.autoClear = !1, s = t.clearColor || s, r = t.clearAlpha || r, s != null && (e.setClearColor(s), e.setClearAlpha(r || 0), e.clear()), this.scene.overrideMaterial = t, e.render(this.scene, this.camera), this.scene.overrideMaterial = null, e.autoClear = o, e.setClearColor(this._originalClearColor), e.setClearAlpha(a);
}
_overrideVisibility() {
const e = this.scene, t = this._visibilityCache;
@@ -27893,11 +27961,11 @@ class hi extends ns {
const l = a, c = o;
s[(a * e + o) * 4] = (t.noise(l, c) * 0.5 + 0.5) * 255, s[(a * e + o) * 4 + 1] = (t.noise(l + e, c) * 0.5 + 0.5) * 255, s[(a * e + o) * 4 + 2] = (t.noise(l, c + e) * 0.5 + 0.5) * 255, s[(a * e + o) * 4 + 3] = (t.noise(l + e, c + e) * 0.5 + 0.5) * 255;
}
- const n = new sr(s, e, e, $t, vi);
- return n.wrapS = Ri, n.wrapT = Ri, n.needsUpdate = !0, n;
+ const r = new nn(s, e, e, Jt, _i);
+ return r.wrapS = Ri, r.wrapT = Ri, r.needsUpdate = !0, r;
}
}
-hi.OUTPUT = {
+ui.OUTPUT = {
Off: -1,
Default: 0,
Diffuse: 1,
@@ -27955,7 +28023,7 @@ const xv = {
}`
)
};
-class tr extends ns {
+class tn extends rs {
/**
* Constructs a new Unreal Bloom pass.
*
@@ -27966,35 +28034,35 @@ class tr extends ns {
*/
constructor(e, t = 1, i, s) {
super(), this.strength = t, this.radius = i, this.threshold = s, this.resolution = e !== void 0 ? new oe(e.x, e.y) : new oe(256, 256), this.clearColor = new xe(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5;
- let n = Math.round(this.resolution.x / 2), a = Math.round(this.resolution.y / 2);
- this.renderTargetBright = new bt(n, a, { type: vt }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1;
+ let r = Math.round(this.resolution.x / 2), a = Math.round(this.resolution.y / 2);
+ this.renderTargetBright = new yt(r, a, { type: vt }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1;
for (let h = 0; h < this.nMips; h++) {
- const u = new bt(n, a, { type: vt });
+ const u = new yt(r, a, { type: vt });
u.texture.name = "UnrealBloomPass.h" + h, u.texture.generateMipmaps = !1, this.renderTargetsHorizontal.push(u);
- const d = new bt(n, a, { type: vt });
- d.texture.name = "UnrealBloomPass.v" + h, d.texture.generateMipmaps = !1, this.renderTargetsVertical.push(d), n = Math.round(n / 2), a = Math.round(a / 2);
+ const d = new yt(r, a, { type: vt });
+ d.texture.name = "UnrealBloomPass.v" + h, d.texture.generateMipmaps = !1, this.renderTargetsVertical.push(d), r = Math.round(r / 2), a = Math.round(a / 2);
}
const o = xv;
- this.highPassUniforms = mi.clone(o.uniforms), this.highPassUniforms.luminosityThreshold.value = s, this.highPassUniforms.smoothWidth.value = 0.01, this.materialHighPassFilter = new ut({
+ this.highPassUniforms = fi.clone(o.uniforms), this.highPassUniforms.luminosityThreshold.value = s, this.highPassUniforms.smoothWidth.value = 0.01, this.materialHighPassFilter = new ut({
uniforms: this.highPassUniforms,
vertexShader: o.vertexShader,
fragmentShader: o.fragmentShader
}), this.separableBlurMaterials = [];
const l = [6, 10, 14, 18, 22];
- n = Math.round(this.resolution.x / 2), a = Math.round(this.resolution.y / 2);
+ r = Math.round(this.resolution.x / 2), a = Math.round(this.resolution.y / 2);
for (let h = 0; h < this.nMips; h++)
- this.separableBlurMaterials.push(this._getSeparableBlurMaterial(l[h])), this.separableBlurMaterials[h].uniforms.invSize.value = new oe(1 / n, 1 / a), n = Math.round(n / 2), a = Math.round(a / 2);
+ this.separableBlurMaterials.push(this._getSeparableBlurMaterial(l[h])), this.separableBlurMaterials[h].uniforms.invSize.value = new oe(1 / r, 1 / a), r = Math.round(r / 2), a = Math.round(a / 2);
this.compositeMaterial = this._getCompositeMaterial(this.nMips), this.compositeMaterial.uniforms.blurTexture1.value = this.renderTargetsVertical[0].texture, this.compositeMaterial.uniforms.blurTexture2.value = this.renderTargetsVertical[1].texture, this.compositeMaterial.uniforms.blurTexture3.value = this.renderTargetsVertical[2].texture, this.compositeMaterial.uniforms.blurTexture4.value = this.renderTargetsVertical[3].texture, this.compositeMaterial.uniforms.blurTexture5.value = this.renderTargetsVertical[4].texture, this.compositeMaterial.uniforms.bloomStrength.value = t, this.compositeMaterial.uniforms.bloomRadius.value = 0.1;
const c = [1, 0.8, 0.6, 0.4, 0.2];
- this.compositeMaterial.uniforms.bloomFactors.value = c, this.bloomTintColors = [new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1)], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = mi.clone(ss.uniforms), this.blendMaterial = new ut({
+ this.compositeMaterial.uniforms.bloomFactors.value = c, this.bloomTintColors = [new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1), new w(1, 1, 1)], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = fi.clone(ss.uniforms), this.blendMaterial = new ut({
uniforms: this.copyUniforms,
vertexShader: ss.vertexShader,
fragmentShader: ss.fragmentShader,
- blending: Sn,
+ blending: Sr,
depthTest: !1,
depthWrite: !1,
transparent: !0
- }), this._oldClearColor = new xe(), this._oldClearAlpha = 1, this._basic = new zt(), this._fsQuad = new Nr(null);
+ }), this._oldClearColor = new xe(), this._oldClearAlpha = 1, this._basic = new Ht(), this._fsQuad = new Bn(null);
}
/**
* Frees the GPU-related resources allocated by this instance. Call this
@@ -28019,8 +28087,8 @@ class tr extends ns {
setSize(e, t) {
let i = Math.round(e / 2), s = Math.round(t / 2);
this.renderTargetBright.setSize(i, s);
- for (let n = 0; n < this.nMips; n++)
- this.renderTargetsHorizontal[n].setSize(i, s), this.renderTargetsVertical[n].setSize(i, s), this.separableBlurMaterials[n].uniforms.invSize.value = new oe(1 / i, 1 / s), i = Math.round(i / 2), s = Math.round(s / 2);
+ for (let r = 0; r < this.nMips; r++)
+ this.renderTargetsHorizontal[r].setSize(i, s), this.renderTargetsVertical[r].setSize(i, s), this.separableBlurMaterials[r].uniforms.invSize.value = new oe(1 / i, 1 / s), i = Math.round(i / 2), s = Math.round(s / 2);
}
/**
* Performs the Bloom pass.
@@ -28033,14 +28101,14 @@ class tr extends ns {
* @param {number} deltaTime - The delta time in seconds.
* @param {boolean} maskActive - Whether masking is active or not.
*/
- render(e, t, i, s, n) {
+ render(e, t, i, s, r) {
e.getClearColor(this._oldClearColor), this._oldClearAlpha = e.getClearAlpha();
const a = e.autoClear;
- e.autoClear = !1, e.setClearColor(this.clearColor, 0), n && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this._fsQuad.material = this._basic, this._basic.map = i.texture, e.setRenderTarget(null), e.clear(), this._fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = i.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this._fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this._fsQuad.render(e);
+ e.autoClear = !1, e.setClearColor(this.clearColor, 0), r && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this._fsQuad.material = this._basic, this._basic.map = i.texture, e.setRenderTarget(null), e.clear(), this._fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = i.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this._fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this._fsQuad.render(e);
let o = this.renderTargetBright;
for (let l = 0; l < this.nMips; l++)
- this._fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = o.texture, this.separableBlurMaterials[l].uniforms.direction.value = tr.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[l]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[l].uniforms.colorTexture.value = this.renderTargetsHorizontal[l].texture, this.separableBlurMaterials[l].uniforms.direction.value = tr.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[l]), e.clear(), this._fsQuad.render(e), o = this.renderTargetsVertical[l];
- this._fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, n && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(i), this._fsQuad.render(e)), e.setClearColor(this._oldClearColor, this._oldClearAlpha), e.autoClear = a;
+ this._fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = o.texture, this.separableBlurMaterials[l].uniforms.direction.value = tn.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[l]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[l].uniforms.colorTexture.value = this.renderTargetsHorizontal[l].texture, this.separableBlurMaterials[l].uniforms.direction.value = tn.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[l]), e.clear(), this._fsQuad.render(e), o = this.renderTargetsVertical[l];
+ this._fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, r && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(i), this._fsQuad.render(e)), e.setClearColor(this._oldClearColor, this._oldClearAlpha), e.autoClear = a;
}
// internals
_getSeparableBlurMaterial(e) {
@@ -28133,9 +28201,9 @@ class tr extends ns {
});
}
}
-tr.BlurDirectionX = new oe(1, 0);
-tr.BlurDirectionY = new oe(0, 1);
-const fn = {
+tn.BlurDirectionX = new oe(1, 0);
+tn.BlurDirectionY = new oe(0, 1);
+const fr = {
name: "OutputShader",
uniforms: {
tDiffuse: { value: null },
@@ -28221,17 +28289,17 @@ const fn = {
}`
)
};
-class yv extends ns {
+class bv extends rs {
/**
* Constructs a new output pass.
*/
constructor() {
- super(), this.uniforms = mi.clone(fn.uniforms), this.material = new kd({
- name: fn.name,
+ super(), this.uniforms = fi.clone(fr.uniforms), this.material = new Fd({
+ name: fr.name,
uniforms: this.uniforms,
- vertexShader: fn.vertexShader,
- fragmentShader: fn.fragmentShader
- }), this._fsQuad = new Nr(this.material), this._outputColorSpace = null, this._toneMapping = null;
+ vertexShader: fr.vertexShader,
+ fragmentShader: fr.fragmentShader
+ }), this._fsQuad = new Bn(this.material), this._outputColorSpace = null, this._toneMapping = null;
}
/**
* Performs the output pass.
@@ -28245,7 +28313,7 @@ class yv extends ns {
* @param {boolean} maskActive - Whether masking is active or not.
*/
render(e, t, i) {
- this.uniforms.tDiffuse.value = i.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, qe.getTransfer(this._outputColorSpace) === tt && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === qc ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === Yc ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === Kc ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === Po ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === $c ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === Jc ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === Zc && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
+ this.uniforms.tDiffuse.value = i.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, qe.getTransfer(this._outputColorSpace) === it && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === qc ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === Yc ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === Kc ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === Po ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === $c ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === Jc ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === Zc && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
}
/**
* Frees the GPU-related resources allocated by this instance. Call this
@@ -28255,7 +28323,7 @@ class yv extends ns {
this.material.dispose(), this._fsQuad.dispose();
}
}
-const bv = {
+const yv = {
name: "FXAAShader",
uniforms: {
tDiffuse: { value: null },
@@ -28531,14 +28599,14 @@ const bv = {
}`
)
};
-function Mv(r) {
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
+function Mv(n) {
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var So = { exports: {} }, Sv = So.exports, Pc;
function Tv() {
- return Pc || (Pc = 1, (function(r, e) {
+ return Pc || (Pc = 1, (function(n, e) {
(function(t, i) {
- r.exports = i();
+ n.exports = i();
})(Sv, function() {
var t = function() {
function i(m) {
@@ -28546,11 +28614,11 @@ function Tv() {
}
function s(m) {
for (var g = 0; g < a.children.length; g++) a.children[g].style.display = g === m ? "block" : "none";
- n = m;
+ r = m;
}
- var n = 0, a = document.createElement("div");
+ var r = 0, a = document.createElement("div");
a.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", a.addEventListener("click", function(m) {
- m.preventDefault(), s(++n % a.children.length);
+ m.preventDefault(), s(++r % a.children.length);
}, !1);
var o = (performance || Date).now(), l = o, c = 0, h = i(new t.Panel("FPS", "#0ff", "#002")), u = i(new t.Panel("MS", "#0f0", "#020"));
if (self.performance && self.performance.memory) var d = i(new t.Panel("MB", "#f08", "#201"));
@@ -28568,12 +28636,12 @@ function Tv() {
o = this.end();
}, domElement: a, setMode: s };
};
- return t.Panel = function(i, s, n) {
- var a = 1 / 0, o = 0, l = Math.round, c = l(window.devicePixelRatio || 1), h = 80 * c, u = 48 * c, d = 3 * c, m = 2 * c, g = 3 * c, v = 15 * c, f = 74 * c, p = 30 * c, y = document.createElement("canvas");
- y.width = h, y.height = u, y.style.cssText = "width:80px;height:48px";
- var _ = y.getContext("2d");
- return _.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", _.textBaseline = "top", _.fillStyle = n, _.fillRect(0, 0, h, u), _.fillStyle = s, _.fillText(i, d, m), _.fillRect(g, v, f, p), _.fillStyle = n, _.globalAlpha = 0.9, _.fillRect(g, v, f, p), { dom: y, update: function(E, R) {
- a = Math.min(a, E), o = Math.max(o, E), _.fillStyle = n, _.globalAlpha = 1, _.fillRect(0, 0, h, v), _.fillStyle = s, _.fillText(l(E) + " " + i + " (" + l(a) + "-" + l(o) + ")", d, m), _.drawImage(y, g + c, v, f - c, p, g, v, f - c, p), _.fillRect(g + f - c, v, c, p), _.fillStyle = n, _.globalAlpha = 0.9, _.fillRect(g + f - c, v, c, l((1 - E / R) * p));
+ return t.Panel = function(i, s, r) {
+ var a = 1 / 0, o = 0, l = Math.round, c = l(window.devicePixelRatio || 1), h = 80 * c, u = 48 * c, d = 3 * c, m = 2 * c, g = 3 * c, v = 15 * c, f = 74 * c, p = 30 * c, b = document.createElement("canvas");
+ b.width = h, b.height = u, b.style.cssText = "width:80px;height:48px";
+ var _ = b.getContext("2d");
+ return _.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", _.textBaseline = "top", _.fillStyle = r, _.fillRect(0, 0, h, u), _.fillStyle = s, _.fillText(i, d, m), _.fillRect(g, v, f, p), _.fillStyle = r, _.globalAlpha = 0.9, _.fillRect(g, v, f, p), { dom: b, update: function(E, R) {
+ a = Math.min(a, E), o = Math.max(o, E), _.fillStyle = r, _.globalAlpha = 1, _.fillRect(0, 0, h, v), _.fillStyle = s, _.fillText(l(E) + " " + i + " (" + l(a) + "-" + l(o) + ")", d, m), _.drawImage(b, g + c, v, f - c, p, g, v, f - c, p), _.fillRect(g + f - c, v, c, p), _.fillStyle = r, _.globalAlpha = 0.9, _.fillRect(g + f - c, v, c, l((1 - E / R) * p));
} };
}, t;
});
@@ -28597,7 +28665,7 @@ class Cv {
getBoundingBox() {
const e = new Lt();
return this.scene.traverse((t) => {
- if (t instanceof at || t instanceof Gi) {
+ if (t instanceof ot || t instanceof Gi) {
const i = new Lt().setFromObject(t);
e.union(i);
}
@@ -28607,7 +28675,7 @@ class Cv {
), e;
}
}
-const Lc = { type: "change" }, tl = { type: "start" }, Nh = { type: "end" }, gn = new ir(), Dc = new Ti(), Av = Math.cos(70 * zo.DEG2RAD), St = new w(), Wt = 2 * Math.PI, nt = {
+const Lc = { type: "change" }, tl = { type: "start" }, Nh = { type: "end" }, gr = new sn(), Dc = new Ti(), Av = Math.cos(70 * zo.DEG2RAD), St = new w(), jt = 2 * Math.PI, at = {
NONE: -1,
ROTATE: 0,
DOLLY: 1,
@@ -28617,7 +28685,7 @@ const Lc = { type: "change" }, tl = { type: "start" }, Nh = { type: "end" }, gn
TOUCH_DOLLY_PAN: 5,
TOUCH_DOLLY_ROTATE: 6
}, Ma = 1e-6;
-class Oh extends xp {
+class Bh extends xp {
/**
* Constructs a new controls instance.
*
@@ -28625,7 +28693,7 @@ class Oh extends xp {
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
*/
constructor(e, t = null) {
- super(e, t), this.state = nt.NONE, this.target = new w(), this.cursor = new w(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: ks.ROTATE, MIDDLE: ks.DOLLY, RIGHT: ks.PAN }, this.touches = { ONE: Bs.ROTATE, TWO: Bs.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new _i(), this._lastTargetPosition = new w(), this._quat = new _i().setFromUnitVectors(e.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new rc(), this._sphericalDelta = new rc(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new oe(), this._rotateEnd = new oe(), this._rotateDelta = new oe(), this._panStart = new oe(), this._panEnd = new oe(), this._panDelta = new oe(), this._dollyStart = new oe(), this._dollyEnd = new oe(), this._dollyDelta = new oe(), this._dollyDirection = new w(), this._mouse = new oe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Pv.bind(this), this._onPointerDown = Rv.bind(this), this._onPointerUp = Lv.bind(this), this._onContextMenu = Fv.bind(this), this._onMouseWheel = Uv.bind(this), this._onKeyDown = Nv.bind(this), this._onTouchStart = Ov.bind(this), this._onTouchMove = Bv.bind(this), this._onMouseDown = Dv.bind(this), this._onMouseMove = Iv.bind(this), this._interceptControlDown = kv.bind(this), this._interceptControlUp = zv.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
+ super(e, t), this.state = at.NONE, this.target = new w(), this.cursor = new w(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Fs.ROTATE, MIDDLE: Fs.DOLLY, RIGHT: Fs.PAN }, this.touches = { ONE: Os.ROTATE, TWO: Os.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new xi(), this._lastTargetPosition = new w(), this._quat = new xi().setFromUnitVectors(e.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new nc(), this._sphericalDelta = new nc(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new oe(), this._rotateEnd = new oe(), this._rotateDelta = new oe(), this._panStart = new oe(), this._panEnd = new oe(), this._panDelta = new oe(), this._dollyStart = new oe(), this._dollyEnd = new oe(), this._dollyDelta = new oe(), this._dollyDirection = new w(), this._mouse = new oe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Pv.bind(this), this._onPointerDown = Rv.bind(this), this._onPointerUp = Lv.bind(this), this._onContextMenu = kv.bind(this), this._onMouseWheel = Uv.bind(this), this._onKeyDown = Nv.bind(this), this._onTouchStart = Bv.bind(this), this._onTouchMove = Ov.bind(this), this._onMouseDown = Dv.bind(this), this._onMouseMove = Iv.bind(this), this._interceptControlDown = Fv.bind(this), this._interceptControlUp = zv.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
}
connect(e) {
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -28686,19 +28754,19 @@ class Oh extends xp {
* was called, or the initial state.
*/
reset() {
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Lc), this.update(), this.state = nt.NONE;
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Lc), this.update(), this.state = at.NONE;
}
update(e = null) {
const t = this.object.position;
- St.copy(t).sub(this.target), St.applyQuaternion(this._quat), this._spherical.setFromVector3(St), this.autoRotate && this.state === nt.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
+ St.copy(t).sub(this.target), St.applyQuaternion(this._quat), this._spherical.setFromVector3(St), this.autoRotate && this.state === at.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
let i = this.minAzimuthAngle, s = this.maxAzimuthAngle;
- isFinite(i) && isFinite(s) && (i < -Math.PI ? i += Wt : i > Math.PI && (i -= Wt), s < -Math.PI ? s += Wt : s > Math.PI && (s -= Wt), i <= s ? this._spherical.theta = Math.max(i, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + s) / 2 ? Math.max(i, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
- let n = !1;
+ isFinite(i) && isFinite(s) && (i < -Math.PI ? i += jt : i > Math.PI && (i -= jt), s < -Math.PI ? s += jt : s > Math.PI && (s -= jt), i <= s ? this._spherical.theta = Math.max(i, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + s) / 2 ? Math.max(i, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
+ let r = !1;
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
this._spherical.radius = this._clampDistance(this._spherical.radius);
else {
const a = this._spherical.radius;
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = a != this._spherical.radius;
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), r = a != this._spherical.radius;
}
if (St.setFromSpherical(this._spherical), St.applyQuaternion(this._quatInverse), t.copy(this.target).add(St), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
let a = null;
@@ -28706,25 +28774,25 @@ class Oh extends xp {
const o = St.length();
a = this._clampDistance(o * this._scale);
const l = o - a;
- this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), n = !!l;
+ this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), r = !!l;
} else if (this.object.isOrthographicCamera) {
const o = new w(this._mouse.x, this._mouse.y, 0);
o.unproject(this.object);
const l = this.object.zoom;
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = l !== this.object.zoom;
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = l !== this.object.zoom;
const c = new w(this._mouse.x, this._mouse.y, 0);
c.unproject(this.object), this.object.position.sub(c).add(o), this.object.updateMatrixWorld(), a = St.length();
} else
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
- a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (gn.origin.copy(this.object.position), gn.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(gn.direction)) < Av ? this.object.lookAt(this.target) : (Dc.setFromNormalAndCoplanarPoint(this.object.up, this.target), gn.intersectPlane(Dc, this.target))));
+ a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (gr.origin.copy(this.object.position), gr.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(gr.direction)) < Av ? this.object.lookAt(this.target) : (Dc.setFromNormalAndCoplanarPoint(this.object.up, this.target), gr.intersectPlane(Dc, this.target))));
} else if (this.object.isOrthographicCamera) {
const a = this.object.zoom;
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), a !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), a !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
}
- return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > Ma || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Ma || this._lastTargetPosition.distanceToSquared(this.target) > Ma ? (this.dispatchEvent(Lc), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
+ return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > Ma || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Ma || this._lastTargetPosition.distanceToSquared(this.target) > Ma ? (this.dispatchEvent(Lc), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
}
_getAutoRotationAngle(e) {
- return e !== null ? Wt / 60 * this.autoRotateSpeed * e : Wt / 60 / 60 * this.autoRotateSpeed;
+ return e !== null ? jt / 60 * this.autoRotateSpeed * e : jt / 60 / 60 * this.autoRotateSpeed;
}
_getZoomScale(e) {
const t = Math.abs(e * 0.01);
@@ -28748,8 +28816,8 @@ class Oh extends xp {
if (this.object.isPerspectiveCamera) {
const s = this.object.position;
St.copy(s).sub(this.target);
- let n = St.length();
- n *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * n / i.clientHeight, this.object.matrix), this._panUp(2 * t * n / i.clientHeight, this.object.matrix);
+ let r = St.length();
+ r *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * r / i.clientHeight, this.object.matrix), this._panUp(2 * t * r / i.clientHeight, this.object.matrix);
} else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
}
_dollyOut(e) {
@@ -28762,8 +28830,8 @@ class Oh extends xp {
if (!this.zoomToCursor)
return;
this._performCursorZoom = !0;
- const i = this.domElement.getBoundingClientRect(), s = e - i.left, n = t - i.top, a = i.width, o = i.height;
- this._mouse.x = s / a * 2 - 1, this._mouse.y = -(n / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
+ const i = this.domElement.getBoundingClientRect(), s = e - i.left, r = t - i.top, a = i.width, o = i.height;
+ this._mouse.x = s / a * 2 - 1, this._mouse.y = -(r / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
}
_clampDistance(e) {
return Math.max(this.minDistance, Math.min(this.maxDistance, e));
@@ -28783,7 +28851,7 @@ class Oh extends xp {
_handleMouseMoveRotate(e) {
this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
const t = this.domElement;
- this._rotateLeft(Wt * this._rotateDelta.x / t.clientHeight), this._rotateUp(Wt * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
+ this._rotateLeft(jt * this._rotateDelta.x / t.clientHeight), this._rotateUp(jt * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
}
_handleMouseMoveDolly(e) {
this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
@@ -28798,16 +28866,16 @@ class Oh extends xp {
let t = !1;
switch (e.code) {
case this.keys.UP:
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(Wt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(jt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
break;
case this.keys.BOTTOM:
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-Wt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-jt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
break;
case this.keys.LEFT:
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(Wt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(jt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
break;
case this.keys.RIGHT:
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-Wt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-jt * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
break;
}
t && (e.preventDefault(), this.update());
@@ -28829,8 +28897,8 @@ class Oh extends xp {
}
}
_handleTouchStartDolly(e) {
- const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, s = e.pageY - t.y, n = Math.sqrt(i * i + s * s);
- this._dollyStart.set(0, n);
+ const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, s = e.pageY - t.y, r = Math.sqrt(i * i + s * s);
+ this._dollyStart.set(0, r);
}
_handleTouchStartDollyPan(e) {
this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
@@ -28842,12 +28910,12 @@ class Oh extends xp {
if (this._pointers.length == 1)
this._rotateEnd.set(e.pageX, e.pageY);
else {
- const i = this._getSecondPointerPosition(e), s = 0.5 * (e.pageX + i.x), n = 0.5 * (e.pageY + i.y);
- this._rotateEnd.set(s, n);
+ const i = this._getSecondPointerPosition(e), s = 0.5 * (e.pageX + i.x), r = 0.5 * (e.pageY + i.y);
+ this._rotateEnd.set(s, r);
}
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
const t = this.domElement;
- this._rotateLeft(Wt * this._rotateDelta.x / t.clientHeight), this._rotateUp(Wt * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
+ this._rotateLeft(jt * this._rotateDelta.x / t.clientHeight), this._rotateUp(jt * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
}
_handleTouchMovePan(e) {
if (this._pointers.length === 1)
@@ -28859,8 +28927,8 @@ class Oh extends xp {
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
}
_handleTouchMoveDolly(e) {
- const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, s = e.pageY - t.y, n = Math.sqrt(i * i + s * s);
- this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
+ const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, s = e.pageY - t.y, r = Math.sqrt(i * i + s * s);
+ this._dollyEnd.set(0, r), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
const a = (e.pageX + t.x) * 0.5, o = (e.pageY + t.y) * 0.5;
this._updateZoomParameters(a, o);
}
@@ -28913,16 +28981,16 @@ class Oh extends xp {
return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
}
}
-function Rv(r) {
- this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(r.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(r) && (this._addPointer(r), r.pointerType === "touch" ? this._onTouchStart(r) : this._onMouseDown(r)));
+function Rv(n) {
+ this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(n.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(n) && (this._addPointer(n), n.pointerType === "touch" ? this._onTouchStart(n) : this._onMouseDown(n)));
}
-function Pv(r) {
- this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
+function Pv(n) {
+ this.enabled !== !1 && (n.pointerType === "touch" ? this._onTouchMove(n) : this._onMouseMove(n));
}
-function Lv(r) {
- switch (this._removePointer(r), this._pointers.length) {
+function Lv(n) {
+ switch (this._removePointer(n), this._pointers.length) {
case 0:
- this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Nh), this.state = nt.NONE;
+ this.domElement.releasePointerCapture(n.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Nh), this.state = at.NONE;
break;
case 1:
const e = this._pointers[0], t = this._pointerPositions[e];
@@ -28930,9 +28998,9 @@ function Lv(r) {
break;
}
}
-function Dv(r) {
+function Dv(n) {
let e;
- switch (r.button) {
+ switch (n.button) {
case 0:
e = this.mouseButtons.LEFT;
break;
@@ -28946,128 +29014,128 @@ function Dv(r) {
e = -1;
}
switch (e) {
- case ks.DOLLY:
+ case Fs.DOLLY:
if (this.enableZoom === !1) return;
- this._handleMouseDownDolly(r), this.state = nt.DOLLY;
+ this._handleMouseDownDolly(n), this.state = at.DOLLY;
break;
- case ks.ROTATE:
- if (r.ctrlKey || r.metaKey || r.shiftKey) {
+ case Fs.ROTATE:
+ if (n.ctrlKey || n.metaKey || n.shiftKey) {
if (this.enablePan === !1) return;
- this._handleMouseDownPan(r), this.state = nt.PAN;
+ this._handleMouseDownPan(n), this.state = at.PAN;
} else {
if (this.enableRotate === !1) return;
- this._handleMouseDownRotate(r), this.state = nt.ROTATE;
+ this._handleMouseDownRotate(n), this.state = at.ROTATE;
}
break;
- case ks.PAN:
- if (r.ctrlKey || r.metaKey || r.shiftKey) {
+ case Fs.PAN:
+ if (n.ctrlKey || n.metaKey || n.shiftKey) {
if (this.enableRotate === !1) return;
- this._handleMouseDownRotate(r), this.state = nt.ROTATE;
+ this._handleMouseDownRotate(n), this.state = at.ROTATE;
} else {
if (this.enablePan === !1) return;
- this._handleMouseDownPan(r), this.state = nt.PAN;
+ this._handleMouseDownPan(n), this.state = at.PAN;
}
break;
default:
- this.state = nt.NONE;
+ this.state = at.NONE;
}
- this.state !== nt.NONE && this.dispatchEvent(tl);
+ this.state !== at.NONE && this.dispatchEvent(tl);
}
-function Iv(r) {
+function Iv(n) {
switch (this.state) {
- case nt.ROTATE:
+ case at.ROTATE:
if (this.enableRotate === !1) return;
- this._handleMouseMoveRotate(r);
+ this._handleMouseMoveRotate(n);
break;
- case nt.DOLLY:
+ case at.DOLLY:
if (this.enableZoom === !1) return;
- this._handleMouseMoveDolly(r);
+ this._handleMouseMoveDolly(n);
break;
- case nt.PAN:
+ case at.PAN:
if (this.enablePan === !1) return;
- this._handleMouseMovePan(r);
+ this._handleMouseMovePan(n);
break;
}
}
-function Uv(r) {
- this.enabled === !1 || this.enableZoom === !1 || this.state !== nt.NONE || (r.preventDefault(), this.dispatchEvent(tl), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(Nh));
+function Uv(n) {
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== at.NONE || (n.preventDefault(), this.dispatchEvent(tl), this._handleMouseWheel(this._customWheelEvent(n)), this.dispatchEvent(Nh));
}
-function Nv(r) {
- this.enabled !== !1 && this._handleKeyDown(r);
+function Nv(n) {
+ this.enabled !== !1 && this._handleKeyDown(n);
}
-function Ov(r) {
- switch (this._trackPointer(r), this._pointers.length) {
+function Bv(n) {
+ switch (this._trackPointer(n), this._pointers.length) {
case 1:
switch (this.touches.ONE) {
- case Bs.ROTATE:
+ case Os.ROTATE:
if (this.enableRotate === !1) return;
- this._handleTouchStartRotate(r), this.state = nt.TOUCH_ROTATE;
+ this._handleTouchStartRotate(n), this.state = at.TOUCH_ROTATE;
break;
- case Bs.PAN:
+ case Os.PAN:
if (this.enablePan === !1) return;
- this._handleTouchStartPan(r), this.state = nt.TOUCH_PAN;
+ this._handleTouchStartPan(n), this.state = at.TOUCH_PAN;
break;
default:
- this.state = nt.NONE;
+ this.state = at.NONE;
}
break;
case 2:
switch (this.touches.TWO) {
- case Bs.DOLLY_PAN:
+ case Os.DOLLY_PAN:
if (this.enableZoom === !1 && this.enablePan === !1) return;
- this._handleTouchStartDollyPan(r), this.state = nt.TOUCH_DOLLY_PAN;
+ this._handleTouchStartDollyPan(n), this.state = at.TOUCH_DOLLY_PAN;
break;
- case Bs.DOLLY_ROTATE:
+ case Os.DOLLY_ROTATE:
if (this.enableZoom === !1 && this.enableRotate === !1) return;
- this._handleTouchStartDollyRotate(r), this.state = nt.TOUCH_DOLLY_ROTATE;
+ this._handleTouchStartDollyRotate(n), this.state = at.TOUCH_DOLLY_ROTATE;
break;
default:
- this.state = nt.NONE;
+ this.state = at.NONE;
}
break;
default:
- this.state = nt.NONE;
+ this.state = at.NONE;
}
- this.state !== nt.NONE && this.dispatchEvent(tl);
+ this.state !== at.NONE && this.dispatchEvent(tl);
}
-function Bv(r) {
- switch (this._trackPointer(r), this.state) {
- case nt.TOUCH_ROTATE:
+function Ov(n) {
+ switch (this._trackPointer(n), this.state) {
+ case at.TOUCH_ROTATE:
if (this.enableRotate === !1) return;
- this._handleTouchMoveRotate(r), this.update();
+ this._handleTouchMoveRotate(n), this.update();
break;
- case nt.TOUCH_PAN:
+ case at.TOUCH_PAN:
if (this.enablePan === !1) return;
- this._handleTouchMovePan(r), this.update();
+ this._handleTouchMovePan(n), this.update();
break;
- case nt.TOUCH_DOLLY_PAN:
+ case at.TOUCH_DOLLY_PAN:
if (this.enableZoom === !1 && this.enablePan === !1) return;
- this._handleTouchMoveDollyPan(r), this.update();
+ this._handleTouchMoveDollyPan(n), this.update();
break;
- case nt.TOUCH_DOLLY_ROTATE:
+ case at.TOUCH_DOLLY_ROTATE:
if (this.enableZoom === !1 && this.enableRotate === !1) return;
- this._handleTouchMoveDollyRotate(r), this.update();
+ this._handleTouchMoveDollyRotate(n), this.update();
break;
default:
- this.state = nt.NONE;
+ this.state = at.NONE;
}
}
-function Fv(r) {
- this.enabled !== !1 && r.preventDefault();
+function kv(n) {
+ this.enabled !== !1 && n.preventDefault();
}
-function kv(r) {
- r.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
+function Fv(n) {
+ n.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
}
-function zv(r) {
- r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
+function zv(n) {
+ n.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
}
-var Vs = /* @__PURE__ */ ((r) => (r.Top = "top", r.Bottom = "bottom", r.Left = "left", r.Right = "right", r.Front = "front", r.Back = "back", r.Iso = "iso", r))(Vs || {}), Fs = /* @__PURE__ */ ((r) => (r.Perspective = "perspective", r.Orthographic = "orthographic", r))(Fs || {}), Dn = /* @__PURE__ */ ((r) => (r.Orbit = "orbit", r.FirstPerson = "walk", r.PanOnly = "pan_only", r))(Dn || {});
+var Vs = /* @__PURE__ */ ((n) => (n.Top = "top", n.Bottom = "bottom", n.Left = "left", n.Right = "right", n.Front = "front", n.Back = "back", n.Iso = "iso", n))(Vs || {}), ks = /* @__PURE__ */ ((n) => (n.Perspective = "perspective", n.Orthographic = "orthographic", n))(ks || {}), Dr = /* @__PURE__ */ ((n) => (n.Orbit = "orbit", n.FirstPerson = "walk", n.PanOnly = "pan_only", n))(Dr || {});
class Hv {
camera;
controls;
engineState;
constructor(e, t, i, s) {
- this.engineState = s, this.camera = new Tt(45, t / i, 0.1, 1e4), this.camera.position.set(20, 20, 20), this.controls = new Oh(this.camera, e, this.engineState), this.controls.enableDamping = !0, this.controls.dampingFactor = 0.05;
+ this.engineState = s, this.camera = new Tt(45, t / i, 0.1, 1e4), this.camera.position.set(20, 20, 20), this.controls = new Bh(this.camera, e, this.engineState), this.controls.enableDamping = !0, this.controls.dampingFactor = 0.05;
}
updateAspect(e, t) {
this.camera.aspect = e / t, this.camera.updateProjectionMatrix();
@@ -29094,19 +29162,19 @@ class Hv {
this.camera.lookAt(0, 0, 0), this.controls.update();
}
}
-function Ic(r, e) {
+function Ic(n, e) {
if (e === wu)
- return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
+ return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), n;
if (e === fo || e === oh) {
- let t = r.getIndex();
+ let t = n.getIndex();
if (t === null) {
- const a = [], o = r.getAttribute("position");
+ const a = [], o = n.getAttribute("position");
if (o !== void 0) {
for (let l = 0; l < o.count; l++)
a.push(l);
- r.setIndex(a), t = r.getIndex();
+ n.setIndex(a), t = n.getIndex();
} else
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n;
}
const i = t.count - 2, s = [];
if (e === fo)
@@ -29116,12 +29184,12 @@ function Ic(r, e) {
for (let a = 0; a < i; a++)
a % 2 === 0 ? (s.push(t.getX(a)), s.push(t.getX(a + 1)), s.push(t.getX(a + 2))) : (s.push(t.getX(a + 2)), s.push(t.getX(a + 1)), s.push(t.getX(a)));
s.length / 3 !== i && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
- const n = r.clone();
- return n.setIndex(s), n.clearGroups(), n;
+ const r = n.clone();
+ return r.setIndex(s), r.clearGroups(), r;
} else
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), n;
}
-class Bh extends rs {
+class Oh extends ns {
/**
* Constructs a new glTF loader.
*
@@ -29137,7 +29205,7 @@ class Bh extends rs {
}), this.register(function(t) {
return new s1(t);
}), this.register(function(t) {
- return new r1(t);
+ return new n1(t);
}), this.register(function(t) {
return new Kv(t);
}), this.register(function(t) {
@@ -29159,7 +29227,7 @@ class Bh extends rs {
}), this.register(function(t) {
return new Gv(t);
}), this.register(function(t) {
- return new n1(t);
+ return new r1(t);
}), this.register(function(t) {
return new a1(t);
});
@@ -29174,23 +29242,23 @@ class Bh extends rs {
* @param {onErrorCallback} onError - Executed when errors occur.
*/
load(e, t, i, s) {
- const n = this;
+ const r = this;
let a;
if (this.resourcePath !== "")
a = this.resourcePath;
else if (this.path !== "") {
- const c = Tr.extractUrlBase(e);
- a = Tr.resolveURL(c, this.path);
+ const c = En.extractUrlBase(e);
+ a = En.resolveURL(c, this.path);
} else
- a = Tr.extractUrlBase(e);
+ a = En.extractUrlBase(e);
this.manager.itemStart(e);
const o = function(c) {
- s ? s(c) : console.error(c), n.manager.itemError(e), n.manager.itemEnd(e);
+ s ? s(c) : console.error(c), r.manager.itemError(e), r.manager.itemEnd(e);
}, l = new $o(this.manager);
l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(c) {
try {
- n.parse(c, a, function(h) {
- t(h), n.manager.itemEnd(e);
+ r.parse(c, a, function(h) {
+ t(h), r.manager.itemEnd(e);
}, o);
} catch (h) {
o(h);
@@ -29256,28 +29324,28 @@ class Bh extends rs {
* @param {onErrorCallback} onError - Executed when errors occur.
*/
parse(e, t, i, s) {
- let n;
+ let r;
const a = {}, o = {}, l = new TextDecoder();
if (typeof e == "string")
- n = JSON.parse(e);
+ r = JSON.parse(e);
else if (e instanceof ArrayBuffer)
- if (l.decode(new Uint8Array(e, 0, 4)) === Fh) {
+ if (l.decode(new Uint8Array(e, 0, 4)) === kh) {
try {
a[We.KHR_BINARY_GLTF] = new o1(e);
} catch (h) {
s && s(h);
return;
}
- n = JSON.parse(a[We.KHR_BINARY_GLTF].content);
+ r = JSON.parse(a[We.KHR_BINARY_GLTF].content);
} else
- n = JSON.parse(l.decode(e));
+ r = JSON.parse(l.decode(e));
else
- n = e;
- if (n.asset === void 0 || n.asset.version[0] < 2) {
+ r = e;
+ if (r.asset === void 0 || r.asset.version[0] < 2) {
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
return;
}
- const c = new y1(n, {
+ const c = new b1(r, {
path: t || this.resourcePath || "",
crossOrigin: this.crossOrigin,
requestHeader: this.requestHeader,
@@ -29290,15 +29358,15 @@ class Bh extends rs {
const u = this.pluginCallbacks[h](c);
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), o[u.name] = u, a[u.name] = !0;
}
- if (n.extensionsUsed)
- for (let h = 0; h < n.extensionsUsed.length; ++h) {
- const u = n.extensionsUsed[h], d = n.extensionsRequired || [];
+ if (r.extensionsUsed)
+ for (let h = 0; h < r.extensionsUsed.length; ++h) {
+ const u = r.extensionsUsed[h], d = r.extensionsRequired || [];
switch (u) {
case We.KHR_MATERIALS_UNLIT:
a[u] = new Wv();
break;
case We.KHR_DRACO_MESH_COMPRESSION:
- a[u] = new l1(n, this.dracoLoader);
+ a[u] = new l1(r, this.dracoLoader);
break;
case We.KHR_TEXTURE_TRANSFORM:
a[u] = new c1();
@@ -29322,25 +29390,25 @@ class Bh extends rs {
*/
parseAsync(e, t) {
const i = this;
- return new Promise(function(s, n) {
- i.parse(e, t, s, n);
+ return new Promise(function(s, r) {
+ i.parse(e, t, s, r);
});
}
}
function Vv() {
- let r = {};
+ let n = {};
return {
get: function(e) {
- return r[e];
+ return n[e];
},
add: function(e, t) {
- r[e] = t;
+ n[e] = t;
},
remove: function(e) {
- delete r[e];
+ delete n[e];
},
removeAll: function() {
- r = {};
+ n = {};
}
};
}
@@ -29375,25 +29443,25 @@ class Gv {
_markDefs() {
const e = this.parser, t = this.parser.json.nodes || [];
for (let i = 0, s = t.length; i < s; i++) {
- const n = t[i];
- n.extensions && n.extensions[this.name] && n.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, n.extensions[this.name].light);
+ const r = t[i];
+ r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
}
}
_loadLight(e) {
const t = this.parser, i = "light:" + e;
let s = t.cache.get(i);
if (s) return s;
- const n = t.json, a = ((n.extensions && n.extensions[this.name] || {}).lights || [])[e];
+ const r = t.json, a = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
let o;
const l = new xe(16777215);
- a.color !== void 0 && l.setRGB(a.color[0], a.color[1], a.color[2], Bt);
+ a.color !== void 0 && l.setRGB(a.color[0], a.color[1], a.color[2], kt);
const c = a.range !== void 0 ? a.range : 0;
switch (a.type) {
case "directional":
o = new Ch(l), o.target.position.set(0, 0, -1), o.add(o.target);
break;
case "point":
- o = new np(l), o.distance = c;
+ o = new rp(l), o.distance = c;
break;
case "spot":
o = new sp(l), o.distance = c, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, o.angle = a.spot.outerConeAngle, o.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, o.target.position.set(0, 0, -1), o.add(o.target);
@@ -29408,9 +29476,9 @@ class Gv {
return this._loadLight(t);
}
createNodeAttachment(e) {
- const t = this, i = this.parser, s = i.json.nodes[e], n = (s.extensions && s.extensions[this.name] || {}).light;
- return n === void 0 ? null : this._loadLight(n).then(function(a) {
- return i._getNodeRef(t.cache, n, a);
+ const t = this, i = this.parser, s = i.json.nodes[e], r = (s.extensions && s.extensions[this.name] || {}).light;
+ return r === void 0 ? null : this._loadLight(r).then(function(a) {
+ return i._getNodeRef(t.cache, r, a);
});
}
}
@@ -29419,18 +29487,18 @@ class Wv {
this.name = We.KHR_MATERIALS_UNLIT;
}
getMaterialType() {
- return zt;
+ return Ht;
}
extendParams(e, t, i) {
const s = [];
e.color = new xe(1, 1, 1), e.opacity = 1;
- const n = t.pbrMetallicRoughness;
- if (n) {
- if (Array.isArray(n.baseColorFactor)) {
- const a = n.baseColorFactor;
- e.color.setRGB(a[0], a[1], a[2], Bt), e.opacity = a[3];
+ const r = t.pbrMetallicRoughness;
+ if (r) {
+ if (Array.isArray(r.baseColorFactor)) {
+ const a = r.baseColorFactor;
+ e.color.setRGB(a[0], a[1], a[2], kt), e.opacity = a[3];
}
- n.baseColorTexture !== void 0 && s.push(i.assignTexture(e, "map", n.baseColorTexture, Rt));
+ r.baseColorTexture !== void 0 && s.push(i.assignTexture(e, "map", r.baseColorTexture, Rt));
}
return Promise.all(s);
}
@@ -29459,12 +29527,12 @@ class Xv {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- if (a.clearcoatFactor !== void 0 && (t.clearcoat = a.clearcoatFactor), a.clearcoatTexture !== void 0 && n.push(i.assignTexture(t, "clearcoatMap", a.clearcoatTexture)), a.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = a.clearcoatRoughnessFactor), a.clearcoatRoughnessTexture !== void 0 && n.push(i.assignTexture(t, "clearcoatRoughnessMap", a.clearcoatRoughnessTexture)), a.clearcoatNormalTexture !== void 0 && (n.push(i.assignTexture(t, "clearcoatNormalMap", a.clearcoatNormalTexture)), a.clearcoatNormalTexture.scale !== void 0)) {
+ const r = [], a = s.extensions[this.name];
+ if (a.clearcoatFactor !== void 0 && (t.clearcoat = a.clearcoatFactor), a.clearcoatTexture !== void 0 && r.push(i.assignTexture(t, "clearcoatMap", a.clearcoatTexture)), a.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = a.clearcoatRoughnessFactor), a.clearcoatRoughnessTexture !== void 0 && r.push(i.assignTexture(t, "clearcoatRoughnessMap", a.clearcoatRoughnessTexture)), a.clearcoatNormalTexture !== void 0 && (r.push(i.assignTexture(t, "clearcoatNormalMap", a.clearcoatNormalTexture)), a.clearcoatNormalTexture.scale !== void 0)) {
const o = a.clearcoatNormalTexture.scale;
t.clearcoatNormalScale = new oe(o, o);
}
- return Promise.all(n);
+ return Promise.all(r);
}
}
class qv {
@@ -29495,8 +29563,8 @@ class Yv {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- return a.iridescenceFactor !== void 0 && (t.iridescence = a.iridescenceFactor), a.iridescenceTexture !== void 0 && n.push(i.assignTexture(t, "iridescenceMap", a.iridescenceTexture)), a.iridescenceIor !== void 0 && (t.iridescenceIOR = a.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), a.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum), a.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum), a.iridescenceThicknessTexture !== void 0 && n.push(i.assignTexture(t, "iridescenceThicknessMap", a.iridescenceThicknessTexture)), Promise.all(n);
+ const r = [], a = s.extensions[this.name];
+ return a.iridescenceFactor !== void 0 && (t.iridescence = a.iridescenceFactor), a.iridescenceTexture !== void 0 && r.push(i.assignTexture(t, "iridescenceMap", a.iridescenceTexture)), a.iridescenceIor !== void 0 && (t.iridescenceIOR = a.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), a.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum), a.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum), a.iridescenceThicknessTexture !== void 0 && r.push(i.assignTexture(t, "iridescenceThicknessMap", a.iridescenceThicknessTexture)), Promise.all(r);
}
}
class Kv {
@@ -29511,14 +29579,14 @@ class Kv {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [];
+ const r = [];
t.sheenColor = new xe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
const a = s.extensions[this.name];
if (a.sheenColorFactor !== void 0) {
const o = a.sheenColorFactor;
- t.sheenColor.setRGB(o[0], o[1], o[2], Bt);
+ t.sheenColor.setRGB(o[0], o[1], o[2], kt);
}
- return a.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = a.sheenRoughnessFactor), a.sheenColorTexture !== void 0 && n.push(i.assignTexture(t, "sheenColorMap", a.sheenColorTexture, Rt)), a.sheenRoughnessTexture !== void 0 && n.push(i.assignTexture(t, "sheenRoughnessMap", a.sheenRoughnessTexture)), Promise.all(n);
+ return a.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = a.sheenRoughnessFactor), a.sheenColorTexture !== void 0 && r.push(i.assignTexture(t, "sheenColorMap", a.sheenColorTexture, Rt)), a.sheenRoughnessTexture !== void 0 && r.push(i.assignTexture(t, "sheenRoughnessMap", a.sheenRoughnessTexture)), Promise.all(r);
}
}
class Zv {
@@ -29533,8 +29601,8 @@ class Zv {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- return a.transmissionFactor !== void 0 && (t.transmission = a.transmissionFactor), a.transmissionTexture !== void 0 && n.push(i.assignTexture(t, "transmissionMap", a.transmissionTexture)), Promise.all(n);
+ const r = [], a = s.extensions[this.name];
+ return a.transmissionFactor !== void 0 && (t.transmission = a.transmissionFactor), a.transmissionTexture !== void 0 && r.push(i.assignTexture(t, "transmissionMap", a.transmissionTexture)), Promise.all(r);
}
}
class $v {
@@ -29549,10 +29617,10 @@ class $v {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- t.thickness = a.thicknessFactor !== void 0 ? a.thicknessFactor : 0, a.thicknessTexture !== void 0 && n.push(i.assignTexture(t, "thicknessMap", a.thicknessTexture)), t.attenuationDistance = a.attenuationDistance || 1 / 0;
+ const r = [], a = s.extensions[this.name];
+ t.thickness = a.thicknessFactor !== void 0 ? a.thicknessFactor : 0, a.thicknessTexture !== void 0 && r.push(i.assignTexture(t, "thicknessMap", a.thicknessTexture)), t.attenuationDistance = a.attenuationDistance || 1 / 0;
const o = a.attenuationColor || [1, 1, 1];
- return t.attenuationColor = new xe().setRGB(o[0], o[1], o[2], Bt), Promise.all(n);
+ return t.attenuationColor = new xe().setRGB(o[0], o[1], o[2], kt), Promise.all(r);
}
}
class Jv {
@@ -29583,10 +29651,10 @@ class Qv {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- t.specularIntensity = a.specularFactor !== void 0 ? a.specularFactor : 1, a.specularTexture !== void 0 && n.push(i.assignTexture(t, "specularIntensityMap", a.specularTexture));
+ const r = [], a = s.extensions[this.name];
+ t.specularIntensity = a.specularFactor !== void 0 ? a.specularFactor : 1, a.specularTexture !== void 0 && r.push(i.assignTexture(t, "specularIntensityMap", a.specularTexture));
const o = a.specularColorFactor || [1, 1, 1];
- return t.specularColor = new xe().setRGB(o[0], o[1], o[2], Bt), a.specularColorTexture !== void 0 && n.push(i.assignTexture(t, "specularColorMap", a.specularColorTexture, Rt)), Promise.all(n);
+ return t.specularColor = new xe().setRGB(o[0], o[1], o[2], kt), a.specularColorTexture !== void 0 && r.push(i.assignTexture(t, "specularColorMap", a.specularColorTexture, Rt)), Promise.all(r);
}
}
class e1 {
@@ -29601,8 +29669,8 @@ class e1 {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- return t.bumpScale = a.bumpFactor !== void 0 ? a.bumpFactor : 1, a.bumpTexture !== void 0 && n.push(i.assignTexture(t, "bumpMap", a.bumpTexture)), Promise.all(n);
+ const r = [], a = s.extensions[this.name];
+ return t.bumpScale = a.bumpFactor !== void 0 ? a.bumpFactor : 1, a.bumpTexture !== void 0 && r.push(i.assignTexture(t, "bumpMap", a.bumpTexture)), Promise.all(r);
}
}
class t1 {
@@ -29617,8 +29685,8 @@ class t1 {
const i = this.parser, s = i.json.materials[e];
if (!s.extensions || !s.extensions[this.name])
return Promise.resolve();
- const n = [], a = s.extensions[this.name];
- return a.anisotropyStrength !== void 0 && (t.anisotropy = a.anisotropyStrength), a.anisotropyRotation !== void 0 && (t.anisotropyRotation = a.anisotropyRotation), a.anisotropyTexture !== void 0 && n.push(i.assignTexture(t, "anisotropyMap", a.anisotropyTexture)), Promise.all(n);
+ const r = [], a = s.extensions[this.name];
+ return a.anisotropyStrength !== void 0 && (t.anisotropy = a.anisotropyStrength), a.anisotropyRotation !== void 0 && (t.anisotropyRotation = a.anisotropyRotation), a.anisotropyTexture !== void 0 && r.push(i.assignTexture(t, "anisotropyMap", a.anisotropyTexture)), Promise.all(r);
}
}
class i1 {
@@ -29629,13 +29697,13 @@ class i1 {
const t = this.parser, i = t.json, s = i.textures[e];
if (!s.extensions || !s.extensions[this.name])
return null;
- const n = s.extensions[this.name], a = t.options.ktx2Loader;
+ const r = s.extensions[this.name], a = t.options.ktx2Loader;
if (!a) {
if (i.extensionsRequired && i.extensionsRequired.indexOf(this.name) >= 0)
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
return null;
}
- return t.loadTextureImage(e, n.source, a);
+ return t.loadTextureImage(e, r.source, a);
}
}
class s1 {
@@ -29643,27 +29711,10 @@ class s1 {
this.parser = e, this.name = We.EXT_TEXTURE_WEBP;
}
loadTexture(e) {
- const t = this.name, i = this.parser, s = i.json, n = s.textures[e];
- if (!n.extensions || !n.extensions[t])
+ const t = this.name, i = this.parser, s = i.json, r = s.textures[e];
+ if (!r.extensions || !r.extensions[t])
return null;
- const a = n.extensions[t], o = s.images[a.source];
- let l = i.textureLoader;
- if (o.uri) {
- const c = i.options.manager.getHandler(o.uri);
- c !== null && (l = c);
- }
- return i.loadTextureImage(e, a.source, l);
- }
-}
-class r1 {
- constructor(e) {
- this.parser = e, this.name = We.EXT_TEXTURE_AVIF;
- }
- loadTexture(e) {
- const t = this.name, i = this.parser, s = i.json, n = s.textures[e];
- if (!n.extensions || !n.extensions[t])
- return null;
- const a = n.extensions[t], o = s.images[a.source];
+ const a = r.extensions[t], o = s.images[a.source];
let l = i.textureLoader;
if (o.uri) {
const c = i.options.manager.getHandler(o.uri);
@@ -29673,19 +29724,36 @@ class r1 {
}
}
class n1 {
+ constructor(e) {
+ this.parser = e, this.name = We.EXT_TEXTURE_AVIF;
+ }
+ loadTexture(e) {
+ const t = this.name, i = this.parser, s = i.json, r = s.textures[e];
+ if (!r.extensions || !r.extensions[t])
+ return null;
+ const a = r.extensions[t], o = s.images[a.source];
+ let l = i.textureLoader;
+ if (o.uri) {
+ const c = i.options.manager.getHandler(o.uri);
+ c !== null && (l = c);
+ }
+ return i.loadTextureImage(e, a.source, l);
+ }
+}
+class r1 {
constructor(e) {
this.name = We.EXT_MESHOPT_COMPRESSION, this.parser = e;
}
loadBufferView(e) {
const t = this.parser.json, i = t.bufferViews[e];
if (i.extensions && i.extensions[this.name]) {
- const s = i.extensions[this.name], n = this.parser.getDependency("buffer", s.buffer), a = this.parser.options.meshoptDecoder;
+ const s = i.extensions[this.name], r = this.parser.getDependency("buffer", s.buffer), a = this.parser.options.meshoptDecoder;
if (!a || !a.supported) {
if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
return null;
}
- return n.then(function(o) {
+ return r.then(function(o) {
const l = s.byteOffset || 0, c = s.byteLength || 0, h = s.count, u = s.byteStride, d = new Uint8Array(o, l, c);
return a.decodeGltfBufferAsync ? a.decodeGltfBufferAsync(h, u, d, s.mode, s.filter).then(function(m) {
return m.buffer;
@@ -29708,52 +29776,52 @@ class a1 {
return null;
const s = t.meshes[i.mesh];
for (const l of s.primitives)
- if (l.mode !== ei.TRIANGLES && l.mode !== ei.TRIANGLE_STRIP && l.mode !== ei.TRIANGLE_FAN && l.mode !== void 0)
+ if (l.mode !== ti.TRIANGLES && l.mode !== ti.TRIANGLE_STRIP && l.mode !== ti.TRIANGLE_FAN && l.mode !== void 0)
return null;
- const n = i.extensions[this.name].attributes, a = [], o = {};
- for (const l in n)
- a.push(this.parser.getDependency("accessor", n[l]).then((c) => (o[l] = c, o[l])));
+ const r = i.extensions[this.name].attributes, a = [], o = {};
+ for (const l in r)
+ a.push(this.parser.getDependency("accessor", r[l]).then((c) => (o[l] = c, o[l])));
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((l) => {
const c = l.pop(), h = c.isGroup ? c.children : [c], u = l[0].count, d = [];
for (const m of h) {
- const g = new Ne(), v = new w(), f = new _i(), p = new w(1, 1, 1), y = new Dd(m.geometry, m.material, u);
+ const g = new Ne(), v = new w(), f = new xi(), p = new w(1, 1, 1), b = new Dd(m.geometry, m.material, u);
for (let _ = 0; _ < u; _++)
- o.TRANSLATION && v.fromBufferAttribute(o.TRANSLATION, _), o.ROTATION && f.fromBufferAttribute(o.ROTATION, _), o.SCALE && p.fromBufferAttribute(o.SCALE, _), y.setMatrixAt(_, g.compose(v, f, p));
+ o.TRANSLATION && v.fromBufferAttribute(o.TRANSLATION, _), o.ROTATION && f.fromBufferAttribute(o.ROTATION, _), o.SCALE && p.fromBufferAttribute(o.SCALE, _), b.setMatrixAt(_, g.compose(v, f, p));
for (const _ in o)
if (_ === "_COLOR_0") {
const E = o[_];
- y.instanceColor = new _o(E.array, E.itemSize, E.normalized);
+ b.instanceColor = new _o(E.array, E.itemSize, E.normalized);
} else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && m.geometry.setAttribute(_, o[_]);
- mt.prototype.copy.call(y, m), this.parser.assignFinalMaterial(y), d.push(y);
+ mt.prototype.copy.call(b, m), this.parser.assignFinalMaterial(b), d.push(b);
}
return c.isGroup ? (c.clear(), c.add(...d), c) : d[0];
}));
}
}
-const Fh = "glTF", vr = 12, Uc = { JSON: 1313821514, BIN: 5130562 };
+const kh = "glTF", _n = 12, Uc = { JSON: 1313821514, BIN: 5130562 };
class o1 {
constructor(e) {
this.name = We.KHR_BINARY_GLTF, this.content = null, this.body = null;
- const t = new DataView(e, 0, vr), i = new TextDecoder();
+ const t = new DataView(e, 0, _n), i = new TextDecoder();
if (this.header = {
magic: i.decode(new Uint8Array(e.slice(0, 4))),
version: t.getUint32(4, !0),
length: t.getUint32(8, !0)
- }, this.header.magic !== Fh)
+ }, this.header.magic !== kh)
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
if (this.header.version < 2)
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
- const s = this.header.length - vr, n = new DataView(e, vr);
+ const s = this.header.length - _n, r = new DataView(e, _n);
let a = 0;
for (; a < s; ) {
- const o = n.getUint32(a, !0);
+ const o = r.getUint32(a, !0);
a += 4;
- const l = n.getUint32(a, !0);
+ const l = r.getUint32(a, !0);
if (a += 4, l === Uc.JSON) {
- const c = new Uint8Array(e, vr + a, o);
+ const c = new Uint8Array(e, _n + a, o);
this.content = i.decode(c);
} else if (l === Uc.BIN) {
- const c = vr + a;
+ const c = _n + a;
this.body = e.slice(c, c + o);
}
a += o;
@@ -29769,7 +29837,7 @@ class l1 {
this.name = We.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
}
decodePrimitive(e, t) {
- const i = this.json, s = this.dracoLoader, n = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, l = {}, c = {};
+ const i = this.json, s = this.dracoLoader, r = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, l = {}, c = {};
for (const h in a) {
const u = To[h] || h.toLowerCase();
o[u] = a[h];
@@ -29781,7 +29849,7 @@ class l1 {
c[u] = m.name, l[u] = d.normalized === !0;
}
}
- return t.getDependency("bufferView", n).then(function(h) {
+ return t.getDependency("bufferView", r).then(function(h) {
return new Promise(function(u, d) {
s.decodeDracoFile(h, function(m) {
for (const g in m.attributes) {
@@ -29789,7 +29857,7 @@ class l1 {
f !== void 0 && (v.normalized = f);
}
u(m);
- }, o, c, Bt, d);
+ }, o, c, kt, d);
});
});
}
@@ -29807,33 +29875,33 @@ class h1 {
this.name = We.KHR_MESH_QUANTIZATION;
}
}
-class kh extends Ir {
+class Fh extends Un {
constructor(e, t, i, s) {
super(e, t, i, s);
}
copySampleValue_(e) {
- const t = this.resultBuffer, i = this.sampleValues, s = this.valueSize, n = e * s * 3 + s;
+ const t = this.resultBuffer, i = this.sampleValues, s = this.valueSize, r = e * s * 3 + s;
for (let a = 0; a !== s; a++)
- t[a] = i[n + a];
+ t[a] = i[r + a];
return t;
}
interpolate_(e, t, i, s) {
- const n = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = o * 2, c = o * 3, h = s - t, u = (i - t) / h, d = u * u, m = d * u, g = e * c, v = g - c, f = -2 * m + 3 * d, p = m - d, y = 1 - f, _ = p - d + u;
+ const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = o * 2, c = o * 3, h = s - t, u = (i - t) / h, d = u * u, m = d * u, g = e * c, v = g - c, f = -2 * m + 3 * d, p = m - d, b = 1 - f, _ = p - d + u;
for (let E = 0; E !== o; E++) {
const R = a[v + E + o], T = a[v + E + l] * h, A = a[g + E + o], I = a[g + E] * h;
- n[E] = y * R + _ * T + f * A + p * I;
+ r[E] = b * R + _ * T + f * A + p * I;
}
- return n;
+ return r;
}
}
-const u1 = new _i();
-class d1 extends kh {
+const u1 = new xi();
+class d1 extends Fh {
interpolate_(e, t, i, s) {
- const n = super.interpolate_(e, t, i, s);
- return u1.fromArray(n).normalize().toArray(n), n;
+ const r = super.interpolate_(e, t, i, s);
+ return u1.fromArray(r).normalize().toArray(r), r;
}
}
-const ei = {
+const ti = {
POINTS: 0,
LINES: 1,
LINE_LOOP: 2,
@@ -29849,15 +29917,15 @@ const ei = {
5125: Uint32Array,
5126: Float32Array
}, Nc = {
- 9728: Ut,
+ 9728: Nt,
9729: Mt,
9984: eh,
- 9985: vn,
- 9986: xr,
+ 9985: vr,
+ 9986: bn,
9987: wi
-}, Oc = {
- 33071: ti,
- 33648: En,
+}, Bc = {
+ 33071: ii,
+ 33648: Er,
10497: Ri
}, Sa = {
SCALAR: 1,
@@ -29887,15 +29955,15 @@ const ei = {
CUBICSPLINE: void 0,
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
// keyframe track will be initialized with a default interpolation type, then modified.
- LINEAR: Rr,
- STEP: Ar
+ LINEAR: Pn,
+ STEP: Rn
}, Ta = {
OPAQUE: "OPAQUE",
MASK: "MASK",
BLEND: "BLEND"
};
-function m1(r) {
- return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new Zo({
+function m1(n) {
+ return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new Zo({
color: 16777215,
emissive: 0,
metalness: 1,
@@ -29903,35 +29971,35 @@ function m1(r) {
transparent: !1,
depthTest: !0,
side: Ai
- })), r.DefaultMaterial;
+ })), n.DefaultMaterial;
}
-function ms(r, e, t) {
+function ms(n, e, t) {
for (const i in t.extensions)
- r[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = t.extensions[i]);
+ n[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = t.extensions[i]);
}
-function Si(r, e) {
- e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
+function Si(n, e) {
+ e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(n.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
}
-function f1(r, e, t) {
- let i = !1, s = !1, n = !1;
+function f1(n, e, t) {
+ let i = !1, s = !1, r = !1;
for (let c = 0, h = e.length; c < h; c++) {
const u = e[c];
- if (u.POSITION !== void 0 && (i = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (n = !0), i && s && n) break;
+ if (u.POSITION !== void 0 && (i = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (r = !0), i && s && r) break;
}
- if (!i && !s && !n) return Promise.resolve(r);
+ if (!i && !s && !r) return Promise.resolve(n);
const a = [], o = [], l = [];
for (let c = 0, h = e.length; c < h; c++) {
const u = e[c];
if (i) {
- const d = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
+ const d = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : n.attributes.position;
a.push(d);
}
if (s) {
- const d = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : r.attributes.normal;
+ const d = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : n.attributes.normal;
o.push(d);
}
- if (n) {
- const d = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : r.attributes.color;
+ if (r) {
+ const d = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : n.attributes.color;
l.push(d);
}
}
@@ -29941,40 +30009,40 @@ function f1(r, e, t) {
Promise.all(l)
]).then(function(c) {
const h = c[0], u = c[1], d = c[2];
- return i && (r.morphAttributes.position = h), s && (r.morphAttributes.normal = u), n && (r.morphAttributes.color = d), r.morphTargetsRelative = !0, r;
+ return i && (n.morphAttributes.position = h), s && (n.morphAttributes.normal = u), r && (n.morphAttributes.color = d), n.morphTargetsRelative = !0, n;
});
}
-function g1(r, e) {
- if (r.updateMorphTargets(), e.weights !== void 0)
+function g1(n, e) {
+ if (n.updateMorphTargets(), e.weights !== void 0)
for (let t = 0, i = e.weights.length; t < i; t++)
- r.morphTargetInfluences[t] = e.weights[t];
+ n.morphTargetInfluences[t] = e.weights[t];
if (e.extras && Array.isArray(e.extras.targetNames)) {
const t = e.extras.targetNames;
- if (r.morphTargetInfluences.length === t.length) {
- r.morphTargetDictionary = {};
+ if (n.morphTargetInfluences.length === t.length) {
+ n.morphTargetDictionary = {};
for (let i = 0, s = t.length; i < s; i++)
- r.morphTargetDictionary[t[i]] = i;
+ n.morphTargetDictionary[t[i]] = i;
} else
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
}
}
-function v1(r) {
+function v1(n) {
let e;
- const t = r.extensions && r.extensions[We.KHR_DRACO_MESH_COMPRESSION];
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Ea(t.attributes) : e = r.indices + ":" + Ea(r.attributes) + ":" + r.mode, r.targets !== void 0)
- for (let i = 0, s = r.targets.length; i < s; i++)
- e += ":" + Ea(r.targets[i]);
+ const t = n.extensions && n.extensions[We.KHR_DRACO_MESH_COMPRESSION];
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Ea(t.attributes) : e = n.indices + ":" + Ea(n.attributes) + ":" + n.mode, n.targets !== void 0)
+ for (let i = 0, s = n.targets.length; i < s; i++)
+ e += ":" + Ea(n.targets[i]);
return e;
}
-function Ea(r) {
+function Ea(n) {
let e = "";
- const t = Object.keys(r).sort();
+ const t = Object.keys(n).sort();
for (let i = 0, s = t.length; i < s; i++)
- e += t[i] + ":" + r[t[i]] + ";";
+ e += t[i] + ":" + n[t[i]] + ";";
return e;
}
-function Eo(r) {
- switch (r) {
+function Eo(n) {
+ switch (n) {
case Int8Array:
return 1 / 127;
case Uint8Array:
@@ -29987,21 +30055,21 @@ function Eo(r) {
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
}
}
-function _1(r) {
- return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
+function _1(n) {
+ return n.search(/\.jpe?g($|\?)/i) > 0 || n.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : n.search(/\.webp($|\?)/i) > 0 || n.search(/^data\:image\/webp/) === 0 ? "image/webp" : n.search(/\.ktx2($|\?)/i) > 0 || n.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
}
const x1 = new Ne();
-class y1 {
+class b1 {
constructor(e = {}, t = {}) {
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Vv(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
- let i = !1, s = -1, n = !1, a = -1;
+ let i = !1, s = -1, r = !1, a = -1;
if (typeof navigator < "u") {
const o = navigator.userAgent;
i = /^((?!chrome|android).)*safari/i.test(o) === !0;
const l = o.match(/Version\/(\d+)/);
- s = i && l ? parseInt(l[1], 10) : -1, n = o.indexOf("Firefox") > -1, a = n ? o.match(/Firefox\/([0-9]+)\./)[1] : -1;
+ s = i && l ? parseInt(l[1], 10) : -1, r = o.indexOf("Firefox") > -1, a = r ? o.match(/Firefox\/([0-9]+)\./)[1] : -1;
}
- typeof createImageBitmap > "u" || i && s < 17 || n && a < 98 ? this.textureLoader = new wh(this.options.manager) : this.textureLoader = new op(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new $o(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
+ typeof createImageBitmap > "u" || i && s < 17 || r && a < 98 ? this.textureLoader = new wh(this.options.manager) : this.textureLoader = new op(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new $o(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
}
setExtensions(e) {
this.extensions = e;
@@ -30010,7 +30078,7 @@ class y1 {
this.plugins = e;
}
parse(e, t) {
- const i = this, s = this.json, n = this.extensions;
+ const i = this, s = this.json, r = this.extensions;
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(a) {
return a._markDefs && a._markDefs();
}), Promise.all(this._invokeAll(function(a) {
@@ -30031,7 +30099,7 @@ class y1 {
parser: i,
userData: {}
};
- return ms(n, o, s), Si(o, s), Promise.all(i._invokeAll(function(l) {
+ return ms(r, o, s), Si(o, s), Promise.all(i._invokeAll(function(l) {
return l.afterRoot && l.afterRoot(o);
})).then(function() {
for (const l of o.scenes)
@@ -30047,12 +30115,12 @@ class y1 {
*/
_markDefs() {
const e = this.json.nodes || [], t = this.json.skins || [], i = this.json.meshes || [];
- for (let s = 0, n = t.length; s < n; s++) {
+ for (let s = 0, r = t.length; s < r; s++) {
const a = t[s].joints;
for (let o = 0, l = a.length; o < l; o++)
e[a[o]].isBone = !0;
}
- for (let s = 0, n = e.length; s < n; s++) {
+ for (let s = 0, r = e.length; s < r; s++) {
const a = e[s];
a.mesh !== void 0 && (this._addNodeRef(this.meshCache, a.mesh), a.skin !== void 0 && (i[a.mesh].isSkinnedMesh = !0)), a.camera !== void 0 && this._addNodeRef(this.cameraCache, a.camera);
}
@@ -30084,13 +30152,13 @@ class y1 {
*/
_getNodeRef(e, t, i) {
if (e.refs[t] <= 1) return i;
- const s = i.clone(), n = (a, o) => {
+ const s = i.clone(), r = (a, o) => {
const l = this.associations.get(a);
l != null && this.associations.set(o, l);
for (const [c, h] of a.children.entries())
- n(h, o.children[c]);
+ r(h, o.children[c]);
};
- return n(i, s), s.name += "_instance_" + e.uses[t]++, s;
+ return r(i, s), s.name += "_instance_" + e.uses[t]++, s;
}
_invokeOne(e) {
const t = Object.values(this.plugins);
@@ -30106,8 +30174,8 @@ class y1 {
t.unshift(this);
const i = [];
for (let s = 0; s < t.length; s++) {
- const n = e(t[s]);
- n && i.push(n);
+ const r = e(t[s]);
+ r && i.push(r);
}
return i;
}
@@ -30128,50 +30196,50 @@ class y1 {
s = this.loadScene(t);
break;
case "node":
- s = this._invokeOne(function(n) {
- return n.loadNode && n.loadNode(t);
+ s = this._invokeOne(function(r) {
+ return r.loadNode && r.loadNode(t);
});
break;
case "mesh":
- s = this._invokeOne(function(n) {
- return n.loadMesh && n.loadMesh(t);
+ s = this._invokeOne(function(r) {
+ return r.loadMesh && r.loadMesh(t);
});
break;
case "accessor":
s = this.loadAccessor(t);
break;
case "bufferView":
- s = this._invokeOne(function(n) {
- return n.loadBufferView && n.loadBufferView(t);
+ s = this._invokeOne(function(r) {
+ return r.loadBufferView && r.loadBufferView(t);
});
break;
case "buffer":
s = this.loadBuffer(t);
break;
case "material":
- s = this._invokeOne(function(n) {
- return n.loadMaterial && n.loadMaterial(t);
+ s = this._invokeOne(function(r) {
+ return r.loadMaterial && r.loadMaterial(t);
});
break;
case "texture":
- s = this._invokeOne(function(n) {
- return n.loadTexture && n.loadTexture(t);
+ s = this._invokeOne(function(r) {
+ return r.loadTexture && r.loadTexture(t);
});
break;
case "skin":
s = this.loadSkin(t);
break;
case "animation":
- s = this._invokeOne(function(n) {
- return n.loadAnimation && n.loadAnimation(t);
+ s = this._invokeOne(function(r) {
+ return r.loadAnimation && r.loadAnimation(t);
});
break;
case "camera":
s = this.loadCamera(t);
break;
default:
- if (s = this._invokeOne(function(n) {
- return n != this && n.getDependency && n.getDependency(e, t);
+ if (s = this._invokeOne(function(r) {
+ return r != this && r.getDependency && r.getDependency(e, t);
}), !s)
throw new Error("Unknown type: " + e);
break;
@@ -30191,7 +30259,7 @@ class y1 {
let t = this.cache.get(e);
if (!t) {
const i = this, s = this.json[e + (e === "mesh" ? "es" : "s")] || [];
- t = Promise.all(s.map(function(n, a) {
+ t = Promise.all(s.map(function(r, a) {
return i.getDependency(e, a);
})), this.cache.add(e, t);
}
@@ -30211,8 +30279,8 @@ class y1 {
if (t.uri === void 0 && e === 0)
return Promise.resolve(this.extensions[We.KHR_BINARY_GLTF].body);
const s = this.options;
- return new Promise(function(n, a) {
- i.load(Tr.resolveURL(t.uri, s.path), n, void 0, function() {
+ return new Promise(function(r, a) {
+ i.load(En.resolveURL(t.uri, s.path), r, void 0, function() {
a(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
});
});
@@ -30227,8 +30295,8 @@ class y1 {
loadBufferView(e) {
const t = this.json.bufferViews[e];
return this.getDependency("buffer", t.buffer).then(function(i) {
- const s = t.byteLength || 0, n = t.byteOffset || 0;
- return i.slice(n, n + s);
+ const s = t.byteLength || 0, r = t.byteOffset || 0;
+ return i.slice(r, r + s);
});
}
/**
@@ -30242,21 +30310,21 @@ class y1 {
const t = this, i = this.json, s = this.json.accessors[e];
if (s.bufferView === void 0 && s.sparse === void 0) {
const a = Sa[s.type], o = Gs[s.componentType], l = s.normalized === !0, c = new o(s.count * a);
- return Promise.resolve(new Vt(c, a, l));
+ return Promise.resolve(new Gt(c, a, l));
}
- const n = [];
- return s.bufferView !== void 0 ? n.push(this.getDependency("bufferView", s.bufferView)) : n.push(null), s.sparse !== void 0 && (n.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), n.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(n).then(function(a) {
+ const r = [];
+ return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(a) {
const o = a[0], l = Sa[s.type], c = Gs[s.componentType], h = c.BYTES_PER_ELEMENT, u = h * l, d = s.byteOffset || 0, m = s.bufferView !== void 0 ? i.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
let v, f;
if (m && m !== u) {
- const p = Math.floor(d / m), y = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + p + ":" + s.count;
- let _ = t.cache.get(y);
- _ || (v = new c(o, p * m, s.count * m / h), _ = new Cd(v, m / h), t.cache.add(y, _)), f = new jo(_, l, d % m / h, g);
+ const p = Math.floor(d / m), b = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + p + ":" + s.count;
+ let _ = t.cache.get(b);
+ _ || (v = new c(o, p * m, s.count * m / h), _ = new Cd(v, m / h), t.cache.add(b, _)), f = new jo(_, l, d % m / h, g);
} else
- o === null ? v = new c(s.count * l) : v = new c(o, d, s.count * l), f = new Vt(v, l, g);
+ o === null ? v = new c(s.count * l) : v = new c(o, d, s.count * l), f = new Gt(v, l, g);
if (s.sparse !== void 0) {
- const p = Sa.SCALAR, y = Gs[s.sparse.indices.componentType], _ = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, R = new y(a[1], _, s.sparse.count * p), T = new c(a[2], E, s.sparse.count * l);
- o !== null && (f = new Vt(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
+ const p = Sa.SCALAR, b = Gs[s.sparse.indices.componentType], _ = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, R = new b(a[1], _, s.sparse.count * p), T = new c(a[2], E, s.sparse.count * l);
+ o !== null && (f = new Gt(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
for (let A = 0, I = R.length; A < I; A++) {
const S = R[A];
if (f.setX(S, T[A * l]), l >= 2 && f.setY(S, T[A * l + 1]), l >= 3 && f.setZ(S, T[A * l + 2]), l >= 4 && f.setW(S, T[A * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
@@ -30274,29 +30342,29 @@ class y1 {
* @return {Promise}
*/
loadTexture(e) {
- const t = this.json, i = this.options, s = t.textures[e].source, n = t.images[s];
+ const t = this.json, i = this.options, s = t.textures[e].source, r = t.images[s];
let a = this.textureLoader;
- if (n.uri) {
- const o = i.manager.getHandler(n.uri);
+ if (r.uri) {
+ const o = i.manager.getHandler(r.uri);
o !== null && (a = o);
}
return this.loadTextureImage(e, s, a);
}
loadTextureImage(e, t, i) {
- const s = this, n = this.json, a = n.textures[e], o = n.images[t], l = (o.uri || o.bufferView) + ":" + a.sampler;
+ const s = this, r = this.json, a = r.textures[e], o = r.images[t], l = (o.uri || o.bufferView) + ":" + a.sampler;
if (this.textureCache[l])
return this.textureCache[l];
const c = this.loadImageSource(t, i).then(function(h) {
h.flipY = !1, h.name = a.name || o.name || "", h.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (h.name = o.uri);
- const u = (n.samplers || {})[a.sampler] || {};
- return h.magFilter = Nc[u.magFilter] || Mt, h.minFilter = Nc[u.minFilter] || wi, h.wrapS = Oc[u.wrapS] || Ri, h.wrapT = Oc[u.wrapT] || Ri, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Ut && h.minFilter !== Mt, s.associations.set(h, { textures: e }), h;
+ const u = (r.samplers || {})[a.sampler] || {};
+ return h.magFilter = Nc[u.magFilter] || Mt, h.minFilter = Nc[u.minFilter] || wi, h.wrapS = Bc[u.wrapS] || Ri, h.wrapT = Bc[u.wrapT] || Ri, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Nt && h.minFilter !== Mt, s.associations.set(h, { textures: e }), h;
}).catch(function() {
return null;
});
return this.textureCache[l] = c, c;
}
loadImageSource(e, t) {
- const i = this, s = this.json, n = this.options;
+ const i = this, s = this.json, r = this.options;
if (this.sourceCache[e] !== void 0)
return this.sourceCache[e].then((u) => u.clone());
const a = s.images[e], o = self.URL || self.webkitURL;
@@ -30315,7 +30383,7 @@ class y1 {
t.isImageBitmapLoader === !0 && (g = function(v) {
const f = new Pt(v);
f.needsUpdate = !0, d(f);
- }), t.load(Tr.resolveURL(u, n.path), g, void 0, m);
+ }), t.load(En.resolveURL(u, r.path), g, void 0, m);
});
}).then(function(u) {
return c === !0 && o.revokeObjectURL(l), Si(u, a), u.userData.mimeType = a.mimeType || _1(a.uri), u;
@@ -30335,14 +30403,14 @@ class y1 {
* @return {Promise}
*/
assignTexture(e, t, i, s) {
- const n = this;
+ const r = this;
return this.getDependency("texture", i.index).then(function(a) {
if (!a) return null;
- if (i.texCoord !== void 0 && i.texCoord > 0 && (a = a.clone(), a.channel = i.texCoord), n.extensions[We.KHR_TEXTURE_TRANSFORM]) {
+ if (i.texCoord !== void 0 && i.texCoord > 0 && (a = a.clone(), a.channel = i.texCoord), r.extensions[We.KHR_TEXTURE_TRANSFORM]) {
const o = i.extensions !== void 0 ? i.extensions[We.KHR_TEXTURE_TRANSFORM] : void 0;
if (o) {
- const l = n.associations.get(a);
- a = n.extensions[We.KHR_TEXTURE_TRANSFORM].extendTexture(a, o), n.associations.set(a, l);
+ const l = r.associations.get(a);
+ a = r.extensions[We.KHR_TEXTURE_TRANSFORM].extendTexture(a, o), r.associations.set(a, l);
}
}
return s !== void 0 && (a.colorSpace = s), e[t] = a, a;
@@ -30361,21 +30429,21 @@ class y1 {
assignFinalMaterial(e) {
const t = e.geometry;
let i = e.material;
- const s = t.attributes.tangent === void 0, n = t.attributes.color !== void 0, a = t.attributes.normal === void 0;
+ const s = t.attributes.tangent === void 0, r = t.attributes.color !== void 0, a = t.attributes.normal === void 0;
if (e.isPoints) {
const o = "PointsMaterial:" + i.uuid;
let l = this.cache.get(o);
- l || (l = new xh(), ii.prototype.copy.call(l, i), l.color.copy(i.color), l.map = i.map, l.sizeAttenuation = !1, this.cache.add(o, l)), i = l;
+ l || (l = new xh(), si.prototype.copy.call(l, i), l.color.copy(i.color), l.map = i.map, l.sizeAttenuation = !1, this.cache.add(o, l)), i = l;
} else if (e.isLine) {
const o = "LineBasicMaterial:" + i.uuid;
let l = this.cache.get(o);
- l || (l = new _h(), ii.prototype.copy.call(l, i), l.color.copy(i.color), l.map = i.map, this.cache.add(o, l)), i = l;
+ l || (l = new _h(), si.prototype.copy.call(l, i), l.color.copy(i.color), l.map = i.map, this.cache.add(o, l)), i = l;
}
- if (s || n || a) {
+ if (s || r || a) {
let o = "ClonedMaterial:" + i.uuid + ":";
- s && (o += "derivative-tangents:"), n && (o += "vertex-colors:"), a && (o += "flat-shading:");
+ s && (o += "derivative-tangents:"), r && (o += "vertex-colors:"), a && (o += "flat-shading:");
let l = this.cache.get(o);
- l || (l = i.clone(), n && (l.vertexColors = !0), a && (l.flatShading = !0), s && (l.normalScale && (l.normalScale.y *= -1), l.clearcoatNormalScale && (l.clearcoatNormalScale.y *= -1)), this.cache.add(o, l), this.associations.set(l, this.associations.get(i))), i = l;
+ l || (l = i.clone(), r && (l.vertexColors = !0), a && (l.flatShading = !0), s && (l.normalScale && (l.normalScale.y *= -1), l.clearcoatNormalScale && (l.clearcoatNormalScale.y *= -1)), this.cache.add(o, l), this.associations.set(l, this.associations.get(i))), i = l;
}
e.material = i;
}
@@ -30390,17 +30458,17 @@ class y1 {
* @return {Promise}
*/
loadMaterial(e) {
- const t = this, i = this.json, s = this.extensions, n = i.materials[e];
+ const t = this, i = this.json, s = this.extensions, r = i.materials[e];
let a;
- const o = {}, l = n.extensions || {}, c = [];
+ const o = {}, l = r.extensions || {}, c = [];
if (l[We.KHR_MATERIALS_UNLIT]) {
const u = s[We.KHR_MATERIALS_UNLIT];
- a = u.getMaterialType(), c.push(u.extendParams(o, n, t));
+ a = u.getMaterialType(), c.push(u.extendParams(o, r, t));
} else {
- const u = n.pbrMetallicRoughness || {};
+ const u = r.pbrMetallicRoughness || {};
if (o.color = new xe(1, 1, 1), o.opacity = 1, Array.isArray(u.baseColorFactor)) {
const d = u.baseColorFactor;
- o.color.setRGB(d[0], d[1], d[2], Bt), o.opacity = d[3];
+ o.color.setRGB(d[0], d[1], d[2], kt), o.opacity = d[3];
}
u.baseColorTexture !== void 0 && c.push(t.assignTexture(o, "map", u.baseColorTexture, Rt)), o.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, o.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(o, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(o, "roughnessMap", u.metallicRoughnessTexture))), a = this._invokeOne(function(d) {
return d.getMaterialType && d.getMaterialType(e);
@@ -30408,19 +30476,19 @@ class y1 {
return d.extendMaterialParams && d.extendMaterialParams(e, o);
})));
}
- n.doubleSided === !0 && (o.side = jt);
- const h = n.alphaMode || Ta.OPAQUE;
- if (h === Ta.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, h === Ta.MASK && (o.alphaTest = n.alphaCutoff !== void 0 ? n.alphaCutoff : 0.5)), n.normalTexture !== void 0 && a !== zt && (c.push(t.assignTexture(o, "normalMap", n.normalTexture)), o.normalScale = new oe(1, 1), n.normalTexture.scale !== void 0)) {
- const u = n.normalTexture.scale;
+ r.doubleSided === !0 && (o.side = Xt);
+ const h = r.alphaMode || Ta.OPAQUE;
+ if (h === Ta.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, h === Ta.MASK && (o.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && a !== Ht && (c.push(t.assignTexture(o, "normalMap", r.normalTexture)), o.normalScale = new oe(1, 1), r.normalTexture.scale !== void 0)) {
+ const u = r.normalTexture.scale;
o.normalScale.set(u, u);
}
- if (n.occlusionTexture !== void 0 && a !== zt && (c.push(t.assignTexture(o, "aoMap", n.occlusionTexture)), n.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = n.occlusionTexture.strength)), n.emissiveFactor !== void 0 && a !== zt) {
- const u = n.emissiveFactor;
- o.emissive = new xe().setRGB(u[0], u[1], u[2], Bt);
+ if (r.occlusionTexture !== void 0 && a !== Ht && (c.push(t.assignTexture(o, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && a !== Ht) {
+ const u = r.emissiveFactor;
+ o.emissive = new xe().setRGB(u[0], u[1], u[2], kt);
}
- return n.emissiveTexture !== void 0 && a !== zt && c.push(t.assignTexture(o, "emissiveMap", n.emissiveTexture, Rt)), Promise.all(c).then(function() {
+ return r.emissiveTexture !== void 0 && a !== Ht && c.push(t.assignTexture(o, "emissiveMap", r.emissiveTexture, Rt)), Promise.all(c).then(function() {
const u = new a(o);
- return n.name && (u.name = n.name), Si(u, n), t.associations.set(u, { materials: e }), n.extensions && ms(s, u, n), u;
+ return r.name && (u.name = r.name), Si(u, r), t.associations.set(u, { materials: e }), r.extensions && ms(s, u, r), u;
});
}
/**
@@ -30431,7 +30499,7 @@ class y1 {
* @return {string}
*/
createUniqueName(e) {
- const t = st.sanitizeNodeName(e || "");
+ const t = nt.sanitizeNodeName(e || "");
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
}
/**
@@ -30445,9 +30513,9 @@ class y1 {
*/
loadGeometries(e) {
const t = this, i = this.extensions, s = this.primitiveCache;
- function n(o) {
+ function r(o) {
return i[We.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o, t).then(function(l) {
- return Bc(l, o, t);
+ return Oc(l, o, t);
});
}
const a = [];
@@ -30457,7 +30525,7 @@ class y1 {
a.push(u.promise);
else {
let d;
- c.extensions && c.extensions[We.KHR_DRACO_MESH_COMPRESSION] ? d = n(c) : d = Bc(new si(), c, t), s[h] = { primitive: c, promise: d }, a.push(d);
+ c.extensions && c.extensions[We.KHR_DRACO_MESH_COMPRESSION] ? d = r(c) : d = Oc(new ni(), c, t), s[h] = { primitive: c, promise: d }, a.push(d);
}
}
return Promise.all(a);
@@ -30470,7 +30538,7 @@ class y1 {
* @return {Promise}
*/
loadMesh(e) {
- const t = this, i = this.json, s = this.extensions, n = i.meshes[e], a = n.primitives, o = [];
+ const t = this, i = this.json, s = this.extensions, r = i.meshes[e], a = r.primitives, o = [];
for (let l = 0, c = a.length; l < c; l++) {
const h = a[l].material === void 0 ? m1(this.cache) : this.getDependency("material", a[l].material);
o.push(h);
@@ -30480,20 +30548,20 @@ class y1 {
for (let m = 0, g = h.length; m < g; m++) {
const v = h[m], f = a[m];
let p;
- const y = c[m];
- if (f.mode === ei.TRIANGLES || f.mode === ei.TRIANGLE_STRIP || f.mode === ei.TRIANGLE_FAN || f.mode === void 0)
- p = n.isSkinnedMesh === !0 ? new Rd(v, y) : new at(v, y), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), f.mode === ei.TRIANGLE_STRIP ? p.geometry = Ic(p.geometry, oh) : f.mode === ei.TRIANGLE_FAN && (p.geometry = Ic(p.geometry, fo));
- else if (f.mode === ei.LINES)
- p = new Od(v, y);
- else if (f.mode === ei.LINE_STRIP)
- p = new Yo(v, y);
- else if (f.mode === ei.LINE_LOOP)
- p = new Bd(v, y);
- else if (f.mode === ei.POINTS)
- p = new Fd(v, y);
+ const b = c[m];
+ if (f.mode === ti.TRIANGLES || f.mode === ti.TRIANGLE_STRIP || f.mode === ti.TRIANGLE_FAN || f.mode === void 0)
+ p = r.isSkinnedMesh === !0 ? new Rd(v, b) : new ot(v, b), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), f.mode === ti.TRIANGLE_STRIP ? p.geometry = Ic(p.geometry, oh) : f.mode === ti.TRIANGLE_FAN && (p.geometry = Ic(p.geometry, fo));
+ else if (f.mode === ti.LINES)
+ p = new Bd(v, b);
+ else if (f.mode === ti.LINE_STRIP)
+ p = new Yo(v, b);
+ else if (f.mode === ti.LINE_LOOP)
+ p = new Od(v, b);
+ else if (f.mode === ti.POINTS)
+ p = new kd(v, b);
else
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + f.mode);
- Object.keys(p.geometry.morphAttributes).length > 0 && g1(p, n), p.name = t.createUniqueName(n.name || "mesh_" + e), Si(p, n), f.extensions && ms(s, p, f), t.assignFinalMaterial(p), u.push(p);
+ Object.keys(p.geometry.morphAttributes).length > 0 && g1(p, r), p.name = t.createUniqueName(r.name || "mesh_" + e), Si(p, r), f.extensions && ms(s, p, f), t.assignFinalMaterial(p), u.push(p);
}
for (let m = 0, g = u.length; m < g; m++)
t.associations.set(u[m], {
@@ -30501,9 +30569,9 @@ class y1 {
primitives: m
});
if (u.length === 1)
- return n.extensions && ms(s, u[0], n), u[0];
+ return r.extensions && ms(s, u[0], r), u[0];
const d = new Gi();
- n.extensions && ms(s, d, n), t.associations.set(d, { meshes: e });
+ r.extensions && ms(s, d, r), t.associations.set(d, { meshes: e });
for (let m = 0, g = u.length; m < g; m++)
d.add(u[m]);
return d;
@@ -30534,16 +30602,16 @@ class y1 {
*/
loadSkin(e) {
const t = this.json.skins[e], i = [];
- for (let s = 0, n = t.joints.length; s < n; s++)
+ for (let s = 0, r = t.joints.length; s < r; s++)
i.push(this._loadNodeShallow(t.joints[s]));
return t.inverseBindMatrices !== void 0 ? i.push(this.getDependency("accessor", t.inverseBindMatrices)) : i.push(null), Promise.all(i).then(function(s) {
- const n = s.pop(), a = s, o = [], l = [];
+ const r = s.pop(), a = s, o = [], l = [];
for (let c = 0, h = a.length; c < h; c++) {
const u = a[c];
if (u) {
o.push(u);
const d = new Ne();
- n !== null && d.fromArray(n.array, c * 16), l.push(d);
+ r !== null && d.fromArray(r.array, c * 16), l.push(d);
} else
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
}
@@ -30558,10 +30626,10 @@ class y1 {
* @return {Promise}
*/
loadAnimation(e) {
- const t = this.json, i = this, s = t.animations[e], n = s.name ? s.name : "animation_" + e, a = [], o = [], l = [], c = [], h = [];
+ const t = this.json, i = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, a = [], o = [], l = [], c = [], h = [];
for (let u = 0, d = s.channels.length; u < d; u++) {
- const m = s.channels[u], g = s.samplers[m.sampler], v = m.target, f = v.node, p = s.parameters !== void 0 ? s.parameters[g.input] : g.input, y = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
- v.node !== void 0 && (a.push(this.getDependency("node", f)), o.push(this.getDependency("accessor", p)), l.push(this.getDependency("accessor", y)), c.push(g), h.push(v));
+ const m = s.channels[u], g = s.samplers[m.sampler], v = m.target, f = v.node, p = s.parameters !== void 0 ? s.parameters[g.input] : g.input, b = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
+ v.node !== void 0 && (a.push(this.getDependency("node", f)), o.push(this.getDependency("accessor", p)), l.push(this.getDependency("accessor", b)), c.push(g), h.push(v));
}
return Promise.all([
Promise.all(a),
@@ -30580,14 +30648,14 @@ class y1 {
for (let L = 0; L < M.length; L++)
p.push(M[L]);
}
- const y = new Kd(n, void 0, p);
- return Si(y, s), y;
+ const b = new Kd(r, void 0, p);
+ return Si(b, s), b;
});
}
createNodeMesh(e) {
const t = this.json, i = this, s = t.nodes[e];
- return s.mesh === void 0 ? null : i.getDependency("mesh", s.mesh).then(function(n) {
- const a = i._getNodeRef(i.meshCache, s.mesh, n);
+ return s.mesh === void 0 ? null : i.getDependency("mesh", s.mesh).then(function(r) {
+ const a = i._getNodeRef(i.meshCache, s.mesh, r);
return s.weights !== void 0 && a.traverse(function(o) {
if (o.isMesh)
for (let l = 0, c = s.weights.length; l < c; l++)
@@ -30603,12 +30671,12 @@ class y1 {
* @return {Promise}
*/
loadNode(e) {
- const t = this.json, i = this, s = t.nodes[e], n = i._loadNodeShallow(e), a = [], o = s.children || [];
+ const t = this.json, i = this, s = t.nodes[e], r = i._loadNodeShallow(e), a = [], o = s.children || [];
for (let c = 0, h = o.length; c < h; c++)
a.push(i.getDependency("node", o[c]));
const l = s.skin === void 0 ? Promise.resolve(null) : i.getDependency("skin", s.skin);
return Promise.all([
- n,
+ r,
Promise.all(a),
l
]).then(function(c) {
@@ -30627,28 +30695,28 @@ class y1 {
const t = this.json, i = this.extensions, s = this;
if (this.nodeCache[e] !== void 0)
return this.nodeCache[e];
- const n = t.nodes[e], a = n.name ? s.createUniqueName(n.name) : "", o = [], l = s._invokeOne(function(c) {
+ const r = t.nodes[e], a = r.name ? s.createUniqueName(r.name) : "", o = [], l = s._invokeOne(function(c) {
return c.createNodeMesh && c.createNodeMesh(e);
});
- return l && o.push(l), n.camera !== void 0 && o.push(s.getDependency("camera", n.camera).then(function(c) {
- return s._getNodeRef(s.cameraCache, n.camera, c);
+ return l && o.push(l), r.camera !== void 0 && o.push(s.getDependency("camera", r.camera).then(function(c) {
+ return s._getNodeRef(s.cameraCache, r.camera, c);
})), s._invokeAll(function(c) {
return c.createNodeAttachment && c.createNodeAttachment(e);
}).forEach(function(c) {
o.push(c);
}), this.nodeCache[e] = Promise.all(o).then(function(c) {
let h;
- if (n.isBone === !0 ? h = new vh() : c.length > 1 ? h = new Gi() : c.length === 1 ? h = c[0] : h = new mt(), h !== c[0])
+ if (r.isBone === !0 ? h = new vh() : c.length > 1 ? h = new Gi() : c.length === 1 ? h = c[0] : h = new mt(), h !== c[0])
for (let u = 0, d = c.length; u < d; u++)
h.add(c[u]);
- if (n.name && (h.userData.name = n.name, h.name = a), Si(h, n), n.extensions && ms(i, h, n), n.matrix !== void 0) {
+ if (r.name && (h.userData.name = r.name, h.name = a), Si(h, r), r.extensions && ms(i, h, r), r.matrix !== void 0) {
const u = new Ne();
- u.fromArray(n.matrix), h.applyMatrix4(u);
+ u.fromArray(r.matrix), h.applyMatrix4(u);
} else
- n.translation !== void 0 && h.position.fromArray(n.translation), n.rotation !== void 0 && h.quaternion.fromArray(n.rotation), n.scale !== void 0 && h.scale.fromArray(n.scale);
+ r.translation !== void 0 && h.position.fromArray(r.translation), r.rotation !== void 0 && h.quaternion.fromArray(r.rotation), r.scale !== void 0 && h.scale.fromArray(r.scale);
if (!s.associations.has(h))
s.associations.set(h, {});
- else if (n.mesh !== void 0 && s.meshCache.refs[n.mesh] > 1) {
+ else if (r.mesh !== void 0 && s.meshCache.refs[r.mesh] > 1) {
const u = s.associations.get(h);
s.associations.set(h, { ...u });
}
@@ -30663,33 +30731,33 @@ class y1 {
* @return {Promise}
*/
loadScene(e) {
- const t = this.extensions, i = this.json.scenes[e], s = this, n = new Gi();
- i.name && (n.name = s.createUniqueName(i.name)), Si(n, i), i.extensions && ms(t, n, i);
+ const t = this.extensions, i = this.json.scenes[e], s = this, r = new Gi();
+ i.name && (r.name = s.createUniqueName(i.name)), Si(r, i), i.extensions && ms(t, r, i);
const a = i.nodes || [], o = [];
for (let l = 0, c = a.length; l < c; l++)
o.push(s.getDependency("node", a[l]));
return Promise.all(o).then(function(l) {
for (let h = 0, u = l.length; h < u; h++)
- n.add(l[h]);
+ r.add(l[h]);
const c = (h) => {
const u = /* @__PURE__ */ new Map();
for (const [d, m] of s.associations)
- (d instanceof ii || d instanceof Pt) && u.set(d, m);
+ (d instanceof si || d instanceof Pt) && u.set(d, m);
return h.traverse((d) => {
const m = s.associations.get(d);
m != null && u.set(d, m);
}), u;
};
- return s.associations = c(n), n;
+ return s.associations = c(r), r;
});
}
- _createAnimationTracks(e, t, i, s, n) {
+ _createAnimationTracks(e, t, i, s, r) {
const a = [], o = e.name ? e.name : e.uuid, l = [];
- Ji[n.path] === Ji.weights ? e.traverse(function(d) {
+ Ji[r.path] === Ji.weights ? e.traverse(function(d) {
d.morphTargetInfluences && l.push(d.name ? d.name : d.uuid);
}) : l.push(o);
let c;
- switch (Ji[n.path]) {
+ switch (Ji[r.path]) {
case Ji.weights:
c = Js;
break;
@@ -30698,7 +30766,7 @@ class y1 {
break;
case Ji.translation:
case Ji.scale:
- c = er;
+ c = en;
break;
default:
switch (i.itemSize) {
@@ -30708,15 +30776,15 @@ class y1 {
case 2:
case 3:
default:
- c = er;
+ c = en;
break;
}
break;
}
- const h = s.interpolation !== void 0 ? p1[s.interpolation] : Rr, u = this._getArrayFromAccessor(i);
+ const h = s.interpolation !== void 0 ? p1[s.interpolation] : Pn, u = this._getArrayFromAccessor(i);
for (let d = 0, m = l.length; d < m; d++) {
const g = new c(
- l[d] + "." + Ji[n.path],
+ l[d] + "." + Ji[r.path],
t.array,
u,
h
@@ -30729,20 +30797,20 @@ class y1 {
let t = e.array;
if (e.normalized) {
const i = Eo(t.constructor), s = new Float32Array(t.length);
- for (let n = 0, a = t.length; n < a; n++)
- s[n] = t[n] * i;
+ for (let r = 0, a = t.length; r < a; r++)
+ s[r] = t[r] * i;
t = s;
}
return t;
}
_createCubicSplineTrackInterpolant(e) {
e.createInterpolant = function(t) {
- const i = this instanceof Qs ? d1 : kh;
+ const i = this instanceof Qs ? d1 : Fh;
return new i(this.times, this.values, this.getValueSize() / 3, t);
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
}
}
-function b1(r, e, t) {
+function y1(n, e, t) {
const i = e.attributes, s = new Lt();
if (i.POSITION !== void 0) {
const o = t.json.accessors[i.POSITION], l = o.min, c = o.max;
@@ -30760,11 +30828,11 @@ function b1(r, e, t) {
}
} else
return;
- const n = e.targets;
- if (n !== void 0) {
+ const r = e.targets;
+ if (r !== void 0) {
const o = new w(), l = new w();
- for (let c = 0, h = n.length; c < h; c++) {
- const u = n[c];
+ for (let c = 0, h = r.length; c < h; c++) {
+ const u = r[c];
if (u.POSITION !== void 0) {
const d = t.json.accessors[u.POSITION], m = d.min, g = d.max;
if (m !== void 0 && g !== void 0) {
@@ -30779,29 +30847,29 @@ function b1(r, e, t) {
}
s.expandByVector(o);
}
- r.boundingBox = s;
+ n.boundingBox = s;
const a = new Li();
- s.getCenter(a.center), a.radius = s.min.distanceTo(s.max) / 2, r.boundingSphere = a;
+ s.getCenter(a.center), a.radius = s.min.distanceTo(s.max) / 2, n.boundingSphere = a;
}
-function Bc(r, e, t) {
+function Oc(n, e, t) {
const i = e.attributes, s = [];
- function n(a, o) {
+ function r(a, o) {
return t.getDependency("accessor", a).then(function(l) {
- r.setAttribute(o, l);
+ n.setAttribute(o, l);
});
}
for (const a in i) {
const o = To[a] || a.toLowerCase();
- o in r.attributes || s.push(n(i[a], o));
+ o in n.attributes || s.push(r(i[a], o));
}
- if (e.indices !== void 0 && !r.index) {
+ if (e.indices !== void 0 && !n.index) {
const a = t.getDependency("accessor", e.indices).then(function(o) {
- r.setIndex(o);
+ n.setIndex(o);
});
s.push(a);
}
- return qe.workingColorSpace !== Bt && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${qe.workingColorSpace}" not supported.`), Si(r, e), b1(r, e, t), Promise.all(s).then(function() {
- return e.targets !== void 0 ? f1(r, e.targets, t) : r;
+ return qe.workingColorSpace !== kt && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${qe.workingColorSpace}" not supported.`), Si(n, e), y1(n, e, t), Promise.all(s).then(function() {
+ return e.targets !== void 0 ? f1(n, e.targets, t) : n;
});
}
class M1 {
@@ -30810,19 +30878,19 @@ class M1 {
models = [];
// 存储加载的模型
constructor(e) {
- this.scene = e, this.loader = new Bh();
+ this.scene = e, this.loader = new Oh();
}
async loadGLTF(e) {
return new Promise((t, i) => {
this.loader.load(
e,
(s) => {
- const n = s.scene;
- n.traverse((a) => {
- a instanceof at && (a.receiveShadow = !0, a.castShadow = !0);
- }), this.scene.add(n), this.models.push({
- children: this.extractMeshes(n)
- }), t(n);
+ const r = s.scene;
+ r.traverse((a) => {
+ a instanceof ot && (a.receiveShadow = !0, a.castShadow = !0);
+ }), this.scene.add(r), this.models.push({
+ children: this.extractMeshes(r)
+ }), t(r);
},
void 0,
(s) => {
@@ -30837,7 +30905,7 @@ class M1 {
extractMeshes(e) {
const t = [];
return e.traverse((i) => {
- i instanceof at && t.push(i);
+ i instanceof ot && t.push(i);
}), t;
}
/**
@@ -30871,7 +30939,7 @@ class S1 {
// private mouseDownPosition: { x: number; y: number } | null = null;
// private isDragging: boolean = false;
constructor(e, t, i, s) {
- this.scene = e, this.highlightMaterial = new zt({
+ this.scene = e, this.highlightMaterial = new Ht({
color: 43775,
// 明显的蓝色
depthTest: !1,
@@ -30881,7 +30949,7 @@ class S1 {
transparent: !0,
opacity: 0.8,
// 半透明效果
- side: jt
+ side: Xt
// 双面渲染
});
}
@@ -31059,7 +31127,7 @@ class S1 {
});
}
}
-class ts extends ns {
+class ts extends rs {
/**
* Constructs a new outline pass.
*
@@ -31071,19 +31139,19 @@ class ts extends ns {
*/
constructor(e, t, i, s) {
super(), this.renderScene = t, this.renderCamera = i, this.selectedObjects = s !== void 0 ? s : [], this.visibleEdgeColor = new xe(1, 1, 1), this.hiddenEdgeColor = new xe(0.1, 0.04, 0.02), this.edgeGlow = 0, this.usePatternTexture = !1, this.patternTexture = null, this.edgeThickness = 1, this.edgeStrength = 3, this.downSampleRatio = 2, this.pulsePeriod = 0, this._visibilityCache = /* @__PURE__ */ new Map(), this._selectionCache = /* @__PURE__ */ new Set(), this.resolution = e !== void 0 ? new oe(e.x, e.y) : new oe(256, 256);
- const n = Math.round(this.resolution.x / this.downSampleRatio), a = Math.round(this.resolution.y / this.downSampleRatio);
- this.renderTargetMaskBuffer = new bt(this.resolution.x, this.resolution.y), this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask", this.renderTargetMaskBuffer.texture.generateMipmaps = !1, this.depthMaterial = new bh(), this.depthMaterial.side = jt, this.depthMaterial.depthPacking = lh, this.depthMaterial.blending = yt, this.prepareMaskMaterial = this._getPrepareMaskMaterial(), this.prepareMaskMaterial.side = jt, this.prepareMaskMaterial.fragmentShader = h(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.renderTargetDepthBuffer = new bt(this.resolution.x, this.resolution.y, { type: vt }), this.renderTargetDepthBuffer.texture.name = "OutlinePass.depth", this.renderTargetDepthBuffer.texture.generateMipmaps = !1, this.renderTargetMaskDownSampleBuffer = new bt(n, a, { type: vt }), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new bt(n, a, { type: vt }), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new bt(Math.round(n / 2), Math.round(a / 2), { type: vt }), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new bt(n, a, { type: vt }), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new bt(Math.round(n / 2), Math.round(a / 2), { type: vt }), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1;
+ const r = Math.round(this.resolution.x / this.downSampleRatio), a = Math.round(this.resolution.y / this.downSampleRatio);
+ this.renderTargetMaskBuffer = new yt(this.resolution.x, this.resolution.y), this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask", this.renderTargetMaskBuffer.texture.generateMipmaps = !1, this.depthMaterial = new yh(), this.depthMaterial.side = Xt, this.depthMaterial.depthPacking = lh, this.depthMaterial.blending = bt, this.prepareMaskMaterial = this._getPrepareMaskMaterial(), this.prepareMaskMaterial.side = Xt, this.prepareMaskMaterial.fragmentShader = h(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.renderTargetDepthBuffer = new yt(this.resolution.x, this.resolution.y, { type: vt }), this.renderTargetDepthBuffer.texture.name = "OutlinePass.depth", this.renderTargetDepthBuffer.texture.generateMipmaps = !1, this.renderTargetMaskDownSampleBuffer = new yt(r, a, { type: vt }), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new yt(r, a, { type: vt }), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new yt(Math.round(r / 2), Math.round(a / 2), { type: vt }), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new yt(r, a, { type: vt }), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new yt(Math.round(r / 2), Math.round(a / 2), { type: vt }), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1;
const o = 4, l = 4;
- this.separableBlurMaterial1 = this._getSeparableBlurMaterial(o), this.separableBlurMaterial1.uniforms.texSize.value.set(n, a), this.separableBlurMaterial1.uniforms.kernelRadius.value = 1, this.separableBlurMaterial2 = this._getSeparableBlurMaterial(l), this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(n / 2), Math.round(a / 2)), this.separableBlurMaterial2.uniforms.kernelRadius.value = l, this.overlayMaterial = this._getOverlayMaterial();
+ this.separableBlurMaterial1 = this._getSeparableBlurMaterial(o), this.separableBlurMaterial1.uniforms.texSize.value.set(r, a), this.separableBlurMaterial1.uniforms.kernelRadius.value = 1, this.separableBlurMaterial2 = this._getSeparableBlurMaterial(l), this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(r / 2), Math.round(a / 2)), this.separableBlurMaterial2.uniforms.kernelRadius.value = l, this.overlayMaterial = this._getOverlayMaterial();
const c = ss;
- this.copyUniforms = mi.clone(c.uniforms), this.materialCopy = new ut({
+ this.copyUniforms = fi.clone(c.uniforms), this.materialCopy = new ut({
uniforms: this.copyUniforms,
vertexShader: c.vertexShader,
fragmentShader: c.fragmentShader,
- blending: yt,
+ blending: bt,
depthTest: !1,
depthWrite: !1
- }), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new xe(), this.oldClearAlpha = 1, this._fsQuad = new Nr(null), this.tempPulseColor1 = new xe(), this.tempPulseColor2 = new xe(), this.textureMatrix = new Ne();
+ }), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new xe(), this.oldClearAlpha = 1, this._fsQuad = new Bn(null), this.tempPulseColor1 = new xe(), this.tempPulseColor2 = new xe(), this.textureMatrix = new Ne();
function h(u, d) {
const m = d.isPerspectiveCamera ? "perspective" : "orthographic";
return u.replace(/DEPTH_TO_VIEW_Z/g, m + "DepthToViewZ");
@@ -31118,17 +31186,17 @@ class ts extends ns {
* @param {number} deltaTime - The delta time in seconds.
* @param {boolean} maskActive - Whether masking is active or not.
*/
- render(e, t, i, s, n) {
+ render(e, t, i, s, r) {
if (this.selectedObjects.length > 0) {
e.getClearColor(this._oldClearColor), this.oldClearAlpha = e.getClearAlpha();
const a = e.autoClear;
- e.autoClear = !1, n && e.state.buffers.stencil.setTest(!1), e.setClearColor(16777215, 1), this._updateSelectionCache(), this._changeVisibilityOfSelectedObjects(!1);
+ e.autoClear = !1, r && e.state.buffers.stencil.setTest(!1), e.setClearColor(16777215, 1), this._updateSelectionCache(), this._changeVisibilityOfSelectedObjects(!1);
const o = this.renderScene.background, l = this.renderScene.overrideMaterial;
if (this.renderScene.background = null, this.renderScene.overrideMaterial = this.depthMaterial, e.setRenderTarget(this.renderTargetDepthBuffer), e.clear(), e.render(this.renderScene, this.renderCamera), this._changeVisibilityOfSelectedObjects(!0), this._visibilityCache.clear(), this._updateTextureMatrix(), this._changeVisibilityOfNonSelectedObjects(!1), this.renderScene.overrideMaterial = this.prepareMaskMaterial, this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near, this.renderCamera.far), this.prepareMaskMaterial.uniforms.depthTexture.value = this.renderTargetDepthBuffer.texture, this.prepareMaskMaterial.uniforms.textureMatrix.value = this.textureMatrix, e.setRenderTarget(this.renderTargetMaskBuffer), e.clear(), e.render(this.renderScene, this.renderCamera), this._changeVisibilityOfNonSelectedObjects(!0), this._visibilityCache.clear(), this._selectionCache.clear(), this.renderScene.background = o, this.renderScene.overrideMaterial = l, this._fsQuad.material = this.materialCopy, this.copyUniforms.tDiffuse.value = this.renderTargetMaskBuffer.texture, e.setRenderTarget(this.renderTargetMaskDownSampleBuffer), e.clear(), this._fsQuad.render(e), this.tempPulseColor1.copy(this.visibleEdgeColor), this.tempPulseColor2.copy(this.hiddenEdgeColor), this.pulsePeriod > 0) {
const c = 0.625 + Math.cos(performance.now() * 0.01 / this.pulsePeriod) * 0.75 / 2;
this.tempPulseColor1.multiplyScalar(c), this.tempPulseColor2.multiplyScalar(c);
}
- this._fsQuad.material = this.edgeDetectionMaterial, this.edgeDetectionMaterial.uniforms.maskTexture.value = this.renderTargetMaskDownSampleBuffer.texture, this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height), this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value = this.tempPulseColor1, this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value = this.tempPulseColor2, e.setRenderTarget(this.renderTargetEdgeBuffer1), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.separableBlurMaterial1, this.separableBlurMaterial1.uniforms.colorTexture.value = this.renderTargetEdgeBuffer1.texture, this.separableBlurMaterial1.uniforms.direction.value = ts.BlurDirectionX, this.separableBlurMaterial1.uniforms.kernelRadius.value = this.edgeThickness, e.setRenderTarget(this.renderTargetBlurBuffer1), e.clear(), this._fsQuad.render(e), this.separableBlurMaterial1.uniforms.colorTexture.value = this.renderTargetBlurBuffer1.texture, this.separableBlurMaterial1.uniforms.direction.value = ts.BlurDirectionY, e.setRenderTarget(this.renderTargetEdgeBuffer1), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.separableBlurMaterial2, this.separableBlurMaterial2.uniforms.colorTexture.value = this.renderTargetEdgeBuffer1.texture, this.separableBlurMaterial2.uniforms.direction.value = ts.BlurDirectionX, e.setRenderTarget(this.renderTargetBlurBuffer2), e.clear(), this._fsQuad.render(e), this.separableBlurMaterial2.uniforms.colorTexture.value = this.renderTargetBlurBuffer2.texture, this.separableBlurMaterial2.uniforms.direction.value = ts.BlurDirectionY, e.setRenderTarget(this.renderTargetEdgeBuffer2), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.overlayMaterial, this.overlayMaterial.uniforms.maskTexture.value = this.renderTargetMaskBuffer.texture, this.overlayMaterial.uniforms.edgeTexture1.value = this.renderTargetEdgeBuffer1.texture, this.overlayMaterial.uniforms.edgeTexture2.value = this.renderTargetEdgeBuffer2.texture, this.overlayMaterial.uniforms.patternTexture.value = this.patternTexture, this.overlayMaterial.uniforms.edgeStrength.value = this.edgeStrength, this.overlayMaterial.uniforms.edgeGlow.value = this.edgeGlow, this.overlayMaterial.uniforms.usePatternTexture.value = this.usePatternTexture, n && e.state.buffers.stencil.setTest(!0), e.setRenderTarget(i), this._fsQuad.render(e), e.setClearColor(this._oldClearColor, this.oldClearAlpha), e.autoClear = a;
+ this._fsQuad.material = this.edgeDetectionMaterial, this.edgeDetectionMaterial.uniforms.maskTexture.value = this.renderTargetMaskDownSampleBuffer.texture, this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height), this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value = this.tempPulseColor1, this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value = this.tempPulseColor2, e.setRenderTarget(this.renderTargetEdgeBuffer1), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.separableBlurMaterial1, this.separableBlurMaterial1.uniforms.colorTexture.value = this.renderTargetEdgeBuffer1.texture, this.separableBlurMaterial1.uniforms.direction.value = ts.BlurDirectionX, this.separableBlurMaterial1.uniforms.kernelRadius.value = this.edgeThickness, e.setRenderTarget(this.renderTargetBlurBuffer1), e.clear(), this._fsQuad.render(e), this.separableBlurMaterial1.uniforms.colorTexture.value = this.renderTargetBlurBuffer1.texture, this.separableBlurMaterial1.uniforms.direction.value = ts.BlurDirectionY, e.setRenderTarget(this.renderTargetEdgeBuffer1), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.separableBlurMaterial2, this.separableBlurMaterial2.uniforms.colorTexture.value = this.renderTargetEdgeBuffer1.texture, this.separableBlurMaterial2.uniforms.direction.value = ts.BlurDirectionX, e.setRenderTarget(this.renderTargetBlurBuffer2), e.clear(), this._fsQuad.render(e), this.separableBlurMaterial2.uniforms.colorTexture.value = this.renderTargetBlurBuffer2.texture, this.separableBlurMaterial2.uniforms.direction.value = ts.BlurDirectionY, e.setRenderTarget(this.renderTargetEdgeBuffer2), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.overlayMaterial, this.overlayMaterial.uniforms.maskTexture.value = this.renderTargetMaskBuffer.texture, this.overlayMaterial.uniforms.edgeTexture1.value = this.renderTargetEdgeBuffer1.texture, this.overlayMaterial.uniforms.edgeTexture2.value = this.renderTargetEdgeBuffer2.texture, this.overlayMaterial.uniforms.patternTexture.value = this.patternTexture, this.overlayMaterial.uniforms.edgeStrength.value = this.edgeStrength, this.overlayMaterial.uniforms.edgeGlow.value = this.edgeGlow, this.overlayMaterial.uniforms.usePatternTexture.value = this.usePatternTexture, r && e.state.buffers.stencil.setTest(!0), e.setRenderTarget(i), this._fsQuad.render(e), e.setClearColor(this._oldClearColor, this.oldClearAlpha), e.autoClear = a;
}
this.renderToScreen && (this._fsQuad.material = this.materialCopy, this.copyUniforms.tDiffuse.value = i.texture, e.setRenderTarget(null), this._fsQuad.render(e));
}
@@ -31149,12 +31217,12 @@ class ts extends ns {
}
_changeVisibilityOfNonSelectedObjects(e) {
const t = this._visibilityCache, i = this._selectionCache;
- function s(n) {
- if (n.isPoints || n.isLine || n.isLine2)
- e === !0 ? n.visible = t.get(n) : (t.set(n, n.visible), n.visible = e);
- else if ((n.isMesh || n.isSprite) && !i.has(n)) {
- const a = n.visible;
- (e === !1 || t.get(n) === !0) && (n.visible = e), t.set(n, a);
+ function s(r) {
+ if (r.isPoints || r.isLine || r.isLine2)
+ e === !0 ? r.visible = t.get(r) : (t.set(r, r.visible), r.visible = e);
+ else if ((r.isMesh || r.isSprite) && !i.has(r)) {
+ const a = r.visible;
+ (e === !1 || t.get(r) === !0) && (r.visible = e), t.set(r, a);
}
}
this.renderScene.traverse(s);
@@ -31360,7 +31428,7 @@ class ts extends ns {
finalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);
gl_FragColor = finalColor;
}`,
- blending: Sn,
+ blending: Sr,
depthTest: !1,
depthWrite: !1,
transparent: !0
@@ -31458,8 +31526,8 @@ class E1 {
selectionBox = null;
// 当前框选的对象
selectedObjects = [];
- constructor(e, t, i, s, n) {
- this.scene = e, this.camera = t, this.canvas = i, this.controls = s, this.outlineManager = n, this.setupEventListeners(), this.createSelectionBoxElement();
+ constructor(e, t, i, s, r) {
+ this.scene = e, this.camera = t, this.canvas = i, this.controls = s, this.outlineManager = r, this.setupEventListeners(), this.createSelectionBoxElement();
}
/**
* 创建虚线框UI元素
@@ -31525,11 +31593,11 @@ class E1 {
* 更新选中的对象
*/
updateSelectedObjects() {
- const e = this.endPoint.x > this.startPoint.x, t = this.endPoint.y > this.startPoint.y, i = e && t, s = this.canvas.getBoundingClientRect(), n = s.width, a = s.height, o = new oe(
- Math.min(this.startPoint.x, this.endPoint.x) / n,
+ const e = this.endPoint.x > this.startPoint.x, t = this.endPoint.y > this.startPoint.y, i = e && t, s = this.canvas.getBoundingClientRect(), r = s.width, a = s.height, o = new oe(
+ Math.min(this.startPoint.x, this.endPoint.x) / r,
Math.min(this.startPoint.y, this.endPoint.y) / a
), l = new oe(
- Math.max(this.startPoint.x, this.endPoint.x) / n,
+ Math.max(this.startPoint.x, this.endPoint.x) / r,
Math.max(this.startPoint.y, this.endPoint.y) / a
), c = [];
this.scene.traverse((h) => {
@@ -31548,8 +31616,8 @@ class E1 {
* 获取包围盒的8个顶点
*/
getBoundingBoxCorners(e, t) {
- const i = [], s = e.min, n = e.max;
- return i.push(new w(s.x, s.y, s.z)), i.push(new w(n.x, s.y, s.z)), i.push(new w(s.x, n.y, s.z)), i.push(new w(n.x, n.y, s.z)), i.push(new w(s.x, s.y, n.z)), i.push(new w(n.x, s.y, n.z)), i.push(new w(s.x, n.y, n.z)), i.push(new w(n.x, n.y, n.z)), i.forEach((a) => {
+ const i = [], s = e.min, r = e.max;
+ return i.push(new w(s.x, s.y, s.z)), i.push(new w(r.x, s.y, s.z)), i.push(new w(s.x, r.y, s.z)), i.push(new w(r.x, r.y, s.z)), i.push(new w(s.x, s.y, r.z)), i.push(new w(r.x, s.y, r.z)), i.push(new w(s.x, r.y, r.z)), i.push(new w(r.x, r.y, r.z)), i.forEach((a) => {
a.applyMatrix4(t.matrixWorld);
}), i;
}
@@ -31660,7 +31728,7 @@ class w1 {
*/
updateSceneMaterials(e) {
this.scene.traverse((t) => {
- if (t instanceof at) {
+ if (t instanceof ot) {
if (t.userData.isStencilCap) return;
(Array.isArray(t.material) ? t.material : [t.material]).forEach((i) => {
i && (e ? ((!i.clippingPlanes || i.clippingPlanes.indexOf(this.clippingPlane) === -1) && (i.clippingPlanes = [this.clippingPlane]), i.clipShadows = !0) : i.clippingPlanes = [], i.needsUpdate = !0);
@@ -31675,7 +31743,7 @@ class w1 {
this.stencilGroup = new Gi(), this.stencilGroup.name = "ClippingStencilGroup", this.scene.add(this.stencilGroup);
let e = 0;
this.scene.traverse((t) => {
- if (t instanceof at && t.visible && !t.userData.isStencilCap) {
+ if (t instanceof ot && t.visible && !t.userData.isStencilCap) {
if (!t.geometry) return;
this.createStencilMeshesForObject(t), e++;
}
@@ -31684,26 +31752,26 @@ class w1 {
createStencilMeshesForObject(e) {
const t = e.geometry;
e.updateMatrixWorld(!0);
- const i = e.matrixWorld, s = new zt({
+ const i = e.matrixWorld, s = new Ht({
depthWrite: !1,
depthTest: !1,
colorWrite: !1,
stencilWrite: !0,
stencilFunc: go,
clippingPlanes: [this.clippingPlane]
- }), n = s.clone();
- n.side = Ht, n.stencilFail = zn, n.stencilZFail = zn, n.stencilZPass = zn;
- const a = new at(t, n);
+ }), r = s.clone();
+ r.side = Vt, r.stencilFail = zr, r.stencilZFail = zr, r.stencilZPass = zr;
+ const a = new ot(t, r);
a.applyMatrix4(i), a.matrixAutoUpdate = !1, a.userData.isStencilCap = !0, a.renderOrder = 1, this.stencilGroup.add(a);
const o = s.clone();
- o.side = Ai, o.stencilFail = Hn, o.stencilZFail = Hn, o.stencilZPass = Hn;
- const l = new at(t, o);
+ o.side = Ai, o.stencilFail = Hr, o.stencilZFail = Hr, o.stencilZPass = Hr;
+ const l = new ot(t, o);
l.applyMatrix4(i), l.matrixAutoUpdate = !1, l.userData.isStencilCap = !0, l.renderOrder = 1, this.stencilGroup.add(l);
}
addCapPlane() {
- const e = new zt({
+ const e = new Ht({
color: this.capColor,
- side: jt,
+ side: Xt,
stencilWrite: !0,
transparent: !0,
opacity: 0,
@@ -31717,7 +31785,7 @@ class w1 {
polygonOffsetFactor: -1,
//稍微拉向摄像机,防止z-fighting
polygonOffsetUnits: -1
- }), t = new Dr(1e5, 1e5), i = new at(t, e);
+ }), t = new In(1e5, 1e5), i = new ot(t, e);
i.userData.isCapPlane = !0, i.userData.isStencilCap = !0, i.renderOrder = 2, this.capMesh = i, this.stencilGroup.add(i);
}
updateCapPlane() {
@@ -31778,17 +31846,17 @@ class C1 {
this._lastClickWorldPosition = null, this._lastClickScreenPosition = null;
}
}
-function A1(r) {
+function A1(n) {
let e = new Object();
return e.updataSceneOctreeBox = function() {
- r.octreeBoxModels = [];
+ n.octreeBoxModels = [];
let t = e.getBoundingBox();
e.ocBox = e.splitBoxIntoAuto(t);
let i = 0;
- r.models.forEach((a) => {
+ n.models.forEach((a) => {
a.children.forEach((o) => {
o.info.forEach((l) => {
- n(l, e.ocBox);
+ r(l, e.ocBox);
});
}), i = i + 1;
}), s(e.ocBox);
@@ -31798,7 +31866,7 @@ function A1(r) {
l.isLeaf == !1 && s(l), l.children.length == 0 && (l.isLeaf = !0), l.isLeaf && (l.elements == null || l.elements.length == 0) && a.children.splice(o, 1);
}
}
- function n(a, o) {
+ function r(a, o) {
var l = {
min: a.box.min,
max: a.box.max
@@ -31807,7 +31875,7 @@ function A1(r) {
if (o.elements == null && (o.elements = []), o.isLeaf == !1) {
let c = !1;
for (let h = 0; h < o.children.length; h++)
- if (n(a, o.children[h]) == !0) {
+ if (r(a, o.children[h]) == !0) {
c = !0;
break;
}
@@ -31820,10 +31888,10 @@ function A1(r) {
}
}, e.rayInterationModel = function(t) {
var i = [];
- n(t, e.ocBox);
+ r(t, e.ocBox);
var s = a(t, i);
return s;
- function n(o, l) {
+ function r(o, l) {
if (l == null)
return;
let c = new Lt(l.min, l.max), h = o.ray.intersectsBox(c);
@@ -31837,18 +31905,18 @@ function A1(r) {
for (var u of l.elements)
i.push(u);
for (let d of l.children)
- n(o, d);
+ r(o, d);
}
}
function a(o, l) {
let c = [];
- const h = new zt({
+ const h = new Ht({
color: 16711680
});
for (let u of l) {
- let d = r.models[u[0]].children[u[1]];
+ let d = n.models[u[0]].children[u[1]];
if (d.TypeName == "Mesh" && d.geometry.groups[u[2]].visibility !== !1) {
- let m = new at(d.geometryArray[u[2]], h);
+ let m = new ot(d.geometryArray[u[2]], h);
m.indexs = u, m.TypeName = d.TypeName, c.push(m);
} else d.TypeName == "InstancedMesh" || d.TypeName == "InstancedMesh-Pipe";
}
@@ -31857,7 +31925,7 @@ function A1(r) {
}, e.boxContainBox = function(t, i) {
return i.min.x >= t.min.x && i.min.y >= t.min.y && i.min.z >= t.min.z && i.max.x <= t.max.x && i.max.y <= t.max.y && i.max.z <= t.max.z;
}, e.splitBoxIntoAuto = function(t, i = 10) {
- let s = [], n = [], a = [], o = (t.max.x - t.min.x) * 0.5, l = (t.max.y - t.min.y) * 0.5, c = (t.max.z - t.min.z) * 0.5;
+ let s = [], r = [], a = [], o = (t.max.x - t.min.x) * 0.5, l = (t.max.y - t.min.y) * 0.5, c = (t.max.z - t.min.z) * 0.5;
if (o > i) {
let h = t, u = {
min: h.min,
@@ -31877,12 +31945,12 @@ function A1(r) {
min: new w(h.min.x, h.min.y + l, h.min.z),
max: h.max
};
- n.push(u), n.push(d);
+ r.push(u), r.push(d);
}
else
- n = s;
+ r = s;
if (c > i)
- for (let h of n) {
+ for (let h of r) {
let u = {
min: h.min,
max: new w(h.max.x, h.max.y, h.min.z + c)
@@ -31893,7 +31961,7 @@ function A1(r) {
a.push(u), a.push(d);
}
else
- a = n;
+ a = r;
if (t.children = a, t.children.length > 0) {
t.isLeaf = !1;
for (let h = 0; h < t.children.length; h++)
@@ -31902,18 +31970,18 @@ function A1(r) {
t.isLeaf = !0;
return t.length = t.min.distanceTo(t.max), t;
}, e.splitBoxInto8 = function(t) {
- const i = t.min, s = t.max, n = new w().addVectors(i, s).multiplyScalar(0.5), a = [];
+ const i = t.min, s = t.max, r = new w().addVectors(i, s).multiplyScalar(0.5), a = [];
for (let o = 0; o < 2; o++)
for (let l = 0; l < 2; l++)
for (let c = 0; c < 2; c++) {
const h = new w(
- o === 0 ? i.x : n.x,
- l === 0 ? i.y : n.y,
- c === 0 ? i.z : n.z
+ o === 0 ? i.x : r.x,
+ l === 0 ? i.y : r.y,
+ c === 0 ? i.z : r.z
), u = new w(
- o === 1 ? s.x : n.x,
- l === 1 ? s.y : n.y,
- c === 1 ? s.z : n.z
+ o === 1 ? s.x : r.x,
+ l === 1 ? s.y : r.y,
+ c === 1 ? s.z : r.z
), d = new Lt(h, u);
a.push(d);
}
@@ -31923,19 +31991,19 @@ function A1(r) {
i.x - t.radius * 0.5,
i.y - t.radius * 0.5,
i.z - t.radius * 0.5
- ), n = new w(
+ ), r = new w(
i.x + t.radius * 0.5,
i.y + t.radius * 0.5,
i.z + t.radius * 0.5
);
return {
min: s,
- max: n
+ max: r
};
}, e.getBoundingBox = function() {
- let t = r.models, i = new w(1e8, 1e9, 1e10), s = new w(-1e8, -1e9, -1e10);
- return t.forEach((n) => {
- n.children.forEach((a) => {
+ let t = n.models, i = new w(1e8, 1e9, 1e10), s = new w(-1e8, -1e9, -1e10);
+ return t.forEach((r) => {
+ r.children.forEach((a) => {
a.geometry.computeBoundingBox();
let o = a.geometry.boundingBox.min, l = a.geometry.boundingBox.max;
o.x < i.x && (i.x = o.x), o.y < i.y && (i.y = o.y), o.z < i.z && (i.z = o.z), l.x > s.x && (s.x = l.x), l.y > s.y && (s.y = l.y), l.z > s.z && (s.z = l.z);
@@ -31948,223 +32016,223 @@ function A1(r) {
}
var Ws = Object.freeze({
Linear: Object.freeze({
- None: function(r) {
- return r;
+ None: function(n) {
+ return n;
},
- In: function(r) {
- return r;
+ In: function(n) {
+ return n;
},
- Out: function(r) {
- return r;
+ Out: function(n) {
+ return n;
},
- InOut: function(r) {
- return r;
+ InOut: function(n) {
+ return n;
}
}),
Quadratic: Object.freeze({
- In: function(r) {
- return r * r;
+ In: function(n) {
+ return n * n;
},
- Out: function(r) {
- return r * (2 - r);
+ Out: function(n) {
+ return n * (2 - n);
},
- InOut: function(r) {
- return (r *= 2) < 1 ? 0.5 * r * r : -0.5 * (--r * (r - 2) - 1);
+ InOut: function(n) {
+ return (n *= 2) < 1 ? 0.5 * n * n : -0.5 * (--n * (n - 2) - 1);
}
}),
Cubic: Object.freeze({
- In: function(r) {
- return r * r * r;
+ In: function(n) {
+ return n * n * n;
},
- Out: function(r) {
- return --r * r * r + 1;
+ Out: function(n) {
+ return --n * n * n + 1;
},
- InOut: function(r) {
- return (r *= 2) < 1 ? 0.5 * r * r * r : 0.5 * ((r -= 2) * r * r + 2);
+ InOut: function(n) {
+ return (n *= 2) < 1 ? 0.5 * n * n * n : 0.5 * ((n -= 2) * n * n + 2);
}
}),
Quartic: Object.freeze({
- In: function(r) {
- return r * r * r * r;
+ In: function(n) {
+ return n * n * n * n;
},
- Out: function(r) {
- return 1 - --r * r * r * r;
+ Out: function(n) {
+ return 1 - --n * n * n * n;
},
- InOut: function(r) {
- return (r *= 2) < 1 ? 0.5 * r * r * r * r : -0.5 * ((r -= 2) * r * r * r - 2);
+ InOut: function(n) {
+ return (n *= 2) < 1 ? 0.5 * n * n * n * n : -0.5 * ((n -= 2) * n * n * n - 2);
}
}),
Quintic: Object.freeze({
- In: function(r) {
- return r * r * r * r * r;
+ In: function(n) {
+ return n * n * n * n * n;
},
- Out: function(r) {
- return --r * r * r * r * r + 1;
+ Out: function(n) {
+ return --n * n * n * n * n + 1;
},
- InOut: function(r) {
- return (r *= 2) < 1 ? 0.5 * r * r * r * r * r : 0.5 * ((r -= 2) * r * r * r * r + 2);
+ InOut: function(n) {
+ return (n *= 2) < 1 ? 0.5 * n * n * n * n * n : 0.5 * ((n -= 2) * n * n * n * n + 2);
}
}),
Sinusoidal: Object.freeze({
- In: function(r) {
- return 1 - Math.sin((1 - r) * Math.PI / 2);
+ In: function(n) {
+ return 1 - Math.sin((1 - n) * Math.PI / 2);
},
- Out: function(r) {
- return Math.sin(r * Math.PI / 2);
+ Out: function(n) {
+ return Math.sin(n * Math.PI / 2);
},
- InOut: function(r) {
- return 0.5 * (1 - Math.sin(Math.PI * (0.5 - r)));
+ InOut: function(n) {
+ return 0.5 * (1 - Math.sin(Math.PI * (0.5 - n)));
}
}),
Exponential: Object.freeze({
- In: function(r) {
- return r === 0 ? 0 : Math.pow(1024, r - 1);
+ In: function(n) {
+ return n === 0 ? 0 : Math.pow(1024, n - 1);
},
- Out: function(r) {
- return r === 1 ? 1 : 1 - Math.pow(2, -10 * r);
+ Out: function(n) {
+ return n === 1 ? 1 : 1 - Math.pow(2, -10 * n);
},
- InOut: function(r) {
- return r === 0 ? 0 : r === 1 ? 1 : (r *= 2) < 1 ? 0.5 * Math.pow(1024, r - 1) : 0.5 * (-Math.pow(2, -10 * (r - 1)) + 2);
+ InOut: function(n) {
+ return n === 0 ? 0 : n === 1 ? 1 : (n *= 2) < 1 ? 0.5 * Math.pow(1024, n - 1) : 0.5 * (-Math.pow(2, -10 * (n - 1)) + 2);
}
}),
Circular: Object.freeze({
- In: function(r) {
- return 1 - Math.sqrt(1 - r * r);
+ In: function(n) {
+ return 1 - Math.sqrt(1 - n * n);
},
- Out: function(r) {
- return Math.sqrt(1 - --r * r);
+ Out: function(n) {
+ return Math.sqrt(1 - --n * n);
},
- InOut: function(r) {
- return (r *= 2) < 1 ? -0.5 * (Math.sqrt(1 - r * r) - 1) : 0.5 * (Math.sqrt(1 - (r -= 2) * r) + 1);
+ InOut: function(n) {
+ return (n *= 2) < 1 ? -0.5 * (Math.sqrt(1 - n * n) - 1) : 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);
}
}),
Elastic: Object.freeze({
- In: function(r) {
- return r === 0 ? 0 : r === 1 ? 1 : -Math.pow(2, 10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI);
+ In: function(n) {
+ return n === 0 ? 0 : n === 1 ? 1 : -Math.pow(2, 10 * (n - 1)) * Math.sin((n - 1.1) * 5 * Math.PI);
},
- Out: function(r) {
- return r === 0 ? 0 : r === 1 ? 1 : Math.pow(2, -10 * r) * Math.sin((r - 0.1) * 5 * Math.PI) + 1;
+ Out: function(n) {
+ return n === 0 ? 0 : n === 1 ? 1 : Math.pow(2, -10 * n) * Math.sin((n - 0.1) * 5 * Math.PI) + 1;
},
- InOut: function(r) {
- return r === 0 ? 0 : r === 1 ? 1 : (r *= 2, r < 1 ? -0.5 * Math.pow(2, 10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI) : 0.5 * Math.pow(2, -10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI) + 1);
+ InOut: function(n) {
+ return n === 0 ? 0 : n === 1 ? 1 : (n *= 2, n < 1 ? -0.5 * Math.pow(2, 10 * (n - 1)) * Math.sin((n - 1.1) * 5 * Math.PI) : 0.5 * Math.pow(2, -10 * (n - 1)) * Math.sin((n - 1.1) * 5 * Math.PI) + 1);
}
}),
Back: Object.freeze({
- In: function(r) {
+ In: function(n) {
var e = 1.70158;
- return r === 1 ? 1 : r * r * ((e + 1) * r - e);
+ return n === 1 ? 1 : n * n * ((e + 1) * n - e);
},
- Out: function(r) {
+ Out: function(n) {
var e = 1.70158;
- return r === 0 ? 0 : --r * r * ((e + 1) * r + e) + 1;
+ return n === 0 ? 0 : --n * n * ((e + 1) * n + e) + 1;
},
- InOut: function(r) {
+ InOut: function(n) {
var e = 2.5949095;
- return (r *= 2) < 1 ? 0.5 * (r * r * ((e + 1) * r - e)) : 0.5 * ((r -= 2) * r * ((e + 1) * r + e) + 2);
+ return (n *= 2) < 1 ? 0.5 * (n * n * ((e + 1) * n - e)) : 0.5 * ((n -= 2) * n * ((e + 1) * n + e) + 2);
}
}),
Bounce: Object.freeze({
- In: function(r) {
- return 1 - Ws.Bounce.Out(1 - r);
+ In: function(n) {
+ return 1 - Ws.Bounce.Out(1 - n);
},
- Out: function(r) {
- return r < 1 / 2.75 ? 7.5625 * r * r : r < 2 / 2.75 ? 7.5625 * (r -= 1.5 / 2.75) * r + 0.75 : r < 2.5 / 2.75 ? 7.5625 * (r -= 2.25 / 2.75) * r + 0.9375 : 7.5625 * (r -= 2.625 / 2.75) * r + 0.984375;
+ Out: function(n) {
+ return n < 1 / 2.75 ? 7.5625 * n * n : n < 2 / 2.75 ? 7.5625 * (n -= 1.5 / 2.75) * n + 0.75 : n < 2.5 / 2.75 ? 7.5625 * (n -= 2.25 / 2.75) * n + 0.9375 : 7.5625 * (n -= 2.625 / 2.75) * n + 0.984375;
},
- InOut: function(r) {
- return r < 0.5 ? Ws.Bounce.In(r * 2) * 0.5 : Ws.Bounce.Out(r * 2 - 1) * 0.5 + 0.5;
+ InOut: function(n) {
+ return n < 0.5 ? Ws.Bounce.In(n * 2) * 0.5 : Ws.Bounce.Out(n * 2 - 1) * 0.5 + 0.5;
}
}),
- generatePow: function(r) {
- return r === void 0 && (r = 4), r = r < Number.EPSILON ? Number.EPSILON : r, r = r > 1e4 ? 1e4 : r, {
+ generatePow: function(n) {
+ return n === void 0 && (n = 4), n = n < Number.EPSILON ? Number.EPSILON : n, n = n > 1e4 ? 1e4 : n, {
In: function(e) {
- return Math.pow(e, r);
+ return Math.pow(e, n);
},
Out: function(e) {
- return 1 - Math.pow(1 - e, r);
+ return 1 - Math.pow(1 - e, n);
},
InOut: function(e) {
- return e < 0.5 ? Math.pow(e * 2, r) / 2 : (1 - Math.pow(2 - e * 2, r)) / 2 + 0.5;
+ return e < 0.5 ? Math.pow(e * 2, n) / 2 : (1 - Math.pow(2 - e * 2, n)) / 2 + 0.5;
}
};
}
-}), br = function() {
+}), Mn = function() {
return performance.now();
}, R1 = (
/** @class */
(function() {
- function r() {
+ function n() {
this._tweens = {}, this._tweensAddedDuringUpdate = {};
}
- return r.prototype.getAll = function() {
+ return n.prototype.getAll = function() {
var e = this;
return Object.keys(this._tweens).map(function(t) {
return e._tweens[t];
});
- }, r.prototype.removeAll = function() {
+ }, n.prototype.removeAll = function() {
this._tweens = {};
- }, r.prototype.add = function(e) {
+ }, n.prototype.add = function(e) {
this._tweens[e.getId()] = e, this._tweensAddedDuringUpdate[e.getId()] = e;
- }, r.prototype.remove = function(e) {
+ }, n.prototype.remove = function(e) {
delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()];
- }, r.prototype.update = function(e, t) {
- e === void 0 && (e = br()), t === void 0 && (t = !1);
+ }, n.prototype.update = function(e, t) {
+ e === void 0 && (e = Mn()), t === void 0 && (t = !1);
var i = Object.keys(this._tweens);
if (i.length === 0)
return !1;
for (; i.length > 0; ) {
this._tweensAddedDuringUpdate = {};
for (var s = 0; s < i.length; s++) {
- var n = this._tweens[i[s]], a = !t;
- n && n.update(e, a) === !1 && !t && delete this._tweens[i[s]];
+ var r = this._tweens[i[s]], a = !t;
+ r && r.update(e, a) === !1 && !t && delete this._tweens[i[s]];
}
i = Object.keys(this._tweensAddedDuringUpdate);
}
return !0;
- }, r;
+ }, n;
})()
), wo = {
- Linear: function(r, e) {
- var t = r.length - 1, i = t * e, s = Math.floor(i), n = wo.Utils.Linear;
- return e < 0 ? n(r[0], r[1], i) : e > 1 ? n(r[t], r[t - 1], t - i) : n(r[s], r[s + 1 > t ? t : s + 1], i - s);
+ Linear: function(n, e) {
+ var t = n.length - 1, i = t * e, s = Math.floor(i), r = wo.Utils.Linear;
+ return e < 0 ? r(n[0], n[1], i) : e > 1 ? r(n[t], n[t - 1], t - i) : r(n[s], n[s + 1 > t ? t : s + 1], i - s);
},
Utils: {
- Linear: function(r, e, t) {
- return (e - r) * t + r;
+ Linear: function(n, e, t) {
+ return (e - n) * t + n;
}
}
}, zh = (
/** @class */
(function() {
- function r() {
+ function n() {
}
- return r.nextId = function() {
- return r._nextId++;
- }, r._nextId = 0, r;
+ return n.nextId = function() {
+ return n._nextId++;
+ }, n._nextId = 0, n;
})()
), Co = new R1(), P1 = (
/** @class */
(function() {
- function r(e, t) {
+ function n(e, t) {
t === void 0 && (t = Co), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Ws.Linear.None, this._interpolationFunction = wo.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = zh.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
}
- return r.prototype.getId = function() {
+ return n.prototype.getId = function() {
return this._id;
- }, r.prototype.isPlaying = function() {
+ }, n.prototype.isPlaying = function() {
return this._isPlaying;
- }, r.prototype.isPaused = function() {
+ }, n.prototype.isPaused = function() {
return this._isPaused;
- }, r.prototype.getDuration = function() {
+ }, n.prototype.getDuration = function() {
return this._duration;
- }, r.prototype.to = function(e, t) {
+ }, n.prototype.to = function(e, t) {
if (t === void 0 && (t = 1e3), this._isPlaying)
throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
return this._valuesEnd = e, this._propertiesAreSetUp = !1, this._duration = t < 0 ? 0 : t, this;
- }, r.prototype.duration = function(e) {
+ }, n.prototype.duration = function(e) {
return e === void 0 && (e = 1e3), this._duration = e < 0 ? 0 : e, this;
- }, r.prototype.dynamic = function(e) {
+ }, n.prototype.dynamic = function(e) {
return e === void 0 && (e = !1), this._isDynamic = e, this;
- }, r.prototype.start = function(e, t) {
- if (e === void 0 && (e = br()), t === void 0 && (t = !1), this._isPlaying)
+ }, n.prototype.start = function(e, t) {
+ if (e === void 0 && (e = Mn()), t === void 0 && (t = !1), this._isPlaying)
return this;
if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) {
this._reversed = !1;
@@ -32174,16 +32242,16 @@ var Ws = Object.freeze({
if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e, this._startTime += this._delayTime, !this._propertiesAreSetUp || t) {
if (this._propertiesAreSetUp = !0, !this._isDynamic) {
var s = {};
- for (var n in this._valuesEnd)
- s[n] = this._valuesEnd[n];
+ for (var r in this._valuesEnd)
+ s[r] = this._valuesEnd[r];
this._valuesEnd = s;
}
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, t);
}
return this;
- }, r.prototype.startFromCurrentValues = function(e) {
+ }, n.prototype.startFromCurrentValues = function(e) {
return this.start(e, !0);
- }, r.prototype._setupProperties = function(e, t, i, s, n) {
+ }, n.prototype._setupProperties = function(e, t, i, s, r) {
for (var a in i) {
var o = e[a], l = Array.isArray(o), c = l ? "array" : typeof o, h = !l && Array.isArray(i[a]);
if (!(c === "undefined" || c === "function")) {
@@ -32209,63 +32277,63 @@ var Ws = Object.freeze({
s[a] = l ? [] : {};
var u = i[a];
if (!this._isDynamic) {
- var y = {};
+ var b = {};
for (var p in u)
- y[p] = u[p];
- i[a] = u = y;
+ b[p] = u[p];
+ i[a] = u = b;
}
- this._setupProperties(f, t[a], u, s[a], n);
+ this._setupProperties(f, t[a], u, s[a], r);
} else
- (typeof t[a] > "u" || n) && (t[a] = o), l || (t[a] *= 1), h ? s[a] = i[a].slice().reverse() : s[a] = t[a] || 0;
+ (typeof t[a] > "u" || r) && (t[a] = o), l || (t[a] *= 1), h ? s[a] = i[a].slice().reverse() : s[a] = t[a] || 0;
}
}
- }, r.prototype.stop = function() {
+ }, n.prototype.stop = function() {
return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
- }, r.prototype.end = function() {
+ }, n.prototype.end = function() {
return this._goToEnd = !0, this.update(1 / 0), this;
- }, r.prototype.pause = function(e) {
- return e === void 0 && (e = br()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
- }, r.prototype.resume = function(e) {
- return e === void 0 && (e = br()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
- }, r.prototype.stopChainedTweens = function() {
+ }, n.prototype.pause = function(e) {
+ return e === void 0 && (e = Mn()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
+ }, n.prototype.resume = function(e) {
+ return e === void 0 && (e = Mn()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
+ }, n.prototype.stopChainedTweens = function() {
for (var e = 0, t = this._chainedTweens.length; e < t; e++)
this._chainedTweens[e].stop();
return this;
- }, r.prototype.group = function(e) {
+ }, n.prototype.group = function(e) {
return e === void 0 && (e = Co), this._group = e, this;
- }, r.prototype.delay = function(e) {
+ }, n.prototype.delay = function(e) {
return e === void 0 && (e = 0), this._delayTime = e, this;
- }, r.prototype.repeat = function(e) {
+ }, n.prototype.repeat = function(e) {
return e === void 0 && (e = 0), this._initialRepeat = e, this._repeat = e, this;
- }, r.prototype.repeatDelay = function(e) {
+ }, n.prototype.repeatDelay = function(e) {
return this._repeatDelayTime = e, this;
- }, r.prototype.yoyo = function(e) {
+ }, n.prototype.yoyo = function(e) {
return e === void 0 && (e = !1), this._yoyo = e, this;
- }, r.prototype.easing = function(e) {
+ }, n.prototype.easing = function(e) {
return e === void 0 && (e = Ws.Linear.None), this._easingFunction = e, this;
- }, r.prototype.interpolation = function(e) {
+ }, n.prototype.interpolation = function(e) {
return e === void 0 && (e = wo.Linear), this._interpolationFunction = e, this;
- }, r.prototype.chain = function() {
+ }, n.prototype.chain = function() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
return this._chainedTweens = e, this;
- }, r.prototype.onStart = function(e) {
+ }, n.prototype.onStart = function(e) {
return this._onStartCallback = e, this;
- }, r.prototype.onEveryStart = function(e) {
+ }, n.prototype.onEveryStart = function(e) {
return this._onEveryStartCallback = e, this;
- }, r.prototype.onUpdate = function(e) {
+ }, n.prototype.onUpdate = function(e) {
return this._onUpdateCallback = e, this;
- }, r.prototype.onRepeat = function(e) {
+ }, n.prototype.onRepeat = function(e) {
return this._onRepeatCallback = e, this;
- }, r.prototype.onComplete = function(e) {
+ }, n.prototype.onComplete = function(e) {
return this._onCompleteCallback = e, this;
- }, r.prototype.onStop = function(e) {
+ }, n.prototype.onStop = function(e) {
return this._onStopCallback = e, this;
- }, r.prototype.update = function(e, t) {
+ }, n.prototype.update = function(e, t) {
var i = this, s;
- if (e === void 0 && (e = br()), t === void 0 && (t = !0), this._isPaused)
+ if (e === void 0 && (e = Mn()), t === void 0 && (t = !0), this._isPaused)
return !0;
- var n, a = this._startTime + this._duration;
+ var r, a = this._startTime + this._duration;
if (!this._goToEnd && !this._isPlaying) {
if (e > a)
return !1;
@@ -32277,17 +32345,17 @@ var Ws = Object.freeze({
var o = e - this._startTime, l = this._duration + ((s = this._repeatDelayTime) !== null && s !== void 0 ? s : this._delayTime), c = this._duration + this._repeat * l, h = function() {
if (i._duration === 0 || o > c)
return 1;
- var f = Math.trunc(o / l), p = o - f * l, y = Math.min(p / i._duration, 1);
- return y === 0 && o === i._duration ? 1 : y;
+ var f = Math.trunc(o / l), p = o - f * l, b = Math.min(p / i._duration, 1);
+ return b === 0 && o === i._duration ? 1 : b;
}, u = h(), d = this._easingFunction(u);
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, d), this._onUpdateCallback && this._onUpdateCallback(this._object, u), this._duration === 0 || o >= this._duration)
if (this._repeat > 0) {
var m = Math.min(Math.trunc((o - this._duration) / l) + 1, this._repeat);
isFinite(this._repeat) && (this._repeat -= m);
- for (n in this._valuesStartRepeat)
- !this._yoyo && typeof this._valuesEnd[n] == "string" && (this._valuesStartRepeat[n] = // eslint-disable-next-line
+ for (r in this._valuesStartRepeat)
+ !this._yoyo && typeof this._valuesEnd[r] == "string" && (this._valuesStartRepeat[r] = // eslint-disable-next-line
// @ts-ignore FIXME?
- this._valuesStartRepeat[n] + parseFloat(this._valuesEnd[n])), this._yoyo && this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
+ this._valuesStartRepeat[r] + parseFloat(this._valuesEnd[r])), this._yoyo && this._swapEndStartRepeatValues(r), this._valuesStart[r] = this._valuesStartRepeat[r];
return this._yoyo && (this._reversed = !this._reversed), this._startTime += l * m, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
} else {
this._onCompleteCallback && this._onCompleteCallback(this._object);
@@ -32296,18 +32364,18 @@ var Ws = Object.freeze({
return this._isPlaying = !1, !1;
}
return !0;
- }, r.prototype._updateProperties = function(e, t, i, s) {
- for (var n in i)
- if (t[n] !== void 0) {
- var a = t[n] || 0, o = i[n], l = Array.isArray(e[n]), c = Array.isArray(o), h = !l && c;
- h ? e[n] = this._interpolationFunction(o, s) : typeof o == "object" && o ? this._updateProperties(e[n], a, o, s) : (o = this._handleRelativeValue(a, o), typeof o == "number" && (e[n] = a + (o - a) * s));
+ }, n.prototype._updateProperties = function(e, t, i, s) {
+ for (var r in i)
+ if (t[r] !== void 0) {
+ var a = t[r] || 0, o = i[r], l = Array.isArray(e[r]), c = Array.isArray(o), h = !l && c;
+ h ? e[r] = this._interpolationFunction(o, s) : typeof o == "object" && o ? this._updateProperties(e[r], a, o, s) : (o = this._handleRelativeValue(a, o), typeof o == "number" && (e[r] = a + (o - a) * s));
}
- }, r.prototype._handleRelativeValue = function(e, t) {
+ }, n.prototype._handleRelativeValue = function(e, t) {
return typeof t != "string" ? t : t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t);
- }, r.prototype._swapEndStartRepeatValues = function(e) {
+ }, n.prototype._swapEndStartRepeatValues = function(e) {
var t = this._valuesStartRepeat[e], i = this._valuesEnd[e];
typeof i == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(i) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
- }, r;
+ }, n;
})()
);
zh.nextId;
@@ -32324,19 +32392,19 @@ var wa = {
function L1() {
return new Wo();
}
-function D1(r, e) {
- r.appendChild(e.domElement);
+function D1(n, e) {
+ n.appendChild(e.domElement);
}
-function I1(r, e, t) {
+function I1(n, e, t) {
var i = new Object();
i.visible = !0;
- let s = null, n, a, o = [];
+ let s = null, r, a, o = [];
i.init = function() {
- n || (c(), h(), u());
+ r || (c(), h(), u());
}, i.Hide = function() {
- n.style.display = "none", i.visible = !1;
+ r.style.display = "none", i.visible = !1;
}, i.Show = function() {
- n.style.display = "block", i.visible = !0;
+ r.style.display = "block", i.visible = !0;
}, i.RenderScene = function() {
i.camera.quaternion.copy(e.camera.quaternion);
let g = new w(0, 0, -1).clone().applyMatrix4(e.camera.matrixWorld.clone()), v = e.camera.position.clone().sub(g.clone()).setLength(100);
@@ -32345,27 +32413,27 @@ function I1(r, e, t) {
console.log(g);
var v = new w(0, 0, 0);
g == "top" ? v = new w(0, 1, 0) : g == "down" ? v = new w(0, -1, 0) : g == "front" ? v = new w(0, 0, 1) : g == "left" ? v = new w(-1, 0, 0) : g == "back" ? v = new w(0, 0, -1) : g == "right" ? v = new w(1, 0, 0) : g == "top_front" ? v = new w(1, 1, 0) : g == "top_left" ? v = new w(0, 1, -1) : g == "top_back" ? v = new w(-1, 1, 0) : g == "top_right" ? v = new w(0, 1, 1) : g == "down_front" ? v = new w(1, -1, 0) : g == "down_left" ? v = new w(0, -1, -1) : g == "down_back" ? v = new w(-1, -1, 0) : g == "down_right" ? v = new w(0, -1, 1) : g == "front_right" ? v = new w(1, 0, 1) : g == "right_back" ? v = new w(-1, 0, 1) : g == "back_left" ? v = new w(-1, 0, -1) : g == "left_front" ? v = new w(1, 0, -1) : g == "top_left_front" ? v = new w(1, 1, -1) : g == "top_front_right" ? v = new w(1, 1, 1) : g == "top_right_back" ? v = new w(-1, 1, 1) : g == "top_back_left" ? v = new w(-1, 1, -1) : g == "button_left_front" ? v = new w(1, -1, -1) : g == "button_front_right" ? v = new w(1, -1, 1) : g == "button_right_back" ? v = new w(-1, 1, 1) : g == "button_back_left" && (v = new w(-1, -1, -1));
- var f = r.octreeBox.getBoundingBox(), p = f.min, y = f.max, _ = p.clone().add(y.clone()).multiplyScalar(0.5), E = _.clone().add(v.multiplyScalar(1 * y.distanceTo(p)));
- l(e.camera.position, E, r.controls.target.clone(), _);
+ var f = n.octreeBox.getBoundingBox(), p = f.min, b = f.max, _ = p.clone().add(b.clone()).multiplyScalar(0.5), E = _.clone().add(v.multiplyScalar(1 * b.distanceTo(p)));
+ l(e.camera.position, E, n.controls.target.clone(), _);
}, i.GetCameraPose = function() {
- var g = e.camera.quaternion, v = e.camera.position, f = r.controls.target, p = {
+ var g = e.camera.quaternion, v = e.camera.position, f = n.controls.target, p = {
quaternion: g,
position: v,
target: f
};
return p;
}, i.ReductionCameraPose = function(g, v = 1e3, f) {
- var p = new _i(
+ var p = new xi(
g.quaternion._x,
g.quaternion._y,
g.quaternion._z,
g.quaternion._w
- ), y = new w(g.position.x, g.position.y, g.position.z), _ = new w(g.target.x, g.target.y, g.target.z);
+ ), b = new w(g.position.x, g.position.y, g.position.z), _ = new w(g.target.x, g.target.y, g.target.z);
let E = !1;
l(
e.camera.position,
- y,
- r.controls.target.clone(),
+ b,
+ n.controls.target.clone(),
_,
e.camera.quaternion,
p,
@@ -32377,14 +32445,14 @@ function I1(r, e, t) {
E || (f(!0), E = !0);
}, v + 10);
}, i.CameraGoHome = function() {
- var g = r.octreeBox.getBoundingBox(), v = g.min.clone().add(g.max.clone()).multiplyScalar(0.5);
+ var g = n.octreeBox.getBoundingBox(), v = g.min.clone().add(g.max.clone()).multiplyScalar(0.5);
let f = new w(1, 1, 1);
var p = v.clone().add(f.multiplyScalar(1 * g.max.distanceTo(g.min)));
- l(e.camera.position, p, r.controls.target.clone(), v);
+ l(e.camera.position, p, n.controls.target.clone(), v);
};
- function l(g, v, f, p, y, _, E = 1e3, R) {
+ function l(g, v, f, p, b, _, E = 1e3, R) {
var T;
- y && _ ? (T = new wa.Tween({
+ b && _ ? (T = new wa.Tween({
x1: g.x,
// 相机当前位置x
y1: g.y,
@@ -32397,13 +32465,13 @@ function I1(r, e, t) {
// 控制当前的中心点y
z2: f.z,
// 控制当前的中心点z
- _x: y._x,
+ _x: b._x,
// 相机当前quaternion
- _y: y._y,
+ _y: b._y,
// 相机当前quaternion
- _z: y._z,
+ _z: b._z,
// 相机当前quaternion
- _w: y._w
+ _w: b._w
// 相机当前quaternion
}), T.to(
{
@@ -32459,9 +32527,9 @@ function I1(r, e, t) {
},
E
)), T.onUpdate(function(I) {
- y && _ ? (e.camera.quaternion._x = I._x, e.camera.quaternion._y = I._y, e.camera.quaternion._z = I._z, e.camera.quaternion._w = I._w) : r.controls.auto = !0, e.camera.position.x = I.x1, e.camera.position.y = I.y1, e.camera.position.z = I.z1, r.controls.target.x = I.x2, r.controls.target.y = I.y2, r.controls.target.z = I.z2, r.controls.update(), i.RenderScene();
+ b && _ ? (e.camera.quaternion._x = I._x, e.camera.quaternion._y = I._y, e.camera.quaternion._z = I._z, e.camera.quaternion._w = I._w) : n.controls.auto = !0, e.camera.position.x = I.x1, e.camera.position.y = I.y1, e.camera.position.z = I.z1, n.controls.target.x = I.x2, n.controls.target.y = I.y2, n.controls.target.z = I.z2, n.controls.update(), i.RenderScene();
}), T.onComplete(function(I) {
- r.controls.auto = !1, i.RenderScene(), R && R(!0), cancelAnimationFrame(s), s = null;
+ n.controls.auto = !1, i.RenderScene(), R && R(!0), cancelAnimationFrame(s), s = null;
}), T.easing(wa.Easing.Cubic.InOut);
function A(I) {
s = requestAnimationFrame(A), T.update();
@@ -32469,7 +32537,7 @@ function I1(r, e, t) {
T.start(), A();
}
function c() {
- n = document.createElement("div"), n.className = "ViewCube", t.appendChild(n), a = document.createElement("div"), a.className = "ViewAttr", t.appendChild(a);
+ r = document.createElement("div"), r.className = "ViewCube", t.appendChild(r), a = document.createElement("div"), a.className = "ViewAttr", t.appendChild(a);
}
function h() {
i.sceneOrtho = L1();
@@ -32482,12 +32550,12 @@ function I1(r, e, t) {
0.01,
1e4
);
- var f = n.clientWidth, p = n.clientHeight, y = new Ln({
+ var f = r.clientWidth, p = r.clientHeight, b = new Lr({
alpha: !0
});
- y.setSize(f, p), y.setClearAlpha(0), i.sceneOrtho.renderer = y;
+ b.setSize(f, p), b.setClearAlpha(0), i.sceneOrtho.renderer = b;
let _ = new Ah(16777215, 0.8);
- i.sceneOrtho.add(_), D1(n, y);
+ i.sceneOrtho.add(_), D1(r, b);
}
function u() {
let g = [
@@ -32519,7 +32587,7 @@ function I1(r, e, t) {
var v = [];
for (const p of g)
v.push(
- new zt({
+ new Ht({
color: 16777215,
map: new wh().load(p.icon)
})
@@ -32527,19 +32595,19 @@ function I1(r, e, t) {
new Hd({
color: 255
});
- var f = new at(new vs(110, 110, 110), v);
- i.sceneOrtho.add(f), d(122), n.addEventListener("mousedown", (p) => {
- var y = {};
- y.x = p.offsetX / n.clientWidth * 2 - 1, y.y = -(p.offsetY / n.clientHeight) * 2 + 1;
+ var f = new ot(new vs(110, 110, 110), v);
+ i.sceneOrtho.add(f), d(122), r.addEventListener("mousedown", (p) => {
+ var b = {};
+ b.x = p.offsetX / r.clientWidth * 2 - 1, b.y = -(p.offsetY / r.clientHeight) * 2 + 1;
var _ = new ic();
- _.setFromCamera(y, i.camera);
+ _.setFromCamera(b, i.camera);
const E = _.intersectObjects(o, !1);
E.length > 0 && i.ToggleDirectionView(E[0].object.name);
- }), n.addEventListener("mousemove", (p) => {
- var y = {};
- y.x = p.offsetX / n.clientWidth * 2 - 1, y.y = -(p.offsetY / n.clientHeight) * 2 + 1;
+ }), r.addEventListener("mousemove", (p) => {
+ var b = {};
+ b.x = p.offsetX / r.clientWidth * 2 - 1, b.y = -(p.offsetY / r.clientHeight) * 2 + 1;
var _ = new ic();
- _.setFromCamera(y, i.camera);
+ _.setFromCamera(b, i.camera);
const E = _.intersectObjects(o, !1);
for (var R of o)
R.material.opacity = 0.01;
@@ -32647,7 +32715,7 @@ function I1(r, e, t) {
c: 30,
point: new w(v, -v, -v)
}
- ], y = [
+ ], b = [
{
name: "top_front",
a: 30,
@@ -32736,21 +32804,21 @@ function I1(r, e, t) {
o.push(m(f[_]));
for (var _ = 0; _ < p.length; _++)
o.push(m(p[_]));
- for (var _ = 0; _ < y.length; _++)
- o.push(m(y[_]));
+ for (var _ = 0; _ < b.length; _++)
+ o.push(m(b[_]));
}
function m(g) {
- const v = new vs(g.a, g.b, g.c), f = new zt({
+ const v = new vs(g.a, g.b, g.c), f = new Ht({
color: "blue",
transparent: !0,
opacity: 0.01
}), p = new Ne().makeTranslation(g.point.x, g.point.y, g.point.z);
- let y = v.applyMatrix4(p), _ = new at(y, f);
+ let b = v.applyMatrix4(p), _ = new ot(b, f);
return _.name = g.name, i.sceneOrtho.add(_), _;
}
return i;
}
-class Fc {
+class kc {
constructor(e, t) {
this.object = e, this.id = t;
}
@@ -32778,144 +32846,144 @@ class Fc {
}
}
let U1 = class {
- constructor(r, e, t) {
- this.manager = r, this.scene = e, this.clippingManager = t;
+ constructor(n, e, t) {
+ this.manager = n, this.scene = e, this.clippingManager = t;
}
models = /* @__PURE__ */ new Map();
- async loadModel(r, e) {
- const t = await this.manager.loadGLTF(r), i = e?.id || t.uuid;
+ async loadModel(n, e) {
+ const t = await this.manager.loadGLTF(n), i = e?.id || t.uuid;
t.name = i, e?.position && t.position.fromArray(e.position), e?.scale && t.scale.fromArray(e.scale), e?.rotation && t.rotation.setFromVector3(new w(...e.rotation));
- const s = new Fc(t, i);
+ const s = new kc(t, i);
return this.models.set(i, s), this.clippingManager?.refresh(), s;
}
- unloadModel(r) {
- const e = this.models.get(r);
- e && e instanceof Fc && (this.scene.remove(e.object), this.models.delete(r));
+ unloadModel(n) {
+ const e = this.models.get(n);
+ e && e instanceof kc && (this.scene.remove(e.object), this.models.delete(n));
}
getAllModels() {
return Array.from(this.models.values());
}
- getModel(r) {
- return this.models.get(r);
+ getModel(n) {
+ return this.models.get(n);
}
}, N1 = class {
- constructor(r) {
- this.manager = r;
+ constructor(n) {
+ this.manager = n;
}
- setView(r, e) {
- this.manager.setView(r);
+ setView(n, e) {
+ this.manager.setView(n);
}
- fitToView(r, e) {
+ fitToView(n, e) {
console.log("[V1] fitToView not fully implemented in manager, resetting camera"), this.manager.camera.position.set(20, 20, 20), this.manager.camera.lookAt(0, 0, 0), this.manager.controls.update();
}
- goHome(r) {
+ goHome(n) {
this.manager.camera.position.set(20, 20, 20), this.manager.camera.lookAt(0, 0, 0), this.manager.controls.update();
}
- setProjection(r) {
+ setProjection(n) {
console.warn("[V1] Projection switching not supported in V1 CameraManager");
}
- setNavigationMode(r) {
- r === Dn.PanOnly ? this.manager.controls.enableRotate = !1 : this.manager.controls.enableRotate = !0;
+ setNavigationMode(n) {
+ n === Dr.PanOnly ? this.manager.controls.enableRotate = !1 : this.manager.controls.enableRotate = !0;
}
getState() {
return {
position: this.manager.camera.position.toArray(),
target: this.manager.controls.target.toArray(),
up: this.manager.camera.up.toArray(),
- projection: Fs.Perspective
+ projection: ks.Perspective
};
}
- restoreState(r, e) {
- this.manager.camera.position.fromArray(r.position), this.manager.camera.up.fromArray(r.up), this.manager.controls.target.fromArray(r.target), this.manager.controls.update();
+ restoreState(n, e) {
+ this.manager.camera.position.fromArray(n.position), this.manager.camera.up.fromArray(n.up), this.manager.controls.target.fromArray(n.target), this.manager.controls.update();
}
-}, O1 = class {
- constructor(r, e) {
- this.manager = r, this.scene = e;
+}, B1 = class {
+ constructor(n, e) {
+ this.manager = n, this.scene = e;
}
getSelection() {
return console.warn("[V1] getSelection not fully supported by InteractionManager"), [];
}
- select(r) {
+ select(n) {
const e = [];
this.scene.traverse((t) => {
- t instanceof at && r.includes(t.name) && e.push(t);
+ t instanceof ot && n.includes(t.name) && e.push(t);
}), this.manager.highlight(e);
}
- addSelection(r) {
- this.select(r);
+ addSelection(n) {
+ this.select(n);
}
- removeSelection(r) {
+ removeSelection(n) {
this.manager.clearHighlight();
}
clearSelection() {
this.manager.clearHighlight();
}
getHiddenComponents() {
- const r = [];
+ const n = [];
return this.scene.traverse((e) => {
- e.visible || r.push(e.name);
- }), r;
+ e.visible || n.push(e.name);
+ }), n;
}
- setVisibility(r, e) {
- this.manager.setVisibility(r, e);
+ setVisibility(n, e) {
+ this.manager.setVisibility(n, e);
}
- isolate(r) {
- this.scene.traverse((e) => e.visible = !1), this.setVisibility(r, !0);
+ isolate(n) {
+ this.scene.traverse((e) => e.visible = !1), this.setVisibility(n, !0);
}
clearIsolation() {
- this.scene.traverse((r) => r.visible = !0);
+ this.scene.traverse((n) => n.visible = !0);
}
- setColor(r, e) {
+ setColor(n, e) {
console.warn("[V1] setColor not implemented");
}
- restoreColor(r) {
+ restoreColor(n) {
console.warn("[V1] restoreColor not implemented");
}
- setOpacity(r, e) {
+ setOpacity(n, e) {
console.warn("[V1] setOpacity not implemented");
}
- restoreOpacity(r) {
+ restoreOpacity(n) {
console.warn("[V1] restoreOpacity not implemented");
}
clearAllOverrides() {
}
- getBoundingBox(r) {
+ getBoundingBox(n) {
let e;
if (this.scene.traverse((t) => {
- t.name === r && (e = t);
+ t.name === n && (e = t);
}), e) {
const t = new Lt().setFromObject(e);
return { min: t.min, max: t.max };
}
return { min: { x: 0, y: 0, z: 0 }, max: { x: 0, y: 0, z: 0 } };
}
-}, B1 = class {
- constructor(r, e) {
- this.sceneManager = r, this.renderer = e;
+}, O1 = class {
+ constructor(n, e) {
+ this.sceneManager = n, this.renderer = e;
}
- setBackgroundColor(r) {
- this.sceneManager.setBackground(r);
+ setBackgroundColor(n) {
+ this.sceneManager.setBackground(n);
}
- setSkybox(r) {
- const e = new Eh().load(r);
+ setSkybox(n) {
+ const e = new Eh().load(n);
this.sceneManager.scene.background = e;
}
- enableShadows(r) {
+ enableShadows(n) {
}
- enableAntialiasing(r) {
+ enableAntialiasing(n) {
}
- enableAmbientOcclusion(r) {
+ enableAmbientOcclusion(n) {
}
- addSectionPlane(r, e) {
+ addSectionPlane(n, e) {
return "";
}
- removeSectionPlane(r) {
+ removeSectionPlane(n) {
}
clearSectionPlanes() {
}
- enableSectioning(r) {
+ enableSectioning(n) {
}
- captureScreen(r, e) {
+ captureScreen(n, e) {
return this.renderer.domElement.toDataURL();
}
getViewerConfig() {
@@ -32926,7 +32994,7 @@ let U1 = class {
};
}
getRenderStatistics() {
- const r = this.renderer.info || {}, e = r.render || {}, t = r.memory || {};
+ const n = this.renderer.info || {}, e = n.render || {}, t = n.memory || {};
return {
calls: e.calls || 0,
triangles: e.triangles || 0,
@@ -32938,22 +33006,22 @@ let U1 = class {
}
};
}
-}, F1 = class {
- async getProperties(r) {
+}, k1 = class {
+ async getProperties(n) {
return [
{
name: "Identity Data",
properties: [
- { name: "Element ID", value: r },
+ { name: "Element ID", value: n },
{ name: "Version", value: "V1 Engine" }
]
}
];
}
- async getPropertyValue(r, e) {
+ async getPropertyValue(n, e) {
return "Unknown";
}
- async getModelTree(r) {
+ async getModelTree(n) {
return [
{
id: "root",
@@ -32963,14 +33031,14 @@ let U1 = class {
}
];
}
- async search(r) {
+ async search(n) {
return [];
}
-}, k1 = class {
+}, F1 = class {
activeTool = null;
tools = /* @__PURE__ */ new Map();
- activate(r, e) {
- console.log(`[V1] Activating tool: ${r}`, e), this.activeTool = r;
+ activate(n, e) {
+ console.log(`[V1] Activating tool: ${n}`, e), this.activeTool = n;
}
deactivate() {
this.activeTool && (console.log(`[V1] Deactivating tool: ${this.activeTool}`), this.activeTool = null);
@@ -32978,25 +33046,25 @@ let U1 = class {
getActiveTool() {
return this.activeTool;
}
- registerTool(r, e) {
- this.tools.set(r, e);
+ registerTool(n, e) {
+ this.tools.set(n, e);
}
}, z1 = class {
listeners = /* @__PURE__ */ new Map();
- on(r, e) {
- this.listeners.has(r) || this.listeners.set(r, []), this.listeners.get(r).push(e);
+ on(n, e) {
+ this.listeners.has(n) || this.listeners.set(n, []), this.listeners.get(n).push(e);
}
- off(r, e) {
- if (!this.listeners.has(r)) return;
- const t = this.listeners.get(r), i = t.indexOf(e);
+ off(n, e) {
+ if (!this.listeners.has(n)) return;
+ const t = this.listeners.get(n), i = t.indexOf(e);
i !== -1 && t.splice(i, 1);
}
- trigger(r, e) {
- this.listeners.has(r) && this.listeners.get(r).forEach((t) => {
+ trigger(n, e) {
+ this.listeners.has(n) && this.listeners.get(n).forEach((t) => {
try {
t(e);
} catch (i) {
- console.error(`Error in event listener for ${r}:`, i);
+ console.error(`Error in event listener for ${n}:`, i);
}
});
}
@@ -33033,16 +33101,16 @@ let U1 = class {
controls;
measure;
animationId = null;
- constructor(r) {
- const e = document.getElementById(r.containerId);
- if (!e) throw new Error(`Container ${r.containerId} not found`);
- this.container = e, this.models = [], this.engineState = new C1(), this.sceneManager = new Cv(r);
+ constructor(n) {
+ const e = document.getElementById(n.containerId);
+ if (!e) throw new Error(`Container ${n.containerId} not found`);
+ this.container = e, this.models = [], this.engineState = new C1(), this.sceneManager = new Cv(n);
const { width: t, height: i } = this.getContainerSize();
this.cameraManager = new Hv(this.container, t, i, this.engineState);
try {
- this.renderer = new Ln({ antialias: r.antialias ?? !0 }), console.log("Engine: Using WebGPURenderer");
+ this.renderer = new Lr({ antialias: n.antialias ?? !0 }), console.log("Engine: Using WebGPURenderer");
} catch (s) {
- console.warn("WebGPURenderer failed", s), this.renderer = new Ln({ antialias: r.antialias ?? !0 });
+ console.warn("WebGPURenderer failed", s), this.renderer = new Lr({ antialias: n.antialias ?? !0 });
}
this.renderer.setSize(t, i), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = jc, this.renderer.toneMapping = Po, this.renderer.toneMappingExposure = 1, this.renderer.localClippingEnabled = !0, this.container.appendChild(this.renderer.domElement), this.loaderManager = new M1(this.sceneManager.scene), this.outlineManager = new T1(
this.sceneManager.scene,
@@ -33062,37 +33130,37 @@ let U1 = class {
this.outlineManager
), this.clippingManager = new w1(this.sceneManager.scene), setTimeout(() => {
this.clippingManager.enable();
- }, 1e3), this.events = new z1(), this.interactionManager.setEventModule(this.events), this.loader = new U1(this.loaderManager, this.sceneManager.scene, this.clippingManager), this.cameraTool = new N1(this.cameraManager), this.components = new O1(this.interactionManager, this.sceneManager.scene), this.viewer = new B1(this.sceneManager, this.renderer), this.data = new F1(), this.tools = new k1(), this.scene = this.sceneManager.scene, this.scene.camera = this.cameraManager.camera, this.camera = this.cameraManager.camera, this.controls = this.cameraManager.controls, this.octreeBox = A1(this), this.viewCube = I1(this, this.scene, this.container), this.viewCube.init(), this.setupVisuals(), this.setupPostProcessing(), r.showStats !== !1 && this.initStats(), this.setupResizeObserver(), this.animate();
+ }, 1e3), this.events = new z1(), this.interactionManager.setEventModule(this.events), this.loader = new U1(this.loaderManager, this.sceneManager.scene, this.clippingManager), this.cameraTool = new N1(this.cameraManager), this.components = new B1(this.interactionManager, this.sceneManager.scene), this.viewer = new O1(this.sceneManager, this.renderer), this.data = new k1(), this.tools = new F1(), this.scene = this.sceneManager.scene, this.scene.camera = this.cameraManager.camera, this.camera = this.cameraManager.camera, this.controls = this.cameraManager.controls, this.octreeBox = A1(this), this.viewCube = I1(this, this.scene, this.container), this.viewCube.init(), this.setupVisuals(), this.setupPostProcessing(), n.showStats !== !1 && this.initStats(), this.setupResizeObserver(), this.animate();
}
initStats() {
this.stats = new wv(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom);
}
- toggleStats(r) {
- r && !this.stats ? this.initStats() : !r && this.stats && (this.container.removeChild(this.stats.dom), this.stats = null);
+ toggleStats(n) {
+ n && !this.stats ? this.initStats() : !n && this.stats && (this.container.removeChild(this.stats.dom), this.stats = null);
}
getVersion() {
return "1.2.0 (WebGPU Experimental)";
}
setupVisuals() {
- const r = this.sceneManager.scene;
- r.children.filter((s) => s instanceof Ur).forEach((s) => r.remove(s));
+ const n = this.sceneManager.scene;
+ n.children.filter((s) => s instanceof Nn).forEach((s) => n.remove(s));
const e = new Ch(16777215, 4.5);
e.position.set(10, 20, 10), e.castShadow = !0, e.shadow.mapSize.width = 4096, e.shadow.mapSize.height = 4096, e.shadow.camera.near = 0.1, e.shadow.camera.far = 500, e.shadow.bias = -5e-5, e.shadow.normalBias = 0.02;
const t = 50;
- e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, r.add(e);
+ e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, n.add(e);
const i = new Ah(4210752, 0.4);
- r.add(i), new lv().load("https://raw.githubusercontent.com/mrdoob/three.js/master/examples/textures/equirectangular/royal_esplanade_1k.hdr", (s) => {
- s.mapping = Tn, r.environment = s, r.environmentIntensity = 1;
+ n.add(i), new lv().load("https://raw.githubusercontent.com/mrdoob/three.js/master/examples/textures/equirectangular/royal_esplanade_1k.hdr", (s) => {
+ s.mapping = Tr, n.environment = s, n.environmentIntensity = 1;
});
}
setupPostProcessing() {
if (!this.renderer) return;
- const { width: r, height: e } = this.getContainerSize(), t = window.devicePixelRatio, i = this.sceneManager.scene, s = this.cameraManager.camera;
- this.composer = new pv(this.renderer), this.composer.setPixelRatio(t), this.composer.setSize(r, e);
- const n = new mv(i, s);
- this.composer.addPass(n);
- const a = new hi(i, s, r, e);
- a.output = hi.OUTPUT.Default, a.blendIntensity = 1, a.updateGtaoMaterial && a.updateGtaoMaterial({
+ const { width: n, height: e } = this.getContainerSize(), t = window.devicePixelRatio, i = this.sceneManager.scene, s = this.cameraManager.camera;
+ this.composer = new pv(this.renderer), this.composer.setPixelRatio(t), this.composer.setSize(n, e);
+ const r = new mv(i, s);
+ this.composer.addPass(r);
+ const a = new ui(i, s, n, e);
+ a.output = ui.OUTPUT.Default, a.blendIntensity = 1, a.updateGtaoMaterial && a.updateGtaoMaterial({
radius: 3,
// 减小半径以获得更紧密、更逼真的接触阴影 (原为 10)
distanceExponent: 1,
@@ -33107,8 +33175,8 @@ let U1 = class {
}), this.composer.addPass(a);
const o = this.outlineManager.getPass();
this.composer.addPass(o);
- const l = new tr(
- new oe(r, e),
+ const l = new tn(
+ new oe(n, e),
0.05,
// 强度
0.1,
@@ -33117,17 +33185,17 @@ let U1 = class {
// 阈值
);
this.composer.addPass(l);
- const c = new yv();
+ const c = new bv();
this.composer.addPass(c);
- const h = new Mo(bv);
- h.material.uniforms.resolution.value.x = 1 / (r * t), h.material.uniforms.resolution.value.y = 1 / (e * t), this.composer.addPass(h);
+ const h = new Mo(yv);
+ h.material.uniforms.resolution.value.x = 1 / (n * t), h.material.uniforms.resolution.value.y = 1 / (e * t), this.composer.addPass(h);
}
resize() {
- const { width: r, height: e } = this.getContainerSize(), t = window.devicePixelRatio;
- if (this.cameraManager.updateAspect(r, e), this.renderer.setSize(r, e), this.renderer.setPixelRatio(t), this.outlineManager && this.outlineManager.resize(r, e), this.composer) {
- this.composer.setPixelRatio(t), this.composer.setSize(r, e);
+ const { width: n, height: e } = this.getContainerSize(), t = window.devicePixelRatio;
+ if (this.cameraManager.updateAspect(n, e), this.renderer.setSize(n, e), this.renderer.setPixelRatio(t), this.outlineManager && this.outlineManager.resize(n, e), this.composer) {
+ this.composer.setPixelRatio(t), this.composer.setSize(n, e);
const i = this.composer.passes.find((s) => s instanceof Mo && s.material.uniforms.resolution);
- i && (i.material.uniforms.resolution.value.x = 1 / (r * t), i.material.uniforms.resolution.value.y = 1 / (e * t));
+ i && (i.material.uniforms.resolution.value.x = 1 / (n * t), i.material.uniforms.resolution.value.y = 1 / (e * t));
}
}
getContainerSize() {
@@ -33148,7 +33216,7 @@ let U1 = class {
this.animationId && cancelAnimationFrame(this.animationId), this.selectionBoxManager && this.selectionBoxManager.dispose(), this.renderer.dispose(), this.container.innerHTML = "";
}
};
-class kc {
+class Fc {
constructor(e, t, i) {
this.object = e, this.id = t, this.uuid = i, this.object.name = t;
}
@@ -33177,28 +33245,28 @@ class V1 {
gltfLoader;
models = /* @__PURE__ */ new Map();
constructor(e) {
- this.scene = e, this.gltfLoader = new Bh();
+ this.scene = e, this.gltfLoader = new Oh();
}
async loadModel(e, t) {
return new Promise((i, s) => {
this.gltfLoader.load(
e,
- (n) => {
- const a = n.scene, o = t?.id || zo.generateUUID();
+ (r) => {
+ const a = r.scene, o = t?.id || zo.generateUUID();
t?.position && a.position.fromArray(t.position), t?.scale && a.scale.fromArray(t.scale), t?.rotation && a.rotation.setFromVector3(new w(...t.rotation)), this.scene.add(a);
- const l = new kc(a, o, a.uuid);
+ const l = new Fc(a, o, a.uuid);
this.models.set(o, l), i(l);
},
- (n) => {
- t?.onProgress && t.onProgress(n.loaded / n.total * 100);
+ (r) => {
+ t?.onProgress && t.onProgress(r.loaded / r.total * 100);
},
- (n) => s(n)
+ (r) => s(r)
);
});
}
unloadModel(e) {
const t = this.models.get(e);
- t && t instanceof kc && (this.scene.remove(t.object), this.models.delete(e));
+ t && t instanceof Fc && (this.scene.remove(t.object), this.models.delete(e));
}
getAllModels() {
return Array.from(this.models.values());
@@ -33212,7 +33280,7 @@ class G1 {
controls;
container;
constructor(e, t, i) {
- this.container = e, this.camera = new Tt(75, t / i, 0.1, 1e3), this.camera.position.set(10, 10, 10), this.camera.lookAt(0, 0, 0), this.controls = new Oh(this.camera, this.container), this.controls.enableDamping = !0;
+ this.container = e, this.camera = new Tt(75, t / i, 0.1, 1e3), this.camera.position.set(10, 10, 10), this.camera.lookAt(0, 0, 0), this.controls = new Bh(this.camera, this.container), this.controls.enableDamping = !0;
}
// Used by EngineKernel to update/render
getCamera() {
@@ -33249,10 +33317,10 @@ class G1 {
this.camera.position.set(10, 10, 10), this.camera.lookAt(0, 0, 0), this.controls.update();
}
setProjection(e) {
- e === Fs.Perspective && !(this.camera instanceof Tt) || e === Fs.Orthographic && this.camera instanceof _s;
+ e === ks.Perspective && !(this.camera instanceof Tt) || e === ks.Orthographic && this.camera instanceof _s;
}
setNavigationMode(e) {
- e === Dn.Orbit ? (this.controls.enabled = !0, this.controls.enableRotate = !0) : e === Dn.PanOnly && (this.controls.enableRotate = !1);
+ e === Dr.Orbit ? (this.controls.enabled = !0, this.controls.enableRotate = !0) : e === Dr.PanOnly && (this.controls.enableRotate = !1);
}
getState() {
const e = this.controls.target;
@@ -33260,7 +33328,7 @@ class G1 {
position: this.camera.position.toArray(),
target: e.toArray(),
up: this.camera.up.toArray(),
- projection: this.camera instanceof Tt ? Fs.Perspective : Fs.Orthographic
+ projection: this.camera instanceof Tt ? ks.Perspective : ks.Orthographic
};
}
restoreState(e, t) {
@@ -33319,10 +33387,10 @@ class W1 {
setColor(e, t) {
e.forEach((i) => {
const s = this.findObject(i);
- if (s && s instanceof at) {
+ if (s && s instanceof ot) {
this.materialCache.has(i) || this.materialCache.set(i, s.material);
- const n = new zt({ color: t });
- s.material = n;
+ const r = new Ht({ color: t });
+ s.material = r;
}
});
}
@@ -33339,7 +33407,7 @@ class W1 {
clearAllOverrides() {
this.materialCache.forEach((e, t) => {
const i = this.findObject(t);
- i && i instanceof at && (i.material = e);
+ i && i instanceof ot && (i.material = e);
}), this.materialCache.clear();
}
getBoundingBox(e) {
@@ -33403,7 +33471,7 @@ class X1 {
}
enableShadows(e) {
this._shadowsEnabled = e, this.renderer.shadowMap.enabled = e, this.scene.traverse((t) => {
- t instanceof at && (t.castShadow = e, t.receiveShadow = e);
+ t instanceof ot && (t.castShadow = e, t.receiveShadow = e);
});
}
enableAntialiasing(e) {
@@ -33503,7 +33571,7 @@ class zc {
constructor(e) {
const t = document.getElementById(e.containerId);
if (!t) throw new Error(`Container ${e.containerId} not found`);
- this.container = t, this.scene = new Wo(), this.renderer = new Ln({
+ this.container = t, this.scene = new Wo(), this.renderer = new Lr({
antialias: e.antialias ?? !0,
alpha: !0
}), this.renderer.setPixelRatio(window.devicePixelRatio), this.container.appendChild(this.renderer.domElement), this.events = new Y1(), this._cameraModule = new G1(this.container, this.container.clientWidth, this.container.clientHeight), this.cameraTool = this._cameraModule, this.loader = new V1(this.scene), this.components = new W1(this.scene), this.data = new j1(), this.viewer = new X1(this.scene, this.renderer), this.tools = new q1(), this.viewCube = {
@@ -33538,15 +33606,15 @@ class zc {
this.animationId = requestAnimationFrame(this.animate), this._cameraModule.update(), this.renderer.render(this.scene, this._cameraModule.getCamera());
};
}
-function K1(r) {
- const e = r.version || "v1";
+function K1(n) {
+ const e = n.version || "v1";
switch (e) {
case "v2":
- return new zc(r);
+ return new zc(n);
case "v1":
- return new H1(r);
+ return new H1(n);
default:
- return console.warn(`Version '${e}' not found. Falling back to v2.`), new zc(r);
+ return console.warn(`Version '${e}' not found. Falling back to v2.`), new zc(n);
}
}
class Z1 {
@@ -33603,9 +33671,9 @@ class Z1 {
};
if (this.engine = K1(e), !this.engine)
throw new Error("Failed to create engine instance");
- this._isInitialized = !0, this.unsubscribeTheme = lt.subscribe((t) => {
+ this._isInitialized = !0, this.unsubscribeTheme = Ze.subscribe((t) => {
this.setTheme(t);
- }), this.setTheme(lt.getTheme());
+ }), this.setTheme(Ze.getTheme());
} catch (e) {
throw console.error("[Engine] Failed to initialize engine:", e), this._isInitialized = !1, e;
}
@@ -33723,9 +33791,9 @@ class $1 {
*/
show(e, t) {
this.element.classList.add("visible"), this.isVisible = !0, this.element.style.left = `${e}px`, this.element.style.top = `${t}px`;
- const i = this.element.getBoundingClientRect(), s = window.innerWidth, n = window.innerHeight;
+ const i = this.element.getBoundingClientRect(), s = window.innerWidth, r = window.innerHeight;
let a = e, o = t;
- e + i.width > s && (a = e - i.width), t + i.height > n && (o = t - i.height), this.element.style.left = `${a}px`, this.element.style.top = `${o}px`;
+ e + i.width > s && (a = e - i.width), t + i.height > r && (o = t - i.height), this.element.style.left = `${a}px`, this.element.style.top = `${o}px`;
}
/**
* 隐藏容器
@@ -33756,9 +33824,9 @@ class il {
* 渲染 DOM 结构并订阅语言变更
*/
init() {
- this.render(), this.unsubscribeLocale = qt.subscribe(() => {
+ this.render(), this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
});
}
@@ -33801,14 +33869,14 @@ class il {
const o = a.group || s;
i.has(o) || i.set(o, []), i.get(o).push(a);
});
- let n = [];
+ let r = [];
if (t) {
- n = t.filter((a) => i.has(a));
+ r = t.filter((a) => i.has(a));
for (const a of i.keys())
- n.includes(a) || n.push(a);
+ r.includes(a) || r.push(a);
} else
- n = Array.from(i.keys());
- n.forEach((a, o) => {
+ r = Array.from(i.keys());
+ r.forEach((a, o) => {
if (o > 0) {
const c = document.createElement("li");
c.className = "bim-menu-divider", this.element.appendChild(c);
@@ -33827,8 +33895,8 @@ class il {
t.className = `bim-menu-item ${i ? "" : "disabled"}`;
const s = document.createElement("div");
s.className = "bim-menu-item-icon", e.icon && (s.innerHTML = e.icon), t.appendChild(s);
- const n = document.createElement("div");
- n.className = "bim-menu-item-label", n.textContent = me(e.label), t.appendChild(n);
+ const r = document.createElement("div");
+ r.className = "bim-menu-item-label", r.textContent = le(e.label), t.appendChild(r);
const a = e.children, o = a && a.length > 0;
if (o) {
const l = document.createElement("div");
@@ -33850,12 +33918,12 @@ class il {
this.closeSubMenu();
const s = document.createElement("div");
s.style.position = "fixed", s.style.zIndex = "10001";
- const n = t.getBoundingClientRect();
- s.style.top = `${n.top}px`, s.style.left = `${n.right}px`, s.addEventListener("mousedown", (l) => l.stopPropagation());
+ const r = t.getBoundingClientRect();
+ s.style.top = `${r.top}px`, s.style.left = `${r.right}px`, s.addEventListener("mousedown", (l) => l.stopPropagation());
const a = new il({ items: i });
a.init(), s.appendChild(a.element), document.body.appendChild(s), this.activeSubMenu = { menu: a, container: s };
const o = s.getBoundingClientRect();
- o.right > window.innerWidth && (s.style.left = `${n.left - o.width}px`);
+ o.right > window.innerWidth && (s.style.left = `${r.left - o.width}px`);
}
/**
* 关闭当前激活的子菜单
@@ -33864,7 +33932,7 @@ class il {
this.activeSubMenu && (this.activeSubMenu.menu.destroy(), this.activeSubMenu.container.remove(), this.activeSubMenu = null);
}
}
-class Hh extends yi {
+class Hh extends Yt {
container;
rightKeyPanel;
// 存储注册的上下文处理器
@@ -33897,8 +33965,8 @@ class Hh extends yi {
*/
showMenu(e, t, i, s) {
if (!i || i.length === 0) return;
- const n = new il({ items: i, groupOrder: s });
- n.init(), this.rightKeyPanel.mount(n), this.rightKeyPanel.show(e, t);
+ const r = new il({ items: i, groupOrder: s });
+ r.init(), this.rightKeyPanel.mount(r), this.rightKeyPanel.show(e, t);
}
/**
* 隐藏右键菜单
@@ -33919,39 +33987,39 @@ class Hh extends yi {
t && t.length > 0 ? this.showMenu(e.clientX, e.clientY, t) : this.hide();
};
}
-const J1 = (r) => ({
+const J1 = (n) => ({
id: "infoMenu",
label: "menu.info",
group: "info",
icon: ' ',
onClick: () => {
- console.log("dianjile"), r.dialog?.showInfoDialog(), r.engine?.rightKey?.hide();
+ console.log("dianjile"), n.dialog?.showInfoDialog(), n.engine?.rightKey?.hide();
}
-}), Q1 = (r) => ({
+}), Q1 = (n) => ({
id: "fourMenu",
label: "menu.info",
icon: ' ',
onClick: () => {
- console.log("dianjile"), r.dialog?.showInfoDialog(), r.engine?.rightKey?.hide();
+ console.log("dianjile"), n.dialog?.showInfoDialog(), n.engine?.rightKey?.hide();
}
-}), e_ = (r) => ({
+}), e_ = (n) => ({
id: "infoMenu",
label: "menu.info",
icon: ' ',
onClick: () => {
- console.log("dianjile"), r.dialog?.showInfoDialog(), r.engine?.rightKey?.hide();
+ console.log("dianjile"), n.dialog?.showInfoDialog(), n.engine?.rightKey?.hide();
}
-}), t_ = (r) => ({
+}), t_ = (n) => ({
id: "homeMenu",
label: "menu.home",
group: "home",
- children: [e_(r), Q1(r)],
+ children: [e_(n), Q1(n)],
icon: ' ',
onClick: () => {
- r.dialog?.showInfoDialog(), r.engine?.rightKey?.hide();
+ n.dialog?.showInfoDialog(), n.engine?.rightKey?.hide();
}
});
-class i_ extends yi {
+class i_ extends Yt {
/** 3D 引擎挂载的父容器 */
container;
/** 3D 引擎组件实例 */
@@ -34018,7 +34086,7 @@ class i_ extends yi {
this.engineInstance && (this.engineInstance.destroy(), this.engineInstance = null), this.rightKey && (this.rightKey.destroy(), this.rightKey = null);
}
}
-var gt = /* @__PURE__ */ ((r) => (r[r.Unchecked = 0] = "Unchecked", r[r.Checked = 1] = "Checked", r[r.Indeterminate = 2] = "Indeterminate", r))(gt || {});
+var gt = /* @__PURE__ */ ((n) => (n[n.Unchecked = 0] = "Unchecked", n[n.Checked = 1] = "Checked", n[n.Indeterminate = 2] = "Indeterminate", n))(gt || {});
class s_ {
config;
element;
@@ -34048,18 +34116,18 @@ class s_ {
const t = document.createElement("div");
t.className = "bim-tree-node", this.config.disabled && t.classList.add("is-disabled"), this.contentEl = document.createElement("div"), this.contentEl.className = "bim-tree-node-content", this.switcherEl = document.createElement("span"), this.switcherEl.className = "bim-tree-switcher", this.switcherEl.innerHTML = ' ';
const i = this.config.children && this.config.children.length > 0;
- if (i ? this.config.expanded && this.switcherEl.classList.add("is-expanded") : this.switcherEl.classList.add("is-hidden"), this.switcherEl.addEventListener("click", (n) => {
- n.stopPropagation(), this.toggleExpand();
- }), this.contentEl.appendChild(this.switcherEl), e.checkable !== !1 && (this.checkboxEl = document.createElement("span"), this.checkboxEl.className = "bim-tree-checkbox", this.updateCheckboxUI(), this.checkboxEl.addEventListener("click", (n) => {
- n.stopPropagation(), !this.config.disabled && this.toggleCheck();
+ if (i ? this.config.expanded && this.switcherEl.classList.add("is-expanded") : this.switcherEl.classList.add("is-hidden"), this.switcherEl.addEventListener("click", (r) => {
+ r.stopPropagation(), this.toggleExpand();
+ }), this.contentEl.appendChild(this.switcherEl), e.checkable !== !1 && (this.checkboxEl = document.createElement("span"), this.checkboxEl.className = "bim-tree-checkbox", this.updateCheckboxUI(), this.checkboxEl.addEventListener("click", (r) => {
+ r.stopPropagation(), !this.config.disabled && this.toggleCheck();
}), this.contentEl.appendChild(this.checkboxEl)), this.config.icon) {
- const n = document.createElement("span");
- n.className = "bim-tree-icon", n.innerHTML = this.config.icon.includes(" `, this.contentEl.appendChild(n);
+ const r = document.createElement("span");
+ r.className = "bim-tree-icon", r.innerHTML = this.config.icon.includes(" `, this.contentEl.appendChild(r);
}
- this.titleEl = document.createElement("span"), this.titleEl.className = "bim-tree-title", this.updateLabel(), this.contentEl.appendChild(this.titleEl), this.actionsEl = document.createElement("div"), this.actionsEl.className = "bim-tree-node-actions", this.actionsEl.addEventListener("click", (n) => {
- n.stopPropagation();
- }), this.contentEl.appendChild(this.actionsEl), this.contentEl.addEventListener("click", (n) => {
- if (n.stopPropagation(), this.config.disabled) return;
+ this.titleEl = document.createElement("span"), this.titleEl.className = "bim-tree-title", this.updateLabel(), this.contentEl.appendChild(this.titleEl), this.actionsEl = document.createElement("div"), this.actionsEl.className = "bim-tree-node-actions", this.actionsEl.addEventListener("click", (r) => {
+ r.stopPropagation();
+ }), this.contentEl.appendChild(this.actionsEl), this.contentEl.addEventListener("click", (r) => {
+ if (r.stopPropagation(), this.config.disabled) return;
(this.config.clickAction || "select") === "expand" ? this.toggleExpand() : this.onNodeClick(this);
}), t.appendChild(this.contentEl), this.childrenContainer = document.createElement("div"), this.childrenContainer.className = "bim-tree-children";
const s = e.indent || 24;
@@ -34125,7 +34193,7 @@ class s_ {
this.children.forEach((e) => e.destroy()), this.children = [], this.element.remove(), this.parent = null;
}
}
-class r_ {
+class n_ {
element;
contentElement;
// 树内容容器
@@ -34161,15 +34229,15 @@ class r_ {
const t = document.createElement("div");
t.className = "bim-tree-search-wrapper";
const i = document.createElement("span");
- i.className = "bim-tree-search-icon", i.innerHTML = ' ', t.appendChild(i), this.searchInput = document.createElement("input"), this.searchInput.className = "bim-tree-search-input", this.searchInput.type = "text", this.searchInput.placeholder = me(this.options.searchPlaceholder || "搜索..."), this.searchInput.addEventListener("input", (s) => {
- const n = s.target.value;
- this.handleSearch(n);
+ i.className = "bim-tree-search-icon", i.innerHTML = ' ', t.appendChild(i), this.searchInput = document.createElement("input"), this.searchInput.className = "bim-tree-search-input", this.searchInput.type = "text", this.searchInput.placeholder = le(this.options.searchPlaceholder || "搜索..."), this.searchInput.addEventListener("input", (s) => {
+ const r = s.target.value;
+ this.handleSearch(r);
}), t.appendChild(this.searchInput), e.appendChild(t), this.searchResults = document.createElement("div"), this.searchResults.className = "bim-tree-search-results", e.appendChild(this.searchResults), this.element.appendChild(e), this.clickOutsideHandler = (s) => {
this.searchResults && !this.searchResults.contains(s.target) && !this.searchInput?.contains(s.target) && this.searchResults.classList.remove("is-visible");
}, document.addEventListener("click", this.clickOutsideHandler);
}
init() {
- this.render(), this.unsubscribeLocale = qt.subscribe(() => this.setLocales()), this.unsubscribeTheme = lt.subscribe((e) => this.setTheme(e)), this.setTheme(lt.getTheme());
+ this.render(), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e)), this.setTheme(Ze.getTheme());
}
/**
* 处理搜索逻辑
@@ -34182,10 +34250,10 @@ class r_ {
}
const t = [], i = e.toLowerCase();
this.nodeMap.forEach((s) => {
- const n = s.config.label;
- n.toLowerCase().includes(i) && t.push({
+ const r = s.config.label;
+ r.toLowerCase().includes(i) && t.push({
node: s,
- label: n,
+ label: r,
path: this.getNodePath(s)
});
}), this.renderSearchResults(t);
@@ -34214,8 +34282,8 @@ class r_ {
i.className = "bim-tree-search-item";
const s = document.createElement("span");
s.className = "bim-tree-search-item-title", s.textContent = t.label;
- const n = document.createElement("span");
- n.className = "bim-tree-search-item-path", n.textContent = t.path, i.appendChild(s), t.path && i.appendChild(n), i.addEventListener("click", () => {
+ const r = document.createElement("span");
+ r.className = "bim-tree-search-item-path", r.textContent = t.path, i.appendChild(s), t.path && i.appendChild(r), i.addEventListener("click", () => {
this.revealNode(t.node);
}), this.searchResults.appendChild(i);
});
@@ -34245,7 +34313,7 @@ class r_ {
* 响应语言变更
*/
setLocales() {
- this.nodeMap.forEach((e) => e.updateLabel()), this.searchInput && (this.searchInput.placeholder = me(this.options.searchPlaceholder || "tree.searchPlaceholder"));
+ this.nodeMap.forEach((e) => e.updateLabel()), this.searchInput && (this.searchInput.placeholder = le(this.options.searchPlaceholder || "tree.searchPlaceholder"));
}
destroy() {
this.unsubscribeLocale && (this.unsubscribeLocale(), this.unsubscribeLocale = null), this.unsubscribeTheme && (this.unsubscribeTheme(), this.unsubscribeTheme = null), this.clickOutsideHandler && (document.removeEventListener("click", this.clickOutsideHandler), this.clickOutsideHandler = null), this.rootNodes.forEach((e) => e.destroy()), this.rootNodes = [], this.nodeMap.clear(), this.element.remove(), this.selectedNode = null;
@@ -34286,8 +34354,8 @@ class r_ {
handleNodeCheck(e) {
const t = e.checkState === gt.Checked;
if (this.onNodeCheck && this.onNodeCheck(e), this.options.checkStrictly === !1) return;
- const i = (n, a) => {
- n.children.forEach((o) => {
+ const i = (r, a) => {
+ r.children.forEach((o) => {
o.config.disabled || (o.setChecked(a, !1), i(o, a));
});
};
@@ -34298,7 +34366,7 @@ class r_ {
s = s.parent;
continue;
}
- const n = s.children, a = n.every((l) => l.checkState === gt.Checked), o = n.every((l) => l.checkState === gt.Unchecked);
+ const r = s.children, a = r.every((l) => l.checkState === gt.Checked), o = r.every((l) => l.checkState === gt.Unchecked);
a ? s.setChecked(gt.Checked, !1) : o ? s.setChecked(gt.Unchecked, !1) : s.setChecked(gt.Indeterminate, !1), s = s.parent;
}
}
@@ -34347,7 +34415,7 @@ class Vh {
* 初始化组件
*/
init() {
- this.renderNav(), this.renderPanels(), this.setLocales(), this.setTheme(lt.getTheme()), this.unsubscribeLocale = qt.subscribe(() => this.setLocales()), this.unsubscribeTheme = lt.subscribe((e) => this.setTheme(e));
+ this.renderNav(), this.renderPanels(), this.setLocales(), this.setTheme(Ze.getTheme()), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e));
}
/**
* 渲染头部标签
@@ -34386,10 +34454,10 @@ class Vh {
const t = this.tabMap.get(e);
if (!t || t.disabled) return;
this.activeId = e, this.navElement.querySelectorAll(".bim-tab__item").forEach((s) => {
- const n = s.dataset.id === e;
- s.classList.toggle("is-active", n), s.setAttribute("aria-selected", `${n}`);
- }), this.panelMap.forEach((s, n) => {
- const a = n === e;
+ const r = s.dataset.id === e;
+ s.classList.toggle("is-active", r), s.setAttribute("aria-selected", `${r}`);
+ }), this.panelMap.forEach((s, r) => {
+ const a = r === e;
s.classList.toggle("is-active", a), s.style.display = a ? "block" : "none";
}), this.options.onChange && this.options.onChange(e, t);
}
@@ -34409,8 +34477,8 @@ class Vh {
if (!i) return;
const s = this.tabMap.get(i);
if (!s) return;
- const n = t.querySelector(".bim-tab__title");
- n && (n.textContent = this.resolveTitle(s.title));
+ const r = t.querySelector(".bim-tab__title");
+ r && (r.textContent = this.resolveTitle(s.title));
});
}
/**
@@ -34424,13 +34492,13 @@ class Vh {
*/
resolveTitle(e) {
try {
- return me(e) || e;
+ return le(e) || e;
} catch {
return e;
}
}
}
-const n_ = [
+const r_ = [
{
id: "root",
label: "全部构件",
@@ -34494,7 +34562,7 @@ const n_ = [
]
}
];
-class a_ extends yi {
+class a_ extends Yt {
toolbar = null;
toolbarContainer = null;
container;
@@ -34526,8 +34594,8 @@ class a_ extends yi {
}
openConstructTreeDialog() {
this.setVisible(!1);
- const e = new r_({
- data: n_,
+ const e = new n_({
+ data: r_,
checkable: !0,
indent: 0,
enableSearch: !0,
@@ -34551,10 +34619,10 @@ class a_ extends yi {
i.className = "construct-tab__panel-content";
const s = document.createElement("div");
s.className = "construct-tab__panel-content", s.appendChild(e.element);
- const n = document.createElement("div");
- n.className = "construct-tab__container", n.style.height = "100%", n.style.overflow = "hidden";
+ const r = document.createElement("div");
+ r.className = "construct-tab__container", r.style.height = "100%", r.style.overflow = "hidden";
const a = new Vh({
- container: n,
+ container: r,
tabs: [
{ id: "component", title: "tab.component", content: s },
{ id: "system", title: "tab.system", content: t },
@@ -34569,7 +34637,7 @@ class a_ extends yi {
title: "constructTree.title",
minWidth: 320,
height: 420,
- content: n,
+ content: r,
position: { x: 20, y: 20 },
resizable: !1,
onClose: () => {
@@ -34624,7 +34692,7 @@ class o_ {
const t = document.createElement("span");
t.className = "bim-collapse-icon", t.innerHTML = this.config.icon, this.headerEl.appendChild(t);
}
- if (this.titleEl = document.createElement("span"), this.titleEl.className = "bim-collapse-title", this.titleEl.textContent = me(this.config.title), this.headerEl.appendChild(this.titleEl), this.config.extra) {
+ if (this.titleEl = document.createElement("span"), this.titleEl.className = "bim-collapse-title", this.titleEl.textContent = le(this.config.title), this.headerEl.appendChild(this.titleEl), this.config.extra) {
const t = document.createElement("div");
t.className = "bim-collapse-extra", typeof this.config.extra == "string" ? t.innerHTML = this.config.extra : t.appendChild(this.config.extra), this.headerEl.appendChild(t);
}
@@ -34633,7 +34701,7 @@ class o_ {
}), e.appendChild(this.headerEl), this.contentEl = document.createElement("div"), this.contentEl.className = "bim-collapse-content is-hidden", this.contentBoxEl = document.createElement("div"), this.contentBoxEl.className = "bim-collapse-content-box", typeof this.config.content == "string" ? this.contentBoxEl.innerHTML = this.config.content : this.contentBoxEl.appendChild(this.config.content), this.contentEl.appendChild(this.contentBoxEl), e.appendChild(this.contentEl), e;
}
updateLocale() {
- this.titleEl && (this.titleEl.textContent = me(this.config.title));
+ this.titleEl && (this.titleEl.textContent = le(this.config.title));
}
setActive(e) {
e ? (this.element.classList.add("is-active"), this.contentEl.classList.remove("is-hidden")) : (this.element.classList.remove("is-active"), this.contentEl.classList.add("is-hidden"));
@@ -34659,11 +34727,11 @@ class Hc {
this.options.items.forEach((e) => {
const t = new o_(e, this);
this.items.set(e.id, t), this.element.appendChild(t.element), this.activeIds.has(e.id) && t.setActive(!0);
- }), this.unsubscribeLocale = qt.subscribe(() => {
+ }), this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.setTheme(lt.getTheme());
+ }), this.setTheme(Ze.getTheme());
}
toggleItem(e) {
const t = this.activeIds.has(e);
@@ -34698,9 +34766,9 @@ class Ca {
t && t.appendChild(this.element), this.init();
}
init() {
- this.applyCustomStyles(), this.renderItems(), this.unsubscribeTheme = lt.subscribe((e) => {
+ this.applyCustomStyles(), this.renderItems(), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.setTheme(lt.getTheme());
+ }), this.setTheme(Ze.getTheme());
}
createDom() {
const e = document.createElement("div");
@@ -34736,8 +34804,10 @@ class Ca {
this.unsubscribeTheme && (this.unsubscribeTheme(), this.unsubscribeTheme = null), this.element.remove();
}
}
-class l_ extends yi {
+class l_ extends Yt {
dialogId = "property-panel-dialog";
+ dialog = null;
+ // 保存 dialog 引用
constructor(e) {
super(e);
}
@@ -34754,9 +34824,10 @@ class l_ extends yi {
console.warn("Dialog manager is not initialized");
return;
}
+ if (this.isOpen())
+ return;
const e = 360, t = document.body.clientWidth - e - 40;
- console.log("x", t);
- const i = this.engine.dialog.create({
+ console.log("x", t), this.dialog = this.engine.dialog.create({
id: this.dialogId,
title: "panel.property.title",
// '构件详情'
@@ -34765,10 +34836,14 @@ class l_ extends yi {
height: "500px",
position: { x: t, y: 20 },
showMask: !1,
- resizable: !0
- }), s = document.createElement("div");
- s.style.height = "100%", s.style.display = "flex", s.style.flexDirection = "column", i.setContent(s), new Vh({
- container: s,
+ resizable: !0,
+ onClose: () => {
+ this.hide();
+ }
+ });
+ const i = document.createElement("div");
+ i.style.height = "100%", i.style.display = "flex", i.style.flexDirection = "column", this.dialog.setContent(i), new Vh({
+ container: i,
tabs: [
{
id: "props",
@@ -34876,7 +34951,20 @@ class l_ extends yi {
]
}), e.appendChild(i), e;
}
+ /**
+ * 检查属性面板是否打开
+ */
+ isOpen() {
+ return this.dialog !== null;
+ }
+ /**
+ * 隐藏属性面板
+ */
+ hide() {
+ this.dialog && (this.dialog.destroy(), this.dialog = null);
+ }
destroy() {
+ this.hide();
}
}
const c_ = {
@@ -34889,7 +34977,7 @@ const c_ = {
slope: ' ',
spaceVolume: ' '
};
-class Er {
+class wn {
element;
options;
activeMode;
@@ -34943,17 +35031,17 @@ class Er {
* @param options 组件配置
*/
constructor(e = {}) {
- this.options = e, this.activeMode = e.defaultMode ?? "distance", this.isExpanded = e.defaultExpanded ?? !1, this.config = this.loadConfigFromCache() ?? { ...Er.DEFAULT_CONFIG }, this.element = this.createDom();
+ this.options = e, this.activeMode = e.defaultMode ?? "distance", this.isExpanded = e.defaultExpanded ?? !1, this.config = this.loadConfigFromCache() ?? { ...wn.DEFAULT_CONFIG }, this.element = this.createDom();
}
/**
* 初始化组件(实现 IBimComponent)
*/
init() {
- this.unsubscribeLocale = qt.subscribe(() => {
+ this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.setLocales(), this.setTheme(lt.getTheme()), this.applyExpandedState(), this.applyActiveModeState(), this.applyViewState(), this.renderResult();
+ }), this.setLocales(), this.setTheme(Ze.getTheme()), this.applyExpandedState(), this.applyActiveModeState(), this.applyViewState(), this.renderResult();
}
/**
* 设置主题(实现 IBimComponent)
@@ -34968,11 +35056,11 @@ class Er {
*/
setLocales() {
for (const [t, i] of this.toolButtons.entries())
- i.title = me(this.getModeI18nKey(t)), i.setAttribute("aria-label", i.title);
- this.toggleBtn.title = this.isExpanded ? me("measure.actions.collapse") : me("measure.actions.expand"), this.toggleBtn.setAttribute("aria-label", this.toggleBtn.title), this.toggleTextEl && (this.toggleTextEl.textContent = this.toggleBtn.title), this.clearBtn.textContent = me("measure.actions.clearAll"), this.settingsBtn.title = me("measure.actions.settings"), this.settingsBtn.setAttribute("aria-label", this.settingsBtn.title), this.mainValueLabelEl.textContent = me(this.getModeValueLabelI18nKey(this.activeMode)), this.element.querySelectorAll("[data-i18n-key]").forEach((t) => {
+ i.title = le(this.getModeI18nKey(t)), i.setAttribute("aria-label", i.title);
+ this.toggleBtn.title = this.isExpanded ? le("measure.actions.collapse") : le("measure.actions.expand"), this.toggleBtn.setAttribute("aria-label", this.toggleBtn.title), this.toggleTextEl && (this.toggleTextEl.textContent = this.toggleBtn.title), this.clearBtn.textContent = le("measure.actions.clearAll"), this.settingsBtn.title = le("measure.actions.settings"), this.settingsBtn.setAttribute("aria-label", this.settingsBtn.title), this.mainValueLabelEl.textContent = le(this.getModeValueLabelI18nKey(this.activeMode)), this.element.querySelectorAll("[data-i18n-key]").forEach((t) => {
const i = t.dataset.i18nKey;
- i && (t.textContent = me(i));
- }), this.saveSettingsBtn.textContent = me("measure.settings.save"), this.cancelSettingsBtn.textContent = me("measure.settings.cancel");
+ i && (t.textContent = le(i));
+ }), this.saveSettingsBtn.textContent = le("measure.settings.save"), this.cancelSettingsBtn.textContent = le("measure.settings.cancel");
}
/**
* 销毁组件(实现 IBimComponent)
@@ -35001,7 +35089,7 @@ class Er {
* @param mode 目标测量方式
*/
setActiveMode(e) {
- this.activeMode !== e && (this.activeMode = e, this.applyActiveModeState(), this.mainValueLabelEl.textContent = me(this.getModeValueLabelI18nKey(this.activeMode)), this.options.onModeChange && this.options.onModeChange(e), this.renderResult(), this.options.onExpandedChange && this.options.onExpandedChange(this.isExpanded));
+ this.activeMode !== e && (this.activeMode = e, this.applyActiveModeState(), this.mainValueLabelEl.textContent = le(this.getModeValueLabelI18nKey(this.activeMode)), this.options.onModeChange && this.options.onModeChange(e), this.renderResult(), this.options.onExpandedChange && this.options.onExpandedChange(this.isExpanded));
}
/**
* 设置测量结果(由外部注入)
@@ -35072,7 +35160,7 @@ class Er {
"laserDistance",
"slope",
"spaceVolume"
- ], n = `
+ ], r = `
@@ -35080,8 +35168,8 @@ class Er {
for (let v = 0; v < s.length; v++) {
const f = s[v], p = document.createElement("button");
p.type = "button", p.className = "bim-measure-tool-btn", p.dataset.mode = f;
- const y = document.createElement("span");
- y.className = "bim-measure-tool-icon", y.innerHTML = c_[f] || n, p.appendChild(y), p.addEventListener("click", () => {
+ const b = document.createElement("span");
+ b.className = "bim-measure-tool-icon", b.innerHTML = c_[f] || r, p.appendChild(b), p.addEventListener("click", () => {
this.setActiveMode(f);
}), this.toolButtons.set(f, p), i.appendChild(p);
}
@@ -35107,12 +35195,12 @@ class Er {
const d = document.createElement("div");
d.className = "bim-measure-xyz", this.xyzBoxEl = d;
const m = (v, f, p) => {
- const y = document.createElement("div");
- y.className = "bim-measure-row";
+ const b = document.createElement("div");
+ b.className = "bim-measure-row";
const _ = document.createElement("span");
_.className = "label", _.dataset.i18nKey = v;
const E = document.createElement("span");
- return E.className = `value ${f}`, p(E), y.appendChild(_), y.appendChild(E), y;
+ return E.className = `value ${f}`, p(E), b.appendChild(_), b.appendChild(E), b;
};
d.appendChild(m("measure.labels.x", "bim-measure-xyz-x", (v) => this.xyzXEl = v)), d.appendChild(m("measure.labels.y", "bim-measure-xyz-y", (v) => this.xyzYEl = v)), d.appendChild(m("measure.labels.z", "bim-measure-xyz-z", (v) => this.xyzZEl = v)), l.appendChild(d), this.mainViewEl.appendChild(l);
const g = document.createElement("div");
@@ -35138,8 +35226,8 @@ class Er {
i.className = "bim-measure-settings-row";
const s = document.createElement("div");
s.className = "label", s.dataset.i18nKey = "measure.settings.unit", this.unitSelectEl = document.createElement("select"), this.unitSelectEl.className = "bim-measure-settings-select", this.unitSelectEl.appendChild(this.makeOption("m")), this.unitSelectEl.appendChild(this.makeOption("cm")), this.unitSelectEl.appendChild(this.makeOption("mm")), this.unitSelectEl.appendChild(this.makeOption("km")), i.appendChild(s), i.appendChild(this.unitSelectEl), e.appendChild(i);
- const n = document.createElement("div");
- n.className = "bim-measure-settings-hint", n.dataset.i18nKey = "measure.settings.hint", e.appendChild(n);
+ const r = document.createElement("div");
+ r.className = "bim-measure-settings-hint", r.dataset.i18nKey = "measure.settings.hint", e.appendChild(r);
const a = document.createElement("div");
a.className = "bim-measure-settings-row";
const o = document.createElement("div");
@@ -35194,7 +35282,7 @@ class Er {
*/
loadConfigFromCache() {
try {
- const e = localStorage.getItem(Er.CONFIG_CACHE_KEY);
+ const e = localStorage.getItem(wn.CONFIG_CACHE_KEY);
if (!e) return null;
const t = JSON.parse(e);
if (!t || typeof t != "object") return null;
@@ -35212,7 +35300,7 @@ class Er {
*/
saveConfigToCache(e) {
try {
- localStorage.setItem(Er.CONFIG_CACHE_KEY, JSON.stringify(e));
+ localStorage.setItem(wn.CONFIG_CACHE_KEY, JSON.stringify(e));
} catch {
}
}
@@ -35243,9 +35331,9 @@ class Er {
*/
renderResult() {
if (this.activeMode === "laserDistance")
- this.mainValueLabelEl.style.display = "none", this.mainNumberEl.textContent = me(this.getModeI18nKey("laserDistance")), this.mainUnitEl.textContent = "", this.mainNumberEl.classList.add("is-laser-text");
+ this.mainValueLabelEl.style.display = "none", this.mainNumberEl.textContent = le(this.getModeI18nKey("laserDistance")), this.mainUnitEl.textContent = "", this.mainNumberEl.classList.add("is-laser-text");
else {
- this.mainValueLabelEl.style.display = "", this.mainValueLabelEl.textContent = me(this.getModeValueLabelI18nKey(this.activeMode));
+ this.mainValueLabelEl.style.display = "", this.mainValueLabelEl.textContent = le(this.getModeValueLabelI18nKey(this.activeMode));
const e = this.formatMainValueParts(this.activeMode, this.result);
this.mainNumberEl.textContent = e.numberText, this.mainUnitEl.textContent = e.unitText, this.mainNumberEl.classList.remove("is-laser-text");
}
@@ -35326,7 +35414,7 @@ class Er {
* - 坡度:%
*/
formatMainValueParts(e, t) {
- if (e === "laserDistance") return { numberText: me(this.getModeI18nKey("laserDistance")), unitText: "" };
+ if (e === "laserDistance") return { numberText: le(this.getModeI18nKey("laserDistance")), unitText: "" };
if (!t)
return this.getEmptyValuePartsByMode(e);
switch (e) {
@@ -35335,16 +35423,16 @@ class Er {
case "minDistance":
return this.formatLengthParts(t.minDistanceMm);
case "angle":
- return this.formatFixedUnitParts(t.angleDeg, me("measure.units.deg"));
+ return this.formatFixedUnitParts(t.angleDeg, le("measure.units.deg"));
case "elevation":
return this.formatFixedUnitParts(
t.elevationMm === void 0 ? void 0 : t.elevationMm / 1e3,
- me("measure.units.m")
+ le("measure.units.m")
);
case "volume":
return this.formatVolumeParts(t.volumeM3);
case "slope":
- return this.formatFixedUnitParts(t.slopePercent, me("measure.units.percent"));
+ return this.formatFixedUnitParts(t.slopePercent, le("measure.units.percent"));
case "spaceVolume":
return this.formatVolumeParts(t.spaceVolumeM3);
default:
@@ -35355,16 +35443,16 @@ class Er {
switch (e) {
case "distance":
case "minDistance":
- return { numberText: "--", unitText: me(this.getUnitI18nKey(this.config.unit)) };
+ return { numberText: "--", unitText: le(this.getUnitI18nKey(this.config.unit)) };
case "angle":
- return { numberText: "--", unitText: me("measure.units.deg") };
+ return { numberText: "--", unitText: le("measure.units.deg") };
case "elevation":
- return { numberText: "--", unitText: me("measure.units.m") };
+ return { numberText: "--", unitText: le("measure.units.m") };
case "volume":
case "spaceVolume":
return { numberText: "--", unitText: `${this.config.unit}³` };
case "slope":
- return { numberText: "--", unitText: me("measure.units.percent") };
+ return { numberText: "--", unitText: le("measure.units.percent") };
default:
return { numberText: "--", unitText: "" };
}
@@ -35373,7 +35461,7 @@ class Er {
return e == null || Number.isNaN(e) ? { numberText: "--", unitText: t } : { numberText: this.formatNumberWithPrecision(e, this.config.precision), unitText: t };
}
formatLengthParts(e) {
- const t = me(this.getUnitI18nKey(this.config.unit));
+ const t = le(this.getUnitI18nKey(this.config.unit));
if (e == null || Number.isNaN(e))
return { numberText: "--", unitText: t };
const i = this.convertMmToUnit(e, this.config.unit);
@@ -35387,7 +35475,7 @@ class Er {
return { numberText: this.formatNumberWithPrecision(i, this.config.precision), unitText: t };
}
}
-class h_ extends yi {
+class h_ extends Yt {
dialogId = "measure-dialog";
dialog = null;
panel = null;
@@ -35409,8 +35497,8 @@ class h_ extends yi {
console.warn("Dialog manager or container is not initialized");
return;
}
- const e = 250, t = 300, i = 20, s = this.engine.container, n = s.clientWidth, a = s.clientHeight, o = n - e - i, l = (a - t) / 2;
- this.destroy(), this.panel = new Er({
+ const e = 250, t = 300, i = 20, s = this.engine.container, r = s.clientWidth, a = s.clientHeight, o = r - e - i, l = (a - t) / 2;
+ this.destroy(), this.panel = new wn({
defaultMode: "distance",
// 默认展示前四个,且默认选中“距离”
defaultExpanded: !1,
@@ -35526,11 +35614,11 @@ class u_ {
* 初始化组件
*/
init() {
- this.unsubscribeLocale = qt.subscribe(() => {
+ this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.setLocales(), this.setTheme(lt.getTheme());
+ }), this.setLocales(), this.setTheme(Ze.getTheme());
}
/**
* 设置主题
@@ -35543,7 +35631,7 @@ class u_ {
* 设置语言
*/
setLocales() {
- this.hideLabelEl.textContent = me("sectionPlane.actions.hide"), this.reverseLabelEl.textContent = me("sectionPlane.actions.reverse"), this.resetLabelEl.textContent = me("sectionPlane.actions.reset"), this.hideBtn.title = me("sectionPlane.actions.hide"), this.reverseBtn.title = me("sectionPlane.actions.reverse"), this.resetBtn.title = me("sectionPlane.actions.reset");
+ this.hideLabelEl.textContent = le("sectionPlane.actions.hide"), this.reverseLabelEl.textContent = le("sectionPlane.actions.reverse"), this.resetLabelEl.textContent = le("sectionPlane.actions.reset"), this.hideBtn.title = le("sectionPlane.actions.hide"), this.reverseBtn.title = le("sectionPlane.actions.reverse"), this.resetBtn.title = le("sectionPlane.actions.reset");
}
/**
* 销毁组件
@@ -35582,13 +35670,13 @@ class u_ {
createButton(e, t, i) {
const s = document.createElement("button");
s.type = "button", s.className = "section-plane-btn";
- const n = document.createElement("div");
- n.className = "section-plane-btn-icon", n.innerHTML = t, s.appendChild(n);
+ const r = document.createElement("div");
+ r.className = "section-plane-btn-icon", r.innerHTML = t, s.appendChild(r);
const a = document.createElement("div");
return a.className = "section-plane-btn-label", s.appendChild(a), e === "hide" ? this.hideLabelEl = a : e === "reverse" ? this.reverseLabelEl = a : this.resetLabelEl = a, s.addEventListener("click", i), s;
}
}
-class d_ extends yi {
+class d_ extends Yt {
dialogId = "section-plane-dialog";
dialog = null;
panel = null;
@@ -35616,7 +35704,7 @@ class d_ extends yi {
console.log("[SectionPlaneDialogManager] 重置");
}
}), this.panel.init();
- const e = 240, t = 120, i = 20, s = 50, n = this.engine.container, a = n.clientWidth, o = n.clientHeight, l = a - e - i, c = o - t - s;
+ const e = 240, t = 120, i = 20, s = 50, r = this.engine.container, a = r.clientWidth, o = r.clientHeight, l = a - e - i, c = o - t - s;
this.dialog = this.engine.dialog.create({
id: this.dialogId,
title: "sectionPlane.dialogTitle",
@@ -35669,11 +35757,11 @@ class p_ {
* 初始化组件
*/
init() {
- this.unsubscribeLocale = qt.subscribe(() => {
+ this.unsubscribeLocale = Ut.subscribe(() => {
this.setLocales();
- }), this.unsubscribeTheme = lt.subscribe((e) => {
+ }), this.unsubscribeTheme = Ze.subscribe((e) => {
this.setTheme(e);
- }), this.setLocales(), this.setTheme(lt.getTheme()), this.updateHideButtonState(), this.updateAxisButtonsState();
+ }), this.setLocales(), this.setTheme(Ze.getTheme()), this.updateHideButtonState(), this.updateAxisButtonsState();
}
/**
* 设置主题
@@ -35686,7 +35774,7 @@ class p_ {
* 设置语言
*/
setLocales() {
- this.hideLabelEl.textContent = me("sectionAxis.actions.hide"), this.reverseLabelEl.textContent = me("sectionAxis.actions.reverse"), this.hideBtn.title = me("sectionAxis.actions.hide"), this.reverseBtn.title = me("sectionAxis.actions.reverse"), this.axisXBtn.title = me("sectionAxis.actions.axisX"), this.axisYBtn.title = me("sectionAxis.actions.axisY"), this.axisZBtn.title = me("sectionAxis.actions.axisZ");
+ this.hideLabelEl.textContent = le("sectionAxis.actions.hide"), this.reverseLabelEl.textContent = le("sectionAxis.actions.reverse"), this.hideBtn.title = le("sectionAxis.actions.hide"), this.reverseBtn.title = le("sectionAxis.actions.reverse"), this.axisXBtn.title = le("sectionAxis.actions.axisX"), this.axisYBtn.title = le("sectionAxis.actions.axisY"), this.axisZBtn.title = le("sectionAxis.actions.axisZ");
}
/**
* 设置隐藏状态
@@ -35743,8 +35831,8 @@ class p_ {
createButton(e, t, i) {
const s = document.createElement("button");
s.type = "button", s.className = "section-axis-btn";
- const n = document.createElement("div");
- n.className = "section-axis-btn-icon", n.innerHTML = t, s.appendChild(n);
+ const r = document.createElement("div");
+ r.className = "section-axis-btn-icon", r.innerHTML = t, s.appendChild(r);
const a = document.createElement("div");
return a.className = "section-axis-btn-label", s.appendChild(a), e === "hide" ? this.hideLabelEl = a : e === "reverse" && (this.reverseLabelEl = a), s.addEventListener("click", i), s;
}
@@ -35754,8 +35842,8 @@ class p_ {
createAxisButton(e, t, i) {
const s = document.createElement("button");
s.type = "button", s.className = "section-axis-btn section-axis-btn-text";
- const n = document.createElement("div");
- return n.className = "section-axis-btn-label", n.textContent = t, s.appendChild(n), s.addEventListener("click", i), s;
+ const r = document.createElement("div");
+ return r.className = "section-axis-btn-label", r.textContent = t, s.appendChild(r), s.addEventListener("click", i), s;
}
/**
* 处理隐藏按钮切换
@@ -35788,7 +35876,7 @@ class p_ {
this.axisXBtn.classList.toggle("active", this.activeAxis === "x"), this.axisYBtn.classList.toggle("active", this.activeAxis === "y"), this.axisZBtn.classList.toggle("active", this.activeAxis === "z");
}
}
-class m_ extends yi {
+class m_ extends Yt {
dialogId = "section-axis-dialog";
dialog = null;
panel = null;
@@ -35818,7 +35906,7 @@ class m_ extends yi {
console.log("[SectionAxisDialogManager] 切换轴向:", c);
}
}), this.panel.init();
- const e = 240, t = 20, i = 50, s = this.engine.container, n = s.clientWidth, a = s.clientHeight, o = n - e - t, l = a - i - 200;
+ const e = 240, t = 20, i = 50, s = this.engine.container, r = s.clientWidth, a = s.clientHeight, o = r - e - t, l = a - i - 200;
this.dialog = this.engine.dialog.create({
id: this.dialogId,
title: "sectionAxis.dialogTitle",
@@ -35914,7 +36002,7 @@ class f_ {
this.options = e, this.isHidden = e.defaultHidden ?? !1, this.isReversed = e.defaultReversed ?? !1, this.range = JSON.parse(JSON.stringify(e.defaultRange ?? Vc));
}
init() {
- this.element = this.createPanel(), this.unsubscribeLocale = qt.subscribe(() => this.setLocales()), this.unsubscribeTheme = lt.subscribe((e) => this.setTheme(e)), this.setLocales(), this.setTheme(lt.getTheme()), this.updateButtonStates(), this.updateAllSlidersUI(), this.setupDragListeners();
+ this.element = this.createPanel(), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e)), this.setLocales(), this.setTheme(Ze.getTheme()), this.updateButtonStates(), this.updateAllSlidersUI(), this.setupDragListeners();
}
// --- Public APIs ---
setHiddenState(e) {
@@ -35943,37 +36031,37 @@ class f_ {
const e = document.createElement("div");
e.className = "section-box-panel";
const t = document.createElement("div");
- t.className = "section-box-row-buttons", this.hideBtn = this.createButton("hide", me("sectionBox.actions.hide"), () => {
+ t.className = "section-box-row-buttons", this.hideBtn = this.createButton("hide", le("sectionBox.actions.hide"), () => {
this.isHidden = !this.isHidden, this.updateButtonStates(), this.options.onHideToggle?.(this.isHidden);
- }, "hide"), this.reverseBtn = this.createButton("reverse", me("sectionBox.actions.reverse"), () => {
+ }, "hide"), this.reverseBtn = this.createButton("reverse", le("sectionBox.actions.reverse"), () => {
this.isReversed = !this.isReversed, this.updateButtonStates(), this.options.onReverseToggle?.(this.isReversed);
- }, "reverse"), this.fitBtn = this.createButton("fit", me("sectionBox.actions.fitToModel"), () => {
+ }, "reverse"), this.fitBtn = this.createButton("fit", le("sectionBox.actions.fitToModel"), () => {
this.options.onFitToModel?.();
- }, "fit"), this.resetBtn = this.createButton("reset", me("sectionBox.actions.reset"), () => this.reset(), "reset"), [this.hideBtn, this.reverseBtn, this.fitBtn, this.resetBtn].forEach((s) => t.appendChild(s));
+ }, "fit"), this.resetBtn = this.createButton("reset", le("sectionBox.actions.reset"), () => this.reset(), "reset"), [this.hideBtn, this.reverseBtn, this.fitBtn, this.resetBtn].forEach((s) => t.appendChild(s));
const i = document.createElement("div");
- return i.className = "section-box-sliders", i.addEventListener("pointerdown", (s) => s.stopPropagation()), this.xSlider = this.createSlider("x", me("sectionBox.axes.x")), this.ySlider = this.createSlider("y", me("sectionBox.axes.y")), this.zSlider = this.createSlider("z", me("sectionBox.axes.z")), [this.xSlider, this.ySlider, this.zSlider].forEach((s) => i.appendChild(s)), e.appendChild(t), e.appendChild(i), e;
+ return i.className = "section-box-sliders", i.addEventListener("pointerdown", (s) => s.stopPropagation()), this.xSlider = this.createSlider("x", le("sectionBox.axes.x")), this.ySlider = this.createSlider("y", le("sectionBox.axes.y")), this.zSlider = this.createSlider("z", le("sectionBox.axes.z")), [this.xSlider, this.ySlider, this.zSlider].forEach((s) => i.appendChild(s)), e.appendChild(t), e.appendChild(i), e;
}
createButton(e, t, i, s) {
- const n = document.createElement("button");
- n.className = "section-box-btn", n.title = t;
+ const r = document.createElement("button");
+ r.className = "section-box-btn", r.title = t;
const a = document.createElement("div");
a.className = "section-box-btn-icon", a.innerHTML = this.getIconSVG(e);
const o = document.createElement("div");
- return o.className = "section-box-btn-label", o.textContent = t, s === "hide" ? this.hideLabelEl = o : s === "reverse" ? this.reverseLabelEl = o : s === "fit" ? this.fitLabelEl = o : s === "reset" && (this.resetLabelEl = o), n.appendChild(a), n.appendChild(o), n.addEventListener("click", i), n;
+ return o.className = "section-box-btn-label", o.textContent = t, s === "hide" ? this.hideLabelEl = o : s === "reverse" ? this.reverseLabelEl = o : s === "fit" ? this.fitLabelEl = o : s === "reset" && (this.resetLabelEl = o), r.appendChild(a), r.appendChild(o), r.addEventListener("click", i), r;
}
createSlider(e, t) {
const i = document.createElement("div");
i.className = "section-box-slider";
const s = document.createElement("div");
s.className = "section-box-slider-label", s.textContent = t, e === "x" ? this.xLabelEl = s : e === "y" ? this.yLabelEl = s : this.zLabelEl = s;
- const n = document.createElement("div");
- n.className = "section-box-slider-track";
+ const r = document.createElement("div");
+ r.className = "section-box-slider-track";
const a = document.createElement("div");
a.className = "section-box-slider-range";
const o = document.createElement("div");
o.className = "section-box-slider-handle", o.setAttribute("data-axis", e), o.setAttribute("data-handle", "min");
const l = document.createElement("div");
- return l.className = "section-box-slider-handle", l.setAttribute("data-axis", e), l.setAttribute("data-handle", "max"), n.append(a, o, l), i.append(s, n), e === "x" ? (this.xMinHandle = o, this.xMaxHandle = l) : e === "y" ? (this.yMinHandle = o, this.yMaxHandle = l) : (this.zMinHandle = o, this.zMaxHandle = l), i;
+ return l.className = "section-box-slider-handle", l.setAttribute("data-axis", e), l.setAttribute("data-handle", "max"), r.append(a, o, l), i.append(s, r), e === "x" ? (this.xMinHandle = o, this.xMaxHandle = l) : e === "y" ? (this.yMinHandle = o, this.yMaxHandle = l) : (this.zMinHandle = o, this.zMaxHandle = l), i;
}
setupDragListeners() {
[this.xMinHandle, this.xMaxHandle, this.yMinHandle, this.yMaxHandle, this.zMinHandle, this.zMaxHandle].forEach((t) => {
@@ -36021,7 +36109,7 @@ class f_ {
}[e] || "";
}
setLocales() {
- this.hideLabelEl && (this.hideLabelEl.textContent = me("sectionBox.actions.hide"), this.reverseLabelEl.textContent = me("sectionBox.actions.reverse"), this.fitLabelEl.textContent = me("sectionBox.actions.fitToModel"), this.resetLabelEl.textContent = me("sectionBox.actions.reset"), this.xLabelEl.textContent = me("sectionBox.axes.x"), this.yLabelEl.textContent = me("sectionBox.axes.y"), this.zLabelEl.textContent = me("sectionBox.axes.z"), this.hideBtn.title = me("sectionBox.actions.hide"), this.reverseBtn.title = me("sectionBox.actions.reverse"), this.fitBtn.title = me("sectionBox.actions.fitToModel"), this.resetBtn.title = me("sectionBox.actions.reset"));
+ this.hideLabelEl && (this.hideLabelEl.textContent = le("sectionBox.actions.hide"), this.reverseLabelEl.textContent = le("sectionBox.actions.reverse"), this.fitLabelEl.textContent = le("sectionBox.actions.fitToModel"), this.resetLabelEl.textContent = le("sectionBox.actions.reset"), this.xLabelEl.textContent = le("sectionBox.axes.x"), this.yLabelEl.textContent = le("sectionBox.axes.y"), this.zLabelEl.textContent = le("sectionBox.axes.z"), this.hideBtn.title = le("sectionBox.actions.hide"), this.reverseBtn.title = le("sectionBox.actions.reverse"), this.fitBtn.title = le("sectionBox.actions.fitToModel"), this.resetBtn.title = le("sectionBox.actions.reset"));
}
setTheme(e) {
if (!this.element) return;
@@ -36032,7 +36120,7 @@ class f_ {
this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element);
}
}
-class g_ extends yi {
+class g_ extends Yt {
dialogId = "section-box-dialog";
dialog = null;
panel = null;
@@ -36068,7 +36156,7 @@ class g_ extends yi {
console.log("[SectionBoxDialogManager] 范围变化:", c);
}
}), this.panel.init();
- const e = 280, t = 20, i = 50, s = this.engine.container, n = s.clientWidth, a = s.clientHeight, o = n - e - t, l = a - i - 300;
+ const e = 280, t = 20, i = 50, s = this.engine.container, r = s.clientWidth, a = s.clientHeight, o = r - e - t, l = a - i - 300;
this.dialog = this.engine.dialog.create({
id: this.dialogId,
title: "sectionBox.dialogTitle",
@@ -36133,6 +36221,379 @@ class g_ extends yi {
}
}
class v_ {
+ element;
+ options;
+ // 状态
+ state = {
+ mode: "none",
+ isPlanViewActive: !1,
+ speed: 1,
+ gravity: !1,
+ collision: !1,
+ characterModel: "construction-worker",
+ walkMode: "walk"
+ };
+ // DOM 引用 - 左侧按钮
+ planViewBtn;
+ pathModeBtn;
+ walkModeBtn;
+ // DOM 引用 - 中间设置区
+ settingsContainer;
+ speedControl;
+ speedDecreaseBtn;
+ speedIncreaseBtn;
+ speedDisplay;
+ gravityCheckbox;
+ gravityLabel;
+ collisionCheckbox;
+ collisionLabel;
+ characterModelSelect;
+ characterModelLabel;
+ walkModeSelect;
+ walkModeLabel;
+ // DOM 引用 - 退出按钮
+ exitBtn;
+ // 国际化订阅
+ unsubscribeLocale = null;
+ unsubscribeTheme = null;
+ constructor(e = {}) {
+ this.options = e, this.state.speed = e.defaultSpeed ?? 1, this.state.gravity = e.defaultGravity ?? !1, this.state.collision = e.defaultCollision ?? !1, this.state.characterModel = e.defaultCharacterModel ?? "construction-worker", this.state.walkMode = e.defaultWalkMode ?? "walk";
+ }
+ init() {
+ this.element = this.createPanel(), this.updateSettingsView(), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e)), this.setLocales(), this.setTheme(Ze.getTheme());
+ }
+ // --- 公共方法 ---
+ setPlanViewActive(e) {
+ this.state.isPlanViewActive = e, this.updateButtonStates();
+ }
+ setPathModeActive(e) {
+ if (!e && this.state.mode !== "path")
+ return;
+ const t = e ? "path" : "none";
+ this.setMode(t);
+ }
+ getState() {
+ return { ...this.state };
+ }
+ // --- 私有方法 ---
+ createPanel() {
+ const e = document.createElement("div");
+ e.className = "walk-control-panel";
+ const t = this.createLeftButtons(), i = document.createElement("div");
+ i.className = "walk-divider", this.settingsContainer = this.createSettingsContainer();
+ const s = document.createElement("div");
+ s.className = "walk-divider";
+ const r = this.createExitButton();
+ return e.appendChild(t), e.appendChild(i), e.appendChild(this.settingsContainer), e.appendChild(s), e.appendChild(r), e;
+ }
+ createLeftButtons() {
+ const e = document.createElement("div");
+ return e.className = "walk-control-left", this.planViewBtn = this.createIconButton("plan-view", () => {
+ this.state.isPlanViewActive = !this.state.isPlanViewActive, this.updateButtonStates(), this.options.onPlanViewToggle?.(this.state.isPlanViewActive);
+ }), this.pathModeBtn = this.createIconButton("path", () => {
+ const t = this.state.mode === "path" ? "none" : "path";
+ this.setMode(t), this.options.onPathModeToggle?.(t === "path");
+ }), this.walkModeBtn = this.createIconButton("walk", () => {
+ const t = this.state.mode === "walk" ? "none" : "walk";
+ this.setMode(t), this.options.onWalkModeToggle?.(t === "walk");
+ }), e.appendChild(this.planViewBtn), e.appendChild(this.pathModeBtn), e.appendChild(this.walkModeBtn), e;
+ }
+ createSettingsContainer() {
+ const e = document.createElement("div");
+ e.className = "walk-control-settings", this.speedControl = this.createSpeedControl();
+ const t = document.createElement("label");
+ t.className = "walk-checkbox-wrapper walk-checkbox-gravity", this.gravityCheckbox = document.createElement("input"), this.gravityCheckbox.type = "checkbox", this.gravityCheckbox.className = "walk-checkbox", this.gravityCheckbox.checked = this.state.gravity, this.gravityCheckbox.addEventListener("change", () => {
+ this.state.gravity = this.gravityCheckbox.checked, this.options.onGravityToggle?.(this.state.gravity);
+ }), this.gravityLabel = document.createElement("span"), this.gravityLabel.className = "walk-checkbox-label", t.appendChild(this.gravityCheckbox), t.appendChild(this.gravityLabel);
+ const i = document.createElement("label");
+ i.className = "walk-checkbox-wrapper walk-checkbox-collision", this.collisionCheckbox = document.createElement("input"), this.collisionCheckbox.type = "checkbox", this.collisionCheckbox.className = "walk-checkbox", this.collisionCheckbox.checked = this.state.collision, this.collisionCheckbox.addEventListener("change", () => {
+ this.state.collision = this.collisionCheckbox.checked, this.options.onCollisionToggle?.(this.state.collision);
+ }), this.collisionLabel = document.createElement("span"), this.collisionLabel.className = "walk-checkbox-label", i.appendChild(this.collisionCheckbox), i.appendChild(this.collisionLabel);
+ const s = document.createElement("div");
+ s.className = "walk-select-wrapper walk-select-wrapper-character-model", this.characterModelLabel = document.createElement("label"), this.characterModelLabel.className = "walk-select-label", this.characterModelSelect = document.createElement("select"), this.characterModelSelect.className = "walk-select walk-select-character-model", this.characterModelSelect.addEventListener("change", () => {
+ this.state.characterModel = this.characterModelSelect.value, this.options.onCharacterModelChange?.(this.state.characterModel);
+ }), s.appendChild(this.characterModelLabel), s.appendChild(this.characterModelSelect);
+ const r = document.createElement("div");
+ return r.className = "walk-select-wrapper walk-select-wrapper-walk-mode", this.walkModeLabel = document.createElement("label"), this.walkModeLabel.className = "walk-select-label", this.walkModeSelect = document.createElement("select"), this.walkModeSelect.className = "walk-select walk-select-walk-mode", this.walkModeSelect.addEventListener("change", () => {
+ this.state.walkMode = this.walkModeSelect.value, this.options.onWalkModeChange?.(this.state.walkMode);
+ }), r.appendChild(this.walkModeLabel), r.appendChild(this.walkModeSelect), e.appendChild(this.speedControl), e.appendChild(s), e.appendChild(r), e.appendChild(t), e.appendChild(i), e;
+ }
+ createSpeedControl() {
+ const e = document.createElement("div");
+ e.className = "walk-speed-control";
+ const t = document.createElement("label");
+ t.className = "walk-speed-label", t.textContent = le("walkControl.speed");
+ const i = document.createElement("div");
+ return i.className = "walk-speed-group", this.speedDecreaseBtn = document.createElement("button"), this.speedDecreaseBtn.className = "walk-speed-btn", this.speedDecreaseBtn.textContent = "-", this.speedDecreaseBtn.addEventListener("click", () => {
+ this.state.speed > 1 && (this.state.speed--, this.updateSpeedDisplay(), this.options.onSpeedChange?.(this.state.speed));
+ }), this.speedDisplay = document.createElement("div"), this.speedDisplay.className = "walk-speed-display", this.speedDisplay.textContent = `${this.state.speed}X`, this.speedIncreaseBtn = document.createElement("button"), this.speedIncreaseBtn.className = "walk-speed-btn", this.speedIncreaseBtn.textContent = "+", this.speedIncreaseBtn.addEventListener("click", () => {
+ this.state.speed < 10 && (this.state.speed++, this.updateSpeedDisplay(), this.options.onSpeedChange?.(this.state.speed));
+ }), i.appendChild(this.speedDecreaseBtn), i.appendChild(this.speedDisplay), i.appendChild(this.speedIncreaseBtn), e.appendChild(t), e.appendChild(i), e;
+ }
+ createIconButton(e, t) {
+ const i = document.createElement("button");
+ return i.className = `walk-icon-btn walk-icon-btn-${e}`, i.innerHTML = this.getIconSVG(e), i.addEventListener("click", t), i;
+ }
+ createExitButton() {
+ const e = document.createElement("button");
+ return e.className = "walk-exit-btn", e.addEventListener("click", () => {
+ this.options.onExit?.();
+ }), this.exitBtn = e, e;
+ }
+ setMode(e) {
+ const t = this.state.mode;
+ t === "walk" && e !== "walk" && this.options.onWalkModeToggle?.(!1), t === "path" && e !== "path" && this.options.onPathModeToggle?.(!1), this.state.mode = e, e === "path" ? (this.state.gravity = !1, this.state.collision = !1, this.gravityCheckbox.checked = !1, this.gravityCheckbox.disabled = !0, this.collisionCheckbox.checked = !1, this.collisionCheckbox.disabled = !0) : (this.gravityCheckbox.disabled = !1, this.collisionCheckbox.disabled = !1), this.updateButtonStates(), this.updateSettingsView(), this.updateSpeedButtonStates();
+ }
+ updateButtonStates() {
+ this.planViewBtn.classList.toggle("active", this.state.isPlanViewActive), this.pathModeBtn.classList.toggle("active", this.state.mode === "path"), this.walkModeBtn.classList.toggle("active", this.state.mode === "walk");
+ }
+ updateSettingsView() {
+ const e = this.speedControl, t = this.gravityCheckbox.parentElement, i = this.collisionCheckbox.parentElement, s = this.characterModelSelect.parentElement, r = this.walkModeSelect.parentElement;
+ this.state.mode === "walk" ? (e.style.display = "none", t.style.display = "flex", i.style.display = "flex", s.style.display = "flex", r.style.display = "flex") : (e.style.display = "flex", t.style.display = "flex", i.style.display = "flex", s.style.display = "none", r.style.display = "none");
+ }
+ updateSpeedDisplay() {
+ this.speedDisplay.textContent = `${this.state.speed}X`, this.updateSpeedButtonStates();
+ }
+ updateSpeedButtonStates() {
+ this.speedDecreaseBtn.disabled = this.state.speed <= 1, this.speedIncreaseBtn.disabled = this.state.speed >= 10;
+ }
+ getIconSVG(e) {
+ return {
+ "plan-view": ' ',
+ path: ' ',
+ walk: ' '
+ }[e] || "";
+ }
+ setLocales() {
+ const e = this.speedControl.querySelector(".walk-speed-label");
+ e && (e.textContent = le("walkControl.speed")), this.gravityLabel.textContent = le("walkControl.gravity"), this.collisionLabel.textContent = le("walkControl.collision"), this.characterModelLabel.textContent = le("walkControl.characterModel.label"), this.characterModelSelect.innerHTML = "";
+ const t = document.createElement("option");
+ t.value = "construction-worker", t.textContent = le("walkControl.characterModel.constructionWorker"), t.selected = this.state.characterModel === "construction-worker", this.characterModelSelect.appendChild(t);
+ const i = document.createElement("option");
+ i.value = "office-male", i.textContent = le("walkControl.characterModel.officeMale"), i.selected = this.state.characterModel === "office-male", this.characterModelSelect.appendChild(i), this.walkModeLabel.textContent = le("walkControl.walkMode.label"), this.walkModeSelect.innerHTML = "";
+ const s = document.createElement("option");
+ s.value = "walk", s.textContent = le("walkControl.walkMode.walk"), s.selected = this.state.walkMode === "walk", this.walkModeSelect.appendChild(s);
+ const r = document.createElement("option");
+ r.value = "run", r.textContent = le("walkControl.walkMode.run"), r.selected = this.state.walkMode === "run", this.walkModeSelect.appendChild(r), this.exitBtn.textContent = le("walkControl.exit");
+ }
+ setTheme(e) {
+ if (!this.element) return;
+ const t = this.element.style;
+ t.setProperty("--bim-walk-control-bg", e.panelBackground ?? "rgba(0, 0, 0, 0.8)"), t.setProperty("--bim-walk-btn-hover", e.componentHover ?? "rgba(255, 255, 255, 0.15)"), t.setProperty("--bim-walk-btn-active", e.componentActive ?? "rgba(255, 255, 255, 0.3)"), t.setProperty("--bim-primary-color", e.primary ?? "#1890ff"), t.setProperty("--bim-primary-hover", e.primaryHover ?? "#40a9ff"), t.setProperty("--bim-icon-color", e.icon ?? "#ccc"), t.setProperty("--bim-text-color", e.textPrimary ?? "#fff"), t.setProperty("--bim-divider-color", e.border ?? "rgba(255, 255, 255, 0.2)"), t.setProperty("--bim-speed-group-bg", e.componentHover ?? "rgba(255, 255, 255, 0.1)"), t.setProperty("--bim-speed-btn-bg", e.componentHover ?? "rgba(255, 255, 255, 0.1)"), t.setProperty("--bim-speed-btn-hover", e.componentActive ?? "rgba(255, 255, 255, 0.2)"), t.setProperty("--bim-select-bg", e.componentHover ?? "rgba(255, 255, 255, 0.1)"), t.setProperty("--bim-select-border", e.border ?? "rgba(255, 255, 255, 0.2)"), t.setProperty("--bim-select-option-bg", e.panelBackground ?? "#333");
+ }
+ destroy() {
+ this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element);
+ }
+}
+class __ {
+ element;
+ unsubscribeLocale = null;
+ unsubscribeTheme = null;
+ constructor() {
+ }
+ init() {
+ this.element = this.createPanel(), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e)), this.setLocales(), this.setTheme(Ze.getTheme());
+ }
+ createPanel() {
+ const e = document.createElement("div");
+ return e.className = "walk-path-panel", e.style.padding = "20px", e.style.color = "var(--bim-text-color, #fff)", e.textContent = "路径漫游内容待实现", e;
+ }
+ setLocales() {
+ }
+ setTheme(e) {
+ }
+ destroy() {
+ this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element);
+ }
+}
+class x_ extends Yt {
+ dialogId = "walk-path-dialog";
+ dialog = null;
+ panel = null;
+ constructor(e) {
+ super(e);
+ }
+ init() {
+ }
+ /**
+ * 显示弹窗
+ */
+ show() {
+ if (!this.engine.dialog || !this.engine.container) {
+ console.warn("Dialog manager or container is not initialized");
+ return;
+ }
+ this.destroy(), this.panel = new __(), this.panel.init();
+ const e = 300, t = 400, i = 20, s = this.engine.container, r = s.clientHeight, o = s.clientWidth - e - i, l = (r - t) / 2;
+ this.dialog = this.engine.dialog.create({
+ id: this.dialogId,
+ title: "walkControl.path.dialogTitle",
+ width: e,
+ height: t,
+ position: { x: o, y: l },
+ draggable: !0,
+ resizable: !1,
+ content: this.panel.element,
+ onClose: () => {
+ this.engine.walkControl && this.engine.walkControl.panel && this.engine.walkControl.panel.setPathModeActive(!1), this.hide();
+ }
+ }), this.dialog.init();
+ }
+ /**
+ * 隐藏弹窗
+ */
+ hide() {
+ this.destroy();
+ }
+ /**
+ * 销毁弹窗和面板
+ */
+ destroy() {
+ const e = this.dialog;
+ this.dialog = null, e && e.destroy(), this.panel && (this.panel.destroy(), this.panel = null);
+ }
+}
+class b_ extends Yt {
+ panel = null;
+ pathManager = null;
+ constructor(e) {
+ super(e);
+ }
+ init() {
+ this.pathManager = new x_(this.engine), this.pathManager.init();
+ }
+ /**
+ * 显示漫游控制面板
+ */
+ show() {
+ if (!this.engine.toolbar) {
+ console.warn("Toolbar not initialized");
+ return;
+ }
+ this.engine.toolbar.hide(), this.panel = new v_({
+ onPlanViewToggle: (e) => {
+ console.log("[WalkControl] 地图:", e), e ? this.engine.map?.show() : this.engine.map?.hide(), this.emit("walk:plan-view-toggle", { isActive: e });
+ },
+ onPathModeToggle: (e) => {
+ console.log("[WalkControl] 路径漫游:", e), e ? this.pathManager?.show() : this.pathManager?.hide(), this.emit("walk:path-mode-toggle", { isActive: e });
+ },
+ onWalkModeToggle: (e) => {
+ console.log("[WalkControl] 漫游模式:", e), e && this.pathManager?.hide(), this.emit("walk:walk-mode-toggle", { isActive: e });
+ },
+ onSpeedChange: (e) => {
+ console.log("[WalkControl] 速度变化:", e), this.emit("walk:speed-change", { speed: e });
+ },
+ onGravityToggle: (e) => {
+ console.log("[WalkControl] 重力:", e), this.emit("walk:gravity-toggle", { enabled: e });
+ },
+ onCollisionToggle: (e) => {
+ console.log("[WalkControl] 碰撞:", e), this.emit("walk:collision-toggle", { enabled: e });
+ },
+ onCharacterModelChange: (e) => {
+ console.log("[WalkControl] 角色模型:", e);
+ },
+ onWalkModeChange: (e) => {
+ console.log("[WalkControl] 行走模式:", e);
+ },
+ onExit: () => {
+ this.hide();
+ }
+ }), this.panel.init(), this.engine.map?.isOpen() && this.panel.setPlanViewActive(!0), this.engine.on("map:opened", () => {
+ this.panel?.setPlanViewActive(!0);
+ }), this.engine.on("map:closed", () => {
+ this.panel?.setPlanViewActive(!1);
+ }), this.engine.container ? (this.panel.element.style.position = "absolute", this.panel.element.style.bottom = "20px", this.panel.element.style.left = "50%", this.panel.element.style.transform = "translateX(-50%)", this.panel.element.style.zIndex = "1000", this.engine.container.appendChild(this.panel.element)) : console.warn("[WalkControlManager] Container not found");
+ }
+ /**
+ * 隐藏漫游控制面板
+ */
+ hide() {
+ this.pathManager?.hide(), this.panel && (this.panel.destroy(), this.panel = null), this.engine.toolbar && this.engine.toolbar.show();
+ }
+ /**
+ * 销毁管理器
+ */
+ destroy() {
+ this.hide(), this.pathManager?.destroy(), this.pathManager = null;
+ }
+}
+class y_ {
+ element;
+ unsubscribeLocale = null;
+ unsubscribeTheme = null;
+ constructor() {
+ }
+ init() {
+ this.element = this.createPanel(), this.unsubscribeLocale = Ut.subscribe(() => this.setLocales()), this.unsubscribeTheme = Ze.subscribe((e) => this.setTheme(e)), this.setLocales(), this.setTheme(Ze.getTheme());
+ }
+ createPanel() {
+ const e = document.createElement("div");
+ return e.className = "map-panel", e.style.padding = "20px", e.style.color = "#fff", e.textContent = "地图内容待实现", e;
+ }
+ setLocales() {
+ }
+ setTheme(e) {
+ }
+ destroy() {
+ this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element);
+ }
+}
+class M_ extends Yt {
+ dialogId = "map-dialog";
+ dialog = null;
+ panel = null;
+ constructor(e) {
+ super(e);
+ }
+ init() {
+ }
+ /**
+ * 显示弹窗
+ */
+ show() {
+ if (!this.engine.dialog || !this.engine.container) {
+ console.warn("Dialog manager or container is not initialized");
+ return;
+ }
+ if (this.isOpen())
+ return;
+ this.panel = new y_(), this.panel.init();
+ const e = 300, t = 400, i = 20, s = 20, a = this.engine.container.clientHeight, o = i, l = a - t - s;
+ this.dialog = this.engine.dialog.create({
+ id: this.dialogId,
+ title: "map.dialogTitle",
+ width: e,
+ height: t,
+ position: { x: o, y: l },
+ draggable: !0,
+ resizable: !1,
+ content: this.panel.element,
+ onClose: () => {
+ this.hide();
+ }
+ }), this.dialog.init(), this.emit("map:opened", {});
+ }
+ /**
+ * 隐藏弹窗
+ */
+ hide() {
+ this.destroy(), this.emit("map:closed", {});
+ }
+ /**
+ * 检查地图是否打开
+ */
+ isOpen() {
+ return this.dialog !== null;
+ }
+ /**
+ * 销毁弹窗和面板
+ */
+ destroy() {
+ const e = this.dialog;
+ this.dialog = null, e && e.destroy(), this.panel && (this.panel.destroy(), this.panel = null);
+ }
+}
+class S_ {
events = /* @__PURE__ */ new Map();
on(e, t) {
return this.events.has(e) || this.events.set(e, []), this.events.get(e).push(t), () => this.off(e, t);
@@ -36148,8 +36609,8 @@ class v_ {
i && i.forEach((s) => {
try {
s(t);
- } catch (n) {
- console.error(`[EventEmitter] Error in listener for event "${e}":`, n);
+ } catch (r) {
+ console.error(`[EventEmitter] Error in listener for event "${e}":`, r);
}
});
}
@@ -36157,7 +36618,7 @@ class v_ {
this.events.clear();
}
}
-class __ extends v_ {
+class T_ extends S_ {
container;
wrapper = null;
toolbar = null;
@@ -36181,11 +36642,15 @@ class __ extends v_ {
// 轴向剖切面板
sectionBox = null;
// 剖切盒面板
+ walkControl = null;
+ // 漫游控制面板
+ map = null;
+ // 地图面板
constructor(e, t) {
super();
const i = typeof e == "string" ? document.getElementById(e) : e;
if (!i) throw new Error("Container not found");
- this.container = i, t?.locale && qt.setLocale(t.locale), t?.theme && (t.theme === "custom" ? console.warn("Custom theme should be set via setCustomTheme().") : lt.setTheme(t.theme)), this.init();
+ this.container = i, t?.locale && Ut.setLocale(t.locale), t?.theme && (t.theme === "custom" ? console.warn("Custom theme should be set via setCustomTheme().") : Ze.setTheme(t.theme)), this.init();
}
// Typed wrappers for events
emit(e, t) {
@@ -36195,19 +36660,19 @@ class __ extends v_ {
return super.on(e, t);
}
setLocale(e) {
- qt.setLocale(e);
+ Ut.setLocale(e);
}
getLocale() {
- return qt.getLocale();
+ return Ut.getLocale();
}
setTheme(e) {
- lt.setTheme(e);
+ Ze.setTheme(e);
}
setCustomTheme(e) {
- lt.setCustomTheme(e);
+ Ze.setCustomTheme(e);
}
init() {
- this.container.innerHTML = "", this.wrapper = document.createElement("div"), this.wrapper.className = "bim-engine-wrapper", this.container.appendChild(this.wrapper), this.engine = new i_(this, this.wrapper), this.dialog = new nu(this, this.wrapper), this.toolbar = new iu(this, this.wrapper), this.buttonGroup = new su(this, this.wrapper), this.rightKey = new Hh(this, this.wrapper), this.constructTreeBtn = new a_(this, this.wrapper), this.propertyPanel = new l_(this), this.measure = new h_(this), this.sectionPlane = new d_(this), this.sectionAxis = new m_(this), this.sectionBox = new g_(this), this.updateTheme(lt.getTheme()), lt.subscribe((e) => {
+ this.container.innerHTML = "", this.wrapper = document.createElement("div"), this.wrapper.className = "bim-engine-wrapper", this.container.appendChild(this.wrapper), this.engine = new i_(this, this.wrapper), this.dialog = new ru(this, this.wrapper), this.toolbar = new iu(this, this.wrapper), this.buttonGroup = new su(this, this.wrapper), this.rightKey = new Hh(this, this.wrapper), this.constructTreeBtn = new a_(this, this.wrapper), this.propertyPanel = new l_(this), this.measure = new h_(this), this.sectionPlane = new d_(this), this.sectionAxis = new m_(this), this.sectionBox = new g_(this), this.walkControl = new b_(this), this.walkControl.init(), this.map = new M_(this), this.map.init(), this.updateTheme(Ze.getTheme()), Ze.subscribe((e) => {
this.updateTheme(e);
});
}
@@ -36215,10 +36680,10 @@ class __ extends v_ {
this.wrapper && (this.wrapper.style.backgroundColor = e.background, this.wrapper.style.color = e.textPrimary);
}
destroy() {
- this.toolbar?.destroy(), this.buttonGroup?.destroy(), this.engine?.destroy(), this.dialog?.destroy(), this.rightKey?.destroy(), this.propertyPanel?.destroy(), this.measure?.destroy(), this.container.innerHTML = "", this.clear();
+ this.toolbar?.destroy(), this.buttonGroup?.destroy(), this.engine?.destroy(), this.dialog?.destroy(), this.rightKey?.destroy(), this.propertyPanel?.destroy(), this.measure?.destroy(), this.sectionPlane?.destroy(), this.sectionAxis?.destroy(), this.sectionBox?.destroy(), this.walkControl?.destroy(), this.container.innerHTML = "", this.clear();
}
}
export {
- __ as BimEngine
+ T_ as BimEngine
};
//# sourceMappingURL=bim-engine-sdk.es.js.map
diff --git a/dist/bim-engine-sdk.es.js.map b/dist/bim-engine-sdk.es.js.map
index f1a4363..ebb0dcd 100644
--- a/dist/bim-engine-sdk.es.js.map
+++ b/dist/bim-engine-sdk.es.js.map
@@ -1 +1 @@
-{"version":3,"file":"bim-engine-sdk.es.js","sources":["../src/locales/zh-CN.ts","../src/locales/en-US.ts","../src/services/locale.ts","../src/themes/presets.ts","../src/services/theme.ts","../src/components/button-group/index.ts","../src/components/button-group/toolbar/index.ts","../src/core/component.ts","../src/managers/toolbar-manager.ts","../src/managers/button-group-manager.ts","../src/components/dialog/index.ts","../src/components/dialog/bimInfoDialog/index.ts","../src/managers/dialog-manager.ts","../src/bim-engine-sdk.es.js","../src/components/engine/index.ts","../src/components/right-key/index.ts","../src/components/menu/index.ts","../src/managers/right-key-manager.ts","../src/components/menu/buttons/info.ts","../src/components/menu/buttons/four.ts","../src/components/menu/buttons/second.ts","../src/components/menu/buttons/home.ts","../src/managers/engine-manager.ts","../src/components/tree/types.ts","../src/components/tree/tree-node.ts","../src/components/tree/index.ts","../src/components/tab/index.ts","../src/managers/construct-tree-manager-btn.ts","../src/components/collapse/index.ts","../src/components/description/index.ts","../src/managers/property-panel-manager.ts","../src/components/measure-panel/index.ts","../src/managers/measure-dialog-manager.ts","../src/components/section-plane-panel/index.ts","../src/managers/section-plane-dialog-manager.ts","../src/components/section-axis-panel/index.ts","../src/managers/section-axis-dialog-manager.ts","../src/components/section-box-panel/index.ts","../src/managers/section-box-dialog-manager.ts","../src/core/event-emitter.ts","../src/bim-engine.ts"],"sourcesContent":["import {TranslationDictionary} from './types';\n\nexport const zhCN: TranslationDictionary = {\n common: {\n title: 'BimEngine',\n description: '这是一个使用 BIM-ENGINE。',\n openTestDialog: '打开测试弹窗',\n openInfoDialog: '打开信息弹窗 (封装版)',\n },\n toolbar: {\n home: '首页',\n measure: '测量',\n zoomBox: '选框放大',\n info: '信息',\n location: '定位',\n setting: '设置',\n walk: '漫游',\n walkMenu: '漫游菜单',\n walkPerson: '第一人称',\n walkBird: '第三人称',\n tree: '模型树',\n section: '剖切',\n sectionPlane: '拾取面剖切',\n sectionAxis: '轴向剖切',\n sectionBox: '剖切盒'\n },\n dialog: {\n testTitle: '测试弹窗',\n testContent: '这是一个 可拖拽 且 可缩放 的弹窗。 你可以尝试拖动标题栏,或者拖动右下角改变大小。
',\n },\n menu: {\n info: '信息',\n home: '首页'\n },\n tree: {\n searchPlaceholder: '请输入要搜索的内容',\n },\n constructTree: {\n title: '目录树',\n },\n tab: {\n component: '构件',\n system: '系统',\n space: '空间',\n },\n panel: {\n property: {\n title: '构件详情',\n base: '基本属性',\n material: '材质信息',\n advanced: '高级设置',\n tab: {\n props: '属性',\n material: '材质'\n }\n }\n },\n measure: {\n btnName: '测量',\n dialogTitle: '测量',\n modes: {\n distance: '距离',\n minDistance: '最小距离',\n angle: '角度',\n elevation: '标高',\n volume: '体积',\n laserDistance: '激光测距',\n slope: '坡度',\n spaceVolume: '空间体积',\n },\n actions: {\n expand: '展开',\n collapse: '收起',\n clearAll: '删除全部',\n settings: '设置',\n },\n labels: {\n currentMode: '当前测量方式:',\n x: 'X:',\n y: 'Y:',\n z: 'Z:',\n value: {\n distance: '距离:',\n minDistance: '最小距离:',\n angle: '角度:',\n elevation: '标高:',\n volume: '体积:',\n laserDistance: '激光测距:',\n slope: '坡度:',\n spaceVolume: '空间体积:',\n }\n },\n units: {\n mm: 'mm',\n cm: 'cm',\n m: 'm',\n km: 'km',\n deg: '°',\n m3: 'm³',\n percent: '%',\n },\n settings: {\n title: '设置',\n unit: '单位:',\n precision: '精度:',\n hint: '距离、最小距离和标高默认使用该单位;角度和体积有各自默认单位。',\n save: '保存设置',\n cancel: '取消',\n }\n },\n sectionPlane: {\n dialogTitle: '拾取面剖切',\n actions: {\n hide: '隐藏',\n reverse: '反向',\n reset: '重置'\n }\n },\n sectionAxis: {\n dialogTitle: '轴向剖切',\n actions: {\n hide: '隐藏',\n reverse: '反向',\n axisX: 'X',\n axisY: 'Y',\n axisZ: 'Z'\n }\n },\n sectionBox: {\n dialogTitle: '剖切盒',\n actions: {\n hide: '隐藏',\n reverse: '反向',\n fitToModel: '适应',\n reset: '重置'\n },\n axes: {\n x: 'X',\n y: 'Y',\n z: 'Z'\n }\n }\n};\n","import {TranslationDictionary} from './types';\n\nexport const enUS: TranslationDictionary = {\n common: {\n title: 'BimEngine',\n description: 'This is a BIM-ENGINE demo.',\n openTestDialog: 'Open Test Dialog',\n openInfoDialog: 'Open Info Dialog (Wrapped)',\n },\n toolbar: {\n home: 'Home',\n measure: 'Measure',\n zoomBox: 'Zoom Box',\n info: 'Info',\n location: 'Location',\n setting: 'Settings',\n walk: 'Walk',\n walkPerson: 'Person',\n walkBird: 'Bird Eye',\n walkMenu: 'Menu',\n tree: 'Tree',\n section: 'Section',\n sectionPlane: 'Plane Section',\n sectionAxis: 'Axis Section',\n sectionBox: 'Section Box'\n },\n dialog: {\n testTitle: 'Test Dialog',\n testContent: 'This is a draggable and resizable dialog. Try dragging the title bar or resizing from the bottom-right corner.
',\n },\n menu: {\n info: 'Info',\n home: 'Home',\n },\n tree: {\n searchPlaceholder: 'Please enter content to search',\n },\n constructTree: {\n title: 'Construct Tree',\n },\n tab: {\n component: 'Component',\n system: 'System',\n space: 'Space',\n },\n panel: {\n property: {\n title: 'Component Details',\n base: 'Basic Info',\n material: 'Material',\n advanced: 'Advanced',\n tab: {\n props: 'Properties',\n material: 'Material'\n }\n }\n },\n measure: {\n btnName: 'Measure',\n dialogTitle: 'Measure',\n modes: {\n distance: 'Distance',\n minDistance: 'Min Distance',\n angle: 'Angle',\n elevation: 'Elevation',\n volume: 'Volume',\n laserDistance: 'Laser Distance',\n slope: 'Slope',\n spaceVolume: 'Space Volume',\n },\n actions: {\n expand: 'Expand',\n collapse: 'Collapse',\n clearAll: 'Clear All',\n settings: 'Settings',\n },\n labels: {\n currentMode: 'Mode:',\n x: 'X:',\n y: 'Y:',\n z: 'Z:',\n value: {\n distance: 'Distance:',\n minDistance: 'Min Distance:',\n angle: 'Angle:',\n elevation: 'Elevation:',\n volume: 'Volume:',\n laserDistance: 'Laser Distance:',\n slope: 'Slope:',\n spaceVolume: 'Space Volume:',\n }\n },\n units: {\n mm: 'mm',\n cm: 'cm',\n m: 'm',\n km: 'km',\n deg: '°',\n m3: 'm³',\n percent: '%',\n },\n settings: {\n title: 'Settings',\n unit: 'Unit:',\n precision: 'Precision:',\n hint: 'Distance, min distance and elevation use this unit by default; angle and volume use their own units.',\n save: 'Save',\n cancel: 'Cancel',\n }\n },\n sectionPlane: {\n dialogTitle: 'Plane Section',\n actions: {\n hide: 'Hide',\n reverse: 'Reverse',\n reset: 'Reset'\n }\n },\n sectionAxis: {\n dialogTitle: 'Axis Section',\n actions: {\n hide: 'Hide',\n reverse: 'Reverse',\n axisX: 'X',\n axisY: 'Y',\n axisZ: 'Z'\n }\n },\n sectionBox: {\n dialogTitle: 'Section Box',\n actions: {\n hide: 'Hide',\n reverse: 'Reverse',\n fitToModel: 'Fit',\n reset: 'Reset'\n },\n axes: {\n x: 'X',\n y: 'Y',\n z: 'Z'\n }\n }\n};\n","import { LocaleType, TranslationDictionary } from '../locales/types';\nimport { zhCN } from '../locales/zh-CN';\nimport { enUS } from '../locales/en-US';\n\ntype LocaleChangeListener = (locale: LocaleType) => void;\n\n/**\n * 语言管理器类\n */\nexport class LocaleManager {\n private currentLocale: LocaleType = 'zh-CN';\n private messages: Record = {\n 'zh-CN': zhCN,\n 'en-US': enUS,\n };\n private listeners: LocaleChangeListener[] = [];\n\n constructor() {\n // 默认初始化\n }\n\n /**\n * 获取当前语言\n */\n public getLocale(): LocaleType {\n return this.currentLocale;\n }\n\n /**\n * 切换语言\n */\n public setLocale(locale: LocaleType) {\n if (this.currentLocale === locale) return;\n this.currentLocale = locale;\n this.notifyListeners();\n }\n\n /**\n * 翻译核心方法\n */\n public t(key: string): string {\n if (!key) return '';\n \n const keys = key.split('.');\n let value: any = this.messages[this.currentLocale];\n \n for (const k of keys) {\n if (value && typeof value === 'object' && k in value) {\n value = value[k];\n } else {\n return key;\n }\n }\n return value as string;\n }\n\n /**\n * 订阅变更\n */\n public subscribe(listener: LocaleChangeListener): () => void {\n this.listeners.push(listener);\n return () => {\n this.listeners = this.listeners.filter(l => l !== listener);\n };\n }\n\n private notifyListeners() {\n this.listeners.forEach(listener => listener(this.currentLocale));\n }\n}\n\n// --- 导出单例 ---\nexport const localeManager = new LocaleManager();\n\n// --- 导出便捷方法 ---\n/**\n * 全局翻译函数\n * @param key 键路径 (如 'toolbar.home')\n */\nexport const t = (key: string): string => localeManager.t(key);\n","import { ThemeConfig } from './types';\n\n/**\n * 深色主题 (默认)\n */\nexport const darkTheme: ThemeConfig = {\n name: 'dark',\n primary: '#0078d4',\n primaryHover: '#0063b1',\n\n // 修改:背景色统一为浅灰,不再跟随深色模式变黑\n background: '#f5f5f5',\n panelBackground: 'rgba(30, 30, 30, 0.9)',\n\n textPrimary: '#ffffff',\n textSecondary: '#cccccc',\n\n border: '#444444',\n\n icon: '#cccccc',\n iconActive: '#ffffff',\n\n componentBackground: 'transparent',\n componentHover: '#4e4d4dff',\n componentActive: 'rgba(255, 255, 255, 0.1)'\n};\n\n/**\n * 浅色主题\n */\nexport const lightTheme: ThemeConfig = {\n name: 'light',\n primary: '#0078d4',\n primaryHover: '#106ebe',\n\n // 统一为浅灰\n background: '#f5f5f5',\n panelBackground: '#ffffff',\n\n textPrimary: '#333333',\n textSecondary: '#666666',\n\n border: '#e0e0e0',\n\n icon: '#555555',\n iconActive: '#0078d4',\n\n componentBackground: 'transparent',\n componentHover: '#f0f0f0',\n componentActive: '#e0e0e0'\n};","import { ThemeConfig } from '../themes/types';\nimport { darkTheme, lightTheme } from '../themes/presets';\n\ntype ThemeChangeListener = (theme: ThemeConfig) => void;\n\n/**\n * 主题管理器 (单例)\n */\nexport class ThemeManager {\n private currentTheme: ThemeConfig = darkTheme;\n private listeners: ThemeChangeListener[] = [];\n\n constructor() {\n // 默认初始化\n }\n\n /**\n * 获取当前主题配置\n */\n public getTheme(): ThemeConfig {\n return this.currentTheme;\n }\n\n /**\n * 切换预设主题\n * @param themeName 'dark' | 'light'\n */\n public setTheme(themeName: 'dark' | 'light') {\n if (themeName === 'light') {\n this.applyTheme(lightTheme);\n } else {\n this.applyTheme(darkTheme);\n }\n }\n\n /**\n * 应用自定义主题配置\n * @param theme 配置对象\n */\n public setCustomTheme(theme: ThemeConfig) {\n this.applyTheme(theme);\n }\n\n /**\n * 内部应用主题逻辑\n */\n private applyTheme(theme: ThemeConfig) {\n this.currentTheme = theme;\n this.notifyListeners();\n }\n\n /**\n * 订阅主题变更\n */\n public subscribe(listener: ThemeChangeListener): () => void {\n this.listeners.push(listener);\n // 立即回调一次当前状态\n listener(this.currentTheme);\n return () => {\n this.listeners = this.listeners.filter(l => l !== listener);\n };\n }\n\n private notifyListeners() {\n this.listeners.forEach(listener => listener(this.currentTheme));\n }\n}\n\n// 导出单例\nexport const themeManager = new ThemeManager();","import './index.css';\nimport type {\n OptButton,\n ButtonGroup,\n ButtonGroupOptions,\n ButtonConfig,\n ButtonGroupColors\n} from './index.type';\nimport { t, localeManager } from '../../services/locale';\nimport { themeManager } from '../../services/theme';\nimport type { ThemeConfig } from '../../themes/types';\nimport { IBimComponent } from '../../types/component';\nimport type { BimEngine } from '../../bim-engine';\nimport { EngineEvents } from '../../types/events';\n\n/**\n * 通用按钮组组件 (BimButtonGroup)\n */\nexport class BimButtonGroup implements IBimComponent {\n private container: HTMLElement;\n private options: ButtonGroupOptions;\n private groups: ButtonGroup[] = [];\n private activeBtnIds: Set = new Set();\n private btnRefs: Map = new Map();\n private dropdownElement: HTMLElement | null = null;\n private hoverTimeout: number | null = null;\n private customColors: Set = new Set(); // 记录用户自定义的颜色属性\n private unsubscribeLocale: (() => void) | null = null;\n private unsubscribeTheme: (() => void) | null = null;\n\n protected engine: BimEngine | null = null;\n\n private readonly DEFAULT_ICON = ' ';\n\n constructor(options: ButtonGroupOptions) {\n const el = typeof options.container === 'string'\n ? document.getElementById(options.container)\n : options.container;\n\n if (!el) throw new Error('Container not found');\n\n this.container = el;\n // 合并默认配置\n this.options = {\n showLabel: true,\n visibility: {},\n direction: 'row', // 默认横向\n position: 'static', // 默认静态定位\n align: 'vertical', // 默认图标在上\n expand: 'down', // 默认向下展开\n ...options\n };\n\n // 记录初始传入的自定义颜色\n const colorKeys: (keyof ButtonGroupColors)[] = [\n 'backgroundColor', 'btnBackgroundColor', 'btnHoverColor',\n 'btnActiveColor', 'iconColor', 'iconActiveColor',\n 'textColor', 'textActiveColor'\n ];\n colorKeys.forEach(key => {\n if (options[key]) {\n this.customColors.add(key);\n }\n });\n\n this.initContainer();\n this.applyStyles();\n }\n\n public setEngine(engine: BimEngine) {\n this.engine = engine;\n }\n\n protected emit(event: K, payload: EngineEvents[K]) {\n if (this.engine) {\n this.engine.emit(event, payload);\n } else {\n console.warn('[BimButtonGroup] Engine not set, cannot emit event:', event);\n }\n }\n\n private initContainer(): void {\n this.container.innerHTML = '';\n this.container.classList.add('bim-btn-group-root');\n\n if (this.options.direction === 'column') {\n this.container.classList.add('dir-column');\n } else {\n this.container.classList.add('dir-row');\n }\n\n if (this.options.className) {\n this.container.classList.add(this.options.className);\n }\n\n this.updatePosition();\n\n // 添加事件拦截,防止点击穿透到 3D 引擎\n this.setupEventInterception(this.container);\n }\n\n /**\n * 设置事件拦截,防止事件冒泡到下层元素(如 3D 引擎)\n */\n private setupEventInterception(el: HTMLElement): void {\n const stopPropagation = (e: Event) => {\n e.stopPropagation();\n };\n\n const events = [\n 'click', 'dblclick', 'contextmenu', 'wheel',\n 'mousedown', 'mouseup', 'mousemove',\n 'touchstart', 'touchend', 'touchmove',\n 'pointerdown', 'pointerup', 'pointermove', 'pointerenter', 'pointerleave', 'pointerover', 'pointerout'\n ];\n\n events.forEach(eventType => {\n el.addEventListener(eventType, stopPropagation, { passive: false });\n });\n }\n\n private updatePosition() {\n const pos = this.options.position;\n const style = this.container.style;\n\n style.top = ''; style.bottom = ''; style.left = ''; style.right = ''; style.transform = '';\n\n if (pos === 'static') {\n this.container.classList.add('static');\n return;\n }\n\n this.container.classList.remove('static');\n this.container.style.position = 'absolute';\n\n if (typeof pos === 'object' && 'x' in pos) {\n style.left = `${pos.x}px`;\n style.top = `${pos.y}px`;\n } else {\n const margin = '20px';\n switch (pos) {\n case 'top-left':\n style.top = margin; style.left = margin;\n break;\n case 'top-center':\n style.top = margin; style.left = '50%'; style.transform = 'translateX(-50%)';\n break;\n case 'top-right':\n style.top = margin; style.right = margin;\n break;\n case 'bottom-left':\n style.bottom = margin; style.left = margin;\n break;\n case 'bottom-center':\n style.bottom = margin; style.left = '50%'; style.transform = 'translateX(-50%)';\n break;\n case 'bottom-right':\n style.bottom = margin; style.right = margin;\n break;\n case 'left-center':\n style.left = margin; style.top = '50%'; style.transform = 'translateY(-50%)';\n break;\n case 'right-center':\n style.right = margin; style.top = '50%'; style.transform = 'translateY(-50%)';\n break;\n case 'center':\n style.top = '50%'; style.left = '50%'; style.transform = 'translate(-50%, -50%)';\n break;\n }\n }\n }\n\n /**\n * 应用样式到容器\n */\n private applyStyles(): void {\n const style = this.container.style;\n if (this.options.backgroundColor) style.setProperty('--bim-btn-group-section-bg', this.options.backgroundColor);\n if (this.options.btnBackgroundColor) style.setProperty('--bim-btn-bg', this.options.btnBackgroundColor);\n if (this.options.btnHoverColor) style.setProperty('--bim-btn-hover-bg', this.options.btnHoverColor);\n if (this.options.btnActiveColor) style.setProperty('--bim-btn-active-bg', this.options.btnActiveColor);\n if (this.options.iconColor) style.setProperty('--bim-icon-color', this.options.iconColor);\n if (this.options.iconActiveColor) style.setProperty('--bim-icon-active-color', this.options.iconActiveColor);\n if (this.options.textColor) style.setProperty('--bim-btn-text-color', this.options.textColor);\n if (this.options.textActiveColor) style.setProperty('--bim-btn-text-active-color', this.options.textActiveColor);\n\n // 同步更新所有已存在的dropdown元素的CSS变量(dropdown被添加到body,无法继承容器的CSS变量)\n const dropdowns = document.querySelectorAll('.opt-btn-dropdown');\n dropdowns.forEach(dropdown => {\n const dropdownStyle = (dropdown as HTMLElement).style;\n if (this.options.iconColor) dropdownStyle.setProperty('--bim-icon-color', this.options.iconColor);\n if (this.options.iconActiveColor) dropdownStyle.setProperty('--bim-icon-active-color', this.options.iconActiveColor);\n if (this.options.textColor) dropdownStyle.setProperty('--bim-btn-text-color', this.options.textColor);\n if (this.options.textActiveColor) dropdownStyle.setProperty('--bim-btn-text-active-color', this.options.textActiveColor);\n if (this.options.btnBackgroundColor) dropdownStyle.setProperty('--bim-btn-bg', this.options.btnBackgroundColor);\n if (this.options.btnHoverColor) dropdownStyle.setProperty('--bim-btn-hover-bg', this.options.btnHoverColor);\n if (this.options.btnActiveColor) dropdownStyle.setProperty('--bim-btn-active-bg', this.options.btnActiveColor);\n });\n }\n\n /**\n * 设置主题的primary颜色(用于边框等)\n */\n private setPrimaryColor(color: string): void {\n this.container.style.setProperty('--bim-primary-color', color);\n\n // 同步更新所有dropdown(dropdown被添加到body,无法继承容器的CSS变量)\n const dropdowns = document.querySelectorAll('.opt-btn-dropdown');\n dropdowns.forEach(dropdown => {\n (dropdown as HTMLElement).style.setProperty('--bim-primary-color', color);\n });\n }\n\n /**\n * 设置主题颜色\n * 只会应用到没有被用户自定义的颜色属性上\n */\n public setTheme(theme: ThemeConfig): void {\n const themeColors: ButtonGroupColors = {\n backgroundColor: theme.panelBackground,\n btnBackgroundColor: theme.componentBackground,\n btnHoverColor: theme.componentHover,\n btnActiveColor: theme.componentActive,\n iconColor: theme.icon,\n iconActiveColor: theme.iconActive,\n textColor: theme.textSecondary,\n textActiveColor: theme.textPrimary\n };\n\n // 只应用没有被自定义的颜色\n Object.entries(themeColors).forEach(([key, value]) => {\n const colorKey = key as keyof ButtonGroupColors;\n if (!this.customColors.has(colorKey)) {\n this.options[colorKey] = value;\n }\n });\n\n this.applyStyles();\n this.setPrimaryColor(theme.primary);\n }\n\n /**\n * 直接设置颜色(强制覆盖)\n * 设置的颜色会被标记为自定义,后续的 setTheme 不会覆盖它们\n */\n public setColors(colors: ButtonGroupColors): void {\n // 更新 options\n this.options = { ...this.options, ...colors };\n\n // 标记这些颜色为自定义\n Object.keys(colors).forEach(key => {\n this.customColors.add(key as keyof ButtonGroupColors);\n });\n\n this.applyStyles();\n }\n\n public async init(): Promise {\n this.render();\n\n // 自动订阅语言变更\n this.unsubscribeLocale = localeManager.subscribe(() => {\n this.setLocales();\n });\n\n // 自动订阅主题变更\n this.unsubscribeTheme = themeManager.subscribe((theme) => {\n this.setTheme(theme);\n });\n }\n\n public setLocales(): void {\n this.render();\n }\n\n public addGroup(groupId: string, beforeGroupId?: string): void {\n if (this.groups.some(g => g.id === groupId)) return;\n const newGroup: ButtonGroup = { id: groupId, buttons: [] };\n if (beforeGroupId) {\n const index = this.groups.findIndex(g => g.id === beforeGroupId);\n index !== -1 ? this.groups.splice(index, 0, newGroup) : this.groups.push(newGroup);\n } else {\n this.groups.push(newGroup);\n }\n }\n\n public addButton(config: ButtonConfig): void {\n const { groupId, parentId } = config;\n const group = this.groups.find(g => g.id === groupId);\n if (!group) return;\n\n const button: OptButton = { ...config, children: config.children || [] };\n if (parentId) {\n const parentBtn = this.findButton(group.buttons, parentId);\n if (parentBtn) {\n if (!parentBtn.children) parentBtn.children = [];\n parentBtn.children.push(button);\n }\n } else {\n group.buttons.push(button);\n }\n }\n\n private findButton(buttons: OptButton[], id: string): OptButton | undefined {\n for (const btn of buttons) {\n if (btn.id === id) return btn;\n if (btn.children) {\n const found = this.findButton(btn.children, id);\n if (found) return found;\n }\n }\n return undefined;\n }\n\n public render(): void {\n this.container.innerHTML = '';\n this.btnRefs.clear();\n\n this.groups.forEach((group, index) => {\n const groupElement = this.renderGroup(group, index, this.groups.length);\n this.container.appendChild(groupElement);\n });\n }\n\n private renderGroup(group: ButtonGroup, index: number, total: number): HTMLElement {\n const groupEl = document.createElement('div');\n groupEl.className = 'bim-btn-group-section';\n\n if (index < total - 1) {\n groupEl.classList.add('has-divider');\n }\n\n group.buttons.forEach(button => {\n if (this.isVisible(button.id)) {\n const btnWrapper = this.renderButton(button);\n groupEl.appendChild(btnWrapper);\n }\n });\n return groupEl;\n }\n\n private renderButton(button: OptButton): HTMLElement {\n const wrapper = document.createElement('div');\n wrapper.className = 'opt-btn-wrapper';\n\n const btnEl = document.createElement('div');\n btnEl.className = 'opt-btn';\n\n // 初始化时根据 button 自身的属性同步 active 状态\n if (button.isActive) {\n this.activeBtnIds.add(button.id);\n }\n\n // 按钮优先使用自己的 align,否则使用全局配置,默认为 vertical\n const align = button.align || this.options.align || 'vertical';\n if (align === 'horizontal') {\n btnEl.classList.add('align-horizontal');\n } else {\n btnEl.classList.add('align-vertical');\n }\n\n if (this.activeBtnIds.has(button.id)) btnEl.classList.add('active');\n if (button.disabled) btnEl.classList.add('disabled');\n\n // 判断是否显示 label\n const hasLabel = this.options.showLabel && button.label;\n if (!hasLabel) {\n btnEl.classList.add('no-label');\n // 当不显示 label 时,添加 title 属性作为 tooltip\n if (button.label) {\n btnEl.title = t(button.label);\n }\n }\n\n // 应用按钮的自定义样式\n const iconSize = button.iconSize || 32;\n const minWidth = button.minWidth || 50;\n btnEl.style.minWidth = `${minWidth}px`;\n\n const icon = document.createElement('div');\n icon.className = 'opt-btn-icon';\n icon.style.width = `${iconSize}px`;\n icon.style.height = `${iconSize}px`;\n icon.innerHTML = this.getIcon(button.icon);\n btnEl.appendChild(icon);\n\n // 创建文字和箭头的容器,确保它们始终在一起(无论主轴是横是竖)\n const textWrapper = document.createElement('div');\n textWrapper.className = 'opt-btn-text-wrapper';\n\n if (this.options.showLabel && button.label) {\n const label = document.createElement('span');\n label.className = 'opt-btn-label';\n label.textContent = t(button.label);\n textWrapper.appendChild(label);\n }\n\n if (button.children && button.children.length > 0) {\n const arrow = document.createElement('span');\n arrow.className = 'opt-btn-arrow';\n arrow.textContent = '▼';\n textWrapper.appendChild(arrow);\n }\n\n // 只有当有内容时才添加 wrapper\n if (textWrapper.hasChildNodes()) {\n btnEl.appendChild(textWrapper);\n }\n\n btnEl.addEventListener('click', () => this.handleClick(button));\n btnEl.addEventListener('mouseenter', () => this.handleMouseEnter(button, btnEl));\n btnEl.addEventListener('mouseleave', () => this.handleMouseLeave());\n\n this.btnRefs.set(button.id, btnEl);\n wrapper.appendChild(btnEl);\n return wrapper;\n }\n\n /**\n * 设置按钮的激活状态\n * @param id 按钮 ID\n * @param active 可选,如果不传则切换(toggle)当前状态\n */\n public setBtnActive(id: string, active?: boolean): void {\n const button = this.findButtonById(id);\n if (!button) return;\n\n // 确定最终状态\n const newState = active !== undefined ? active : !this.activeBtnIds.has(id);\n\n if (newState) {\n this.activeBtnIds.add(id);\n } else {\n this.activeBtnIds.delete(id);\n }\n\n // 同步对象状态并更新 DOM\n button.isActive = newState;\n this.updateButtonState(id);\n }\n\n private handleClick(button: OptButton): void {\n if (button.disabled) return;\n if (!button.children || button.children.length === 0) {\n if (button.keepActive) {\n // 1) 先切换自身激活状态(onClick 里通常会根据 isActive 决定“打开/关闭”逻辑)\n const wasActive = this.activeBtnIds.has(button.id);\n const newState = !wasActive;\n this.setBtnActive(button.id, newState);\n\n // 2) 互斥逻辑:仅在“本次切换为激活”时触发\n // - 一级按钮:同 groupId 下其它一级按钮互斥\n // - 二级按钮:同 groupId + 同 parentId 下其它二级按钮互斥\n // - 被关闭的按钮需要触发 onClick(用于执行关闭逻辑)\n if (newState && button.exclusive && button.groupId) {\n this.deactivateExclusiveSiblings(button);\n }\n }\n this.closeDropdown();\n if (button.onClick) button.onClick(button);\n }\n }\n\n /**\n * 互斥关闭同范围内的其它已激活按钮,并触发它们的 onClick\n * @param button 当前被激活的按钮\n */\n private deactivateExclusiveSiblings(button: OptButton): void {\n const group = this.groups.find(g => g.id === button.groupId);\n if (!group) return;\n\n // 二级按钮:同 groupId + 同 parentId\n if (button.parentId) {\n const parent = this.findButton(group.buttons, button.parentId);\n const siblings = parent?.children || [];\n for (const sib of siblings) {\n if (!sib) continue;\n if (sib.id === button.id) continue;\n if (sib.parentId !== button.parentId) continue;\n if (sib.groupId !== button.groupId) continue;\n\n if (this.activeBtnIds.has(sib.id)) {\n this.setBtnActive(sib.id, false);\n // 触发被关闭按钮的 onClick(此时 sib.isActive 已经同步为 false)\n if (sib.onClick) sib.onClick(sib);\n }\n }\n return;\n }\n\n // 一级按钮:同 groupId 下其它一级按钮(不包含二级)\n for (const sib of group.buttons) {\n if (sib.id === button.id) continue;\n if (sib.groupId !== button.groupId) continue;\n if (sib.parentId) continue; // 只处理一级按钮\n\n if (this.activeBtnIds.has(sib.id)) {\n this.setBtnActive(sib.id, false);\n if (sib.onClick) sib.onClick(sib);\n }\n }\n }\n\n private handleMouseEnter(button: OptButton, btnEl: HTMLElement): void {\n if (this.hoverTimeout) clearTimeout(this.hoverTimeout);\n if (button.children && button.children.length > 0) {\n this.showDropdown(button, btnEl);\n } else {\n this.closeDropdown();\n }\n }\n\n private handleMouseLeave(): void {\n this.hoverTimeout = window.setTimeout(() => this.closeDropdown(), 200);\n }\n\n private showDropdown(button: OptButton, btnEl: HTMLElement): void {\n this.closeDropdown();\n if (!button.children) return;\n\n const dropdown = document.createElement('div');\n dropdown.className = 'opt-btn-dropdown';\n if (this.options.backgroundColor) dropdown.style.setProperty('--bim-toolbar-bg', this.options.backgroundColor);\n\n // 将主题CSS变量复制到dropdown元素上(因为dropdown被添加到body,无法继承容器的CSS变量)\n const dropdownStyle = dropdown.style;\n if (this.options.iconColor) dropdownStyle.setProperty('--bim-icon-color', this.options.iconColor);\n if (this.options.iconActiveColor) dropdownStyle.setProperty('--bim-icon-active-color', this.options.iconActiveColor);\n if (this.options.textColor) dropdownStyle.setProperty('--bim-btn-text-color', this.options.textColor);\n if (this.options.textActiveColor) dropdownStyle.setProperty('--bim-btn-text-active-color', this.options.textActiveColor);\n if (this.options.btnBackgroundColor) dropdownStyle.setProperty('--bim-btn-bg', this.options.btnBackgroundColor);\n if (this.options.btnHoverColor) dropdownStyle.setProperty('--bim-btn-hover-bg', this.options.btnHoverColor);\n if (this.options.btnActiveColor) dropdownStyle.setProperty('--bim-btn-active-bg', this.options.btnActiveColor);\n\n // 获取按钮的位置信息\n const btnRect = btnEl.getBoundingClientRect();\n const expand = this.options.expand || 'down';\n\n // 根据主按钮组的方向设置下拉菜单的布局方向\n if (this.options.direction === 'row') {\n dropdown.style.flexDirection = 'column'; // 横向按钮组,菜单纵向排列\n } else {\n dropdown.style.flexDirection = 'row'; // 纵向按钮组,菜单横向排列\n }\n\n // 先添加到 DOM 以便计算尺寸\n document.body.appendChild(dropdown);\n\n // 添加事件拦截\n this.setupEventInterception(dropdown);\n\n // 添加菜单项\n button.children.forEach(subBtn => {\n if (this.isVisible(subBtn.id)) {\n const item = this.renderDropdownItem(subBtn);\n dropdown.appendChild(item);\n }\n });\n\n // 获取下拉菜单的实际尺寸\n const dropdownRect = dropdown.getBoundingClientRect();\n\n if (expand === 'up') {\n // 向上展开,与按钮水平居中对齐\n dropdown.style.bottom = (window.innerHeight - btnRect.top + 8) + 'px';\n dropdown.style.left = (btnRect.left + (btnRect.width - dropdownRect.width) / 2) + 'px';\n } else if (expand === 'down') {\n // 向下展开,与按钮水平居中对齐\n dropdown.style.top = (btnRect.bottom + 8) + 'px';\n dropdown.style.left = (btnRect.left + (btnRect.width - dropdownRect.width) / 2) + 'px';\n } else if (expand === 'right') {\n // 向右展开,与按钮垂直居中对齐\n dropdown.style.top = (btnRect.top + (btnRect.height - dropdownRect.height) / 2) + 'px';\n dropdown.style.left = (btnRect.right + 8) + 'px';\n } else if (expand === 'left') {\n // 向左展开,与按钮垂直居中对齐\n dropdown.style.top = (btnRect.top + (btnRect.height - dropdownRect.height) / 2) + 'px';\n dropdown.style.right = (window.innerWidth - btnRect.left + 8) + 'px';\n }\n\n dropdown.addEventListener('mouseenter', () => { if (this.hoverTimeout) clearTimeout(this.hoverTimeout); });\n dropdown.addEventListener('mouseleave', () => this.handleMouseLeave());\n this.dropdownElement = dropdown;\n }\n\n private renderDropdownItem(button: OptButton): HTMLElement {\n const item = document.createElement('div');\n item.className = 'opt-btn-dropdown-item';\n\n // 应用按钮的 align 设置,默认为 horizontal(图标在左)\n const align = button.align || 'horizontal';\n if (align === 'horizontal') {\n item.classList.add('align-horizontal');\n } else {\n item.classList.add('align-vertical');\n }\n\n // 二级菜单项的 active 状态渲染(修复 keepActive 在二级按钮“看起来不生效”的问题)\n // 说明:\n // - keepActive 的状态会记录在 activeBtnIds / button.isActive 上\n // - 下拉菜单每次打开都会重新渲染,因此必须在这里同步一次 active 样式\n if (this.activeBtnIds.has(button.id) || button.isActive) {\n item.classList.add('active');\n }\n\n // 应用按钮的自定义样式\n const iconSize = button.iconSize || 32; // 二级菜单默认图标更小\n const minWidth = button.minWidth; // 不设置默认值,让下拉菜单项保持紧凑\n if (minWidth) {\n item.style.minWidth = `${minWidth}px`;\n }\n\n const icon = document.createElement('div');\n icon.className = 'opt-btn-icon';\n icon.style.width = `${iconSize}px`;\n icon.style.height = `${iconSize}px`;\n icon.innerHTML = this.getIcon(button.icon);\n item.appendChild(icon);\n\n // 只有在 showLabel 为 true 时才显示 label\n if (this.options.showLabel && button.label) {\n const label = document.createElement('span');\n label.className = 'opt-btn-dropdown-label';\n label.textContent = t(button.label);\n item.appendChild(label);\n } else if (button.label) {\n // 当不显示 label 时,添加 title 属性作为 tooltip\n item.title = t(button.label);\n }\n\n item.addEventListener('click', (e) => { e.stopPropagation(); this.handleClick(button); });\n return item;\n }\n\n private closeDropdown(): void {\n if (this.dropdownElement) {\n this.dropdownElement.remove();\n this.dropdownElement = null;\n }\n this.btnRefs.forEach(btnEl => {\n const arrow = btnEl.querySelector('.opt-btn-arrow');\n if (arrow) arrow.classList.remove('rotated');\n });\n }\n\n private updateButtonState(buttonId: string): void {\n const btnEl = this.btnRefs.get(buttonId);\n if (btnEl) {\n if (this.activeBtnIds.has(buttonId)) {\n btnEl.classList.add('active');\n } else {\n btnEl.classList.remove('active');\n }\n }\n }\n\n private getIcon(icon?: string): string { return icon || this.DEFAULT_ICON; }\n\n public updateButtonVisibility(id: string, visible: boolean): void {\n if (!this.options.visibility) this.options.visibility = {};\n this.options.visibility[id] = visible;\n this.render();\n }\n\n public setShowLabel(show: boolean): void {\n this.options.showLabel = show;\n this.updateLabelsVisibility();\n }\n\n private updateLabelsVisibility(): void {\n this.btnRefs.forEach((btnEl, buttonId) => {\n // 查找按钮配置\n const button = this.findButtonById(buttonId);\n if (!button) return;\n\n const hasLabel = this.options.showLabel && button.label;\n\n // 更新 no-label 类和 title 属性\n if (hasLabel) {\n btnEl.classList.remove('no-label');\n // 显示标签时,移除 title(避免重复显示)\n btnEl.removeAttribute('title');\n } else {\n btnEl.classList.add('no-label');\n // 隐藏标签时,添加 title 作为 tooltip\n if (button.label) {\n btnEl.title = t(button.label);\n }\n }\n });\n }\n\n private findButtonById(id: string): OptButton | undefined {\n for (const group of this.groups) {\n const found = this.findButton(group.buttons, id);\n if (found) return found;\n }\n return undefined;\n }\n\n public setBackgroundColor(color: string): void { this.setColors({ backgroundColor: color }); }\n private isVisible(id: string): boolean { return this.options.visibility?.[id] !== false; }\n\n public destroy(): void {\n if (this.unsubscribeLocale) {\n this.unsubscribeLocale();\n this.unsubscribeLocale = null;\n }\n if (this.unsubscribeTheme) {\n this.unsubscribeTheme();\n this.unsubscribeTheme = null;\n }\n this.closeDropdown();\n this.container.innerHTML = '';\n this.btnRefs.clear();\n }\n}\n","import { BimButtonGroup } from '../index';\n\n/**\n * 底部工具栏 (Toolbar)\n * BimButtonGroup 的子类,专门用于加载工具栏默认按钮。\n */\nexport class Toolbar extends BimButtonGroup {\n /**\n * 重写初始化,加载默认按钮\n */\n public async init(): Promise {\n await super.init();\n\n // 动态加载默认按钮配置\n const { createHomeButton } = await import('./buttons/home');\n const { createZoomBoxButton } = await import('./buttons/zoom-box');\n const { createLocationButton } = await import('./buttons/location');\n const { createWalkMenuButton } = await import('./buttons/walk/walk-menu');\n const { createWalkPersonButton } = await import('./buttons/walk/walk-person');\n const { createWalkBirdButton } = await import('./buttons/walk/walk-bird');\n const { createSettingButton } = await import('./buttons/setting');\n const { createInfoButton } = await import('./buttons/info');\n const { createMeasureButton } = await import('./buttons/measure');\n const { createSectionMenuButton } = await import('./buttons/section/section-menu');\n const { createSectionPlaneButton } = await import('./buttons/section/section-plane');\n const { createSectionAxisButton } = await import('./buttons/section/section-axis');\n const { createSectionBoxButton } = await import('./buttons/section/section-box');\n\n this.addGroup('group-1');\n\n // 使用工厂函数创建按钮,并注入 engine\n if (this.engine) {\n this.addButton(createHomeButton(this.engine));\n // 你要求:在\"首页\"后面添加\"选框放大\"\n this.addButton(createZoomBoxButton(this.engine));\n this.addButton(createMeasureButton(this.engine));\n this.addButton(createSectionMenuButton(this.engine));\n this.addButton(createSectionPlaneButton(this.engine));\n this.addButton(createSectionAxisButton(this.engine));\n this.addButton(createSectionBoxButton(this.engine));\n this.addButton(createWalkMenuButton(this.engine));\n this.addButton(createWalkPersonButton(this.engine));\n this.addButton(createWalkBirdButton(this.engine));\n this.addButton(createLocationButton(this.engine));\n this.addGroup('group-2');\n this.addButton(createSettingButton(this.engine));\n this.addButton(createInfoButton(this.engine));\n } else {\n console.warn('[Toolbar] Engine not available when creating buttons.');\n }\n\n this.render();\n }\n}\n","import { BimEngine } from '../bim-engine';\nimport { EngineEvents } from '../types/events';\n\nexport abstract class BimComponent {\n protected engine: BimEngine;\n\n constructor(engine: BimEngine) {\n this.engine = engine;\n }\n\n /**\n * Helper to send events easily\n */\n protected emit(event: K, payload: EngineEvents[K]): void {\n this.engine.emit(event, payload);\n }\n\n /**\n * Helper to listen to events easily\n * Returns an unsubscribe function\n */\n protected on(event: K, listener: (payload: EngineEvents[K]) => void): () => void {\n return this.engine.on(event, listener);\n }\n\n abstract destroy(): void;\n}\n","import type { ButtonGroupColors, ButtonConfig } from '../components/button-group/index.type';\nimport { Toolbar } from '../components/button-group/toolbar';\nimport type { ThemeConfig } from '../themes/types';\nimport { BimComponent } from '../core/component';\nimport type { BimEngine } from '../bim-engine';\n\n/**\n * 底部工具栏管理器 (ToolbarManager)\n * 仅负责管理底部工具栏实例。\n */\nexport class ToolbarManager extends BimComponent {\n private toolbar: Toolbar | null = null;\n private toolbarContainer: HTMLElement | null = null;\n private container: HTMLElement;\n\n constructor(engine: BimEngine, container: HTMLElement) {\n super(engine);\n this.container = container;\n this.init();\n }\n\n private init() {\n // 创建底部工具栏专用容器\n this.toolbarContainer = document.createElement('div');\n this.toolbarContainer.id = 'opt-btn-groups';\n this.toolbarContainer.className = 'bim-engine-opt-btn-container is-bottom-toolbar';\n this.container.appendChild(this.toolbarContainer);\n\n this.toolbar = new Toolbar({\n container: this.toolbarContainer,\n showLabel: true,\n direction: 'row',\n position: 'bottom-center', // 底部居中\n align: 'vertical', // 图标在上\n expand: 'up' // 向上展开\n });\n\n // 注入 engine 到 Toolbar\n // @ts-ignore - Toolbar 还没更新类型,暂时忽略\n this.toolbar.setEngine(this.engine);\n\n this.toolbar.init();\n }\n\n public updateTheme(theme: ThemeConfig) {\n this.toolbar?.setTheme(theme);\n }\n\n public refresh() {\n this.toolbar?.render();\n }\n\n public destroy() {\n this.toolbar?.destroy();\n this.toolbar = null;\n }\n\n // --- 转发 API ---\n public addGroup(groupId: string, beforeGroupId?: string) { this.toolbar?.addGroup(groupId, beforeGroupId); this.toolbar?.render(); }\n public addButton(config: ButtonConfig) { this.toolbar?.addButton(config); this.toolbar?.render(); }\n public setButtonVisibility(id: string, v: boolean) { this.toolbar?.updateButtonVisibility(id, v); }\n public setShowLabel(show: boolean) { this.toolbar?.setShowLabel(show); }\n public setBtnActive(id: string, active?: boolean) { this.toolbar?.setBtnActive(id, active); }\n public setVisible(visible: boolean) {\n if (this.toolbarContainer) {\n this.toolbarContainer.style.visibility = visible ? 'visible' : 'hidden';\n }\n }\n public setBackgroundColor(color: string) { this.toolbar?.setBackgroundColor(color); }\n public setColors(colors: ButtonGroupColors) { this.toolbar?.setColors(colors); }\n}\n","import { BimButtonGroup } from '../components/button-group';\nimport type { ButtonGroupOptions } from '../components/button-group/index.type';\nimport type { ThemeConfig } from '../themes/types';\nimport { BimComponent } from '../core/component';\nimport type { BimEngine } from '../bim-engine';\n\n/**\n * 通用按钮组管理器 (ButtonGroupManager)\n * 负责创建和管理通用的按钮组实例。\n */\nexport class ButtonGroupManager extends BimComponent {\n private groups: Map = new Map();\n private container: HTMLElement;\n\n constructor(engine: BimEngine, container: HTMLElement) {\n super(engine);\n this.container = container;\n }\n\n public create(id: string, options: Omit): BimButtonGroup {\n const group = new BimButtonGroup({\n container: this.container,\n ...options\n });\n\n // @ts-ignore\n group.setEngine(this.engine);\n\n group.init();\n this.groups.set(id, group);\n return group;\n }\n\n public get(id: string): BimButtonGroup | undefined {\n return this.groups.get(id);\n }\n\n public updateTheme(theme: ThemeConfig) {\n this.groups.forEach(group => group.setTheme(theme));\n }\n\n public destroy() {\n this.groups.forEach(group => group.destroy());\n this.groups.clear();\n }\n}\n","import './index.css';\nimport type { DialogOptions } from './index.type';\nimport type { ThemeConfig } from '../../themes/types';\nimport { IBimComponent } from '../../types/component';\nimport { themeManager } from '../../services/theme';\nimport { t, localeManager } from '../../services/locale';\n\n/**\n * 通用弹窗组件类\n * 支持拖拽、缩放、自定义内容和位置。\n */\nexport class BimDialog implements IBimComponent {\n private element: HTMLElement;\n private options: DialogOptions;\n private container: HTMLElement;\n private header: HTMLElement;\n private contentArea: HTMLElement;\n private _isDestroyed = false;\n private _isInitialized = false;\n private unsubscribeTheme: (() => void) | null = null;\n private unsubscribeLocale: (() => void) | null = null;\n\n // 性能优化:用于存储 requestAnimationFrame 的 ID\n private rafId: number | null = null;\n\n /**\n * 构造函数\n * @param options 弹窗配置选项\n */\n constructor(options: DialogOptions) {\n // 合并默认配置\n this.options = {\n title: 'Dialog',\n width: 300,\n height: 'auto',\n position: 'center',\n draggable: true,\n resizable: false,\n minWidth: 200,\n minHeight: 100,\n ...options\n };\n this.container = options.container;\n\n // 创建 DOM 结构\n this.element = this.createDom();\n this.header = this.element.querySelector('.bim-dialog-header') as HTMLElement;\n this.contentArea = this.element.querySelector('.bim-dialog-content') as HTMLElement;\n\n // 自动初始化 (为了兼容现有逻辑)\n this.init();\n }\n\n /**\n * 设置主题\n * @param theme 全局主题配置\n */\n public setTheme(theme: ThemeConfig) {\n const style = this.element.style;\n if (!this.options.backgroundColor) style.setProperty('--bim-dialog-bg', theme.panelBackground);\n if (!this.options.headerBackgroundColor) style.setProperty('--bim-dialog-header-bg', theme.componentHover);\n if (!this.options.titleColor) style.setProperty('--bim-dialog-title-color', theme.textPrimary);\n if (!this.options.textColor) style.setProperty('--bim-dialog-text-color', theme.textPrimary);\n if (!this.options.borderColor) style.setProperty('--bim-dialog-border-color', theme.border);\n }\n\n /**\n * 初始化组件功能 (接口实现)\n */\n public init() {\n if (this._isInitialized) return;\n\n this.container.appendChild(this.element);\n\n // 必须先挂载才能计算尺寸进行定位\n this.initPosition();\n\n if (this.options.draggable) {\n this.initDrag();\n }\n\n if (this.options.resizable) {\n this.initResize();\n }\n\n this._isInitialized = true;\n\n // 调用弹窗开启后回调\n if (this.options.onOpen) {\n this.options.onOpen();\n }\n\n // 自动订阅主题变更\n this.unsubscribeTheme = themeManager.subscribe((theme) => {\n this.setTheme(theme);\n });\n\n // 自动订阅语言变更\n this.unsubscribeLocale = localeManager.subscribe(() => {\n this.setLocales();\n });\n }\n\n public setLocales(): void {\n if (this.options.title) {\n const titleEl = this.header.querySelector('.bim-dialog-title');\n if (titleEl) {\n titleEl.textContent = t(this.options.title);\n }\n }\n }\n\n /**\n * 创建弹窗的 DOM 结构\n */\n private createDom(): HTMLElement {\n const el = document.createElement('div');\n el.className = 'bim-dialog';\n\n if (this.options.id) el.id = this.options.id;\n\n // 应用颜色配置到 CSS 变量\n const style = el.style;\n if (this.options.backgroundColor) style.setProperty('--bim-dialog-bg', this.options.backgroundColor);\n if (this.options.headerBackgroundColor) style.setProperty('--bim-dialog-header-bg', this.options.headerBackgroundColor);\n if (this.options.titleColor) style.setProperty('--bim-dialog-title-color', this.options.titleColor);\n if (this.options.textColor) style.setProperty('--bim-dialog-text-color', this.options.textColor);\n if (this.options.borderColor) style.setProperty('--bim-dialog-border-color', this.options.borderColor);\n\n // 设置初始尺寸\n this.setSize(el, this.options.width, this.options.height);\n // 确保最小尺寸生效\n if (this.options.minWidth) el.style.minWidth = `${this.options.minWidth}px`;\n\n // 创建标题栏 (Header)\n const header = document.createElement('div');\n header.className = 'bim-dialog-header';\n if (this.options.draggable) header.classList.add('draggable');\n\n const title = document.createElement('span');\n title.className = 'bim-dialog-title';\n title.textContent = this.options.title ? t(this.options.title) : '';\n\n const closeBtn = document.createElement('span');\n closeBtn.className = 'bim-dialog-close';\n closeBtn.innerHTML = '×';\n // 修复 TS 报错:去掉未使用的参数 e\n closeBtn.onclick = () => {\n this.close();\n };\n\n header.appendChild(title);\n header.appendChild(closeBtn);\n\n // 创建内容区域 (Content)\n const content = document.createElement('div');\n content.className = 'bim-dialog-content';\n if (typeof this.options.content === 'string') {\n content.innerHTML = this.options.content;\n } else if (this.options.content instanceof HTMLElement) {\n content.appendChild(this.options.content);\n }\n\n el.appendChild(header);\n el.appendChild(content);\n\n // 如果允许缩放,创建缩放手柄\n if (this.options.resizable) {\n const resizeHandle = document.createElement('div');\n resizeHandle.className = 'bim-dialog-resize-handle';\n el.appendChild(resizeHandle);\n }\n\n // ==================== 事件拦截核心逻辑 ====================\n // 定义阻断逻辑:只阻止冒泡,不阻止捕获,也不阻止默认行为(除非显式阻止)\n const stopPropagation = (e: Event) => {\n e.stopPropagation();\n };\n\n // 现代浏览器和 3D 引擎 (Three.js/Cesium) 交互事件\n const events = [\n 'click', 'dblclick', 'contextmenu', 'wheel',\n 'mousedown', 'mouseup', 'mousemove',\n 'touchstart', 'touchend', 'touchmove',\n 'pointerdown', 'pointerup', 'pointermove', 'pointerenter', 'pointerleave', 'pointerover', 'pointerout'\n ];\n\n // 绑定监听器 (默认冒泡阶段)\n // 这样内部元素(如关闭按钮)先触发,然后冒泡到这里被拦截,不再传给地图\n events.forEach(eventType => {\n el.addEventListener(eventType, stopPropagation, { passive: false });\n });\n\n return el;\n }\n\n /**\n * 设置元素尺寸\n */\n private setSize(el: HTMLElement, width?: number | string, height?: number | string) {\n if (width !== undefined) {\n if (width === 'auto' || width === 'fit-content') {\n el.style.width = width;\n } else {\n el.style.width = typeof width === 'number' ? `${width}px` : width;\n }\n }\n if (height !== undefined) {\n if (height === 'auto' || height === 'fit-content') {\n el.style.height = height;\n } else {\n el.style.height = typeof height === 'number' ? `${height}px` : height;\n }\n }\n }\n\n /**\n * 根据内容自动调整弹窗宽度\n * @param recenter 是否重新计算定位(例如保持居中),默认 true\n */\n public fitWidth(recenter: boolean = false) {\n // 1. 设置为 fit-content 以获取自然宽度,高度保持不变\n this.element.style.width = 'fit-content';\n\n // 2. 如果需要重新定位\n if (recenter) {\n this.initPosition();\n }\n }\n\n /**\n * 根据内容自动调整弹窗高度\n *\n * 设计说明:\n * - 主要用于“内容展开/收起”场景(比如测量面板展开后,Dialog 高度跟随变化)\n * - 默认不改变用户拖拽后的当前位置,只做边界夹紧,避免弹窗超出容器\n *\n * @param recenter 是否根据 options.position 重新定位(默认 false)\n */\n public fitHeight(recenter: boolean = false) {\n // 1) 先让高度由内容自然撑开,便于测量真实高度\n this.element.style.height = 'auto';\n\n // 2) 获取自然高度并做约束(最小高度 + 不超过容器)\n const naturalHeight = this.element.getBoundingClientRect().height;\n const minHeight = this.options.minHeight ?? 100;\n const containerHeight = this.container.clientHeight || 0;\n\n // 如果容器高度不可用,至少保证最小高度\n let targetHeight = Math.max(minHeight, naturalHeight);\n\n // 约束最大高度:不超过容器高度(避免完全溢出)\n if (containerHeight > 0) {\n targetHeight = Math.min(targetHeight, containerHeight);\n }\n\n this.element.style.height = `${targetHeight}px`;\n\n // 3) 定位修正:recenter 则重新按 position 计算,否则只做边界夹紧\n if (recenter) {\n this.initPosition();\n } else {\n this.clampToContainer();\n }\n }\n\n /**\n * 边界夹紧:保持当前 left/top 不变的前提下,确保弹窗不超出容器\n * 说明:用于 fitHeight / fitWidth 后的“尺寸变化”场景,避免弹窗被裁切。\n */\n private clampToContainer(): void {\n const containerW = this.container.clientWidth;\n const containerH = this.container.clientHeight;\n const elW = this.element.offsetWidth;\n const elH = this.element.offsetHeight;\n\n // 当前 left/top(优先从 style 读取,避免 NaN)\n const currentLeft = this.element.offsetLeft;\n const currentTop = this.element.offsetTop;\n\n const maxLeft = Math.max(0, containerW - elW);\n const maxTop = Math.max(0, containerH - elH);\n\n const nextLeft = Math.max(0, Math.min(currentLeft, maxLeft));\n const nextTop = Math.max(0, Math.min(currentTop, maxTop));\n\n this.element.style.left = `${nextLeft}px`;\n this.element.style.top = `${nextTop}px`;\n }\n\n /**\n * 初始化弹窗位置\n */\n private initPosition() {\n const pos = this.options.position;\n const elRect = this.element.getBoundingClientRect();\n\n // 计算相对父容器的定位\n let left = 0;\n let top = 0;\n\n const pW = this.container.clientWidth;\n const pH = this.container.clientHeight;\n const elW = elRect.width;\n const elH = elRect.height;\n\n if (typeof pos === 'object' && 'x' in pos) {\n left = pos.x;\n top = pos.y;\n } else {\n switch (pos) {\n case 'center':\n left = (pW - elW) / 2;\n top = (pH - elH) / 2;\n break;\n case 'top-left': left = 0; top = 0; break;\n case 'top-center': left = (pW - elW) / 2; top = 0; break;\n case 'top-right': left = pW - elW; top = 0; break;\n case 'left-center': left = 0; top = (pH - elH) / 2; break;\n case 'right-center': left = pW - elW; top = (pH - elH) / 2; break;\n case 'bottom-left': left = 0; top = pH - elH; break;\n case 'bottom-center': left = (pW - elW) / 2; top = pH - elH; break;\n case 'bottom-right': left = pW - elW; top = pH - elH; break;\n default:\n left = (pW - elW) / 2;\n top = (pH - elH) / 2;\n }\n }\n\n left = Math.max(0, Math.min(left, pW - elW));\n top = Math.max(0, Math.min(top, pH - elH));\n\n this.element.style.left = `${left}px`;\n this.element.style.top = `${top}px`;\n }\n\n /**\n * 初始化拖拽功能 (性能优化 + 解决粘手)\n */\n private initDrag() {\n let startX = 0;\n let startY = 0;\n let startLeft = 0;\n let startTop = 0;\n let containerW = 0;\n let containerH = 0;\n let elW = 0;\n let elH = 0;\n\n const onMouseDown = (e: MouseEvent) => {\n e.preventDefault(); // 阻止默认行为(如选中文本),非常重要,防止卡顿\n e.stopPropagation(); // 阻止传递给 Three.js\n\n startX = e.clientX;\n startY = e.clientY;\n startLeft = this.element.offsetLeft;\n startTop = this.element.offsetTop;\n\n // 缓存尺寸,减少 reflow\n containerW = this.container.clientWidth;\n containerH = this.container.clientHeight;\n elW = this.element.offsetWidth;\n elH = this.element.offsetHeight;\n\n // 关键:使用 capture: true\n // 确保即使 createDom 阻止了冒泡,document 也能在捕获阶段收到事件\n document.addEventListener('mousemove', onMouseMove, { capture: true });\n document.addEventListener('mouseup', onMouseUp, { capture: true });\n };\n\n const onMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // 节流优化:使用 requestAnimationFrame\n if (this.rafId) return;\n\n this.rafId = requestAnimationFrame(() => {\n const dx = e.clientX - startX;\n const dy = e.clientY - startY;\n\n let newLeft = startLeft + dx;\n let newTop = startTop + dy;\n\n const maxLeft = containerW - elW;\n const maxTop = containerH - elH;\n\n newLeft = Math.max(0, Math.min(newLeft, maxLeft));\n newTop = Math.max(0, Math.min(newTop, maxTop));\n\n this.element.style.left = `${newLeft}px`;\n this.element.style.top = `${newTop}px`;\n\n this.rafId = null;\n });\n };\n\n const onMouseUp = () => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n // 移除监听\n document.removeEventListener('mousemove', onMouseMove, { capture: true });\n document.removeEventListener('mouseup', onMouseUp, { capture: true });\n };\n\n this.header.addEventListener('mousedown', onMouseDown);\n }\n\n /**\n * 初始化缩放功能 (性能优化 + 解决粘手)\n */\n private initResize() {\n const handle = this.element.querySelector('.bim-dialog-resize-handle') as HTMLElement;\n if (!handle) return;\n\n let startX = 0;\n let startY = 0;\n let startW = 0;\n let startH = 0;\n\n const onMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n startX = e.clientX;\n startY = e.clientY;\n startW = this.element.offsetWidth;\n startH = this.element.offsetHeight;\n\n // 关键:使用 capture: true\n document.addEventListener('mousemove', onMouseMove, { capture: true });\n document.addEventListener('mouseup', onMouseUp, { capture: true });\n };\n\n const onMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (this.rafId) return;\n\n this.rafId = requestAnimationFrame(() => {\n const dx = e.clientX - startX;\n const dy = e.clientY - startY;\n\n const newW = Math.max(this.options.minWidth || 100, startW + dx);\n const newH = Math.max(this.options.minHeight || 50, startH + dy);\n\n this.element.style.width = `${newW}px`;\n this.element.style.height = `${newH}px`;\n\n this.rafId = null;\n });\n };\n\n const onMouseUp = () => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n document.removeEventListener('mousemove', onMouseMove, { capture: true });\n document.removeEventListener('mouseup', onMouseUp, { capture: true });\n };\n\n handle.addEventListener('mousedown', onMouseDown);\n }\n\n /**\n * 动态设置内容\n * @param content 内容元素或 HTML 字符串\n */\n public setContent(content: HTMLElement | string) {\n this.contentArea.innerHTML = '';\n if (typeof content === 'string') {\n this.contentArea.innerHTML = content;\n } else {\n this.contentArea.appendChild(content);\n }\n }\n\n /**\n * 关闭弹窗并销毁\n */\n public close() {\n if (this._isDestroyed) return;\n\n // 清理可能存在的动画帧,防止报错\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n if (this.unsubscribeTheme) {\n this.unsubscribeTheme();\n this.unsubscribeTheme = null;\n }\n if (this.unsubscribeLocale) {\n this.unsubscribeLocale();\n this.unsubscribeLocale = null;\n }\n this.element.remove();\n this._isDestroyed = true;\n if (this.options.onClose) {\n this.options.onClose();\n }\n }\n\n /**\n * 销毁组件 (接口实现)\n */\n public destroy() {\n this.close();\n }\n}\n","import './index.css';\nimport { BimDialog } from '../index';\n\n/**\n * BimInfoDialog (继承版)\n * 这是一个展示项目信息的业务弹窗组件,直接继承自 BimDialog。\n */\nexport class BimInfoDialog extends BimDialog {\n /**\n * 构造函数\n * @param container 父容器\n */\n constructor(container: HTMLElement) {\n // 1. 准备内容 DOM\n const contentEl = document.createElement('div');\n contentEl.className = 'bim-info-dialog-content';\n\n const infoTitle = document.createElement('h3');\n infoTitle.textContent = 'Model Information';\n\n const infoList = document.createElement('ul');\n infoList.innerHTML = `\n Name: Sample Project \n Version: 1.0.0 \n Date: ${new Date().toLocaleDateString()} \n Status: Active \n `;\n\n const actionBtn = document.createElement('button');\n actionBtn.textContent = 'Update Status';\n actionBtn.style.marginTop = '10px';\n actionBtn.onclick = () => {\n alert('Status updated!');\n };\n\n contentEl.appendChild(infoTitle);\n contentEl.appendChild(infoList);\n contentEl.appendChild(actionBtn);\n\n // 2. 调用父类构造函数,传入特定的配置\n super({\n container: container,\n title: 'dialog.testTitle',\n content: contentEl,\n width: 320,\n height: 'auto',\n position: 'center',\n resizable: true,\n draggable: true,\n // 可以在这里添加特定的 onClose 逻辑\n onClose: () => {\n console.log('Info dialog closed');\n },\n onOpen: () => {\n console.log('Info dialog opened');\n }\n });\n\n // 3. 如果有特定于子类的初始化逻辑,可以在 super() 之后执行\n // 例如:this.element.classList.add('my-special-class');\n }\n\n // 不需要再手动实现 setTheme, destroy, close, init\n // 它们都已从 BimDialog 继承\n}","import { BimDialog } from '../components/dialog';\nimport { BimInfoDialog } from '../components/dialog/bimInfoDialog';\nimport type { DialogOptions } from '../components/dialog/index.type';\nimport type { ThemeConfig } from '../themes/types';\nimport { themeManager } from '../services/theme';\nimport { BimComponent } from '../core/component';\nimport type { BimEngine } from '../bim-engine';\n\n/**\n * 弹窗管理器\n * 负责创建和管理应用中的各类弹窗。\n */\nexport class DialogManager extends BimComponent {\n /** 弹窗挂载的父容器 */\n private container: HTMLElement;\n /** 活跃的弹窗实例列表 */\n private activeDialogs: BimDialog[] = [];\n\n /**\n * 构造函数\n * @param engine 引擎实例\n * @param container 弹窗挂载的目标容器\n */\n constructor(engine: BimEngine, container: HTMLElement) {\n super(engine);\n this.container = container;\n\n // 监听打开弹窗事件\n this.on('ui:open-dialog', (payload) => {\n // 这里可以根据 payload.id 做更复杂的逻辑,目前简单演示\n console.log('[DialogManager] Received open-dialog event:', payload);\n // 示例:如果 payload.id 是 'info',则打开 info dialog\n if (payload.id === 'info') {\n this.showInfoDialog();\n }\n });\n }\n\n /**\n * 创建一个通用弹窗\n * @param options 弹窗配置选项(不需要传 container,自动使用管理器绑定的容器)\n * @returns BimDialog 实例\n */\n public create(options: Omit): BimDialog {\n const dialog = new BimDialog({\n container: this.container,\n ...options,\n onClose: () => {\n // 从活跃列表中移除\n this.activeDialogs = this.activeDialogs.filter(d => d !== dialog);\n if (options.onClose) options.onClose();\n }\n });\n\n // 应用当前主题\n dialog.setTheme(themeManager.getTheme());\n\n this.activeDialogs.push(dialog);\n return dialog;\n }\n\n /**\n * 显示二次封装的模型信息弹窗\n * 演示如何调用特定的业务弹窗组件\n */\n public showInfoDialog() {\n // 最佳实践:所有弹窗应通过 create 统一管理,或者手动加入管理。\n new BimInfoDialog(this.container);\n // 暂时不做主题追踪,作为遗留逻辑保留\n }\n\n /**\n * 响应全局主题变更\n * @param theme 全局主题配置\n */\n public updateTheme(theme: ThemeConfig) {\n this.activeDialogs.forEach(dialog => {\n if (dialog.setTheme) {\n dialog.setTheme(theme);\n }\n });\n }\n\n public destroy() {\n this.activeDialogs.forEach(d => d.destroy());\n this.activeDialogs = [];\n }\n}\n","const Ni = { ROTATE: 0, DOLLY: 1, PAN: 2 }, Ii = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, Nh = 0, tl = 1, Fh = 2, Dc = 1, Lc = 2, On = 3, En = 0, zt = 1, Wt = 2, Mt = 0, Fi = 1, _r = 2, nl = 3, il = 4, Ic = 5, cn = 100, Oh = 101, Bh = 102, zh = 103, kh = 104, ps = 200, Vh = 201, Gh = 202, Hh = 203, ba = 204, ya = 205, Ta = 206, Wh = 207, Ea = 208, Xh = 209, jh = 210, qh = 211, Yh = 212, Kh = 213, Zh = 214, wa = 0, Aa = 1, Ra = 2, Vi = 3, Ca = 4, Pa = 5, Da = 6, La = 7, So = 0, $h = 1, Jh = 2, Jn = 0, Uc = 1, Nc = 2, Fc = 3, bo = 4, Oc = 5, Bc = 6, zc = 7, sl = \"attached\", Qh = \"detached\", kc = 300, Gi = 301, Hi = 302, vr = 303, Ia = 304, Rr = 306, wn = 1e3, en = 1001, Mr = 1002, Dt = 1003, Vc = 1004, ms = 1005, bt = 1006, ur = 1007, yn = 1008, mn = 1009, Gc = 1010, Hc = 1011, Ss = 1012, yo = 1013, di = 1014, Xt = 1015, xt = 1016, To = 1017, Eo = 1018, Wi = 1020, Wc = 35902, Xc = 35899, jc = 1021, qc = 1022, Zt = 1023, bs = 1026, Xi = 1027, wo = 1028, Ao = 1029, Ro = 1030, Co = 1031, Po = 1033, dr = 33776, fr = 33777, pr = 33778, mr = 33779, Ua = 35840, Na = 35841, Fa = 35842, Oa = 35843, Ba = 36196, za = 37492, ka = 37496, Va = 37808, Ga = 37809, Ha = 37810, Wa = 37811, Xa = 37812, ja = 37813, qa = 37814, Ya = 37815, Ka = 37816, Za = 37817, $a = 37818, Ja = 37819, Qa = 37820, eo = 37821, to = 36492, no = 36494, io = 36495, so = 36283, ro = 36284, ao = 36285, oo = 36286, ys = 2300, Ts = 2301, Ur = 2302, rl = 2400, al = 2401, ol = 2402, eu = 2500, tu = 0, Yc = 1, lo = 2, nu = 3200, Kc = 3201, Cr = 0, iu = 1, Kn = \"\", Rt = \"srgb\", Ut = \"srgb-linear\", Sr = \"linear\", et = \"srgb\", xi = 7680, Nr = 34055, Fr = 34056, su = 517, co = 519, ru = 512, au = 513, ou = 514, Zc = 515, lu = 516, cu = 517, hu = 518, uu = 519, ho = 35044, ll = \"300 es\", Tn = 2e3, br = 2001;\nfunction $c(i) {\n for (let e = i.length - 1; e >= 0; --e)\n if (i[e] >= 65535) return !0;\n return !1;\n}\nfunction Es(i) {\n return document.createElementNS(\"http://www.w3.org/1999/xhtml\", i);\n}\nfunction du() {\n const i = Es(\"canvas\");\n return i.style.display = \"block\", i;\n}\nconst cl = {};\nfunction yr(...i) {\n const e = \"THREE.\" + i.shift();\n console.log(e, ...i);\n}\nfunction Te(...i) {\n const e = \"THREE.\" + i.shift();\n console.warn(e, ...i);\n}\nfunction Xe(...i) {\n const e = \"THREE.\" + i.shift();\n console.error(e, ...i);\n}\nfunction ws(...i) {\n const e = i.join(\" \");\n e in cl || (cl[e] = !0, Te(...i));\n}\nfunction fu(i, e, t) {\n return new Promise(function(n, s) {\n function r() {\n switch (i.clientWaitSync(e, i.SYNC_FLUSH_COMMANDS_BIT, 0)) {\n case i.WAIT_FAILED:\n s();\n break;\n case i.TIMEOUT_EXPIRED:\n setTimeout(r, t);\n break;\n default:\n n();\n }\n }\n setTimeout(r, t);\n });\n}\nclass mi {\n /**\n * Adds the given event listener to the given event type.\n *\n * @param {string} type - The type of event to listen to.\n * @param {Function} listener - The function that gets called when the event is fired.\n */\n addEventListener(e, t) {\n this._listeners === void 0 && (this._listeners = {});\n const n = this._listeners;\n n[e] === void 0 && (n[e] = []), n[e].indexOf(t) === -1 && n[e].push(t);\n }\n /**\n * Returns `true` if the given event listener has been added to the given event type.\n *\n * @param {string} type - The type of event.\n * @param {Function} listener - The listener to check.\n * @return {boolean} Whether the given event listener has been added to the given event type.\n */\n hasEventListener(e, t) {\n const n = this._listeners;\n return n === void 0 ? !1 : n[e] !== void 0 && n[e].indexOf(t) !== -1;\n }\n /**\n * Removes the given event listener from the given event type.\n *\n * @param {string} type - The type of event.\n * @param {Function} listener - The listener to remove.\n */\n removeEventListener(e, t) {\n const n = this._listeners;\n if (n === void 0) return;\n const s = n[e];\n if (s !== void 0) {\n const r = s.indexOf(t);\n r !== -1 && s.splice(r, 1);\n }\n }\n /**\n * Dispatches an event object.\n *\n * @param {Object} event - The event that gets fired.\n */\n dispatchEvent(e) {\n const t = this._listeners;\n if (t === void 0) return;\n const n = t[e.type];\n if (n !== void 0) {\n e.target = this;\n const s = n.slice(0);\n for (let r = 0, a = s.length; r < a; r++)\n s[r].call(this, e);\n e.target = null;\n }\n }\n}\nconst Lt = [\"00\", \"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"0a\", \"0b\", \"0c\", \"0d\", \"0e\", \"0f\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"1a\", \"1b\", \"1c\", \"1d\", \"1e\", \"1f\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"2a\", \"2b\", \"2c\", \"2d\", \"2e\", \"2f\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"3a\", \"3b\", \"3c\", \"3d\", \"3e\", \"3f\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"4a\", \"4b\", \"4c\", \"4d\", \"4e\", \"4f\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"5a\", \"5b\", \"5c\", \"5d\", \"5e\", \"5f\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"6a\", \"6b\", \"6c\", \"6d\", \"6e\", \"6f\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"7a\", \"7b\", \"7c\", \"7d\", \"7e\", \"7f\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"8a\", \"8b\", \"8c\", \"8d\", \"8e\", \"8f\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"9a\", \"9b\", \"9c\", \"9d\", \"9e\", \"9f\", \"a0\", \"a1\", \"a2\", \"a3\", \"a4\", \"a5\", \"a6\", \"a7\", \"a8\", \"a9\", \"aa\", \"ab\", \"ac\", \"ad\", \"ae\", \"af\", \"b0\", \"b1\", \"b2\", \"b3\", \"b4\", \"b5\", \"b6\", \"b7\", \"b8\", \"b9\", \"ba\", \"bb\", \"bc\", \"bd\", \"be\", \"bf\", \"c0\", \"c1\", \"c2\", \"c3\", \"c4\", \"c5\", \"c6\", \"c7\", \"c8\", \"c9\", \"ca\", \"cb\", \"cc\", \"cd\", \"ce\", \"cf\", \"d0\", \"d1\", \"d2\", \"d3\", \"d4\", \"d5\", \"d6\", \"d7\", \"d8\", \"d9\", \"da\", \"db\", \"dc\", \"dd\", \"de\", \"df\", \"e0\", \"e1\", \"e2\", \"e3\", \"e4\", \"e5\", \"e6\", \"e7\", \"e8\", \"e9\", \"ea\", \"eb\", \"ec\", \"ed\", \"ee\", \"ef\", \"f0\", \"f1\", \"f2\", \"f3\", \"f4\", \"f5\", \"f6\", \"f7\", \"f8\", \"f9\", \"fa\", \"fb\", \"fc\", \"fd\", \"fe\", \"ff\"];\nlet hl = 1234567;\nconst _s = Math.PI / 180, ji = 180 / Math.PI;\nfunction fn() {\n const i = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0;\n return (Lt[i & 255] + Lt[i >> 8 & 255] + Lt[i >> 16 & 255] + Lt[i >> 24 & 255] + \"-\" + Lt[e & 255] + Lt[e >> 8 & 255] + \"-\" + Lt[e >> 16 & 15 | 64] + Lt[e >> 24 & 255] + \"-\" + Lt[t & 63 | 128] + Lt[t >> 8 & 255] + \"-\" + Lt[t >> 16 & 255] + Lt[t >> 24 & 255] + Lt[n & 255] + Lt[n >> 8 & 255] + Lt[n >> 16 & 255] + Lt[n >> 24 & 255]).toLowerCase();\n}\nfunction He(i, e, t) {\n return Math.max(e, Math.min(t, i));\n}\nfunction Do(i, e) {\n return (i % e + e) % e;\n}\nfunction pu(i, e, t, n, s) {\n return n + (i - e) * (s - n) / (t - e);\n}\nfunction mu(i, e, t) {\n return i !== e ? (t - i) / (e - i) : 0;\n}\nfunction vs(i, e, t) {\n return (1 - t) * i + t * e;\n}\nfunction gu(i, e, t, n) {\n return vs(i, e, 1 - Math.exp(-t * n));\n}\nfunction xu(i, e = 1) {\n return e - Math.abs(Do(i, e * 2) - e);\n}\nfunction _u(i, e, t) {\n return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * (3 - 2 * i));\n}\nfunction vu(i, e, t) {\n return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * i * (i * (i * 6 - 15) + 10));\n}\nfunction Mu(i, e) {\n return i + Math.floor(Math.random() * (e - i + 1));\n}\nfunction Su(i, e) {\n return i + Math.random() * (e - i);\n}\nfunction bu(i) {\n return i * (0.5 - Math.random());\n}\nfunction yu(i) {\n i !== void 0 && (hl = i);\n let e = hl += 1831565813;\n return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;\n}\nfunction Tu(i) {\n return i * _s;\n}\nfunction Eu(i) {\n return i * ji;\n}\nfunction wu(i) {\n return (i & i - 1) === 0 && i !== 0;\n}\nfunction Au(i) {\n return Math.pow(2, Math.ceil(Math.log(i) / Math.LN2));\n}\nfunction Ru(i) {\n return Math.pow(2, Math.floor(Math.log(i) / Math.LN2));\n}\nfunction Cu(i, e, t, n, s) {\n const r = Math.cos, a = Math.sin, o = r(t / 2), l = a(t / 2), c = r((e + n) / 2), h = a((e + n) / 2), u = r((e - n) / 2), d = a((e - n) / 2), p = r((n - e) / 2), g = a((n - e) / 2);\n switch (s) {\n case \"XYX\":\n i.set(o * h, l * u, l * d, o * c);\n break;\n case \"YZY\":\n i.set(l * d, o * h, l * u, o * c);\n break;\n case \"ZXZ\":\n i.set(l * u, l * d, o * h, o * c);\n break;\n case \"XZX\":\n i.set(o * h, l * g, l * p, o * c);\n break;\n case \"YXY\":\n i.set(l * p, o * h, l * g, o * c);\n break;\n case \"ZYZ\":\n i.set(l * g, l * p, o * h, o * c);\n break;\n default:\n Te(\"MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: \" + s);\n }\n}\nfunction hn(i, e) {\n switch (e.constructor) {\n case Float32Array:\n return i;\n case Uint32Array:\n return i / 4294967295;\n case Uint16Array:\n return i / 65535;\n case Uint8Array:\n return i / 255;\n case Int32Array:\n return Math.max(i / 2147483647, -1);\n case Int16Array:\n return Math.max(i / 32767, -1);\n case Int8Array:\n return Math.max(i / 127, -1);\n default:\n throw new Error(\"Invalid component type.\");\n }\n}\nfunction tt(i, e) {\n switch (e.constructor) {\n case Float32Array:\n return i;\n case Uint32Array:\n return Math.round(i * 4294967295);\n case Uint16Array:\n return Math.round(i * 65535);\n case Uint8Array:\n return Math.round(i * 255);\n case Int32Array:\n return Math.round(i * 2147483647);\n case Int16Array:\n return Math.round(i * 32767);\n case Int8Array:\n return Math.round(i * 127);\n default:\n throw new Error(\"Invalid component type.\");\n }\n}\nconst Lo = {\n DEG2RAD: _s,\n RAD2DEG: ji,\n /**\n * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)\n * (universally unique identifier).\n *\n * @static\n * @method\n * @return {string} The UUID.\n */\n generateUUID: fn,\n /**\n * Clamps the given value between min and max.\n *\n * @static\n * @method\n * @param {number} value - The value to clamp.\n * @param {number} min - The min value.\n * @param {number} max - The max value.\n * @return {number} The clamped value.\n */\n clamp: He,\n /**\n * Computes the Euclidean modulo of the given parameters that\n * is `( ( n % m ) + m ) % m`.\n *\n * @static\n * @method\n * @param {number} n - The first parameter.\n * @param {number} m - The second parameter.\n * @return {number} The Euclidean modulo.\n */\n euclideanModulo: Do,\n /**\n * Performs a linear mapping from range `` to range ``\n * for the given value.\n *\n * @static\n * @method\n * @param {number} x - The value to be mapped.\n * @param {number} a1 - Minimum value for range A.\n * @param {number} a2 - Maximum value for range A.\n * @param {number} b1 - Minimum value for range B.\n * @param {number} b2 - Maximum value for range B.\n * @return {number} The mapped value.\n */\n mapLinear: pu,\n /**\n * Returns the percentage in the closed interval `[0, 1]` of the given value\n * between the start and end point.\n *\n * @static\n * @method\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} value - A value between start and end.\n * @return {number} The interpolation factor.\n */\n inverseLerp: mu,\n /**\n * Returns a value linearly interpolated from two known points based on the given interval -\n * `t = 0` will return `x` and `t = 1` will return `y`.\n *\n * @static\n * @method\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {number} The interpolated value.\n */\n lerp: vs,\n /**\n * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta\n * time to maintain frame rate independent movement. For details, see\n * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).\n *\n * @static\n * @method\n * @param {number} x - The current point.\n * @param {number} y - The target point.\n * @param {number} lambda - A higher lambda value will make the movement more sudden,\n * and a lower value will make the movement more gradual.\n * @param {number} dt - Delta time in seconds.\n * @return {number} The interpolated value.\n */\n damp: gu,\n /**\n * Returns a value that alternates between `0` and the given `length` parameter.\n *\n * @static\n * @method\n * @param {number} x - The value to pingpong.\n * @param {number} [length=1] - The positive value the function will pingpong to.\n * @return {number} The alternated value.\n */\n pingpong: xu,\n /**\n * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n * the `min` and `max`.\n *\n * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.\n *\n * @static\n * @method\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\n smoothstep: _u,\n /**\n * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)\n * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n *\n * @static\n * @method\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\n smootherstep: vu,\n /**\n * Returns a random integer from `` interval.\n *\n * @static\n * @method\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random integer.\n */\n randInt: Mu,\n /**\n * Returns a random float from `` interval.\n *\n * @static\n * @method\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random float.\n */\n randFloat: Su,\n /**\n * Returns a random integer from `<-range/2, range/2>` interval.\n *\n * @static\n * @method\n * @param {number} range - Defines the value range.\n * @return {number} A random float.\n */\n randFloatSpread: bu,\n /**\n * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n *\n * @static\n * @method\n * @param {number} [s] - The integer seed.\n * @return {number} A random float.\n */\n seededRandom: yu,\n /**\n * Converts degrees to radians.\n *\n * @static\n * @method\n * @param {number} degrees - A value in degrees.\n * @return {number} The converted value in radians.\n */\n degToRad: Tu,\n /**\n * Converts radians to degrees.\n *\n * @static\n * @method\n * @param {number} radians - A value in radians.\n * @return {number} The converted value in degrees.\n */\n radToDeg: Eu,\n /**\n * Returns `true` if the given number is a power of two.\n *\n * @static\n * @method\n * @param {number} value - The value to check.\n * @return {boolean} Whether the given number is a power of two or not.\n */\n isPowerOfTwo: wu,\n /**\n * Returns the smallest power of two that is greater than or equal to the given number.\n *\n * @static\n * @method\n * @param {number} value - The value to find a POT for.\n * @return {number} The smallest power of two that is greater than or equal to the given number.\n */\n ceilPowerOfTwo: Au,\n /**\n * Returns the largest power of two that is less than or equal to the given number.\n *\n * @static\n * @method\n * @param {number} value - The value to find a POT for.\n * @return {number} The largest power of two that is less than or equal to the given number.\n */\n floorPowerOfTwo: Ru,\n /**\n * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)\n * defined by the given angles and order.\n *\n * Rotations are applied to the axes in the order specified by order:\n * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n *\n * @static\n * @method\n * @param {Quaternion} q - The quaternion to set.\n * @param {number} a - The rotation applied to the first axis, in radians.\n * @param {number} b - The rotation applied to the second axis, in radians.\n * @param {number} c - The rotation applied to the third axis, in radians.\n * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n */\n setQuaternionFromProperEuler: Cu,\n /**\n * Normalizes the given value according to the given typed array.\n *\n * @static\n * @method\n * @param {number} value - The float value in the range `[0,1]` to normalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The normalize value.\n */\n normalize: tt,\n /**\n * Denormalizes the given value according to the given typed array.\n *\n * @static\n * @method\n * @param {number} value - The value to denormalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The denormalize (float) value in the range `[0,1]`.\n */\n denormalize: hn\n};\nclass le {\n /**\n * Constructs a new 2D vector.\n *\n * @param {number} [x=0] - The x value of this vector.\n * @param {number} [y=0] - The y value of this vector.\n */\n constructor(e = 0, t = 0) {\n le.prototype.isVector2 = !0, this.x = e, this.y = t;\n }\n /**\n * Alias for {@link Vector2#x}.\n *\n * @type {number}\n */\n get width() {\n return this.x;\n }\n set width(e) {\n this.x = e;\n }\n /**\n * Alias for {@link Vector2#y}.\n *\n * @type {number}\n */\n get height() {\n return this.y;\n }\n set height(e) {\n this.y = e;\n }\n /**\n * Sets the vector components.\n *\n * @param {number} x - The value of the x component.\n * @param {number} y - The value of the y component.\n * @return {Vector2} A reference to this vector.\n */\n set(e, t) {\n return this.x = e, this.y = t, this;\n }\n /**\n * Sets the vector components to the same value.\n *\n * @param {number} scalar - The value to set for all vector components.\n * @return {Vector2} A reference to this vector.\n */\n setScalar(e) {\n return this.x = e, this.y = e, this;\n }\n /**\n * Sets the vector's x component to the given value\n *\n * @param {number} x - The value to set.\n * @return {Vector2} A reference to this vector.\n */\n setX(e) {\n return this.x = e, this;\n }\n /**\n * Sets the vector's y component to the given value\n *\n * @param {number} y - The value to set.\n * @return {Vector2} A reference to this vector.\n */\n setY(e) {\n return this.y = e, this;\n }\n /**\n * Allows to set a vector component with an index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n * @param {number} value - The value to set.\n * @return {Vector2} A reference to this vector.\n */\n setComponent(e, t) {\n switch (e) {\n case 0:\n this.x = t;\n break;\n case 1:\n this.y = t;\n break;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n return this;\n }\n /**\n * Returns the value of the vector component which matches the given index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n * @return {number} A vector component value.\n */\n getComponent(e) {\n switch (e) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n }\n /**\n * Returns a new vector with copied values from this instance.\n *\n * @return {Vector2} A clone of this instance.\n */\n clone() {\n return new this.constructor(this.x, this.y);\n }\n /**\n * Copies the values of the given vector to this instance.\n *\n * @param {Vector2} v - The vector to copy.\n * @return {Vector2} A reference to this vector.\n */\n copy(e) {\n return this.x = e.x, this.y = e.y, this;\n }\n /**\n * Adds the given vector to this instance.\n *\n * @param {Vector2} v - The vector to add.\n * @return {Vector2} A reference to this vector.\n */\n add(e) {\n return this.x += e.x, this.y += e.y, this;\n }\n /**\n * Adds the given scalar value to all components of this instance.\n *\n * @param {number} s - The scalar to add.\n * @return {Vector2} A reference to this vector.\n */\n addScalar(e) {\n return this.x += e, this.y += e, this;\n }\n /**\n * Adds the given vectors and stores the result in this instance.\n *\n * @param {Vector2} a - The first vector.\n * @param {Vector2} b - The second vector.\n * @return {Vector2} A reference to this vector.\n */\n addVectors(e, t) {\n return this.x = e.x + t.x, this.y = e.y + t.y, this;\n }\n /**\n * Adds the given vector scaled by the given factor to this instance.\n *\n * @param {Vector2} v - The vector.\n * @param {number} s - The factor that scales `v`.\n * @return {Vector2} A reference to this vector.\n */\n addScaledVector(e, t) {\n return this.x += e.x * t, this.y += e.y * t, this;\n }\n /**\n * Subtracts the given vector from this instance.\n *\n * @param {Vector2} v - The vector to subtract.\n * @return {Vector2} A reference to this vector.\n */\n sub(e) {\n return this.x -= e.x, this.y -= e.y, this;\n }\n /**\n * Subtracts the given scalar value from all components of this instance.\n *\n * @param {number} s - The scalar to subtract.\n * @return {Vector2} A reference to this vector.\n */\n subScalar(e) {\n return this.x -= e, this.y -= e, this;\n }\n /**\n * Subtracts the given vectors and stores the result in this instance.\n *\n * @param {Vector2} a - The first vector.\n * @param {Vector2} b - The second vector.\n * @return {Vector2} A reference to this vector.\n */\n subVectors(e, t) {\n return this.x = e.x - t.x, this.y = e.y - t.y, this;\n }\n /**\n * Multiplies the given vector with this instance.\n *\n * @param {Vector2} v - The vector to multiply.\n * @return {Vector2} A reference to this vector.\n */\n multiply(e) {\n return this.x *= e.x, this.y *= e.y, this;\n }\n /**\n * Multiplies the given scalar value with all components of this instance.\n *\n * @param {number} scalar - The scalar to multiply.\n * @return {Vector2} A reference to this vector.\n */\n multiplyScalar(e) {\n return this.x *= e, this.y *= e, this;\n }\n /**\n * Divides this instance by the given vector.\n *\n * @param {Vector2} v - The vector to divide.\n * @return {Vector2} A reference to this vector.\n */\n divide(e) {\n return this.x /= e.x, this.y /= e.y, this;\n }\n /**\n * Divides this vector by the given scalar.\n *\n * @param {number} scalar - The scalar to divide.\n * @return {Vector2} A reference to this vector.\n */\n divideScalar(e) {\n return this.multiplyScalar(1 / e);\n }\n /**\n * Multiplies this vector (with an implicit 1 as the 3rd component) by\n * the given 3x3 matrix.\n *\n * @param {Matrix3} m - The matrix to apply.\n * @return {Vector2} A reference to this vector.\n */\n applyMatrix3(e) {\n const t = this.x, n = this.y, s = e.elements;\n return this.x = s[0] * t + s[3] * n + s[6], this.y = s[1] * t + s[4] * n + s[7], this;\n }\n /**\n * If this vector's x or y value is greater than the given vector's x or y\n * value, replace that value with the corresponding min value.\n *\n * @param {Vector2} v - The vector.\n * @return {Vector2} A reference to this vector.\n */\n min(e) {\n return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this;\n }\n /**\n * If this vector's x or y value is less than the given vector's x or y\n * value, replace that value with the corresponding max value.\n *\n * @param {Vector2} v - The vector.\n * @return {Vector2} A reference to this vector.\n */\n max(e) {\n return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this;\n }\n /**\n * If this vector's x or y value is greater than the max vector's x or y\n * value, it is replaced by the corresponding value.\n * If this vector's x or y value is less than the min vector's x or y value,\n * it is replaced by the corresponding value.\n *\n * @param {Vector2} min - The minimum x and y values.\n * @param {Vector2} max - The maximum x and y values in the desired range.\n * @return {Vector2} A reference to this vector.\n */\n clamp(e, t) {\n return this.x = He(this.x, e.x, t.x), this.y = He(this.y, e.y, t.y), this;\n }\n /**\n * If this vector's x or y values are greater than the max value, they are\n * replaced by the max value.\n * If this vector's x or y values are less than the min value, they are\n * replaced by the min value.\n *\n * @param {number} minVal - The minimum value the components will be clamped to.\n * @param {number} maxVal - The maximum value the components will be clamped to.\n * @return {Vector2} A reference to this vector.\n */\n clampScalar(e, t) {\n return this.x = He(this.x, e, t), this.y = He(this.y, e, t), this;\n }\n /**\n * If this vector's length is greater than the max value, it is replaced by\n * the max value.\n * If this vector's length is less than the min value, it is replaced by the\n * min value.\n *\n * @param {number} min - The minimum value the vector length will be clamped to.\n * @param {number} max - The maximum value the vector length will be clamped to.\n * @return {Vector2} A reference to this vector.\n */\n clampLength(e, t) {\n const n = this.length();\n return this.divideScalar(n || 1).multiplyScalar(He(n, e, t));\n }\n /**\n * The components of this vector are rounded down to the nearest integer value.\n *\n * @return {Vector2} A reference to this vector.\n */\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;\n }\n /**\n * The components of this vector are rounded up to the nearest integer value.\n *\n * @return {Vector2} A reference to this vector.\n */\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;\n }\n /**\n * The components of this vector are rounded to the nearest integer value\n *\n * @return {Vector2} A reference to this vector.\n */\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this;\n }\n /**\n * The components of this vector are rounded towards zero (up if negative,\n * down if positive) to an integer value.\n *\n * @return {Vector2} A reference to this vector.\n */\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this;\n }\n /**\n * Inverts this vector - i.e. sets x = -x and y = -y.\n *\n * @return {Vector2} A reference to this vector.\n */\n negate() {\n return this.x = -this.x, this.y = -this.y, this;\n }\n /**\n * Calculates the dot product of the given vector with this instance.\n *\n * @param {Vector2} v - The vector to compute the dot product with.\n * @return {number} The result of the dot product.\n */\n dot(e) {\n return this.x * e.x + this.y * e.y;\n }\n /**\n * Calculates the cross product of the given vector with this instance.\n *\n * @param {Vector2} v - The vector to compute the cross product with.\n * @return {number} The result of the cross product.\n */\n cross(e) {\n return this.x * e.y - this.y * e.x;\n }\n /**\n * Computes the square of the Euclidean length (straight-line length) from\n * (0, 0) to (x, y). If you are comparing the lengths of vectors, you should\n * compare the length squared instead as it is slightly more efficient to calculate.\n *\n * @return {number} The square length of this vector.\n */\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n /**\n * Computes the Euclidean length (straight-line length) from (0, 0) to (x, y).\n *\n * @return {number} The length of this vector.\n */\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n /**\n * Computes the Manhattan length of this vector.\n *\n * @return {number} The length of this vector.\n */\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y);\n }\n /**\n * Converts this vector to a unit vector - that is, sets it equal to a vector\n * with the same direction as this one, but with a vector length of `1`.\n *\n * @return {Vector2} A reference to this vector.\n */\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n /**\n * Computes the angle in radians of this vector with respect to the positive x-axis.\n *\n * @return {number} The angle in radians.\n */\n angle() {\n return Math.atan2(-this.y, -this.x) + Math.PI;\n }\n /**\n * Returns the angle between the given vector and this instance in radians.\n *\n * @param {Vector2} v - The vector to compute the angle with.\n * @return {number} The angle in radians.\n */\n angleTo(e) {\n const t = Math.sqrt(this.lengthSq() * e.lengthSq());\n if (t === 0) return Math.PI / 2;\n const n = this.dot(e) / t;\n return Math.acos(He(n, -1, 1));\n }\n /**\n * Computes the distance from the given vector to this instance.\n *\n * @param {Vector2} v - The vector to compute the distance to.\n * @return {number} The distance.\n */\n distanceTo(e) {\n return Math.sqrt(this.distanceToSquared(e));\n }\n /**\n * Computes the squared distance from the given vector to this instance.\n * If you are just comparing the distance with another distance, you should compare\n * the distance squared instead as it is slightly more efficient to calculate.\n *\n * @param {Vector2} v - The vector to compute the squared distance to.\n * @return {number} The squared distance.\n */\n distanceToSquared(e) {\n const t = this.x - e.x, n = this.y - e.y;\n return t * t + n * n;\n }\n /**\n * Computes the Manhattan distance from the given vector to this instance.\n *\n * @param {Vector2} v - The vector to compute the Manhattan distance to.\n * @return {number} The Manhattan distance.\n */\n manhattanDistanceTo(e) {\n return Math.abs(this.x - e.x) + Math.abs(this.y - e.y);\n }\n /**\n * Sets this vector to a vector with the same direction as this one, but\n * with the specified length.\n *\n * @param {number} length - The new length of this vector.\n * @return {Vector2} A reference to this vector.\n */\n setLength(e) {\n return this.normalize().multiplyScalar(e);\n }\n /**\n * Linearly interpolates between the given vector and this instance, where\n * alpha is the percent distance along the line - alpha = 0 will be this\n * vector, and alpha = 1 will be the given one.\n *\n * @param {Vector2} v - The vector to interpolate towards.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector2} A reference to this vector.\n */\n lerp(e, t) {\n return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this;\n }\n /**\n * Linearly interpolates between the given vectors, where alpha is the percent\n * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n * be the second one. The result is stored in this instance.\n *\n * @param {Vector2} v1 - The first vector.\n * @param {Vector2} v2 - The second vector.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector2} A reference to this vector.\n */\n lerpVectors(e, t, n) {\n return this.x = e.x + (t.x - e.x) * n, this.y = e.y + (t.y - e.y) * n, this;\n }\n /**\n * Returns `true` if this vector is equal with the given one.\n *\n * @param {Vector2} v - The vector to test for equality.\n * @return {boolean} Whether this vector is equal with the given one.\n */\n equals(e) {\n return e.x === this.x && e.y === this.y;\n }\n /**\n * Sets this vector's x value to be `array[ offset ]` and y\n * value to be `array[ offset + 1 ]`.\n *\n * @param {Array} array - An array holding the vector component values.\n * @param {number} [offset=0] - The offset into the array.\n * @return {Vector2} A reference to this vector.\n */\n fromArray(e, t = 0) {\n return this.x = e[t], this.y = e[t + 1], this;\n }\n /**\n * Writes the components of this vector to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the vector components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The vector components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this.x, e[t + 1] = this.y, e;\n }\n /**\n * Sets the components of this vector from the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n * @param {number} index - The index into the attribute.\n * @return {Vector2} A reference to this vector.\n */\n fromBufferAttribute(e, t) {\n return this.x = e.getX(t), this.y = e.getY(t), this;\n }\n /**\n * Rotates this vector around the given center by the given angle.\n *\n * @param {Vector2} center - The point around which to rotate.\n * @param {number} angle - The angle to rotate, in radians.\n * @return {Vector2} A reference to this vector.\n */\n rotateAround(e, t) {\n const n = Math.cos(t), s = Math.sin(t), r = this.x - e.x, a = this.y - e.y;\n return this.x = r * n - a * s + e.x, this.y = r * s + a * n + e.y, this;\n }\n /**\n * Sets each component of this vector to a pseudo-random value between `0` and\n * `1`, excluding `1`.\n *\n * @return {Vector2} A reference to this vector.\n */\n random() {\n return this.x = Math.random(), this.y = Math.random(), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y;\n }\n}\nclass gn {\n /**\n * Constructs a new quaternion.\n *\n * @param {number} [x=0] - The x value of this quaternion.\n * @param {number} [y=0] - The y value of this quaternion.\n * @param {number} [z=0] - The z value of this quaternion.\n * @param {number} [w=1] - The w value of this quaternion.\n */\n constructor(e = 0, t = 0, n = 0, s = 1) {\n this.isQuaternion = !0, this._x = e, this._y = t, this._z = n, this._w = s;\n }\n /**\n * Interpolates between two quaternions via SLERP. This implementation assumes the\n * quaternion data are managed in flat arrays.\n *\n * @param {Array} dst - The destination array.\n * @param {number} dstOffset - An offset into the destination array.\n * @param {Array} src0 - The source array of the first quaternion.\n * @param {number} srcOffset0 - An offset into the first source array.\n * @param {Array} src1 - The source array of the second quaternion.\n * @param {number} srcOffset1 - An offset into the second source array.\n * @param {number} t - The interpolation factor in the range `[0,1]`.\n * @see {@link Quaternion#slerp}\n */\n static slerpFlat(e, t, n, s, r, a, o) {\n let l = n[s + 0], c = n[s + 1], h = n[s + 2], u = n[s + 3], d = r[a + 0], p = r[a + 1], g = r[a + 2], x = r[a + 3];\n if (o <= 0) {\n e[t + 0] = l, e[t + 1] = c, e[t + 2] = h, e[t + 3] = u;\n return;\n }\n if (o >= 1) {\n e[t + 0] = d, e[t + 1] = p, e[t + 2] = g, e[t + 3] = x;\n return;\n }\n if (u !== x || l !== d || c !== p || h !== g) {\n let m = l * d + c * p + h * g + u * x;\n m < 0 && (d = -d, p = -p, g = -g, x = -x, m = -m);\n let f = 1 - o;\n if (m < 0.9995) {\n const y = Math.acos(m), v = Math.sin(y);\n f = Math.sin(f * y) / v, o = Math.sin(o * y) / v, l = l * f + d * o, c = c * f + p * o, h = h * f + g * o, u = u * f + x * o;\n } else {\n l = l * f + d * o, c = c * f + p * o, h = h * f + g * o, u = u * f + x * o;\n const y = 1 / Math.sqrt(l * l + c * c + h * h + u * u);\n l *= y, c *= y, h *= y, u *= y;\n }\n }\n e[t] = l, e[t + 1] = c, e[t + 2] = h, e[t + 3] = u;\n }\n /**\n * Multiplies two quaternions. This implementation assumes the quaternion data are managed\n * in flat arrays.\n *\n * @param {Array} dst - The destination array.\n * @param {number} dstOffset - An offset into the destination array.\n * @param {Array} src0 - The source array of the first quaternion.\n * @param {number} srcOffset0 - An offset into the first source array.\n * @param {Array} src1 - The source array of the second quaternion.\n * @param {number} srcOffset1 - An offset into the second source array.\n * @return {Array} The destination array.\n * @see {@link Quaternion#multiplyQuaternions}.\n */\n static multiplyQuaternionsFlat(e, t, n, s, r, a) {\n const o = n[s], l = n[s + 1], c = n[s + 2], h = n[s + 3], u = r[a], d = r[a + 1], p = r[a + 2], g = r[a + 3];\n return e[t] = o * g + h * u + l * p - c * d, e[t + 1] = l * g + h * d + c * u - o * p, e[t + 2] = c * g + h * p + o * d - l * u, e[t + 3] = h * g - o * u - l * d - c * p, e;\n }\n /**\n * The x value of this quaternion.\n *\n * @type {number}\n * @default 0\n */\n get x() {\n return this._x;\n }\n set x(e) {\n this._x = e, this._onChangeCallback();\n }\n /**\n * The y value of this quaternion.\n *\n * @type {number}\n * @default 0\n */\n get y() {\n return this._y;\n }\n set y(e) {\n this._y = e, this._onChangeCallback();\n }\n /**\n * The z value of this quaternion.\n *\n * @type {number}\n * @default 0\n */\n get z() {\n return this._z;\n }\n set z(e) {\n this._z = e, this._onChangeCallback();\n }\n /**\n * The w value of this quaternion.\n *\n * @type {number}\n * @default 1\n */\n get w() {\n return this._w;\n }\n set w(e) {\n this._w = e, this._onChangeCallback();\n }\n /**\n * Sets the quaternion components.\n *\n * @param {number} x - The x value of this quaternion.\n * @param {number} y - The y value of this quaternion.\n * @param {number} z - The z value of this quaternion.\n * @param {number} w - The w value of this quaternion.\n * @return {Quaternion} A reference to this quaternion.\n */\n set(e, t, n, s) {\n return this._x = e, this._y = t, this._z = n, this._w = s, this._onChangeCallback(), this;\n }\n /**\n * Returns a new quaternion with copied values from this instance.\n *\n * @return {Quaternion} A clone of this instance.\n */\n clone() {\n return new this.constructor(this._x, this._y, this._z, this._w);\n }\n /**\n * Copies the values of the given quaternion to this instance.\n *\n * @param {Quaternion} quaternion - The quaternion to copy.\n * @return {Quaternion} A reference to this quaternion.\n */\n copy(e) {\n return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;\n }\n /**\n * Sets this quaternion from the rotation specified by the given\n * Euler angles.\n *\n * @param {Euler} euler - The Euler angles.\n * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n * @return {Quaternion} A reference to this quaternion.\n */\n setFromEuler(e, t = !0) {\n const n = e._x, s = e._y, r = e._z, a = e._order, o = Math.cos, l = Math.sin, c = o(n / 2), h = o(s / 2), u = o(r / 2), d = l(n / 2), p = l(s / 2), g = l(r / 2);\n switch (a) {\n case \"XYZ\":\n this._x = d * h * u + c * p * g, this._y = c * p * u - d * h * g, this._z = c * h * g + d * p * u, this._w = c * h * u - d * p * g;\n break;\n case \"YXZ\":\n this._x = d * h * u + c * p * g, this._y = c * p * u - d * h * g, this._z = c * h * g - d * p * u, this._w = c * h * u + d * p * g;\n break;\n case \"ZXY\":\n this._x = d * h * u - c * p * g, this._y = c * p * u + d * h * g, this._z = c * h * g + d * p * u, this._w = c * h * u - d * p * g;\n break;\n case \"ZYX\":\n this._x = d * h * u - c * p * g, this._y = c * p * u + d * h * g, this._z = c * h * g - d * p * u, this._w = c * h * u + d * p * g;\n break;\n case \"YZX\":\n this._x = d * h * u + c * p * g, this._y = c * p * u + d * h * g, this._z = c * h * g - d * p * u, this._w = c * h * u - d * p * g;\n break;\n case \"XZY\":\n this._x = d * h * u - c * p * g, this._y = c * p * u - d * h * g, this._z = c * h * g + d * p * u, this._w = c * h * u + d * p * g;\n break;\n default:\n Te(\"Quaternion: .setFromEuler() encountered an unknown order: \" + a);\n }\n return t === !0 && this._onChangeCallback(), this;\n }\n /**\n * Sets this quaternion from the given axis and angle.\n *\n * @param {Vector3} axis - The normalized axis.\n * @param {number} angle - The angle in radians.\n * @return {Quaternion} A reference to this quaternion.\n */\n setFromAxisAngle(e, t) {\n const n = t / 2, s = Math.sin(n);\n return this._x = e.x * s, this._y = e.y * s, this._z = e.z * s, this._w = Math.cos(n), this._onChangeCallback(), this;\n }\n /**\n * Sets this quaternion from the given rotation matrix.\n *\n * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n * @return {Quaternion} A reference to this quaternion.\n */\n setFromRotationMatrix(e) {\n const t = e.elements, n = t[0], s = t[4], r = t[8], a = t[1], o = t[5], l = t[9], c = t[2], h = t[6], u = t[10], d = n + o + u;\n if (d > 0) {\n const p = 0.5 / Math.sqrt(d + 1);\n this._w = 0.25 / p, this._x = (h - l) * p, this._y = (r - c) * p, this._z = (a - s) * p;\n } else if (n > o && n > u) {\n const p = 2 * Math.sqrt(1 + n - o - u);\n this._w = (h - l) / p, this._x = 0.25 * p, this._y = (s + a) / p, this._z = (r + c) / p;\n } else if (o > u) {\n const p = 2 * Math.sqrt(1 + o - n - u);\n this._w = (r - c) / p, this._x = (s + a) / p, this._y = 0.25 * p, this._z = (l + h) / p;\n } else {\n const p = 2 * Math.sqrt(1 + u - n - o);\n this._w = (a - s) / p, this._x = (r + c) / p, this._y = (l + h) / p, this._z = 0.25 * p;\n }\n return this._onChangeCallback(), this;\n }\n /**\n * Sets this quaternion to the rotation required to rotate the direction vector\n * `vFrom` to the direction vector `vTo`.\n *\n * @param {Vector3} vFrom - The first (normalized) direction vector.\n * @param {Vector3} vTo - The second (normalized) direction vector.\n * @return {Quaternion} A reference to this quaternion.\n */\n setFromUnitVectors(e, t) {\n let n = e.dot(t) + 1;\n return n < 1e-8 ? (n = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = n) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = n)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = n), this.normalize();\n }\n /**\n * Returns the angle between this quaternion and the given one in radians.\n *\n * @param {Quaternion} q - The quaternion to compute the angle with.\n * @return {number} The angle in radians.\n */\n angleTo(e) {\n return 2 * Math.acos(Math.abs(He(this.dot(e), -1, 1)));\n }\n /**\n * Rotates this quaternion by a given angular step to the given quaternion.\n * The method ensures that the final quaternion will not overshoot `q`.\n *\n * @param {Quaternion} q - The target quaternion.\n * @param {number} step - The angular step in radians.\n * @return {Quaternion} A reference to this quaternion.\n */\n rotateTowards(e, t) {\n const n = this.angleTo(e);\n if (n === 0) return this;\n const s = Math.min(1, t / n);\n return this.slerp(e, s), this;\n }\n /**\n * Sets this quaternion to the identity quaternion; that is, to the\n * quaternion that represents \"no rotation\".\n *\n * @return {Quaternion} A reference to this quaternion.\n */\n identity() {\n return this.set(0, 0, 0, 1);\n }\n /**\n * Inverts this quaternion via {@link Quaternion#conjugate}. The\n * quaternion is assumed to have unit length.\n *\n * @return {Quaternion} A reference to this quaternion.\n */\n invert() {\n return this.conjugate();\n }\n /**\n * Returns the rotational conjugate of this quaternion. The conjugate of a\n * quaternion represents the same rotation in the opposite direction about\n * the rotational axis.\n *\n * @return {Quaternion} A reference to this quaternion.\n */\n conjugate() {\n return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;\n }\n /**\n * Calculates the dot product of this quaternion and the given one.\n *\n * @param {Quaternion} v - The quaternion to compute the dot product with.\n * @return {number} The result of the dot product.\n */\n dot(e) {\n return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;\n }\n /**\n * Computes the squared Euclidean length (straight-line length) of this quaternion,\n * considered as a 4 dimensional vector. This can be useful if you are comparing the\n * lengths of two quaternions, as this is a slightly more efficient calculation than\n * {@link Quaternion#length}.\n *\n * @return {number} The squared Euclidean length.\n */\n lengthSq() {\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n }\n /**\n * Computes the Euclidean length (straight-line length) of this quaternion,\n * considered as a 4 dimensional vector.\n *\n * @return {number} The Euclidean length.\n */\n length() {\n return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n }\n /**\n * Normalizes this quaternion - that is, calculated the quaternion that performs\n * the same rotation as this one, but has a length equal to `1`.\n *\n * @return {Quaternion} A reference to this quaternion.\n */\n normalize() {\n let e = this.length();\n return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this;\n }\n /**\n * Multiplies this quaternion by the given one.\n *\n * @param {Quaternion} q - The quaternion.\n * @return {Quaternion} A reference to this quaternion.\n */\n multiply(e) {\n return this.multiplyQuaternions(this, e);\n }\n /**\n * Pre-multiplies this quaternion by the given one.\n *\n * @param {Quaternion} q - The quaternion.\n * @return {Quaternion} A reference to this quaternion.\n */\n premultiply(e) {\n return this.multiplyQuaternions(e, this);\n }\n /**\n * Multiplies the given quaternions and stores the result in this instance.\n *\n * @param {Quaternion} a - The first quaternion.\n * @param {Quaternion} b - The second quaternion.\n * @return {Quaternion} A reference to this quaternion.\n */\n multiplyQuaternions(e, t) {\n const n = e._x, s = e._y, r = e._z, a = e._w, o = t._x, l = t._y, c = t._z, h = t._w;\n return this._x = n * h + a * o + s * c - r * l, this._y = s * h + a * l + r * o - n * c, this._z = r * h + a * c + n * l - s * o, this._w = a * h - n * o - s * l - r * c, this._onChangeCallback(), this;\n }\n /**\n * Performs a spherical linear interpolation between quaternions.\n *\n * @param {Quaternion} qb - The target quaternion.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {Quaternion} A reference to this quaternion.\n */\n slerp(e, t) {\n if (t <= 0) return this;\n if (t >= 1) return this.copy(e);\n let n = e._x, s = e._y, r = e._z, a = e._w, o = this.dot(e);\n o < 0 && (n = -n, s = -s, r = -r, a = -a, o = -o);\n let l = 1 - t;\n if (o < 0.9995) {\n const c = Math.acos(o), h = Math.sin(c);\n l = Math.sin(l * c) / h, t = Math.sin(t * c) / h, this._x = this._x * l + n * t, this._y = this._y * l + s * t, this._z = this._z * l + r * t, this._w = this._w * l + a * t, this._onChangeCallback();\n } else\n this._x = this._x * l + n * t, this._y = this._y * l + s * t, this._z = this._z * l + r * t, this._w = this._w * l + a * t, this.normalize();\n return this;\n }\n /**\n * Performs a spherical linear interpolation between the given quaternions\n * and stores the result in this quaternion.\n *\n * @param {Quaternion} qa - The source quaternion.\n * @param {Quaternion} qb - The target quaternion.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {Quaternion} A reference to this quaternion.\n */\n slerpQuaternions(e, t, n) {\n return this.copy(e).slerp(t, n);\n }\n /**\n * Sets this quaternion to a uniformly random, normalized quaternion.\n *\n * @return {Quaternion} A reference to this quaternion.\n */\n random() {\n const e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), n = Math.random(), s = Math.sqrt(1 - n), r = Math.sqrt(n);\n return this.set(\n s * Math.sin(e),\n s * Math.cos(e),\n r * Math.sin(t),\n r * Math.cos(t)\n );\n }\n /**\n * Returns `true` if this quaternion is equal with the given one.\n *\n * @param {Quaternion} quaternion - The quaternion to test for equality.\n * @return {boolean} Whether this quaternion is equal with the given one.\n */\n equals(e) {\n return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;\n }\n /**\n * Sets this quaternion's components from the given array.\n *\n * @param {Array} array - An array holding the quaternion component values.\n * @param {number} [offset=0] - The offset into the array.\n * @return {Quaternion} A reference to this quaternion.\n */\n fromArray(e, t = 0) {\n return this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this;\n }\n /**\n * Writes the components of this quaternion to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the quaternion components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The quaternion components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e;\n }\n /**\n * Sets the components of this quaternion from the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - The buffer attribute holding quaternion data.\n * @param {number} index - The index into the attribute.\n * @return {Quaternion} A reference to this quaternion.\n */\n fromBufferAttribute(e, t) {\n return this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this._onChangeCallback(), this;\n }\n /**\n * This methods defines the serialization result of this class. Returns the\n * numerical elements of this quaternion in an array of format `[x, y, z, w]`.\n *\n * @return {Array} The serialized quaternion.\n */\n toJSON() {\n return this.toArray();\n }\n _onChange(e) {\n return this._onChangeCallback = e, this;\n }\n _onChangeCallback() {\n }\n *[Symbol.iterator]() {\n yield this._x, yield this._y, yield this._z, yield this._w;\n }\n}\nclass w {\n /**\n * Constructs a new 3D vector.\n *\n * @param {number} [x=0] - The x value of this vector.\n * @param {number} [y=0] - The y value of this vector.\n * @param {number} [z=0] - The z value of this vector.\n */\n constructor(e = 0, t = 0, n = 0) {\n w.prototype.isVector3 = !0, this.x = e, this.y = t, this.z = n;\n }\n /**\n * Sets the vector components.\n *\n * @param {number} x - The value of the x component.\n * @param {number} y - The value of the y component.\n * @param {number} z - The value of the z component.\n * @return {Vector3} A reference to this vector.\n */\n set(e, t, n) {\n return n === void 0 && (n = this.z), this.x = e, this.y = t, this.z = n, this;\n }\n /**\n * Sets the vector components to the same value.\n *\n * @param {number} scalar - The value to set for all vector components.\n * @return {Vector3} A reference to this vector.\n */\n setScalar(e) {\n return this.x = e, this.y = e, this.z = e, this;\n }\n /**\n * Sets the vector's x component to the given value\n *\n * @param {number} x - The value to set.\n * @return {Vector3} A reference to this vector.\n */\n setX(e) {\n return this.x = e, this;\n }\n /**\n * Sets the vector's y component to the given value\n *\n * @param {number} y - The value to set.\n * @return {Vector3} A reference to this vector.\n */\n setY(e) {\n return this.y = e, this;\n }\n /**\n * Sets the vector's z component to the given value\n *\n * @param {number} z - The value to set.\n * @return {Vector3} A reference to this vector.\n */\n setZ(e) {\n return this.z = e, this;\n }\n /**\n * Allows to set a vector component with an index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n * @param {number} value - The value to set.\n * @return {Vector3} A reference to this vector.\n */\n setComponent(e, t) {\n switch (e) {\n case 0:\n this.x = t;\n break;\n case 1:\n this.y = t;\n break;\n case 2:\n this.z = t;\n break;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n return this;\n }\n /**\n * Returns the value of the vector component which matches the given index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n * @return {number} A vector component value.\n */\n getComponent(e) {\n switch (e) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n case 2:\n return this.z;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n }\n /**\n * Returns a new vector with copied values from this instance.\n *\n * @return {Vector3} A clone of this instance.\n */\n clone() {\n return new this.constructor(this.x, this.y, this.z);\n }\n /**\n * Copies the values of the given vector to this instance.\n *\n * @param {Vector3} v - The vector to copy.\n * @return {Vector3} A reference to this vector.\n */\n copy(e) {\n return this.x = e.x, this.y = e.y, this.z = e.z, this;\n }\n /**\n * Adds the given vector to this instance.\n *\n * @param {Vector3} v - The vector to add.\n * @return {Vector3} A reference to this vector.\n */\n add(e) {\n return this.x += e.x, this.y += e.y, this.z += e.z, this;\n }\n /**\n * Adds the given scalar value to all components of this instance.\n *\n * @param {number} s - The scalar to add.\n * @return {Vector3} A reference to this vector.\n */\n addScalar(e) {\n return this.x += e, this.y += e, this.z += e, this;\n }\n /**\n * Adds the given vectors and stores the result in this instance.\n *\n * @param {Vector3} a - The first vector.\n * @param {Vector3} b - The second vector.\n * @return {Vector3} A reference to this vector.\n */\n addVectors(e, t) {\n return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this;\n }\n /**\n * Adds the given vector scaled by the given factor to this instance.\n *\n * @param {Vector3|Vector4} v - The vector.\n * @param {number} s - The factor that scales `v`.\n * @return {Vector3} A reference to this vector.\n */\n addScaledVector(e, t) {\n return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this;\n }\n /**\n * Subtracts the given vector from this instance.\n *\n * @param {Vector3} v - The vector to subtract.\n * @return {Vector3} A reference to this vector.\n */\n sub(e) {\n return this.x -= e.x, this.y -= e.y, this.z -= e.z, this;\n }\n /**\n * Subtracts the given scalar value from all components of this instance.\n *\n * @param {number} s - The scalar to subtract.\n * @return {Vector3} A reference to this vector.\n */\n subScalar(e) {\n return this.x -= e, this.y -= e, this.z -= e, this;\n }\n /**\n * Subtracts the given vectors and stores the result in this instance.\n *\n * @param {Vector3} a - The first vector.\n * @param {Vector3} b - The second vector.\n * @return {Vector3} A reference to this vector.\n */\n subVectors(e, t) {\n return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this;\n }\n /**\n * Multiplies the given vector with this instance.\n *\n * @param {Vector3} v - The vector to multiply.\n * @return {Vector3} A reference to this vector.\n */\n multiply(e) {\n return this.x *= e.x, this.y *= e.y, this.z *= e.z, this;\n }\n /**\n * Multiplies the given scalar value with all components of this instance.\n *\n * @param {number} scalar - The scalar to multiply.\n * @return {Vector3} A reference to this vector.\n */\n multiplyScalar(e) {\n return this.x *= e, this.y *= e, this.z *= e, this;\n }\n /**\n * Multiplies the given vectors and stores the result in this instance.\n *\n * @param {Vector3} a - The first vector.\n * @param {Vector3} b - The second vector.\n * @return {Vector3} A reference to this vector.\n */\n multiplyVectors(e, t) {\n return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this;\n }\n /**\n * Applies the given Euler rotation to this vector.\n *\n * @param {Euler} euler - The Euler angles.\n * @return {Vector3} A reference to this vector.\n */\n applyEuler(e) {\n return this.applyQuaternion(ul.setFromEuler(e));\n }\n /**\n * Applies a rotation specified by an axis and an angle to this vector.\n *\n * @param {Vector3} axis - A normalized vector representing the rotation axis.\n * @param {number} angle - The angle in radians.\n * @return {Vector3} A reference to this vector.\n */\n applyAxisAngle(e, t) {\n return this.applyQuaternion(ul.setFromAxisAngle(e, t));\n }\n /**\n * Multiplies this vector with the given 3x3 matrix.\n *\n * @param {Matrix3} m - The 3x3 matrix.\n * @return {Vector3} A reference to this vector.\n */\n applyMatrix3(e) {\n const t = this.x, n = this.y, s = this.z, r = e.elements;\n return this.x = r[0] * t + r[3] * n + r[6] * s, this.y = r[1] * t + r[4] * n + r[7] * s, this.z = r[2] * t + r[5] * n + r[8] * s, this;\n }\n /**\n * Multiplies this vector by the given normal matrix and normalizes\n * the result.\n *\n * @param {Matrix3} m - The normal matrix.\n * @return {Vector3} A reference to this vector.\n */\n applyNormalMatrix(e) {\n return this.applyMatrix3(e).normalize();\n }\n /**\n * Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and\n * divides by perspective.\n *\n * @param {Matrix4} m - The matrix to apply.\n * @return {Vector3} A reference to this vector.\n */\n applyMatrix4(e) {\n const t = this.x, n = this.y, s = this.z, r = e.elements, a = 1 / (r[3] * t + r[7] * n + r[11] * s + r[15]);\n return this.x = (r[0] * t + r[4] * n + r[8] * s + r[12]) * a, this.y = (r[1] * t + r[5] * n + r[9] * s + r[13]) * a, this.z = (r[2] * t + r[6] * n + r[10] * s + r[14]) * a, this;\n }\n /**\n * Applies the given Quaternion to this vector.\n *\n * @param {Quaternion} q - The Quaternion.\n * @return {Vector3} A reference to this vector.\n */\n applyQuaternion(e) {\n const t = this.x, n = this.y, s = this.z, r = e.x, a = e.y, o = e.z, l = e.w, c = 2 * (a * s - o * n), h = 2 * (o * t - r * s), u = 2 * (r * n - a * t);\n return this.x = t + l * c + a * u - o * h, this.y = n + l * h + o * c - r * u, this.z = s + l * u + r * h - a * c, this;\n }\n /**\n * Projects this vector from world space into the camera's normalized\n * device coordinate (NDC) space.\n *\n * @param {Camera} camera - The camera.\n * @return {Vector3} A reference to this vector.\n */\n project(e) {\n return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);\n }\n /**\n * Unprojects this vector from the camera's normalized device coordinate (NDC)\n * space into world space.\n *\n * @param {Camera} camera - The camera.\n * @return {Vector3} A reference to this vector.\n */\n unproject(e) {\n return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);\n }\n /**\n * Transforms the direction of this vector by a matrix (the upper left 3 x 3\n * subset of the given 4x4 matrix and then normalizes the result.\n *\n * @param {Matrix4} m - The matrix.\n * @return {Vector3} A reference to this vector.\n */\n transformDirection(e) {\n const t = this.x, n = this.y, s = this.z, r = e.elements;\n return this.x = r[0] * t + r[4] * n + r[8] * s, this.y = r[1] * t + r[5] * n + r[9] * s, this.z = r[2] * t + r[6] * n + r[10] * s, this.normalize();\n }\n /**\n * Divides this instance by the given vector.\n *\n * @param {Vector3} v - The vector to divide.\n * @return {Vector3} A reference to this vector.\n */\n divide(e) {\n return this.x /= e.x, this.y /= e.y, this.z /= e.z, this;\n }\n /**\n * Divides this vector by the given scalar.\n *\n * @param {number} scalar - The scalar to divide.\n * @return {Vector3} A reference to this vector.\n */\n divideScalar(e) {\n return this.multiplyScalar(1 / e);\n }\n /**\n * If this vector's x, y or z value is greater than the given vector's x, y or z\n * value, replace that value with the corresponding min value.\n *\n * @param {Vector3} v - The vector.\n * @return {Vector3} A reference to this vector.\n */\n min(e) {\n return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this;\n }\n /**\n * If this vector's x, y or z value is less than the given vector's x, y or z\n * value, replace that value with the corresponding max value.\n *\n * @param {Vector3} v - The vector.\n * @return {Vector3} A reference to this vector.\n */\n max(e) {\n return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this;\n }\n /**\n * If this vector's x, y or z value is greater than the max vector's x, y or z\n * value, it is replaced by the corresponding value.\n * If this vector's x, y or z value is less than the min vector's x, y or z value,\n * it is replaced by the corresponding value.\n *\n * @param {Vector3} min - The minimum x, y and z values.\n * @param {Vector3} max - The maximum x, y and z values in the desired range.\n * @return {Vector3} A reference to this vector.\n */\n clamp(e, t) {\n return this.x = He(this.x, e.x, t.x), this.y = He(this.y, e.y, t.y), this.z = He(this.z, e.z, t.z), this;\n }\n /**\n * If this vector's x, y or z values are greater than the max value, they are\n * replaced by the max value.\n * If this vector's x, y or z values are less than the min value, they are\n * replaced by the min value.\n *\n * @param {number} minVal - The minimum value the components will be clamped to.\n * @param {number} maxVal - The maximum value the components will be clamped to.\n * @return {Vector3} A reference to this vector.\n */\n clampScalar(e, t) {\n return this.x = He(this.x, e, t), this.y = He(this.y, e, t), this.z = He(this.z, e, t), this;\n }\n /**\n * If this vector's length is greater than the max value, it is replaced by\n * the max value.\n * If this vector's length is less than the min value, it is replaced by the\n * min value.\n *\n * @param {number} min - The minimum value the vector length will be clamped to.\n * @param {number} max - The maximum value the vector length will be clamped to.\n * @return {Vector3} A reference to this vector.\n */\n clampLength(e, t) {\n const n = this.length();\n return this.divideScalar(n || 1).multiplyScalar(He(n, e, t));\n }\n /**\n * The components of this vector are rounded down to the nearest integer value.\n *\n * @return {Vector3} A reference to this vector.\n */\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;\n }\n /**\n * The components of this vector are rounded up to the nearest integer value.\n *\n * @return {Vector3} A reference to this vector.\n */\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;\n }\n /**\n * The components of this vector are rounded to the nearest integer value\n *\n * @return {Vector3} A reference to this vector.\n */\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;\n }\n /**\n * The components of this vector are rounded towards zero (up if negative,\n * down if positive) to an integer value.\n *\n * @return {Vector3} A reference to this vector.\n */\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;\n }\n /**\n * Inverts this vector - i.e. sets x = -x, y = -y and z = -z.\n *\n * @return {Vector3} A reference to this vector.\n */\n negate() {\n return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;\n }\n /**\n * Calculates the dot product of the given vector with this instance.\n *\n * @param {Vector3} v - The vector to compute the dot product with.\n * @return {number} The result of the dot product.\n */\n dot(e) {\n return this.x * e.x + this.y * e.y + this.z * e.z;\n }\n // TODO lengthSquared?\n /**\n * Computes the square of the Euclidean length (straight-line length) from\n * (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should\n * compare the length squared instead as it is slightly more efficient to calculate.\n *\n * @return {number} The square length of this vector.\n */\n lengthSq() {\n return this.x * this.x + this.y * this.y + this.z * this.z;\n }\n /**\n * Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).\n *\n * @return {number} The length of this vector.\n */\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n }\n /**\n * Computes the Manhattan length of this vector.\n *\n * @return {number} The length of this vector.\n */\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n }\n /**\n * Converts this vector to a unit vector - that is, sets it equal to a vector\n * with the same direction as this one, but with a vector length of `1`.\n *\n * @return {Vector3} A reference to this vector.\n */\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n /**\n * Sets this vector to a vector with the same direction as this one, but\n * with the specified length.\n *\n * @param {number} length - The new length of this vector.\n * @return {Vector3} A reference to this vector.\n */\n setLength(e) {\n return this.normalize().multiplyScalar(e);\n }\n /**\n * Linearly interpolates between the given vector and this instance, where\n * alpha is the percent distance along the line - alpha = 0 will be this\n * vector, and alpha = 1 will be the given one.\n *\n * @param {Vector3} v - The vector to interpolate towards.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector3} A reference to this vector.\n */\n lerp(e, t) {\n return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this;\n }\n /**\n * Linearly interpolates between the given vectors, where alpha is the percent\n * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n * be the second one. The result is stored in this instance.\n *\n * @param {Vector3} v1 - The first vector.\n * @param {Vector3} v2 - The second vector.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector3} A reference to this vector.\n */\n lerpVectors(e, t, n) {\n return this.x = e.x + (t.x - e.x) * n, this.y = e.y + (t.y - e.y) * n, this.z = e.z + (t.z - e.z) * n, this;\n }\n /**\n * Calculates the cross product of the given vector with this instance.\n *\n * @param {Vector3} v - The vector to compute the cross product with.\n * @return {Vector3} The result of the cross product.\n */\n cross(e) {\n return this.crossVectors(this, e);\n }\n /**\n * Calculates the cross product of the given vectors and stores the result\n * in this instance.\n *\n * @param {Vector3} a - The first vector.\n * @param {Vector3} b - The second vector.\n * @return {Vector3} A reference to this vector.\n */\n crossVectors(e, t) {\n const n = e.x, s = e.y, r = e.z, a = t.x, o = t.y, l = t.z;\n return this.x = s * l - r * o, this.y = r * a - n * l, this.z = n * o - s * a, this;\n }\n /**\n * Projects this vector onto the given one.\n *\n * @param {Vector3} v - The vector to project to.\n * @return {Vector3} A reference to this vector.\n */\n projectOnVector(e) {\n const t = e.lengthSq();\n if (t === 0) return this.set(0, 0, 0);\n const n = e.dot(this) / t;\n return this.copy(e).multiplyScalar(n);\n }\n /**\n * Projects this vector onto a plane by subtracting this\n * vector projected onto the plane's normal from this vector.\n *\n * @param {Vector3} planeNormal - The plane normal.\n * @return {Vector3} A reference to this vector.\n */\n projectOnPlane(e) {\n return Or.copy(this).projectOnVector(e), this.sub(Or);\n }\n /**\n * Reflects this vector off a plane orthogonal to the given normal vector.\n *\n * @param {Vector3} normal - The (normalized) normal vector.\n * @return {Vector3} A reference to this vector.\n */\n reflect(e) {\n return this.sub(Or.copy(e).multiplyScalar(2 * this.dot(e)));\n }\n /**\n * Returns the angle between the given vector and this instance in radians.\n *\n * @param {Vector3} v - The vector to compute the angle with.\n * @return {number} The angle in radians.\n */\n angleTo(e) {\n const t = Math.sqrt(this.lengthSq() * e.lengthSq());\n if (t === 0) return Math.PI / 2;\n const n = this.dot(e) / t;\n return Math.acos(He(n, -1, 1));\n }\n /**\n * Computes the distance from the given vector to this instance.\n *\n * @param {Vector3} v - The vector to compute the distance to.\n * @return {number} The distance.\n */\n distanceTo(e) {\n return Math.sqrt(this.distanceToSquared(e));\n }\n /**\n * Computes the squared distance from the given vector to this instance.\n * If you are just comparing the distance with another distance, you should compare\n * the distance squared instead as it is slightly more efficient to calculate.\n *\n * @param {Vector3} v - The vector to compute the squared distance to.\n * @return {number} The squared distance.\n */\n distanceToSquared(e) {\n const t = this.x - e.x, n = this.y - e.y, s = this.z - e.z;\n return t * t + n * n + s * s;\n }\n /**\n * Computes the Manhattan distance from the given vector to this instance.\n *\n * @param {Vector3} v - The vector to compute the Manhattan distance to.\n * @return {number} The Manhattan distance.\n */\n manhattanDistanceTo(e) {\n return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);\n }\n /**\n * Sets the vector components from the given spherical coordinates.\n *\n * @param {Spherical} s - The spherical coordinates.\n * @return {Vector3} A reference to this vector.\n */\n setFromSpherical(e) {\n return this.setFromSphericalCoords(e.radius, e.phi, e.theta);\n }\n /**\n * Sets the vector components from the given spherical coordinates.\n *\n * @param {number} radius - The radius.\n * @param {number} phi - The phi angle in radians.\n * @param {number} theta - The theta angle in radians.\n * @return {Vector3} A reference to this vector.\n */\n setFromSphericalCoords(e, t, n) {\n const s = Math.sin(t) * e;\n return this.x = s * Math.sin(n), this.y = Math.cos(t) * e, this.z = s * Math.cos(n), this;\n }\n /**\n * Sets the vector components from the given cylindrical coordinates.\n *\n * @param {Cylindrical} c - The cylindrical coordinates.\n * @return {Vector3} A reference to this vector.\n */\n setFromCylindrical(e) {\n return this.setFromCylindricalCoords(e.radius, e.theta, e.y);\n }\n /**\n * Sets the vector components from the given cylindrical coordinates.\n *\n * @param {number} radius - The radius.\n * @param {number} theta - The theta angle in radians.\n * @param {number} y - The y value.\n * @return {Vector3} A reference to this vector.\n */\n setFromCylindricalCoords(e, t, n) {\n return this.x = e * Math.sin(t), this.y = n, this.z = e * Math.cos(t), this;\n }\n /**\n * Sets the vector components to the position elements of the\n * given transformation matrix.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @return {Vector3} A reference to this vector.\n */\n setFromMatrixPosition(e) {\n const t = e.elements;\n return this.x = t[12], this.y = t[13], this.z = t[14], this;\n }\n /**\n * Sets the vector components to the scale elements of the\n * given transformation matrix.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @return {Vector3} A reference to this vector.\n */\n setFromMatrixScale(e) {\n const t = this.setFromMatrixColumn(e, 0).length(), n = this.setFromMatrixColumn(e, 1).length(), s = this.setFromMatrixColumn(e, 2).length();\n return this.x = t, this.y = n, this.z = s, this;\n }\n /**\n * Sets the vector components from the specified matrix column.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @param {number} index - The column index.\n * @return {Vector3} A reference to this vector.\n */\n setFromMatrixColumn(e, t) {\n return this.fromArray(e.elements, t * 4);\n }\n /**\n * Sets the vector components from the specified matrix column.\n *\n * @param {Matrix3} m - The 3x3 matrix.\n * @param {number} index - The column index.\n * @return {Vector3} A reference to this vector.\n */\n setFromMatrix3Column(e, t) {\n return this.fromArray(e.elements, t * 3);\n }\n /**\n * Sets the vector components from the given Euler angles.\n *\n * @param {Euler} e - The Euler angles to set.\n * @return {Vector3} A reference to this vector.\n */\n setFromEuler(e) {\n return this.x = e._x, this.y = e._y, this.z = e._z, this;\n }\n /**\n * Sets the vector components from the RGB components of the\n * given color.\n *\n * @param {Color} c - The color to set.\n * @return {Vector3} A reference to this vector.\n */\n setFromColor(e) {\n return this.x = e.r, this.y = e.g, this.z = e.b, this;\n }\n /**\n * Returns `true` if this vector is equal with the given one.\n *\n * @param {Vector3} v - The vector to test for equality.\n * @return {boolean} Whether this vector is equal with the given one.\n */\n equals(e) {\n return e.x === this.x && e.y === this.y && e.z === this.z;\n }\n /**\n * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`\n * and z value to be `array[ offset + 2 ]`.\n *\n * @param {Array} array - An array holding the vector component values.\n * @param {number} [offset=0] - The offset into the array.\n * @return {Vector3} A reference to this vector.\n */\n fromArray(e, t = 0) {\n return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this;\n }\n /**\n * Writes the components of this vector to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the vector components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The vector components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e;\n }\n /**\n * Sets the components of this vector from the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n * @param {number} index - The index into the attribute.\n * @return {Vector3} A reference to this vector.\n */\n fromBufferAttribute(e, t) {\n return this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this;\n }\n /**\n * Sets each component of this vector to a pseudo-random value between `0` and\n * `1`, excluding `1`.\n *\n * @return {Vector3} A reference to this vector.\n */\n random() {\n return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;\n }\n /**\n * Sets this vector to a uniformly random point on a unit sphere.\n *\n * @return {Vector3} A reference to this vector.\n */\n randomDirection() {\n const e = Math.random() * Math.PI * 2, t = Math.random() * 2 - 1, n = Math.sqrt(1 - t * t);\n return this.x = n * Math.cos(e), this.y = t, this.z = n * Math.sin(e), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y, yield this.z;\n }\n}\nconst Or = /* @__PURE__ */ new w(), ul = /* @__PURE__ */ new gn();\nclass ze {\n /**\n * Constructs a new 3x3 matrix. The arguments are supposed to be\n * in row-major order. If no arguments are provided, the constructor\n * initializes the matrix as an identity matrix.\n *\n * @param {number} [n11] - 1-1 matrix element.\n * @param {number} [n12] - 1-2 matrix element.\n * @param {number} [n13] - 1-3 matrix element.\n * @param {number} [n21] - 2-1 matrix element.\n * @param {number} [n22] - 2-2 matrix element.\n * @param {number} [n23] - 2-3 matrix element.\n * @param {number} [n31] - 3-1 matrix element.\n * @param {number} [n32] - 3-2 matrix element.\n * @param {number} [n33] - 3-3 matrix element.\n */\n constructor(e, t, n, s, r, a, o, l, c) {\n ze.prototype.isMatrix3 = !0, this.elements = [\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n ], e !== void 0 && this.set(e, t, n, s, r, a, o, l, c);\n }\n /**\n * Sets the elements of the matrix.The arguments are supposed to be\n * in row-major order.\n *\n * @param {number} [n11] - 1-1 matrix element.\n * @param {number} [n12] - 1-2 matrix element.\n * @param {number} [n13] - 1-3 matrix element.\n * @param {number} [n21] - 2-1 matrix element.\n * @param {number} [n22] - 2-2 matrix element.\n * @param {number} [n23] - 2-3 matrix element.\n * @param {number} [n31] - 3-1 matrix element.\n * @param {number} [n32] - 3-2 matrix element.\n * @param {number} [n33] - 3-3 matrix element.\n * @return {Matrix3} A reference to this matrix.\n */\n set(e, t, n, s, r, a, o, l, c) {\n const h = this.elements;\n return h[0] = e, h[1] = s, h[2] = o, h[3] = t, h[4] = r, h[5] = l, h[6] = n, h[7] = a, h[8] = c, this;\n }\n /**\n * Sets this matrix to the 3x3 identity matrix.\n *\n * @return {Matrix3} A reference to this matrix.\n */\n identity() {\n return this.set(\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Copies the values of the given matrix to this instance.\n *\n * @param {Matrix3} m - The matrix to copy.\n * @return {Matrix3} A reference to this matrix.\n */\n copy(e) {\n const t = this.elements, n = e.elements;\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t[4] = n[4], t[5] = n[5], t[6] = n[6], t[7] = n[7], t[8] = n[8], this;\n }\n /**\n * Extracts the basis of this matrix into the three axis vectors provided.\n *\n * @param {Vector3} xAxis - The basis's x axis.\n * @param {Vector3} yAxis - The basis's y axis.\n * @param {Vector3} zAxis - The basis's z axis.\n * @return {Matrix3} A reference to this matrix.\n */\n extractBasis(e, t, n) {\n return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), n.setFromMatrix3Column(this, 2), this;\n }\n /**\n * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @return {Matrix3} A reference to this matrix.\n */\n setFromMatrix4(e) {\n const t = e.elements;\n return this.set(\n t[0],\n t[4],\n t[8],\n t[1],\n t[5],\n t[9],\n t[2],\n t[6],\n t[10]\n ), this;\n }\n /**\n * Post-multiplies this matrix by the given 3x3 matrix.\n *\n * @param {Matrix3} m - The matrix to multiply with.\n * @return {Matrix3} A reference to this matrix.\n */\n multiply(e) {\n return this.multiplyMatrices(this, e);\n }\n /**\n * Pre-multiplies this matrix by the given 3x3 matrix.\n *\n * @param {Matrix3} m - The matrix to multiply with.\n * @return {Matrix3} A reference to this matrix.\n */\n premultiply(e) {\n return this.multiplyMatrices(e, this);\n }\n /**\n * Multiples the given 3x3 matrices and stores the result\n * in this matrix.\n *\n * @param {Matrix3} a - The first matrix.\n * @param {Matrix3} b - The second matrix.\n * @return {Matrix3} A reference to this matrix.\n */\n multiplyMatrices(e, t) {\n const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[3], l = n[6], c = n[1], h = n[4], u = n[7], d = n[2], p = n[5], g = n[8], x = s[0], m = s[3], f = s[6], y = s[1], v = s[4], T = s[7], R = s[2], E = s[5], P = s[8];\n return r[0] = a * x + o * y + l * R, r[3] = a * m + o * v + l * E, r[6] = a * f + o * T + l * P, r[1] = c * x + h * y + u * R, r[4] = c * m + h * v + u * E, r[7] = c * f + h * T + u * P, r[2] = d * x + p * y + g * R, r[5] = d * m + p * v + g * E, r[8] = d * f + p * T + g * P, this;\n }\n /**\n * Multiplies every component of the matrix by the given scalar.\n *\n * @param {number} s - The scalar.\n * @return {Matrix3} A reference to this matrix.\n */\n multiplyScalar(e) {\n const t = this.elements;\n return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this;\n }\n /**\n * Computes and returns the determinant of this matrix.\n *\n * @return {number} The determinant.\n */\n determinant() {\n const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8];\n return t * a * h - t * o * c - n * r * h + n * o * l + s * r * c - s * a * l;\n }\n /**\n * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).\n * You can not invert with a determinant of zero. If you attempt this, the method produces\n * a zero matrix instead.\n *\n * @return {Matrix3} A reference to this matrix.\n */\n invert() {\n const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = h * a - o * c, d = o * l - h * r, p = c * r - a * l, g = t * u + n * d + s * p;\n if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n const x = 1 / g;\n return e[0] = u * x, e[1] = (s * c - h * n) * x, e[2] = (o * n - s * a) * x, e[3] = d * x, e[4] = (h * t - s * l) * x, e[5] = (s * r - o * t) * x, e[6] = p * x, e[7] = (n * l - c * t) * x, e[8] = (a * t - n * r) * x, this;\n }\n /**\n * Transposes this matrix in place.\n *\n * @return {Matrix3} A reference to this matrix.\n */\n transpose() {\n let e;\n const t = this.elements;\n return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this;\n }\n /**\n * Computes the normal matrix which is the inverse transpose of the upper\n * left 3x3 portion of the given 4x4 matrix.\n *\n * @param {Matrix4} matrix4 - The 4x4 matrix.\n * @return {Matrix3} A reference to this matrix.\n */\n getNormalMatrix(e) {\n return this.setFromMatrix4(e).invert().transpose();\n }\n /**\n * Transposes this matrix into the supplied array, and returns itself unchanged.\n *\n * @param {Array} r - An array to store the transposed matrix elements.\n * @return {Matrix3} A reference to this matrix.\n */\n transposeIntoArray(e) {\n const t = this.elements;\n return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this;\n }\n /**\n * Sets the UV transform matrix from offset, repeat, rotation, and center.\n *\n * @param {number} tx - Offset x.\n * @param {number} ty - Offset y.\n * @param {number} sx - Repeat x.\n * @param {number} sy - Repeat y.\n * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise.\n * @param {number} cx - Center x of rotation.\n * @param {number} cy - Center y of rotation\n * @return {Matrix3} A reference to this matrix.\n */\n setUvTransform(e, t, n, s, r, a, o) {\n const l = Math.cos(r), c = Math.sin(r);\n return this.set(\n n * l,\n n * c,\n -n * (l * a + c * o) + a + e,\n -s * c,\n s * l,\n -s * (-c * a + l * o) + o + t,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Scales this matrix with the given scalar values.\n *\n * @param {number} sx - The amount to scale in the X axis.\n * @param {number} sy - The amount to scale in the Y axis.\n * @return {Matrix3} A reference to this matrix.\n */\n scale(e, t) {\n return this.premultiply(Br.makeScale(e, t)), this;\n }\n /**\n * Rotates this matrix by the given angle.\n *\n * @param {number} theta - The rotation in radians.\n * @return {Matrix3} A reference to this matrix.\n */\n rotate(e) {\n return this.premultiply(Br.makeRotation(-e)), this;\n }\n /**\n * Translates this matrix by the given scalar values.\n *\n * @param {number} tx - The amount to translate in the X axis.\n * @param {number} ty - The amount to translate in the Y axis.\n * @return {Matrix3} A reference to this matrix.\n */\n translate(e, t) {\n return this.premultiply(Br.makeTranslation(e, t)), this;\n }\n // for 2D Transforms\n /**\n * Sets this matrix as a 2D translation transform.\n *\n * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector.\n * @param {number} y - The amount to translate in the Y axis.\n * @return {Matrix3} A reference to this matrix.\n */\n makeTranslation(e, t) {\n return e.isVector2 ? this.set(\n 1,\n 0,\n e.x,\n 0,\n 1,\n e.y,\n 0,\n 0,\n 1\n ) : this.set(\n 1,\n 0,\n e,\n 0,\n 1,\n t,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a 2D rotational transformation.\n *\n * @param {number} theta - The rotation in radians.\n * @return {Matrix3} A reference to this matrix.\n */\n makeRotation(e) {\n const t = Math.cos(e), n = Math.sin(e);\n return this.set(\n t,\n -n,\n 0,\n n,\n t,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a 2D scale transform.\n *\n * @param {number} x - The amount to scale in the X axis.\n * @param {number} y - The amount to scale in the Y axis.\n * @return {Matrix3} A reference to this matrix.\n */\n makeScale(e, t) {\n return this.set(\n e,\n 0,\n 0,\n 0,\n t,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Returns `true` if this matrix is equal with the given one.\n *\n * @param {Matrix3} matrix - The matrix to test for equality.\n * @return {boolean} Whether this matrix is equal with the given one.\n */\n equals(e) {\n const t = this.elements, n = e.elements;\n for (let s = 0; s < 9; s++)\n if (t[s] !== n[s]) return !1;\n return !0;\n }\n /**\n * Sets the elements of the matrix from the given array.\n *\n * @param {Array} array - The matrix elements in column-major order.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Matrix3} A reference to this matrix.\n */\n fromArray(e, t = 0) {\n for (let n = 0; n < 9; n++)\n this.elements[n] = e[n + t];\n return this;\n }\n /**\n * Writes the elements of this matrix to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The matrix elements in column-major order.\n */\n toArray(e = [], t = 0) {\n const n = this.elements;\n return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e;\n }\n /**\n * Returns a matrix with copied values from this instance.\n *\n * @return {Matrix3} A clone of this instance.\n */\n clone() {\n return new this.constructor().fromArray(this.elements);\n }\n}\nconst Br = /* @__PURE__ */ new ze(), dl = /* @__PURE__ */ new ze().set(\n 0.4123908,\n 0.3575843,\n 0.1804808,\n 0.212639,\n 0.7151687,\n 0.0721923,\n 0.0193308,\n 0.1191948,\n 0.9505322\n), fl = /* @__PURE__ */ new ze().set(\n 3.2409699,\n -1.5373832,\n -0.4986108,\n -0.9692436,\n 1.8759675,\n 0.0415551,\n 0.0556301,\n -0.203977,\n 1.0569715\n);\nfunction Pu() {\n const i = {\n enabled: !0,\n workingColorSpace: Ut,\n /**\n * Implementations of supported color spaces.\n *\n * Required:\n *\t- primaries: chromaticity coordinates [ rx ry gx gy bx by ]\n *\t- whitePoint: reference white [ x y ]\n *\t- transfer: transfer function (pre-defined)\n *\t- toXYZ: Matrix3 RGB to XYZ transform\n *\t- fromXYZ: Matrix3 XYZ to RGB transform\n *\t- luminanceCoefficients: RGB luminance coefficients\n *\n * Optional:\n * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }\n * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }\n *\n * Reference:\n * - https://www.russellcottrell.com/photo/matrixCalculator.htm\n */\n spaces: {},\n convert: function(s, r, a) {\n return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === et && (s.r = Vn(s.r), s.g = Vn(s.g), s.b = Vn(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === et && (s.r = Oi(s.r), s.g = Oi(s.g), s.b = Oi(s.b))), s;\n },\n workingToColorSpace: function(s, r) {\n return this.convert(s, this.workingColorSpace, r);\n },\n colorSpaceToWorking: function(s, r) {\n return this.convert(s, r, this.workingColorSpace);\n },\n getPrimaries: function(s) {\n return this.spaces[s].primaries;\n },\n getTransfer: function(s) {\n return s === Kn ? Sr : this.spaces[s].transfer;\n },\n getToneMappingMode: function(s) {\n return this.spaces[s].outputColorSpaceConfig.toneMappingMode || \"standard\";\n },\n getLuminanceCoefficients: function(s, r = this.workingColorSpace) {\n return s.fromArray(this.spaces[r].luminanceCoefficients);\n },\n define: function(s) {\n Object.assign(this.spaces, s);\n },\n // Internal APIs\n _getMatrix: function(s, r, a) {\n return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ);\n },\n _getDrawingBufferColorSpace: function(s) {\n return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace;\n },\n _getUnpackColorSpace: function(s = this.workingColorSpace) {\n return this.spaces[s].workingColorSpaceConfig.unpackColorSpace;\n },\n // Deprecated\n fromWorkingColorSpace: function(s, r) {\n return ws(\"ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().\"), i.workingToColorSpace(s, r);\n },\n toWorkingColorSpace: function(s, r) {\n return ws(\"ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().\"), i.colorSpaceToWorking(s, r);\n }\n }, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], t = [0.2126, 0.7152, 0.0722], n = [0.3127, 0.329];\n return i.define({\n [Ut]: {\n primaries: e,\n whitePoint: n,\n transfer: Sr,\n toXYZ: dl,\n fromXYZ: fl,\n luminanceCoefficients: t,\n workingColorSpaceConfig: { unpackColorSpace: Rt },\n outputColorSpaceConfig: { drawingBufferColorSpace: Rt }\n },\n [Rt]: {\n primaries: e,\n whitePoint: n,\n transfer: et,\n toXYZ: dl,\n fromXYZ: fl,\n luminanceCoefficients: t,\n outputColorSpaceConfig: { drawingBufferColorSpace: Rt }\n }\n }), i;\n}\nconst Ye = /* @__PURE__ */ Pu();\nfunction Vn(i) {\n return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction Oi(i) {\n return i < 31308e-7 ? i * 12.92 : 1.055 * Math.pow(i, 0.41666) - 0.055;\n}\nlet _i;\nclass Du {\n /**\n * Returns a data URI containing a representation of the given image.\n *\n * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.\n * @param {string} [type='image/png'] - Indicates the image format.\n * @return {string} The data URI.\n */\n static getDataURL(e, t = \"image/png\") {\n if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > \"u\")\n return e.src;\n let n;\n if (e instanceof HTMLCanvasElement)\n n = e;\n else {\n _i === void 0 && (_i = Es(\"canvas\")), _i.width = e.width, _i.height = e.height;\n const s = _i.getContext(\"2d\");\n e instanceof ImageData ? s.putImageData(e, 0, 0) : s.drawImage(e, 0, 0, e.width, e.height), n = _i;\n }\n return n.toDataURL(t);\n }\n /**\n * Converts the given sRGB image data to linear color space.\n *\n * @param {(HTMLImageElement|HTMLCanvasElement|ImageBitmap|Object)} image - The image object.\n * @return {HTMLCanvasElement|Object} The converted image.\n */\n static sRGBToLinear(e) {\n if (typeof HTMLImageElement < \"u\" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < \"u\" && e instanceof HTMLCanvasElement || typeof ImageBitmap < \"u\" && e instanceof ImageBitmap) {\n const t = Es(\"canvas\");\n t.width = e.width, t.height = e.height;\n const n = t.getContext(\"2d\");\n n.drawImage(e, 0, 0, e.width, e.height);\n const s = n.getImageData(0, 0, e.width, e.height), r = s.data;\n for (let a = 0; a < r.length; a++)\n r[a] = Vn(r[a] / 255) * 255;\n return n.putImageData(s, 0, 0), t;\n } else if (e.data) {\n const t = e.data.slice(0);\n for (let n = 0; n < t.length; n++)\n t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(Vn(t[n] / 255) * 255) : t[n] = Vn(t[n]);\n return {\n data: t,\n width: e.width,\n height: e.height\n };\n } else\n return Te(\"ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.\"), e;\n }\n}\nlet Lu = 0;\nclass Io {\n /**\n * Constructs a new video texture.\n *\n * @param {any} [data=null] - The data definition of a texture.\n */\n constructor(e = null) {\n this.isSource = !0, Object.defineProperty(this, \"id\", { value: Lu++ }), this.uuid = fn(), this.data = e, this.dataReady = !0, this.version = 0;\n }\n /**\n * Returns the dimensions of the source into the given target vector.\n *\n * @param {(Vector2|Vector3)} target - The target object the result is written into.\n * @return {(Vector2|Vector3)} The dimensions of the source.\n */\n getSize(e) {\n const t = this.data;\n return typeof HTMLVideoElement < \"u\" && t instanceof HTMLVideoElement ? e.set(t.videoWidth, t.videoHeight, 0) : t instanceof VideoFrame ? e.set(t.displayHeight, t.displayWidth, 0) : t !== null ? e.set(t.width, t.height, t.depth || 0) : e.set(0, 0, 0), e;\n }\n /**\n * When the property is set to `true`, the engine allocates the memory\n * for the texture (if necessary) and triggers the actual texture upload\n * to the GPU next time the source is used.\n *\n * @type {boolean}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n e === !0 && this.version++;\n }\n /**\n * Serializes the source into JSON.\n *\n * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized source.\n * @see {@link ObjectLoader#parse}\n */\n toJSON(e) {\n const t = e === void 0 || typeof e == \"string\";\n if (!t && e.images[this.uuid] !== void 0)\n return e.images[this.uuid];\n const n = {\n uuid: this.uuid,\n url: \"\"\n }, s = this.data;\n if (s !== null) {\n let r;\n if (Array.isArray(s)) {\n r = [];\n for (let a = 0, o = s.length; a < o; a++)\n s[a].isDataTexture ? r.push(zr(s[a].image)) : r.push(zr(s[a]));\n } else\n r = zr(s);\n n.url = r;\n }\n return t || (e.images[this.uuid] = n), n;\n }\n}\nfunction zr(i) {\n return typeof HTMLImageElement < \"u\" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < \"u\" && i instanceof HTMLCanvasElement || typeof ImageBitmap < \"u\" && i instanceof ImageBitmap ? Du.getDataURL(i) : i.data ? {\n data: Array.from(i.data),\n width: i.width,\n height: i.height,\n type: i.data.constructor.name\n } : (Te(\"Texture: Unable to serialize Texture.\"), {});\n}\nlet Iu = 0;\nconst kr = /* @__PURE__ */ new w();\nclass Ct extends mi {\n /**\n * Constructs a new texture.\n *\n * @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data.\n * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n * @param {number} [magFilter=LinearFilter] - The mag filter value.\n * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n * @param {number} [format=RGBAFormat] - The texture format.\n * @param {number} [type=UnsignedByteType] - The texture type.\n * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n * @param {string} [colorSpace=NoColorSpace] - The color space.\n */\n constructor(e = Ct.DEFAULT_IMAGE, t = Ct.DEFAULT_MAPPING, n = en, s = en, r = bt, a = yn, o = Zt, l = mn, c = Ct.DEFAULT_ANISOTROPY, h = Kn) {\n super(), this.isTexture = !0, Object.defineProperty(this, \"id\", { value: Iu++ }), this.uuid = fn(), this.name = \"\", this.source = new Io(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = c, this.format = o, this.internalFormat = null, this.type = l, this.offset = new le(0, 0), this.repeat = new le(1, 1), this.center = new le(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ze(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;\n }\n /**\n * The width of the texture in pixels.\n */\n get width() {\n return this.source.getSize(kr).x;\n }\n /**\n * The height of the texture in pixels.\n */\n get height() {\n return this.source.getSize(kr).y;\n }\n /**\n * The depth of the texture in pixels.\n */\n get depth() {\n return this.source.getSize(kr).z;\n }\n /**\n * The image object holding the texture data.\n *\n * @type {?Object}\n */\n get image() {\n return this.source.data;\n }\n set image(e = null) {\n this.source.data = e;\n }\n /**\n * Updates the texture transformation matrix from the from the properties {@link Texture#offset},\n * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}.\n */\n updateMatrix() {\n this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);\n }\n /**\n * Adds a range of data in the data texture to be updated on the GPU.\n *\n * @param {number} start - Position at which to start update.\n * @param {number} count - The number of components to update.\n */\n addUpdateRange(e, t) {\n this.updateRanges.push({ start: e, count: t });\n }\n /**\n * Clears the update ranges.\n */\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n /**\n * Returns a new texture with copied values from this instance.\n *\n * @return {Texture} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the values of the given texture to this instance.\n *\n * @param {Texture} source - The texture to copy.\n * @return {Texture} A reference to this instance.\n */\n copy(e) {\n return this.name = e.name, this.source = e.source, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.channel = e.channel, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.internalFormat = e.internalFormat, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), this.rotation = e.rotation, this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrix.copy(e.matrix), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.colorSpace = e.colorSpace, this.renderTarget = e.renderTarget, this.isRenderTargetTexture = e.isRenderTargetTexture, this.isArrayTexture = e.isArrayTexture, this.userData = JSON.parse(JSON.stringify(e.userData)), this.needsUpdate = !0, this;\n }\n /**\n * Sets this texture's properties based on `values`.\n * @param {Object} values - A container with texture parameters.\n */\n setValues(e) {\n for (const t in e) {\n const n = e[t];\n if (n === void 0) {\n Te(`Texture.setValues(): parameter '${t}' has value of undefined.`);\n continue;\n }\n const s = this[t];\n if (s === void 0) {\n Te(`Texture.setValues(): property '${t}' does not exist.`);\n continue;\n }\n s && n && s.isVector2 && n.isVector2 || s && n && s.isVector3 && n.isVector3 || s && n && s.isMatrix3 && n.isMatrix3 ? s.copy(n) : this[t] = n;\n }\n }\n /**\n * Serializes the texture into JSON.\n *\n * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized texture.\n * @see {@link ObjectLoader#parse}\n */\n toJSON(e) {\n const t = e === void 0 || typeof e == \"string\";\n if (!t && e.textures[this.uuid] !== void 0)\n return e.textures[this.uuid];\n const n = {\n metadata: {\n version: 4.7,\n type: \"Texture\",\n generator: \"Texture.toJSON\"\n },\n uuid: this.uuid,\n name: this.name,\n image: this.source.toJSON(e).uuid,\n mapping: this.mapping,\n channel: this.channel,\n repeat: [this.repeat.x, this.repeat.y],\n offset: [this.offset.x, this.offset.y],\n center: [this.center.x, this.center.y],\n rotation: this.rotation,\n wrap: [this.wrapS, this.wrapT],\n format: this.format,\n internalFormat: this.internalFormat,\n type: this.type,\n colorSpace: this.colorSpace,\n minFilter: this.minFilter,\n magFilter: this.magFilter,\n anisotropy: this.anisotropy,\n flipY: this.flipY,\n generateMipmaps: this.generateMipmaps,\n premultiplyAlpha: this.premultiplyAlpha,\n unpackAlignment: this.unpackAlignment\n };\n return Object.keys(this.userData).length > 0 && (n.userData = this.userData), t || (e.textures[this.uuid] = n), n;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n *\n * @fires Texture#dispose\n */\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n /**\n * Transforms the given uv vector with the textures uv transformation matrix.\n *\n * @param {Vector2} uv - The uv vector.\n * @return {Vector2} The transformed uv vector.\n */\n transformUv(e) {\n if (this.mapping !== kc) return e;\n if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)\n switch (this.wrapS) {\n case wn:\n e.x = e.x - Math.floor(e.x);\n break;\n case en:\n e.x = e.x < 0 ? 0 : 1;\n break;\n case Mr:\n Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x);\n break;\n }\n if (e.y < 0 || e.y > 1)\n switch (this.wrapT) {\n case wn:\n e.y = e.y - Math.floor(e.y);\n break;\n case en:\n e.y = e.y < 0 ? 0 : 1;\n break;\n case Mr:\n Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y);\n break;\n }\n return this.flipY && (e.y = 1 - e.y), e;\n }\n /**\n * Setting this property to `true` indicates the engine the texture\n * must be updated in the next render. This triggers a texture upload\n * to the GPU and ensures correct texture parameter configuration.\n *\n * @type {boolean}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n e === !0 && (this.version++, this.source.needsUpdate = !0);\n }\n /**\n * Setting this property to `true` indicates the engine the PMREM\n * must be regenerated.\n *\n * @type {boolean}\n * @default false\n * @param {boolean} value\n */\n set needsPMREMUpdate(e) {\n e === !0 && this.pmremVersion++;\n }\n}\nCt.DEFAULT_IMAGE = null;\nCt.DEFAULT_MAPPING = kc;\nCt.DEFAULT_ANISOTROPY = 1;\nclass Je {\n /**\n * Constructs a new 4D vector.\n *\n * @param {number} [x=0] - The x value of this vector.\n * @param {number} [y=0] - The y value of this vector.\n * @param {number} [z=0] - The z value of this vector.\n * @param {number} [w=1] - The w value of this vector.\n */\n constructor(e = 0, t = 0, n = 0, s = 1) {\n Je.prototype.isVector4 = !0, this.x = e, this.y = t, this.z = n, this.w = s;\n }\n /**\n * Alias for {@link Vector4#z}.\n *\n * @type {number}\n */\n get width() {\n return this.z;\n }\n set width(e) {\n this.z = e;\n }\n /**\n * Alias for {@link Vector4#w}.\n *\n * @type {number}\n */\n get height() {\n return this.w;\n }\n set height(e) {\n this.w = e;\n }\n /**\n * Sets the vector components.\n *\n * @param {number} x - The value of the x component.\n * @param {number} y - The value of the y component.\n * @param {number} z - The value of the z component.\n * @param {number} w - The value of the w component.\n * @return {Vector4} A reference to this vector.\n */\n set(e, t, n, s) {\n return this.x = e, this.y = t, this.z = n, this.w = s, this;\n }\n /**\n * Sets the vector components to the same value.\n *\n * @param {number} scalar - The value to set for all vector components.\n * @return {Vector4} A reference to this vector.\n */\n setScalar(e) {\n return this.x = e, this.y = e, this.z = e, this.w = e, this;\n }\n /**\n * Sets the vector's x component to the given value\n *\n * @param {number} x - The value to set.\n * @return {Vector4} A reference to this vector.\n */\n setX(e) {\n return this.x = e, this;\n }\n /**\n * Sets the vector's y component to the given value\n *\n * @param {number} y - The value to set.\n * @return {Vector4} A reference to this vector.\n */\n setY(e) {\n return this.y = e, this;\n }\n /**\n * Sets the vector's z component to the given value\n *\n * @param {number} z - The value to set.\n * @return {Vector4} A reference to this vector.\n */\n setZ(e) {\n return this.z = e, this;\n }\n /**\n * Sets the vector's w component to the given value\n *\n * @param {number} w - The value to set.\n * @return {Vector4} A reference to this vector.\n */\n setW(e) {\n return this.w = e, this;\n }\n /**\n * Allows to set a vector component with an index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n * `2` equals to z, `3` equals to w.\n * @param {number} value - The value to set.\n * @return {Vector4} A reference to this vector.\n */\n setComponent(e, t) {\n switch (e) {\n case 0:\n this.x = t;\n break;\n case 1:\n this.y = t;\n break;\n case 2:\n this.z = t;\n break;\n case 3:\n this.w = t;\n break;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n return this;\n }\n /**\n * Returns the value of the vector component which matches the given index.\n *\n * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n * `2` equals to z, `3` equals to w.\n * @return {number} A vector component value.\n */\n getComponent(e) {\n switch (e) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n case 2:\n return this.z;\n case 3:\n return this.w;\n default:\n throw new Error(\"index is out of range: \" + e);\n }\n }\n /**\n * Returns a new vector with copied values from this instance.\n *\n * @return {Vector4} A clone of this instance.\n */\n clone() {\n return new this.constructor(this.x, this.y, this.z, this.w);\n }\n /**\n * Copies the values of the given vector to this instance.\n *\n * @param {Vector3|Vector4} v - The vector to copy.\n * @return {Vector4} A reference to this vector.\n */\n copy(e) {\n return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w !== void 0 ? e.w : 1, this;\n }\n /**\n * Adds the given vector to this instance.\n *\n * @param {Vector4} v - The vector to add.\n * @return {Vector4} A reference to this vector.\n */\n add(e) {\n return this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this;\n }\n /**\n * Adds the given scalar value to all components of this instance.\n *\n * @param {number} s - The scalar to add.\n * @return {Vector4} A reference to this vector.\n */\n addScalar(e) {\n return this.x += e, this.y += e, this.z += e, this.w += e, this;\n }\n /**\n * Adds the given vectors and stores the result in this instance.\n *\n * @param {Vector4} a - The first vector.\n * @param {Vector4} b - The second vector.\n * @return {Vector4} A reference to this vector.\n */\n addVectors(e, t) {\n return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this;\n }\n /**\n * Adds the given vector scaled by the given factor to this instance.\n *\n * @param {Vector4} v - The vector.\n * @param {number} s - The factor that scales `v`.\n * @return {Vector4} A reference to this vector.\n */\n addScaledVector(e, t) {\n return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this;\n }\n /**\n * Subtracts the given vector from this instance.\n *\n * @param {Vector4} v - The vector to subtract.\n * @return {Vector4} A reference to this vector.\n */\n sub(e) {\n return this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this;\n }\n /**\n * Subtracts the given scalar value from all components of this instance.\n *\n * @param {number} s - The scalar to subtract.\n * @return {Vector4} A reference to this vector.\n */\n subScalar(e) {\n return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this;\n }\n /**\n * Subtracts the given vectors and stores the result in this instance.\n *\n * @param {Vector4} a - The first vector.\n * @param {Vector4} b - The second vector.\n * @return {Vector4} A reference to this vector.\n */\n subVectors(e, t) {\n return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this;\n }\n /**\n * Multiplies the given vector with this instance.\n *\n * @param {Vector4} v - The vector to multiply.\n * @return {Vector4} A reference to this vector.\n */\n multiply(e) {\n return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this;\n }\n /**\n * Multiplies the given scalar value with all components of this instance.\n *\n * @param {number} scalar - The scalar to multiply.\n * @return {Vector4} A reference to this vector.\n */\n multiplyScalar(e) {\n return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this;\n }\n /**\n * Multiplies this vector with the given 4x4 matrix.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @return {Vector4} A reference to this vector.\n */\n applyMatrix4(e) {\n const t = this.x, n = this.y, s = this.z, r = this.w, a = e.elements;\n return this.x = a[0] * t + a[4] * n + a[8] * s + a[12] * r, this.y = a[1] * t + a[5] * n + a[9] * s + a[13] * r, this.z = a[2] * t + a[6] * n + a[10] * s + a[14] * r, this.w = a[3] * t + a[7] * n + a[11] * s + a[15] * r, this;\n }\n /**\n * Divides this instance by the given vector.\n *\n * @param {Vector4} v - The vector to divide.\n * @return {Vector4} A reference to this vector.\n */\n divide(e) {\n return this.x /= e.x, this.y /= e.y, this.z /= e.z, this.w /= e.w, this;\n }\n /**\n * Divides this vector by the given scalar.\n *\n * @param {number} scalar - The scalar to divide.\n * @return {Vector4} A reference to this vector.\n */\n divideScalar(e) {\n return this.multiplyScalar(1 / e);\n }\n /**\n * Sets the x, y and z components of this\n * vector to the quaternion's axis and w to the angle.\n *\n * @param {Quaternion} q - The Quaternion to set.\n * @return {Vector4} A reference to this vector.\n */\n setAxisAngleFromQuaternion(e) {\n this.w = 2 * Math.acos(e.w);\n const t = Math.sqrt(1 - e.w * e.w);\n return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this;\n }\n /**\n * Sets the x, y and z components of this\n * vector to the axis of rotation and w to the angle.\n *\n * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix.\n * @return {Vector4} A reference to this vector.\n */\n setAxisAngleFromRotationMatrix(e) {\n let t, n, s, r;\n const l = e.elements, c = l[0], h = l[4], u = l[8], d = l[1], p = l[5], g = l[9], x = l[2], m = l[6], f = l[10];\n if (Math.abs(h - d) < 0.01 && Math.abs(u - x) < 0.01 && Math.abs(g - m) < 0.01) {\n if (Math.abs(h + d) < 0.1 && Math.abs(u + x) < 0.1 && Math.abs(g + m) < 0.1 && Math.abs(c + p + f - 3) < 0.1)\n return this.set(1, 0, 0, 0), this;\n t = Math.PI;\n const v = (c + 1) / 2, T = (p + 1) / 2, R = (f + 1) / 2, E = (h + d) / 4, P = (u + x) / 4, I = (g + m) / 4;\n return v > T && v > R ? v < 0.01 ? (n = 0, s = 0.707106781, r = 0.707106781) : (n = Math.sqrt(v), s = E / n, r = P / n) : T > R ? T < 0.01 ? (n = 0.707106781, s = 0, r = 0.707106781) : (s = Math.sqrt(T), n = E / s, r = I / s) : R < 0.01 ? (n = 0.707106781, s = 0.707106781, r = 0) : (r = Math.sqrt(R), n = P / r, s = I / r), this.set(n, s, r, t), this;\n }\n let y = Math.sqrt((m - g) * (m - g) + (u - x) * (u - x) + (d - h) * (d - h));\n return Math.abs(y) < 1e-3 && (y = 1), this.x = (m - g) / y, this.y = (u - x) / y, this.z = (d - h) / y, this.w = Math.acos((c + p + f - 1) / 2), this;\n }\n /**\n * Sets the vector components to the position elements of the\n * given transformation matrix.\n *\n * @param {Matrix4} m - The 4x4 matrix.\n * @return {Vector4} A reference to this vector.\n */\n setFromMatrixPosition(e) {\n const t = e.elements;\n return this.x = t[12], this.y = t[13], this.z = t[14], this.w = t[15], this;\n }\n /**\n * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w\n * value, replace that value with the corresponding min value.\n *\n * @param {Vector4} v - The vector.\n * @return {Vector4} A reference to this vector.\n */\n min(e) {\n return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this;\n }\n /**\n * If this vector's x, y, z or w value is less than the given vector's x, y, z or w\n * value, replace that value with the corresponding max value.\n *\n * @param {Vector4} v - The vector.\n * @return {Vector4} A reference to this vector.\n */\n max(e) {\n return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this;\n }\n /**\n * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w\n * value, it is replaced by the corresponding value.\n * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value,\n * it is replaced by the corresponding value.\n *\n * @param {Vector4} min - The minimum x, y and z values.\n * @param {Vector4} max - The maximum x, y and z values in the desired range.\n * @return {Vector4} A reference to this vector.\n */\n clamp(e, t) {\n return this.x = He(this.x, e.x, t.x), this.y = He(this.y, e.y, t.y), this.z = He(this.z, e.z, t.z), this.w = He(this.w, e.w, t.w), this;\n }\n /**\n * If this vector's x, y, z or w values are greater than the max value, they are\n * replaced by the max value.\n * If this vector's x, y, z or w values are less than the min value, they are\n * replaced by the min value.\n *\n * @param {number} minVal - The minimum value the components will be clamped to.\n * @param {number} maxVal - The maximum value the components will be clamped to.\n * @return {Vector4} A reference to this vector.\n */\n clampScalar(e, t) {\n return this.x = He(this.x, e, t), this.y = He(this.y, e, t), this.z = He(this.z, e, t), this.w = He(this.w, e, t), this;\n }\n /**\n * If this vector's length is greater than the max value, it is replaced by\n * the max value.\n * If this vector's length is less than the min value, it is replaced by the\n * min value.\n *\n * @param {number} min - The minimum value the vector length will be clamped to.\n * @param {number} max - The maximum value the vector length will be clamped to.\n * @return {Vector4} A reference to this vector.\n */\n clampLength(e, t) {\n const n = this.length();\n return this.divideScalar(n || 1).multiplyScalar(He(n, e, t));\n }\n /**\n * The components of this vector are rounded down to the nearest integer value.\n *\n * @return {Vector4} A reference to this vector.\n */\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;\n }\n /**\n * The components of this vector are rounded up to the nearest integer value.\n *\n * @return {Vector4} A reference to this vector.\n */\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;\n }\n /**\n * The components of this vector are rounded to the nearest integer value\n *\n * @return {Vector4} A reference to this vector.\n */\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;\n }\n /**\n * The components of this vector are rounded towards zero (up if negative,\n * down if positive) to an integer value.\n *\n * @return {Vector4} A reference to this vector.\n */\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;\n }\n /**\n * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w.\n *\n * @return {Vector4} A reference to this vector.\n */\n negate() {\n return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;\n }\n /**\n * Calculates the dot product of the given vector with this instance.\n *\n * @param {Vector4} v - The vector to compute the dot product with.\n * @return {number} The result of the dot product.\n */\n dot(e) {\n return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;\n }\n /**\n * Computes the square of the Euclidean length (straight-line length) from\n * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should\n * compare the length squared instead as it is slightly more efficient to calculate.\n *\n * @return {number} The square length of this vector.\n */\n lengthSq() {\n return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n }\n /**\n * Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).\n *\n * @return {number} The length of this vector.\n */\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n }\n /**\n * Computes the Manhattan length of this vector.\n *\n * @return {number} The length of this vector.\n */\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n }\n /**\n * Converts this vector to a unit vector - that is, sets it equal to a vector\n * with the same direction as this one, but with a vector length of `1`.\n *\n * @return {Vector4} A reference to this vector.\n */\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n /**\n * Sets this vector to a vector with the same direction as this one, but\n * with the specified length.\n *\n * @param {number} length - The new length of this vector.\n * @return {Vector4} A reference to this vector.\n */\n setLength(e) {\n return this.normalize().multiplyScalar(e);\n }\n /**\n * Linearly interpolates between the given vector and this instance, where\n * alpha is the percent distance along the line - alpha = 0 will be this\n * vector, and alpha = 1 will be the given one.\n *\n * @param {Vector4} v - The vector to interpolate towards.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector4} A reference to this vector.\n */\n lerp(e, t) {\n return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this;\n }\n /**\n * Linearly interpolates between the given vectors, where alpha is the percent\n * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n * be the second one. The result is stored in this instance.\n *\n * @param {Vector4} v1 - The first vector.\n * @param {Vector4} v2 - The second vector.\n * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n * @return {Vector4} A reference to this vector.\n */\n lerpVectors(e, t, n) {\n return this.x = e.x + (t.x - e.x) * n, this.y = e.y + (t.y - e.y) * n, this.z = e.z + (t.z - e.z) * n, this.w = e.w + (t.w - e.w) * n, this;\n }\n /**\n * Returns `true` if this vector is equal with the given one.\n *\n * @param {Vector4} v - The vector to test for equality.\n * @return {boolean} Whether this vector is equal with the given one.\n */\n equals(e) {\n return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;\n }\n /**\n * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`,\n * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`.\n *\n * @param {Array} array - An array holding the vector component values.\n * @param {number} [offset=0] - The offset into the array.\n * @return {Vector4} A reference to this vector.\n */\n fromArray(e, t = 0) {\n return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this;\n }\n /**\n * Writes the components of this vector to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the vector components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The vector components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e;\n }\n /**\n * Sets the components of this vector from the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n * @param {number} index - The index into the attribute.\n * @return {Vector4} A reference to this vector.\n */\n fromBufferAttribute(e, t) {\n return this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this;\n }\n /**\n * Sets each component of this vector to a pseudo-random value between `0` and\n * `1`, excluding `1`.\n *\n * @return {Vector4} A reference to this vector.\n */\n random() {\n return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y, yield this.z, yield this.w;\n }\n}\nclass Uu extends mi {\n /**\n * Render target options.\n *\n * @typedef {Object} RenderTarget~Options\n * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not.\n * @property {number} [magFilter=LinearFilter] - The mag filter.\n * @property {number} [minFilter=LinearFilter] - The min filter.\n * @property {number} [format=RGBAFormat] - The texture format.\n * @property {number} [type=UnsignedByteType] - The texture type.\n * @property {?string} [internalFormat=null] - The texture's internal format.\n * @property {number} [wrapS=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n * @property {number} [wrapT=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n * @property {number} [anisotropy=1] - The texture's anisotropy value.\n * @property {string} [colorSpace=NoColorSpace] - The texture's color space.\n * @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not.\n * @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not.\n * @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not.\n * @property {boolean} [resolveStencilBuffer=true] - Whether to resolve the stencil buffer or not.\n * @property {?Texture} [depthTexture=null] - Reference to a depth texture.\n * @property {number} [samples=0] - The MSAA samples count.\n * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.\n * @property {number} [depth=1] - The texture depth.\n * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.\n */\n /**\n * Constructs a new render target.\n *\n * @param {number} [width=1] - The width of the render target.\n * @param {number} [height=1] - The height of the render target.\n * @param {RenderTarget~Options} [options] - The configuration object.\n */\n constructor(e = 1, t = 1, n = {}) {\n super(), n = Object.assign({\n generateMipmaps: !1,\n internalFormat: null,\n minFilter: bt,\n depthBuffer: !0,\n stencilBuffer: !1,\n resolveDepthBuffer: !0,\n resolveStencilBuffer: !0,\n depthTexture: null,\n samples: 0,\n count: 1,\n depth: 1,\n multiview: !1\n }, n), this.isRenderTarget = !0, this.width = e, this.height = t, this.depth = n.depth, this.scissor = new Je(0, 0, e, t), this.scissorTest = !1, this.viewport = new Je(0, 0, e, t);\n const s = { width: e, height: t, depth: n.depth }, r = new Ct(s);\n this.textures = [];\n const a = n.count;\n for (let o = 0; o < a; o++)\n this.textures[o] = r.clone(), this.textures[o].isRenderTargetTexture = !0, this.textures[o].renderTarget = this;\n this._setTextureOptions(n), this.depthBuffer = n.depthBuffer, this.stencilBuffer = n.stencilBuffer, this.resolveDepthBuffer = n.resolveDepthBuffer, this.resolveStencilBuffer = n.resolveStencilBuffer, this._depthTexture = null, this.depthTexture = n.depthTexture, this.samples = n.samples, this.multiview = n.multiview;\n }\n _setTextureOptions(e = {}) {\n const t = {\n minFilter: bt,\n generateMipmaps: !1,\n flipY: !1,\n internalFormat: null\n };\n e.mapping !== void 0 && (t.mapping = e.mapping), e.wrapS !== void 0 && (t.wrapS = e.wrapS), e.wrapT !== void 0 && (t.wrapT = e.wrapT), e.wrapR !== void 0 && (t.wrapR = e.wrapR), e.magFilter !== void 0 && (t.magFilter = e.magFilter), e.minFilter !== void 0 && (t.minFilter = e.minFilter), e.format !== void 0 && (t.format = e.format), e.type !== void 0 && (t.type = e.type), e.anisotropy !== void 0 && (t.anisotropy = e.anisotropy), e.colorSpace !== void 0 && (t.colorSpace = e.colorSpace), e.flipY !== void 0 && (t.flipY = e.flipY), e.generateMipmaps !== void 0 && (t.generateMipmaps = e.generateMipmaps), e.internalFormat !== void 0 && (t.internalFormat = e.internalFormat);\n for (let n = 0; n < this.textures.length; n++)\n this.textures[n].setValues(t);\n }\n /**\n * The texture representing the default color attachment.\n *\n * @type {Texture}\n */\n get texture() {\n return this.textures[0];\n }\n set texture(e) {\n this.textures[0] = e;\n }\n set depthTexture(e) {\n this._depthTexture !== null && (this._depthTexture.renderTarget = null), e !== null && (e.renderTarget = this), this._depthTexture = e;\n }\n /**\n * Instead of saving the depth in a renderbuffer, a texture\n * can be used instead which is useful for further processing\n * e.g. in context of post-processing.\n *\n * @type {?DepthTexture}\n * @default null\n */\n get depthTexture() {\n return this._depthTexture;\n }\n /**\n * Sets the size of this render target.\n *\n * @param {number} width - The width.\n * @param {number} height - The height.\n * @param {number} [depth=1] - The depth.\n */\n setSize(e, t, n = 1) {\n if (this.width !== e || this.height !== t || this.depth !== n) {\n this.width = e, this.height = t, this.depth = n;\n for (let s = 0, r = this.textures.length; s < r; s++)\n this.textures[s].image.width = e, this.textures[s].image.height = t, this.textures[s].image.depth = n, this.textures[s].isData3DTexture !== !0 && (this.textures[s].isArrayTexture = this.textures[s].image.depth > 1);\n this.dispose();\n }\n this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t);\n }\n /**\n * Returns a new render target with copied values from this instance.\n *\n * @return {RenderTarget} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the settings of the given render target. This is a structural copy so\n * no resources are shared between render targets after the copy. That includes\n * all MRT textures and the depth texture.\n *\n * @param {RenderTarget} source - The render target to copy.\n * @return {RenderTarget} A reference to this instance.\n */\n copy(e) {\n this.width = e.width, this.height = e.height, this.depth = e.depth, this.scissor.copy(e.scissor), this.scissorTest = e.scissorTest, this.viewport.copy(e.viewport), this.textures.length = 0;\n for (let t = 0, n = e.textures.length; t < n; t++) {\n this.textures[t] = e.textures[t].clone(), this.textures[t].isRenderTargetTexture = !0, this.textures[t].renderTarget = this;\n const s = Object.assign({}, e.textures[t].image);\n this.textures[t].source = new Io(s);\n }\n return this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.resolveDepthBuffer = e.resolveDepthBuffer, this.resolveStencilBuffer = e.resolveStencilBuffer, e.depthTexture !== null && (this.depthTexture = e.depthTexture.clone()), this.samples = e.samples, this;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n *\n * @fires RenderTarget#dispose\n */\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n}\nclass St extends Uu {\n /**\n * Constructs a new 3D render target.\n *\n * @param {number} [width=1] - The width of the render target.\n * @param {number} [height=1] - The height of the render target.\n * @param {RenderTarget~Options} [options] - The configuration object.\n */\n constructor(e = 1, t = 1, n = {}) {\n super(e, t, n), this.isWebGLRenderTarget = !0;\n }\n}\nclass Jc extends Ct {\n /**\n * Constructs a new data array texture.\n *\n * @param {?TypedArray} [data=null] - The buffer data.\n * @param {number} [width=1] - The width of the texture.\n * @param {number} [height=1] - The height of the texture.\n * @param {number} [depth=1] - The depth of the texture.\n */\n constructor(e = null, t = 1, n = 1, s = 1) {\n super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Dt, this.minFilter = Dt, this.wrapR = en, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();\n }\n /**\n * Describes that a specific layer of the texture needs to be updated.\n * Normally when {@link Texture#needsUpdate} is set to `true`, the\n * entire data texture array is sent to the GPU. Marking specific\n * layers will only transmit subsets of all mipmaps associated with a\n * specific depth in the array which is often much more performant.\n *\n * @param {number} layerIndex - The layer index that should be updated.\n */\n addLayerUpdate(e) {\n this.layerUpdates.add(e);\n }\n /**\n * Resets the layer updates registry.\n */\n clearLayerUpdates() {\n this.layerUpdates.clear();\n }\n}\nclass Nu extends Ct {\n /**\n * Constructs a new data array texture.\n *\n * @param {?TypedArray} [data=null] - The buffer data.\n * @param {number} [width=1] - The width of the texture.\n * @param {number} [height=1] - The height of the texture.\n * @param {number} [depth=1] - The depth of the texture.\n */\n constructor(e = null, t = 1, n = 1, s = 1) {\n super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Dt, this.minFilter = Dt, this.wrapR = en, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;\n }\n}\nclass Pt {\n /**\n * Constructs a new bounding box.\n *\n * @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box.\n * @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box.\n */\n constructor(e = new w(1 / 0, 1 / 0, 1 / 0), t = new w(-1 / 0, -1 / 0, -1 / 0)) {\n this.isBox3 = !0, this.min = e, this.max = t;\n }\n /**\n * Sets the lower and upper boundaries of this box.\n * Please note that this method only copies the values from the given objects.\n *\n * @param {Vector3} min - The lower boundary of the box.\n * @param {Vector3} max - The upper boundary of the box.\n * @return {Box3} A reference to this bounding box.\n */\n set(e, t) {\n return this.min.copy(e), this.max.copy(t), this;\n }\n /**\n * Sets the upper and lower bounds of this box so it encloses the position data\n * in the given array.\n *\n * @param {Array} array - An array holding 3D position data.\n * @return {Box3} A reference to this bounding box.\n */\n setFromArray(e) {\n this.makeEmpty();\n for (let t = 0, n = e.length; t < n; t += 3)\n this.expandByPoint(rn.fromArray(e, t));\n return this;\n }\n /**\n * Sets the upper and lower bounds of this box so it encloses the position data\n * in the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - A buffer attribute holding 3D position data.\n * @return {Box3} A reference to this bounding box.\n */\n setFromBufferAttribute(e) {\n this.makeEmpty();\n for (let t = 0, n = e.count; t < n; t++)\n this.expandByPoint(rn.fromBufferAttribute(e, t));\n return this;\n }\n /**\n * Sets the upper and lower bounds of this box so it encloses the position data\n * in the given array.\n *\n * @param {Array} points - An array holding 3D position data as instances of {@link Vector3}.\n * @return {Box3} A reference to this bounding box.\n */\n setFromPoints(e) {\n this.makeEmpty();\n for (let t = 0, n = e.length; t < n; t++)\n this.expandByPoint(e[t]);\n return this;\n }\n /**\n * Centers this box on the given center vector and sets this box's width, height and\n * depth to the given size values.\n *\n * @param {Vector3} center - The center of the box.\n * @param {Vector3} size - The x, y and z dimensions of the box.\n * @return {Box3} A reference to this bounding box.\n */\n setFromCenterAndSize(e, t) {\n const n = rn.copy(t).multiplyScalar(0.5);\n return this.min.copy(e).sub(n), this.max.copy(e).add(n), this;\n }\n /**\n * Computes the world-axis-aligned bounding box for the given 3D object\n * (including its children), accounting for the object's, and children's,\n * world transforms. The function may result in a larger box than strictly necessary.\n *\n * @param {Object3D} object - The 3D object to compute the bounding box for.\n * @param {boolean} [precise=false] - If set to `true`, the method computes the smallest\n * world-axis-aligned bounding box at the expense of more computation.\n * @return {Box3} A reference to this bounding box.\n */\n setFromObject(e, t = !1) {\n return this.makeEmpty(), this.expandByObject(e, t);\n }\n /**\n * Returns a new box with copied values from this instance.\n *\n * @return {Box3} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the values of the given box to this instance.\n *\n * @param {Box3} box - The box to copy.\n * @return {Box3} A reference to this bounding box.\n */\n copy(e) {\n return this.min.copy(e.min), this.max.copy(e.max), this;\n }\n /**\n * Makes this box empty which means in encloses a zero space in 3D.\n *\n * @return {Box3} A reference to this bounding box.\n */\n makeEmpty() {\n return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this;\n }\n /**\n * Returns true if this box includes zero points within its bounds.\n * Note that a box with equal lower and upper bounds still includes one\n * point, the one both bounds share.\n *\n * @return {boolean} Whether this box is empty or not.\n */\n isEmpty() {\n return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n }\n /**\n * Returns the center point of this box.\n *\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The center point.\n */\n getCenter(e) {\n return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5);\n }\n /**\n * Returns the dimensions of this box.\n *\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The size.\n */\n getSize(e) {\n return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min);\n }\n /**\n * Expands the boundaries of this box to include the given point.\n *\n * @param {Vector3} point - The point that should be included by the bounding box.\n * @return {Box3} A reference to this bounding box.\n */\n expandByPoint(e) {\n return this.min.min(e), this.max.max(e), this;\n }\n /**\n * Expands this box equilaterally by the given vector. The width of this\n * box will be expanded by the x component of the vector in both\n * directions. The height of this box will be expanded by the y component of\n * the vector in both directions. The depth of this box will be\n * expanded by the z component of the vector in both directions.\n *\n * @param {Vector3} vector - The vector that should expand the bounding box.\n * @return {Box3} A reference to this bounding box.\n */\n expandByVector(e) {\n return this.min.sub(e), this.max.add(e), this;\n }\n /**\n * Expands each dimension of the box by the given scalar. If negative, the\n * dimensions of the box will be contracted.\n *\n * @param {number} scalar - The scalar value that should expand the bounding box.\n * @return {Box3} A reference to this bounding box.\n */\n expandByScalar(e) {\n return this.min.addScalar(-e), this.max.addScalar(e), this;\n }\n /**\n * Expands the boundaries of this box to include the given 3D object and\n * its children, accounting for the object's, and children's, world\n * transforms. The function may result in a larger box than strictly\n * necessary (unless the precise parameter is set to true).\n *\n * @param {Object3D} object - The 3D object that should expand the bounding box.\n * @param {boolean} precise - If set to `true`, the method expands the bounding box\n * as little as necessary at the expense of more computation.\n * @return {Box3} A reference to this bounding box.\n */\n expandByObject(e, t = !1) {\n e.updateWorldMatrix(!1, !1);\n const n = e.geometry;\n if (n !== void 0) {\n const r = n.getAttribute(\"position\");\n if (t === !0 && r !== void 0 && e.isInstancedMesh !== !0)\n for (let a = 0, o = r.count; a < o; a++)\n e.isMesh === !0 ? e.getVertexPosition(a, rn) : rn.fromBufferAttribute(r, a), rn.applyMatrix4(e.matrixWorld), this.expandByPoint(rn);\n else\n e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), Is.copy(e.boundingBox)) : (n.boundingBox === null && n.computeBoundingBox(), Is.copy(n.boundingBox)), Is.applyMatrix4(e.matrixWorld), this.union(Is);\n }\n const s = e.children;\n for (let r = 0, a = s.length; r < a; r++)\n this.expandByObject(s[r], t);\n return this;\n }\n /**\n * Returns `true` if the given point lies within or on the boundaries of this box.\n *\n * @param {Vector3} point - The point to test.\n * @return {boolean} Whether the bounding box contains the given point or not.\n */\n containsPoint(e) {\n return e.x >= this.min.x && e.x <= this.max.x && e.y >= this.min.y && e.y <= this.max.y && e.z >= this.min.z && e.z <= this.max.z;\n }\n /**\n * Returns `true` if this bounding box includes the entirety of the given bounding box.\n * If this box and the given one are identical, this function also returns `true`.\n *\n * @param {Box3} box - The bounding box to test.\n * @return {boolean} Whether the bounding box contains the given bounding box or not.\n */\n containsBox(e) {\n return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z;\n }\n /**\n * Returns a point as a proportion of this box's width, height and depth.\n *\n * @param {Vector3} point - A point in 3D space.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} A point as a proportion of this box's width, height and depth.\n */\n getParameter(e, t) {\n return t.set(\n (e.x - this.min.x) / (this.max.x - this.min.x),\n (e.y - this.min.y) / (this.max.y - this.min.y),\n (e.z - this.min.z) / (this.max.z - this.min.z)\n );\n }\n /**\n * Returns `true` if the given bounding box intersects with this bounding box.\n *\n * @param {Box3} box - The bounding box to test.\n * @return {boolean} Whether the given bounding box intersects with this bounding box.\n */\n intersectsBox(e) {\n return e.max.x >= this.min.x && e.min.x <= this.max.x && e.max.y >= this.min.y && e.min.y <= this.max.y && e.max.z >= this.min.z && e.min.z <= this.max.z;\n }\n /**\n * Returns `true` if the given bounding sphere intersects with this bounding box.\n *\n * @param {Sphere} sphere - The bounding sphere to test.\n * @return {boolean} Whether the given bounding sphere intersects with this bounding box.\n */\n intersectsSphere(e) {\n return this.clampPoint(e.center, rn), rn.distanceToSquared(e.center) <= e.radius * e.radius;\n }\n /**\n * Returns `true` if the given plane intersects with this bounding box.\n *\n * @param {Plane} plane - The plane to test.\n * @return {boolean} Whether the given plane intersects with this bounding box.\n */\n intersectsPlane(e) {\n let t, n;\n return e.normal.x > 0 ? (t = e.normal.x * this.min.x, n = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, n = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, n += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, n += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, n += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, n += e.normal.z * this.min.z), t <= -e.constant && n >= -e.constant;\n }\n /**\n * Returns `true` if the given triangle intersects with this bounding box.\n *\n * @param {Triangle} triangle - The triangle to test.\n * @return {boolean} Whether the given triangle intersects with this bounding box.\n */\n intersectsTriangle(e) {\n if (this.isEmpty())\n return !1;\n this.getCenter(ss), Us.subVectors(this.max, ss), vi.subVectors(e.a, ss), Mi.subVectors(e.b, ss), Si.subVectors(e.c, ss), Gn.subVectors(Mi, vi), Hn.subVectors(Si, Mi), si.subVectors(vi, Si);\n let t = [\n 0,\n -Gn.z,\n Gn.y,\n 0,\n -Hn.z,\n Hn.y,\n 0,\n -si.z,\n si.y,\n Gn.z,\n 0,\n -Gn.x,\n Hn.z,\n 0,\n -Hn.x,\n si.z,\n 0,\n -si.x,\n -Gn.y,\n Gn.x,\n 0,\n -Hn.y,\n Hn.x,\n 0,\n -si.y,\n si.x,\n 0\n ];\n return !Vr(t, vi, Mi, Si, Us) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Vr(t, vi, Mi, Si, Us)) ? !1 : (Ns.crossVectors(Gn, Hn), t = [Ns.x, Ns.y, Ns.z], Vr(t, vi, Mi, Si, Us));\n }\n /**\n * Clamps the given point within the bounds of this box.\n *\n * @param {Vector3} point - The point to clamp.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The clamped point.\n */\n clampPoint(e, t) {\n return t.copy(e).clamp(this.min, this.max);\n }\n /**\n * Returns the euclidean distance from any edge of this box to the specified point. If\n * the given point lies inside of this box, the distance will be `0`.\n *\n * @param {Vector3} point - The point to compute the distance to.\n * @return {number} The euclidean distance.\n */\n distanceToPoint(e) {\n return this.clampPoint(e, rn).distanceTo(e);\n }\n /**\n * Returns a bounding sphere that encloses this bounding box.\n *\n * @param {Sphere} target - The target sphere that is used to store the method's result.\n * @return {Sphere} The bounding sphere that encloses this bounding box.\n */\n getBoundingSphere(e) {\n return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(rn).length() * 0.5), e;\n }\n /**\n * Computes the intersection of this bounding box and the given one, setting the upper\n * bound of this box to the lesser of the two boxes' upper bounds and the\n * lower bound of this box to the greater of the two boxes' lower bounds. If\n * there's no overlap, makes this box empty.\n *\n * @param {Box3} box - The bounding box to intersect with.\n * @return {Box3} A reference to this bounding box.\n */\n intersect(e) {\n return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this;\n }\n /**\n * Computes the union of this box and another and the given one, setting the upper\n * bound of this box to the greater of the two boxes' upper bounds and the\n * lower bound of this box to the lesser of the two boxes' lower bounds.\n *\n * @param {Box3} box - The bounding box that will be unioned with this instance.\n * @return {Box3} A reference to this bounding box.\n */\n union(e) {\n return this.min.min(e.min), this.max.max(e.max), this;\n }\n /**\n * Transforms this bounding box by the given 4x4 transformation matrix.\n *\n * @param {Matrix4} matrix - The transformation matrix.\n * @return {Box3} A reference to this bounding box.\n */\n applyMatrix4(e) {\n return this.isEmpty() ? this : (Pn[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Pn[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Pn[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Pn[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Pn[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Pn[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Pn[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Pn[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Pn), this);\n }\n /**\n * Adds the given offset to both the upper and lower bounds of this bounding box,\n * effectively moving it in 3D space.\n *\n * @param {Vector3} offset - The offset that should be used to translate the bounding box.\n * @return {Box3} A reference to this bounding box.\n */\n translate(e) {\n return this.min.add(e), this.max.add(e), this;\n }\n /**\n * Returns `true` if this bounding box is equal with the given one.\n *\n * @param {Box3} box - The box to test for equality.\n * @return {boolean} Whether this bounding box is equal with the given one.\n */\n equals(e) {\n return e.min.equals(this.min) && e.max.equals(this.max);\n }\n /**\n * Returns a serialized structure of the bounding box.\n *\n * @return {Object} Serialized structure with fields representing the object state.\n */\n toJSON() {\n return {\n min: this.min.toArray(),\n max: this.max.toArray()\n };\n }\n /**\n * Returns a serialized structure of the bounding box.\n *\n * @param {Object} json - The serialized json to set the box from.\n * @return {Box3} A reference to this bounding box.\n */\n fromJSON(e) {\n return this.min.fromArray(e.min), this.max.fromArray(e.max), this;\n }\n}\nconst Pn = [\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w(),\n /* @__PURE__ */ new w()\n], rn = /* @__PURE__ */ new w(), Is = /* @__PURE__ */ new Pt(), vi = /* @__PURE__ */ new w(), Mi = /* @__PURE__ */ new w(), Si = /* @__PURE__ */ new w(), Gn = /* @__PURE__ */ new w(), Hn = /* @__PURE__ */ new w(), si = /* @__PURE__ */ new w(), ss = /* @__PURE__ */ new w(), Us = /* @__PURE__ */ new w(), Ns = /* @__PURE__ */ new w(), ri = /* @__PURE__ */ new w();\nfunction Vr(i, e, t, n, s) {\n for (let r = 0, a = i.length - 3; r <= a; r += 3) {\n ri.fromArray(i, r);\n const o = s.x * Math.abs(ri.x) + s.y * Math.abs(ri.y) + s.z * Math.abs(ri.z), l = e.dot(ri), c = t.dot(ri), h = n.dot(ri);\n if (Math.max(-Math.max(l, c, h), Math.min(l, c, h)) > o)\n return !1;\n }\n return !0;\n}\nconst Fu = /* @__PURE__ */ new Pt(), rs = /* @__PURE__ */ new w(), Gr = /* @__PURE__ */ new w();\nclass Rn {\n /**\n * Constructs a new sphere.\n *\n * @param {Vector3} [center=(0,0,0)] - The center of the sphere\n * @param {number} [radius=-1] - The radius of the sphere.\n */\n constructor(e = new w(), t = -1) {\n this.isSphere = !0, this.center = e, this.radius = t;\n }\n /**\n * Sets the sphere's components by copying the given values.\n *\n * @param {Vector3} center - The center.\n * @param {number} radius - The radius.\n * @return {Sphere} A reference to this sphere.\n */\n set(e, t) {\n return this.center.copy(e), this.radius = t, this;\n }\n /**\n * Computes the minimum bounding sphere for list of points.\n * If the optional center point is given, it is used as the sphere's\n * center. Otherwise, the center of the axis-aligned bounding box\n * encompassing the points is calculated.\n *\n * @param {Array} points - A list of points in 3D space.\n * @param {Vector3} [optionalCenter] - The center of the sphere.\n * @return {Sphere} A reference to this sphere.\n */\n setFromPoints(e, t) {\n const n = this.center;\n t !== void 0 ? n.copy(t) : Fu.setFromPoints(e).getCenter(n);\n let s = 0;\n for (let r = 0, a = e.length; r < a; r++)\n s = Math.max(s, n.distanceToSquared(e[r]));\n return this.radius = Math.sqrt(s), this;\n }\n /**\n * Copies the values of the given sphere to this instance.\n *\n * @param {Sphere} sphere - The sphere to copy.\n * @return {Sphere} A reference to this sphere.\n */\n copy(e) {\n return this.center.copy(e.center), this.radius = e.radius, this;\n }\n /**\n * Returns `true` if the sphere is empty (the radius set to a negative number).\n *\n * Spheres with a radius of `0` contain only their center point and are not\n * considered to be empty.\n *\n * @return {boolean} Whether this sphere is empty or not.\n */\n isEmpty() {\n return this.radius < 0;\n }\n /**\n * Makes this sphere empty which means in encloses a zero space in 3D.\n *\n * @return {Sphere} A reference to this sphere.\n */\n makeEmpty() {\n return this.center.set(0, 0, 0), this.radius = -1, this;\n }\n /**\n * Returns `true` if this sphere contains the given point inclusive of\n * the surface of the sphere.\n *\n * @param {Vector3} point - The point to check.\n * @return {boolean} Whether this sphere contains the given point or not.\n */\n containsPoint(e) {\n return e.distanceToSquared(this.center) <= this.radius * this.radius;\n }\n /**\n * Returns the closest distance from the boundary of the sphere to the\n * given point. If the sphere contains the point, the distance will\n * be negative.\n *\n * @param {Vector3} point - The point to compute the distance to.\n * @return {number} The distance to the point.\n */\n distanceToPoint(e) {\n return e.distanceTo(this.center) - this.radius;\n }\n /**\n * Returns `true` if this sphere intersects with the given one.\n *\n * @param {Sphere} sphere - The sphere to test.\n * @return {boolean} Whether this sphere intersects with the given one or not.\n */\n intersectsSphere(e) {\n const t = this.radius + e.radius;\n return e.center.distanceToSquared(this.center) <= t * t;\n }\n /**\n * Returns `true` if this sphere intersects with the given box.\n *\n * @param {Box3} box - The box to test.\n * @return {boolean} Whether this sphere intersects with the given box or not.\n */\n intersectsBox(e) {\n return e.intersectsSphere(this);\n }\n /**\n * Returns `true` if this sphere intersects with the given plane.\n *\n * @param {Plane} plane - The plane to test.\n * @return {boolean} Whether this sphere intersects with the given plane or not.\n */\n intersectsPlane(e) {\n return Math.abs(e.distanceToPoint(this.center)) <= this.radius;\n }\n /**\n * Clamps a point within the sphere. If the point is outside the sphere, it\n * will clamp it to the closest point on the edge of the sphere. Points\n * already inside the sphere will not be affected.\n *\n * @param {Vector3} point - The plane to clamp.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The clamped point.\n */\n clampPoint(e, t) {\n const n = this.center.distanceToSquared(e);\n return t.copy(e), n > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t;\n }\n /**\n * Returns a bounding box that encloses this sphere.\n *\n * @param {Box3} target - The target box that is used to store the method's result.\n * @return {Box3} The bounding box that encloses this sphere.\n */\n getBoundingBox(e) {\n return this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e);\n }\n /**\n * Transforms this sphere with the given 4x4 transformation matrix.\n *\n * @param {Matrix4} matrix - The transformation matrix.\n * @return {Sphere} A reference to this sphere.\n */\n applyMatrix4(e) {\n return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this;\n }\n /**\n * Translates the sphere's center by the given offset.\n *\n * @param {Vector3} offset - The offset.\n * @return {Sphere} A reference to this sphere.\n */\n translate(e) {\n return this.center.add(e), this;\n }\n /**\n * Expands the boundaries of this sphere to include the given point.\n *\n * @param {Vector3} point - The point to include.\n * @return {Sphere} A reference to this sphere.\n */\n expandByPoint(e) {\n if (this.isEmpty())\n return this.center.copy(e), this.radius = 0, this;\n rs.subVectors(e, this.center);\n const t = rs.lengthSq();\n if (t > this.radius * this.radius) {\n const n = Math.sqrt(t), s = (n - this.radius) * 0.5;\n this.center.addScaledVector(rs, s / n), this.radius += s;\n }\n return this;\n }\n /**\n * Expands this sphere to enclose both the original sphere and the given sphere.\n *\n * @param {Sphere} sphere - The sphere to include.\n * @return {Sphere} A reference to this sphere.\n */\n union(e) {\n return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (Gr.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(rs.copy(e.center).add(Gr)), this.expandByPoint(rs.copy(e.center).sub(Gr))), this);\n }\n /**\n * Returns `true` if this sphere is equal with the given one.\n *\n * @param {Sphere} sphere - The sphere to test for equality.\n * @return {boolean} Whether this bounding sphere is equal with the given one.\n */\n equals(e) {\n return e.center.equals(this.center) && e.radius === this.radius;\n }\n /**\n * Returns a new sphere with copied values from this instance.\n *\n * @return {Sphere} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Returns a serialized structure of the bounding sphere.\n *\n * @return {Object} Serialized structure with fields representing the object state.\n */\n toJSON() {\n return {\n radius: this.radius,\n center: this.center.toArray()\n };\n }\n /**\n * Returns a serialized structure of the bounding sphere.\n *\n * @param {Object} json - The serialized json to set the sphere from.\n * @return {Box3} A reference to this bounding sphere.\n */\n fromJSON(e) {\n return this.radius = e.radius, this.center.fromArray(e.center), this;\n }\n}\nconst Dn = /* @__PURE__ */ new w(), Hr = /* @__PURE__ */ new w(), Fs = /* @__PURE__ */ new w(), Wn = /* @__PURE__ */ new w(), Wr = /* @__PURE__ */ new w(), Os = /* @__PURE__ */ new w(), Xr = /* @__PURE__ */ new w();\nclass Ji {\n /**\n * Constructs a new ray.\n *\n * @param {Vector3} [origin=(0,0,0)] - The origin of the ray.\n * @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray.\n */\n constructor(e = new w(), t = new w(0, 0, -1)) {\n this.origin = e, this.direction = t;\n }\n /**\n * Sets the ray's components by copying the given values.\n *\n * @param {Vector3} origin - The origin.\n * @param {Vector3} direction - The direction.\n * @return {Ray} A reference to this ray.\n */\n set(e, t) {\n return this.origin.copy(e), this.direction.copy(t), this;\n }\n /**\n * Copies the values of the given ray to this instance.\n *\n * @param {Ray} ray - The ray to copy.\n * @return {Ray} A reference to this ray.\n */\n copy(e) {\n return this.origin.copy(e.origin), this.direction.copy(e.direction), this;\n }\n /**\n * Returns a vector that is located at a given distance along this ray.\n *\n * @param {number} t - The distance along the ray to retrieve a position for.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} A position on the ray.\n */\n at(e, t) {\n return t.copy(this.origin).addScaledVector(this.direction, e);\n }\n /**\n * Adjusts the direction of the ray to point at the given vector in world space.\n *\n * @param {Vector3} v - The target position.\n * @return {Ray} A reference to this ray.\n */\n lookAt(e) {\n return this.direction.copy(e).sub(this.origin).normalize(), this;\n }\n /**\n * Shift the origin of this ray along its direction by the given distance.\n *\n * @param {number} t - The distance along the ray to interpolate.\n * @return {Ray} A reference to this ray.\n */\n recast(e) {\n return this.origin.copy(this.at(e, Dn)), this;\n }\n /**\n * Returns the point along this ray that is closest to the given point.\n *\n * @param {Vector3} point - A point in 3D space to get the closet location on the ray for.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The closest point on this ray.\n */\n closestPointToPoint(e, t) {\n t.subVectors(e, this.origin);\n const n = t.dot(this.direction);\n return n < 0 ? t.copy(this.origin) : t.copy(this.origin).addScaledVector(this.direction, n);\n }\n /**\n * Returns the distance of the closest approach between this ray and the given point.\n *\n * @param {Vector3} point - A point in 3D space to compute the distance to.\n * @return {number} The distance.\n */\n distanceToPoint(e) {\n return Math.sqrt(this.distanceSqToPoint(e));\n }\n /**\n * Returns the squared distance of the closest approach between this ray and the given point.\n *\n * @param {Vector3} point - A point in 3D space to compute the distance to.\n * @return {number} The squared distance.\n */\n distanceSqToPoint(e) {\n const t = Dn.subVectors(e, this.origin).dot(this.direction);\n return t < 0 ? this.origin.distanceToSquared(e) : (Dn.copy(this.origin).addScaledVector(this.direction, t), Dn.distanceToSquared(e));\n }\n /**\n * Returns the squared distance between this ray and the given line segment.\n *\n * @param {Vector3} v0 - The start point of the line segment.\n * @param {Vector3} v1 - The end point of the line segment.\n * @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment.\n * @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray.\n * @return {number} The squared distance.\n */\n distanceSqToSegment(e, t, n, s) {\n Hr.copy(e).add(t).multiplyScalar(0.5), Fs.copy(t).sub(e).normalize(), Wn.copy(this.origin).sub(Hr);\n const r = e.distanceTo(t) * 0.5, a = -this.direction.dot(Fs), o = Wn.dot(this.direction), l = -Wn.dot(Fs), c = Wn.lengthSq(), h = Math.abs(1 - a * a);\n let u, d, p, g;\n if (h > 0)\n if (u = a * l - o, d = a * o - l, g = r * h, u >= 0)\n if (d >= -g)\n if (d <= g) {\n const x = 1 / h;\n u *= x, d *= x, p = u * (u + a * d + 2 * o) + d * (a * u + d + 2 * l) + c;\n } else\n d = r, u = Math.max(0, -(a * d + o)), p = -u * u + d * (d + 2 * l) + c;\n else\n d = -r, u = Math.max(0, -(a * d + o)), p = -u * u + d * (d + 2 * l) + c;\n else\n d <= -g ? (u = Math.max(0, -(-a * r + o)), d = u > 0 ? -r : Math.min(Math.max(-r, -l), r), p = -u * u + d * (d + 2 * l) + c) : d <= g ? (u = 0, d = Math.min(Math.max(-r, -l), r), p = d * (d + 2 * l) + c) : (u = Math.max(0, -(a * r + o)), d = u > 0 ? r : Math.min(Math.max(-r, -l), r), p = -u * u + d * (d + 2 * l) + c);\n else\n d = a > 0 ? -r : r, u = Math.max(0, -(a * d + o)), p = -u * u + d * (d + 2 * l) + c;\n return n && n.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(Hr).addScaledVector(Fs, d), p;\n }\n /**\n * Intersects this ray with the given sphere, returning the intersection\n * point or `null` if there is no intersection.\n *\n * @param {Sphere} sphere - The sphere to intersect.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The intersection point.\n */\n intersectSphere(e, t) {\n Dn.subVectors(e.center, this.origin);\n const n = Dn.dot(this.direction), s = Dn.dot(Dn) - n * n, r = e.radius * e.radius;\n if (s > r) return null;\n const a = Math.sqrt(r - s), o = n - a, l = n + a;\n return l < 0 ? null : o < 0 ? this.at(l, t) : this.at(o, t);\n }\n /**\n * Returns `true` if this ray intersects with the given sphere.\n *\n * @param {Sphere} sphere - The sphere to intersect.\n * @return {boolean} Whether this ray intersects with the given sphere or not.\n */\n intersectsSphere(e) {\n return e.radius < 0 ? !1 : this.distanceSqToPoint(e.center) <= e.radius * e.radius;\n }\n /**\n * Computes the distance from the ray's origin to the given plane. Returns `null` if the ray\n * does not intersect with the plane.\n *\n * @param {Plane} plane - The plane to compute the distance to.\n * @return {?number} Whether this ray intersects with the given sphere or not.\n */\n distanceToPlane(e) {\n const t = e.normal.dot(this.direction);\n if (t === 0)\n return e.distanceToPoint(this.origin) === 0 ? 0 : null;\n const n = -(this.origin.dot(e.normal) + e.constant) / t;\n return n >= 0 ? n : null;\n }\n /**\n * Intersects this ray with the given plane, returning the intersection\n * point or `null` if there is no intersection.\n *\n * @param {Plane} plane - The plane to intersect.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The intersection point.\n */\n intersectPlane(e, t) {\n const n = this.distanceToPlane(e);\n return n === null ? null : this.at(n, t);\n }\n /**\n * Returns `true` if this ray intersects with the given plane.\n *\n * @param {Plane} plane - The plane to intersect.\n * @return {boolean} Whether this ray intersects with the given plane or not.\n */\n intersectsPlane(e) {\n const t = e.distanceToPoint(this.origin);\n return t === 0 || e.normal.dot(this.direction) * t < 0;\n }\n /**\n * Intersects this ray with the given bounding box, returning the intersection\n * point or `null` if there is no intersection.\n *\n * @param {Box3} box - The box to intersect.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The intersection point.\n */\n intersectBox(e, t) {\n let n, s, r, a, o, l;\n const c = 1 / this.direction.x, h = 1 / this.direction.y, u = 1 / this.direction.z, d = this.origin;\n return c >= 0 ? (n = (e.min.x - d.x) * c, s = (e.max.x - d.x) * c) : (n = (e.max.x - d.x) * c, s = (e.min.x - d.x) * c), h >= 0 ? (r = (e.min.y - d.y) * h, a = (e.max.y - d.y) * h) : (r = (e.max.y - d.y) * h, a = (e.min.y - d.y) * h), n > a || r > s || ((r > n || isNaN(n)) && (n = r), (a < s || isNaN(s)) && (s = a), u >= 0 ? (o = (e.min.z - d.z) * u, l = (e.max.z - d.z) * u) : (o = (e.max.z - d.z) * u, l = (e.min.z - d.z) * u), n > l || o > s) || ((o > n || n !== n) && (n = o), (l < s || s !== s) && (s = l), s < 0) ? null : this.at(n >= 0 ? n : s, t);\n }\n /**\n * Returns `true` if this ray intersects with the given box.\n *\n * @param {Box3} box - The box to intersect.\n * @return {boolean} Whether this ray intersects with the given box or not.\n */\n intersectsBox(e) {\n return this.intersectBox(e, Dn) !== null;\n }\n /**\n * Intersects this ray with the given triangle, returning the intersection\n * point or `null` if there is no intersection.\n *\n * @param {Vector3} a - The first vertex of the triangle.\n * @param {Vector3} b - The second vertex of the triangle.\n * @param {Vector3} c - The third vertex of the triangle.\n * @param {boolean} backfaceCulling - Whether to use backface culling or not.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The intersection point.\n */\n intersectTriangle(e, t, n, s, r) {\n Wr.subVectors(t, e), Os.subVectors(n, e), Xr.crossVectors(Wr, Os);\n let a = this.direction.dot(Xr), o;\n if (a > 0) {\n if (s) return null;\n o = 1;\n } else if (a < 0)\n o = -1, a = -a;\n else\n return null;\n Wn.subVectors(this.origin, e);\n const l = o * this.direction.dot(Os.crossVectors(Wn, Os));\n if (l < 0)\n return null;\n const c = o * this.direction.dot(Wr.cross(Wn));\n if (c < 0 || l + c > a)\n return null;\n const h = -o * Wn.dot(Xr);\n return h < 0 ? null : this.at(h / a, r);\n }\n /**\n * Transforms this ray with the given 4x4 transformation matrix.\n *\n * @param {Matrix4} matrix4 - The transformation matrix.\n * @return {Ray} A reference to this ray.\n */\n applyMatrix4(e) {\n return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this;\n }\n /**\n * Returns `true` if this ray is equal with the given one.\n *\n * @param {Ray} ray - The ray to test for equality.\n * @return {boolean} Whether this ray is equal with the given one.\n */\n equals(e) {\n return e.origin.equals(this.origin) && e.direction.equals(this.direction);\n }\n /**\n * Returns a new ray with copied values from this instance.\n *\n * @return {Ray} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n}\nclass Ne {\n /**\n * Constructs a new 4x4 matrix. The arguments are supposed to be\n * in row-major order. If no arguments are provided, the constructor\n * initializes the matrix as an identity matrix.\n *\n * @param {number} [n11] - 1-1 matrix element.\n * @param {number} [n12] - 1-2 matrix element.\n * @param {number} [n13] - 1-3 matrix element.\n * @param {number} [n14] - 1-4 matrix element.\n * @param {number} [n21] - 2-1 matrix element.\n * @param {number} [n22] - 2-2 matrix element.\n * @param {number} [n23] - 2-3 matrix element.\n * @param {number} [n24] - 2-4 matrix element.\n * @param {number} [n31] - 3-1 matrix element.\n * @param {number} [n32] - 3-2 matrix element.\n * @param {number} [n33] - 3-3 matrix element.\n * @param {number} [n34] - 3-4 matrix element.\n * @param {number} [n41] - 4-1 matrix element.\n * @param {number} [n42] - 4-2 matrix element.\n * @param {number} [n43] - 4-3 matrix element.\n * @param {number} [n44] - 4-4 matrix element.\n */\n constructor(e, t, n, s, r, a, o, l, c, h, u, d, p, g, x, m) {\n Ne.prototype.isMatrix4 = !0, this.elements = [\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ], e !== void 0 && this.set(e, t, n, s, r, a, o, l, c, h, u, d, p, g, x, m);\n }\n /**\n * Sets the elements of the matrix.The arguments are supposed to be\n * in row-major order.\n *\n * @param {number} [n11] - 1-1 matrix element.\n * @param {number} [n12] - 1-2 matrix element.\n * @param {number} [n13] - 1-3 matrix element.\n * @param {number} [n14] - 1-4 matrix element.\n * @param {number} [n21] - 2-1 matrix element.\n * @param {number} [n22] - 2-2 matrix element.\n * @param {number} [n23] - 2-3 matrix element.\n * @param {number} [n24] - 2-4 matrix element.\n * @param {number} [n31] - 3-1 matrix element.\n * @param {number} [n32] - 3-2 matrix element.\n * @param {number} [n33] - 3-3 matrix element.\n * @param {number} [n34] - 3-4 matrix element.\n * @param {number} [n41] - 4-1 matrix element.\n * @param {number} [n42] - 4-2 matrix element.\n * @param {number} [n43] - 4-3 matrix element.\n * @param {number} [n44] - 4-4 matrix element.\n * @return {Matrix4} A reference to this matrix.\n */\n set(e, t, n, s, r, a, o, l, c, h, u, d, p, g, x, m) {\n const f = this.elements;\n return f[0] = e, f[4] = t, f[8] = n, f[12] = s, f[1] = r, f[5] = a, f[9] = o, f[13] = l, f[2] = c, f[6] = h, f[10] = u, f[14] = d, f[3] = p, f[7] = g, f[11] = x, f[15] = m, this;\n }\n /**\n * Sets this matrix to the 4x4 identity matrix.\n *\n * @return {Matrix4} A reference to this matrix.\n */\n identity() {\n return this.set(\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Returns a matrix with copied values from this instance.\n *\n * @return {Matrix4} A clone of this instance.\n */\n clone() {\n return new Ne().fromArray(this.elements);\n }\n /**\n * Copies the values of the given matrix to this instance.\n *\n * @param {Matrix4} m - The matrix to copy.\n * @return {Matrix4} A reference to this matrix.\n */\n copy(e) {\n const t = this.elements, n = e.elements;\n return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t[4] = n[4], t[5] = n[5], t[6] = n[6], t[7] = n[7], t[8] = n[8], t[9] = n[9], t[10] = n[10], t[11] = n[11], t[12] = n[12], t[13] = n[13], t[14] = n[14], t[15] = n[15], this;\n }\n /**\n * Copies the translation component of the given matrix\n * into this matrix's translation component.\n *\n * @param {Matrix4} m - The matrix to copy the translation component.\n * @return {Matrix4} A reference to this matrix.\n */\n copyPosition(e) {\n const t = this.elements, n = e.elements;\n return t[12] = n[12], t[13] = n[13], t[14] = n[14], this;\n }\n /**\n * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix.\n *\n * @param {Matrix3} m - The 3x3 matrix.\n * @return {Matrix4} A reference to this matrix.\n */\n setFromMatrix3(e) {\n const t = e.elements;\n return this.set(\n t[0],\n t[3],\n t[6],\n 0,\n t[1],\n t[4],\n t[7],\n 0,\n t[2],\n t[5],\n t[8],\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Extracts the basis of this matrix into the three axis vectors provided.\n *\n * @param {Vector3} xAxis - The basis's x axis.\n * @param {Vector3} yAxis - The basis's y axis.\n * @param {Vector3} zAxis - The basis's z axis.\n * @return {Matrix4} A reference to this matrix.\n */\n extractBasis(e, t, n) {\n return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this;\n }\n /**\n * Sets the given basis vectors to this matrix.\n *\n * @param {Vector3} xAxis - The basis's x axis.\n * @param {Vector3} yAxis - The basis's y axis.\n * @param {Vector3} zAxis - The basis's z axis.\n * @return {Matrix4} A reference to this matrix.\n */\n makeBasis(e, t, n) {\n return this.set(\n e.x,\n t.x,\n n.x,\n 0,\n e.y,\n t.y,\n n.y,\n 0,\n e.z,\n t.z,\n n.z,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Extracts the rotation component of the given matrix\n * into this matrix's rotation component.\n *\n * Note: This method does not support reflection matrices.\n *\n * @param {Matrix4} m - The matrix.\n * @return {Matrix4} A reference to this matrix.\n */\n extractRotation(e) {\n const t = this.elements, n = e.elements, s = 1 / bi.setFromMatrixColumn(e, 0).length(), r = 1 / bi.setFromMatrixColumn(e, 1).length(), a = 1 / bi.setFromMatrixColumn(e, 2).length();\n return t[0] = n[0] * s, t[1] = n[1] * s, t[2] = n[2] * s, t[3] = 0, t[4] = n[4] * r, t[5] = n[5] * r, t[6] = n[6] * r, t[7] = 0, t[8] = n[8] * a, t[9] = n[9] * a, t[10] = n[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;\n }\n /**\n * Sets the rotation component (the upper left 3x3 matrix) of this matrix to\n * the rotation specified by the given Euler angles. The rest of\n * the matrix is set to the identity. Depending on the {@link Euler#order},\n * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix)\n * for a complete list.\n *\n * @param {Euler} euler - The Euler angles.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationFromEuler(e) {\n const t = this.elements, n = e.x, s = e.y, r = e.z, a = Math.cos(n), o = Math.sin(n), l = Math.cos(s), c = Math.sin(s), h = Math.cos(r), u = Math.sin(r);\n if (e.order === \"XYZ\") {\n const d = a * h, p = a * u, g = o * h, x = o * u;\n t[0] = l * h, t[4] = -l * u, t[8] = c, t[1] = p + g * c, t[5] = d - x * c, t[9] = -o * l, t[2] = x - d * c, t[6] = g + p * c, t[10] = a * l;\n } else if (e.order === \"YXZ\") {\n const d = l * h, p = l * u, g = c * h, x = c * u;\n t[0] = d + x * o, t[4] = g * o - p, t[8] = a * c, t[1] = a * u, t[5] = a * h, t[9] = -o, t[2] = p * o - g, t[6] = x + d * o, t[10] = a * l;\n } else if (e.order === \"ZXY\") {\n const d = l * h, p = l * u, g = c * h, x = c * u;\n t[0] = d - x * o, t[4] = -a * u, t[8] = g + p * o, t[1] = p + g * o, t[5] = a * h, t[9] = x - d * o, t[2] = -a * c, t[6] = o, t[10] = a * l;\n } else if (e.order === \"ZYX\") {\n const d = a * h, p = a * u, g = o * h, x = o * u;\n t[0] = l * h, t[4] = g * c - p, t[8] = d * c + x, t[1] = l * u, t[5] = x * c + d, t[9] = p * c - g, t[2] = -c, t[6] = o * l, t[10] = a * l;\n } else if (e.order === \"YZX\") {\n const d = a * l, p = a * c, g = o * l, x = o * c;\n t[0] = l * h, t[4] = x - d * u, t[8] = g * u + p, t[1] = u, t[5] = a * h, t[9] = -o * h, t[2] = -c * h, t[6] = p * u + g, t[10] = d - x * u;\n } else if (e.order === \"XZY\") {\n const d = a * l, p = a * c, g = o * l, x = o * c;\n t[0] = l * h, t[4] = -u, t[8] = c * h, t[1] = d * u + x, t[5] = a * h, t[9] = p * u - g, t[2] = g * u - p, t[6] = o * h, t[10] = x * u + d;\n }\n return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;\n }\n /**\n * Sets the rotation component of this matrix to the rotation specified by\n * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion)\n * The rest of the matrix is set to the identity.\n *\n * @param {Quaternion} q - The Quaternion.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationFromQuaternion(e) {\n return this.compose(Ou, e, Bu);\n }\n /**\n * Sets the rotation component of the transformation matrix, looking from `eye` towards\n * `target`, and oriented by the up-direction.\n *\n * @param {Vector3} eye - The eye vector.\n * @param {Vector3} target - The target vector.\n * @param {Vector3} up - The up vector.\n * @return {Matrix4} A reference to this matrix.\n */\n lookAt(e, t, n) {\n const s = this.elements;\n return Yt.subVectors(e, t), Yt.lengthSq() === 0 && (Yt.z = 1), Yt.normalize(), Xn.crossVectors(n, Yt), Xn.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Yt.x += 1e-4 : Yt.z += 1e-4, Yt.normalize(), Xn.crossVectors(n, Yt)), Xn.normalize(), Bs.crossVectors(Yt, Xn), s[0] = Xn.x, s[4] = Bs.x, s[8] = Yt.x, s[1] = Xn.y, s[5] = Bs.y, s[9] = Yt.y, s[2] = Xn.z, s[6] = Bs.z, s[10] = Yt.z, this;\n }\n /**\n * Post-multiplies this matrix by the given 4x4 matrix.\n *\n * @param {Matrix4} m - The matrix to multiply with.\n * @return {Matrix4} A reference to this matrix.\n */\n multiply(e) {\n return this.multiplyMatrices(this, e);\n }\n /**\n * Pre-multiplies this matrix by the given 4x4 matrix.\n *\n * @param {Matrix4} m - The matrix to multiply with.\n * @return {Matrix4} A reference to this matrix.\n */\n premultiply(e) {\n return this.multiplyMatrices(e, this);\n }\n /**\n * Multiples the given 4x4 matrices and stores the result\n * in this matrix.\n *\n * @param {Matrix4} a - The first matrix.\n * @param {Matrix4} b - The second matrix.\n * @return {Matrix4} A reference to this matrix.\n */\n multiplyMatrices(e, t) {\n const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[4], l = n[8], c = n[12], h = n[1], u = n[5], d = n[9], p = n[13], g = n[2], x = n[6], m = n[10], f = n[14], y = n[3], v = n[7], T = n[11], R = n[15], E = s[0], P = s[4], I = s[8], S = s[12], M = s[1], C = s[5], U = s[9], B = s[13], z = s[2], W = s[6], k = s[10], ee = s[14], X = s[3], $ = s[7], Q = s[11], ge = s[15];\n return r[0] = a * E + o * M + l * z + c * X, r[4] = a * P + o * C + l * W + c * $, r[8] = a * I + o * U + l * k + c * Q, r[12] = a * S + o * B + l * ee + c * ge, r[1] = h * E + u * M + d * z + p * X, r[5] = h * P + u * C + d * W + p * $, r[9] = h * I + u * U + d * k + p * Q, r[13] = h * S + u * B + d * ee + p * ge, r[2] = g * E + x * M + m * z + f * X, r[6] = g * P + x * C + m * W + f * $, r[10] = g * I + x * U + m * k + f * Q, r[14] = g * S + x * B + m * ee + f * ge, r[3] = y * E + v * M + T * z + R * X, r[7] = y * P + v * C + T * W + R * $, r[11] = y * I + v * U + T * k + R * Q, r[15] = y * S + v * B + T * ee + R * ge, this;\n }\n /**\n * Multiplies every component of the matrix by the given scalar.\n *\n * @param {number} s - The scalar.\n * @return {Matrix4} A reference to this matrix.\n */\n multiplyScalar(e) {\n const t = this.elements;\n return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this;\n }\n /**\n * Computes and returns the determinant of this matrix.\n *\n * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).\n *\n * @return {number} The determinant.\n */\n determinant() {\n const e = this.elements, t = e[0], n = e[4], s = e[8], r = e[12], a = e[1], o = e[5], l = e[9], c = e[13], h = e[2], u = e[6], d = e[10], p = e[14], g = e[3], x = e[7], m = e[11], f = e[15];\n return g * (+r * l * u - s * c * u - r * o * d + n * c * d + s * o * p - n * l * p) + x * (+t * l * p - t * c * d + r * a * d - s * a * p + s * c * h - r * l * h) + m * (+t * c * u - t * o * p - r * a * u + n * a * p + r * o * h - n * c * h) + f * (-s * o * h - t * l * u + t * o * d + s * a * u - n * a * d + n * l * h);\n }\n /**\n * Transposes this matrix in place.\n *\n * @return {Matrix4} A reference to this matrix.\n */\n transpose() {\n const e = this.elements;\n let t;\n return t = e[1], e[1] = e[4], e[4] = t, t = e[2], e[2] = e[8], e[8] = t, t = e[6], e[6] = e[9], e[9] = t, t = e[3], e[3] = e[12], e[12] = t, t = e[7], e[7] = e[13], e[13] = t, t = e[11], e[11] = e[14], e[14] = t, this;\n }\n /**\n * Sets the position component for this matrix from the given vector,\n * without affecting the rest of the matrix.\n *\n * @param {number|Vector3} x - The x component of the vector or alternatively the vector object.\n * @param {number} y - The y component of the vector.\n * @param {number} z - The z component of the vector.\n * @return {Matrix4} A reference to this matrix.\n */\n setPosition(e, t, n) {\n const s = this.elements;\n return e.isVector3 ? (s[12] = e.x, s[13] = e.y, s[14] = e.z) : (s[12] = e, s[13] = t, s[14] = n), this;\n }\n /**\n * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).\n * You can not invert with a determinant of zero. If you attempt this, the method produces\n * a zero matrix instead.\n *\n * @return {Matrix4} A reference to this matrix.\n */\n invert() {\n const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], l = e[6], c = e[7], h = e[8], u = e[9], d = e[10], p = e[11], g = e[12], x = e[13], m = e[14], f = e[15], y = u * m * c - x * d * c + x * l * p - o * m * p - u * l * f + o * d * f, v = g * d * c - h * m * c - g * l * p + a * m * p + h * l * f - a * d * f, T = h * x * c - g * u * c + g * o * p - a * x * p - h * o * f + a * u * f, R = g * u * l - h * x * l - g * o * d + a * x * d + h * o * m - a * u * m, E = t * y + n * v + s * T + r * R;\n if (E === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n const P = 1 / E;\n return e[0] = y * P, e[1] = (x * d * r - u * m * r - x * s * p + n * m * p + u * s * f - n * d * f) * P, e[2] = (o * m * r - x * l * r + x * s * c - n * m * c - o * s * f + n * l * f) * P, e[3] = (u * l * r - o * d * r - u * s * c + n * d * c + o * s * p - n * l * p) * P, e[4] = v * P, e[5] = (h * m * r - g * d * r + g * s * p - t * m * p - h * s * f + t * d * f) * P, e[6] = (g * l * r - a * m * r - g * s * c + t * m * c + a * s * f - t * l * f) * P, e[7] = (a * d * r - h * l * r + h * s * c - t * d * c - a * s * p + t * l * p) * P, e[8] = T * P, e[9] = (g * u * r - h * x * r - g * n * p + t * x * p + h * n * f - t * u * f) * P, e[10] = (a * x * r - g * o * r + g * n * c - t * x * c - a * n * f + t * o * f) * P, e[11] = (h * o * r - a * u * r - h * n * c + t * u * c + a * n * p - t * o * p) * P, e[12] = R * P, e[13] = (h * x * s - g * u * s + g * n * d - t * x * d - h * n * m + t * u * m) * P, e[14] = (g * o * s - a * x * s - g * n * l + t * x * l + a * n * m - t * o * m) * P, e[15] = (a * u * s - h * o * s + h * n * l - t * u * l - a * n * d + t * o * d) * P, this;\n }\n /**\n * Multiplies the columns of this matrix by the given vector.\n *\n * @param {Vector3} v - The scale vector.\n * @return {Matrix4} A reference to this matrix.\n */\n scale(e) {\n const t = this.elements, n = e.x, s = e.y, r = e.z;\n return t[0] *= n, t[4] *= s, t[8] *= r, t[1] *= n, t[5] *= s, t[9] *= r, t[2] *= n, t[6] *= s, t[10] *= r, t[3] *= n, t[7] *= s, t[11] *= r, this;\n }\n /**\n * Gets the maximum scale value of the three axes.\n *\n * @return {number} The maximum scale.\n */\n getMaxScaleOnAxis() {\n const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], s = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];\n return Math.sqrt(Math.max(t, n, s));\n }\n /**\n * Sets this matrix as a translation transform from the given vector.\n *\n * @param {number|Vector3} x - The amount to translate in the X axis or alternatively a translation vector.\n * @param {number} y - The amount to translate in the Y axis.\n * @param {number} z - The amount to translate in the z axis.\n * @return {Matrix4} A reference to this matrix.\n */\n makeTranslation(e, t, n) {\n return e.isVector3 ? this.set(\n 1,\n 0,\n 0,\n e.x,\n 0,\n 1,\n 0,\n e.y,\n 0,\n 0,\n 1,\n e.z,\n 0,\n 0,\n 0,\n 1\n ) : this.set(\n 1,\n 0,\n 0,\n e,\n 0,\n 1,\n 0,\n t,\n 0,\n 0,\n 1,\n n,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a rotational transformation around the X axis by\n * the given angle.\n *\n * @param {number} theta - The rotation in radians.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationX(e) {\n const t = Math.cos(e), n = Math.sin(e);\n return this.set(\n 1,\n 0,\n 0,\n 0,\n 0,\n t,\n -n,\n 0,\n 0,\n n,\n t,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a rotational transformation around the Y axis by\n * the given angle.\n *\n * @param {number} theta - The rotation in radians.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationY(e) {\n const t = Math.cos(e), n = Math.sin(e);\n return this.set(\n t,\n 0,\n n,\n 0,\n 0,\n 1,\n 0,\n 0,\n -n,\n 0,\n t,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a rotational transformation around the Z axis by\n * the given angle.\n *\n * @param {number} theta - The rotation in radians.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationZ(e) {\n const t = Math.cos(e), n = Math.sin(e);\n return this.set(\n t,\n -n,\n 0,\n 0,\n n,\n t,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a rotational transformation around the given axis by\n * the given angle.\n *\n * This is a somewhat controversial but mathematically sound alternative to\n * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).\n *\n * @param {Vector3} axis - The normalized rotation axis.\n * @param {number} angle - The rotation in radians.\n * @return {Matrix4} A reference to this matrix.\n */\n makeRotationAxis(e, t) {\n const n = Math.cos(t), s = Math.sin(t), r = 1 - n, a = e.x, o = e.y, l = e.z, c = r * a, h = r * o;\n return this.set(\n c * a + n,\n c * o - s * l,\n c * l + s * o,\n 0,\n c * o + s * l,\n h * o + n,\n h * l - s * a,\n 0,\n c * l - s * o,\n h * l + s * a,\n r * l * l + n,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a scale transformation.\n *\n * @param {number} x - The amount to scale in the X axis.\n * @param {number} y - The amount to scale in the Y axis.\n * @param {number} z - The amount to scale in the Z axis.\n * @return {Matrix4} A reference to this matrix.\n */\n makeScale(e, t, n) {\n return this.set(\n e,\n 0,\n 0,\n 0,\n 0,\n t,\n 0,\n 0,\n 0,\n 0,\n n,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix as a shear transformation.\n *\n * @param {number} xy - The amount to shear X by Y.\n * @param {number} xz - The amount to shear X by Z.\n * @param {number} yx - The amount to shear Y by X.\n * @param {number} yz - The amount to shear Y by Z.\n * @param {number} zx - The amount to shear Z by X.\n * @param {number} zy - The amount to shear Z by Y.\n * @return {Matrix4} A reference to this matrix.\n */\n makeShear(e, t, n, s, r, a) {\n return this.set(\n 1,\n n,\n r,\n 0,\n e,\n 1,\n a,\n 0,\n t,\n s,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n /**\n * Sets this matrix to the transformation composed of the given position,\n * rotation (Quaternion) and scale.\n *\n * @param {Vector3} position - The position vector.\n * @param {Quaternion} quaternion - The rotation as a Quaternion.\n * @param {Vector3} scale - The scale vector.\n * @return {Matrix4} A reference to this matrix.\n */\n compose(e, t, n) {\n const s = this.elements, r = t._x, a = t._y, o = t._z, l = t._w, c = r + r, h = a + a, u = o + o, d = r * c, p = r * h, g = r * u, x = a * h, m = a * u, f = o * u, y = l * c, v = l * h, T = l * u, R = n.x, E = n.y, P = n.z;\n return s[0] = (1 - (x + f)) * R, s[1] = (p + T) * R, s[2] = (g - v) * R, s[3] = 0, s[4] = (p - T) * E, s[5] = (1 - (d + f)) * E, s[6] = (m + y) * E, s[7] = 0, s[8] = (g + v) * P, s[9] = (m - y) * P, s[10] = (1 - (d + x)) * P, s[11] = 0, s[12] = e.x, s[13] = e.y, s[14] = e.z, s[15] = 1, this;\n }\n /**\n * Decomposes this matrix into its position, rotation and scale components\n * and provides the result in the given objects.\n *\n * Note: Not all matrices are decomposable in this way. For example, if an\n * object has a non-uniformly scaled parent, then the object's world matrix\n * may not be decomposable, and this method may not be appropriate.\n *\n * @param {Vector3} position - The position vector.\n * @param {Quaternion} quaternion - The rotation as a Quaternion.\n * @param {Vector3} scale - The scale vector.\n * @return {Matrix4} A reference to this matrix.\n */\n decompose(e, t, n) {\n const s = this.elements;\n let r = bi.set(s[0], s[1], s[2]).length();\n const a = bi.set(s[4], s[5], s[6]).length(), o = bi.set(s[8], s[9], s[10]).length();\n this.determinant() < 0 && (r = -r), e.x = s[12], e.y = s[13], e.z = s[14], an.copy(this);\n const c = 1 / r, h = 1 / a, u = 1 / o;\n return an.elements[0] *= c, an.elements[1] *= c, an.elements[2] *= c, an.elements[4] *= h, an.elements[5] *= h, an.elements[6] *= h, an.elements[8] *= u, an.elements[9] *= u, an.elements[10] *= u, t.setFromRotationMatrix(an), n.x = r, n.y = a, n.z = o, this;\n }\n /**\n \t * Creates a perspective projection matrix. This is used internally by\n \t * {@link PerspectiveCamera#updateProjectionMatrix}.\n \n \t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n \t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n \t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n \t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n \t * @param {number} near - The distance from the camera to the near plane.\n \t * @param {number} far - The distance from the camera to the far plane.\n \t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n \t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n \t * @return {Matrix4} A reference to this matrix.\n \t */\n makePerspective(e, t, n, s, r, a, o = Tn, l = !1) {\n const c = this.elements, h = 2 * r / (t - e), u = 2 * r / (n - s), d = (t + e) / (t - e), p = (n + s) / (n - s);\n let g, x;\n if (l)\n g = r / (a - r), x = a * r / (a - r);\n else if (o === Tn)\n g = -(a + r) / (a - r), x = -2 * a * r / (a - r);\n else if (o === br)\n g = -a / (a - r), x = -a * r / (a - r);\n else\n throw new Error(\"THREE.Matrix4.makePerspective(): Invalid coordinate system: \" + o);\n return c[0] = h, c[4] = 0, c[8] = d, c[12] = 0, c[1] = 0, c[5] = u, c[9] = p, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = g, c[14] = x, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;\n }\n /**\n \t * Creates a orthographic projection matrix. This is used internally by\n \t * {@link OrthographicCamera#updateProjectionMatrix}.\n \n \t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n \t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n \t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n \t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n \t * @param {number} near - The distance from the camera to the near plane.\n \t * @param {number} far - The distance from the camera to the far plane.\n \t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n \t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n \t * @return {Matrix4} A reference to this matrix.\n \t */\n makeOrthographic(e, t, n, s, r, a, o = Tn, l = !1) {\n const c = this.elements, h = 2 / (t - e), u = 2 / (n - s), d = -(t + e) / (t - e), p = -(n + s) / (n - s);\n let g, x;\n if (l)\n g = 1 / (a - r), x = a / (a - r);\n else if (o === Tn)\n g = -2 / (a - r), x = -(a + r) / (a - r);\n else if (o === br)\n g = -1 / (a - r), x = -r / (a - r);\n else\n throw new Error(\"THREE.Matrix4.makeOrthographic(): Invalid coordinate system: \" + o);\n return c[0] = h, c[4] = 0, c[8] = 0, c[12] = d, c[1] = 0, c[5] = u, c[9] = 0, c[13] = p, c[2] = 0, c[6] = 0, c[10] = g, c[14] = x, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this;\n }\n /**\n * Returns `true` if this matrix is equal with the given one.\n *\n * @param {Matrix4} matrix - The matrix to test for equality.\n * @return {boolean} Whether this matrix is equal with the given one.\n */\n equals(e) {\n const t = this.elements, n = e.elements;\n for (let s = 0; s < 16; s++)\n if (t[s] !== n[s]) return !1;\n return !0;\n }\n /**\n * Sets the elements of the matrix from the given array.\n *\n * @param {Array} array - The matrix elements in column-major order.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Matrix4} A reference to this matrix.\n */\n fromArray(e, t = 0) {\n for (let n = 0; n < 16; n++)\n this.elements[n] = e[n + t];\n return this;\n }\n /**\n * Writes the elements of this matrix to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The matrix elements in column-major order.\n */\n toArray(e = [], t = 0) {\n const n = this.elements;\n return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e;\n }\n}\nconst bi = /* @__PURE__ */ new w(), an = /* @__PURE__ */ new Ne(), Ou = /* @__PURE__ */ new w(0, 0, 0), Bu = /* @__PURE__ */ new w(1, 1, 1), Xn = /* @__PURE__ */ new w(), Bs = /* @__PURE__ */ new w(), Yt = /* @__PURE__ */ new w(), pl = /* @__PURE__ */ new Ne(), ml = /* @__PURE__ */ new gn();\nclass xn {\n /**\n * Constructs a new euler instance.\n *\n * @param {number} [x=0] - The angle of the x axis in radians.\n * @param {number} [y=0] - The angle of the y axis in radians.\n * @param {number} [z=0] - The angle of the z axis in radians.\n * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.\n */\n constructor(e = 0, t = 0, n = 0, s = xn.DEFAULT_ORDER) {\n this.isEuler = !0, this._x = e, this._y = t, this._z = n, this._order = s;\n }\n /**\n * The angle of the x axis in radians.\n *\n * @type {number}\n * @default 0\n */\n get x() {\n return this._x;\n }\n set x(e) {\n this._x = e, this._onChangeCallback();\n }\n /**\n * The angle of the y axis in radians.\n *\n * @type {number}\n * @default 0\n */\n get y() {\n return this._y;\n }\n set y(e) {\n this._y = e, this._onChangeCallback();\n }\n /**\n * The angle of the z axis in radians.\n *\n * @type {number}\n * @default 0\n */\n get z() {\n return this._z;\n }\n set z(e) {\n this._z = e, this._onChangeCallback();\n }\n /**\n * A string representing the order that the rotations are applied.\n *\n * @type {string}\n * @default 'XYZ'\n */\n get order() {\n return this._order;\n }\n set order(e) {\n this._order = e, this._onChangeCallback();\n }\n /**\n * Sets the Euler components.\n *\n * @param {number} x - The angle of the x axis in radians.\n * @param {number} y - The angle of the y axis in radians.\n * @param {number} z - The angle of the z axis in radians.\n * @param {string} [order] - A string representing the order that the rotations are applied.\n * @return {Euler} A reference to this Euler instance.\n */\n set(e, t, n, s = this._order) {\n return this._x = e, this._y = t, this._z = n, this._order = s, this._onChangeCallback(), this;\n }\n /**\n * Returns a new Euler instance with copied values from this instance.\n *\n * @return {Euler} A clone of this instance.\n */\n clone() {\n return new this.constructor(this._x, this._y, this._z, this._order);\n }\n /**\n * Copies the values of the given Euler instance to this instance.\n *\n * @param {Euler} euler - The Euler instance to copy.\n * @return {Euler} A reference to this Euler instance.\n */\n copy(e) {\n return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this;\n }\n /**\n * Sets the angles of this Euler instance from a pure rotation matrix.\n *\n * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n * @param {string} [order] - A string representing the order that the rotations are applied.\n * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n * @return {Euler} A reference to this Euler instance.\n */\n setFromRotationMatrix(e, t = this._order, n = !0) {\n const s = e.elements, r = s[0], a = s[4], o = s[8], l = s[1], c = s[5], h = s[9], u = s[2], d = s[6], p = s[10];\n switch (t) {\n case \"XYZ\":\n this._y = Math.asin(He(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-h, p), this._z = Math.atan2(-a, r)) : (this._x = Math.atan2(d, c), this._z = 0);\n break;\n case \"YXZ\":\n this._x = Math.asin(-He(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(o, p), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, r), this._z = 0);\n break;\n case \"ZXY\":\n this._x = Math.asin(He(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(-u, p), this._z = Math.atan2(-a, c)) : (this._y = 0, this._z = Math.atan2(l, r));\n break;\n case \"ZYX\":\n this._y = Math.asin(-He(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(d, p), this._z = Math.atan2(l, r)) : (this._x = 0, this._z = Math.atan2(-a, c));\n break;\n case \"YZX\":\n this._z = Math.asin(He(l, -1, 1)), Math.abs(l) < 0.9999999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(o, p));\n break;\n case \"XZY\":\n this._z = Math.asin(-He(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(o, r)) : (this._x = Math.atan2(-h, p), this._y = 0);\n break;\n default:\n Te(\"Euler: .setFromRotationMatrix() encountered an unknown order: \" + t);\n }\n return this._order = t, n === !0 && this._onChangeCallback(), this;\n }\n /**\n * Sets the angles of this Euler instance from a normalized quaternion.\n *\n * @param {Quaternion} q - A normalized Quaternion.\n * @param {string} [order] - A string representing the order that the rotations are applied.\n * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n * @return {Euler} A reference to this Euler instance.\n */\n setFromQuaternion(e, t, n) {\n return pl.makeRotationFromQuaternion(e), this.setFromRotationMatrix(pl, t, n);\n }\n /**\n * Sets the angles of this Euler instance from the given vector.\n *\n * @param {Vector3} v - The vector.\n * @param {string} [order] - A string representing the order that the rotations are applied.\n * @return {Euler} A reference to this Euler instance.\n */\n setFromVector3(e, t = this._order) {\n return this.set(e.x, e.y, e.z, t);\n }\n /**\n * Resets the euler angle with a new order by creating a quaternion from this\n * euler angle and then setting this euler angle with the quaternion and the\n * new order.\n *\n * Warning: This discards revolution information.\n *\n * @param {string} [newOrder] - A string representing the new order that the rotations are applied.\n * @return {Euler} A reference to this Euler instance.\n */\n reorder(e) {\n return ml.setFromEuler(this), this.setFromQuaternion(ml, e);\n }\n /**\n * Returns `true` if this Euler instance is equal with the given one.\n *\n * @param {Euler} euler - The Euler instance to test for equality.\n * @return {boolean} Whether this Euler instance is equal with the given one.\n */\n equals(e) {\n return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order;\n }\n /**\n * Sets this Euler instance's components to values from the given array. The first three\n * entries of the array are assign to the x,y and z components. An optional fourth entry\n * defines the Euler order.\n *\n * @param {Array} array - An array holding the Euler component values.\n * @return {Euler} A reference to this Euler instance.\n */\n fromArray(e) {\n return this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== void 0 && (this._order = e[3]), this._onChangeCallback(), this;\n }\n /**\n * Writes the components of this Euler instance to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the Euler components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The Euler components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e;\n }\n _onChange(e) {\n return this._onChangeCallback = e, this;\n }\n _onChangeCallback() {\n }\n *[Symbol.iterator]() {\n yield this._x, yield this._y, yield this._z, yield this._order;\n }\n}\nxn.DEFAULT_ORDER = \"XYZ\";\nclass Uo {\n /**\n * Constructs a new layers instance, with membership\n * initially set to layer `0`.\n */\n constructor() {\n this.mask = 1;\n }\n /**\n * Sets membership to the given layer, and remove membership all other layers.\n *\n * @param {number} layer - The layer to set.\n */\n set(e) {\n this.mask = (1 << e | 0) >>> 0;\n }\n /**\n * Adds membership of the given layer.\n *\n * @param {number} layer - The layer to enable.\n */\n enable(e) {\n this.mask |= 1 << e | 0;\n }\n /**\n * Adds membership to all layers.\n */\n enableAll() {\n this.mask = -1;\n }\n /**\n * Toggles the membership of the given layer.\n *\n * @param {number} layer - The layer to toggle.\n */\n toggle(e) {\n this.mask ^= 1 << e | 0;\n }\n /**\n * Removes membership of the given layer.\n *\n * @param {number} layer - The layer to enable.\n */\n disable(e) {\n this.mask &= ~(1 << e | 0);\n }\n /**\n * Removes the membership from all layers.\n */\n disableAll() {\n this.mask = 0;\n }\n /**\n * Returns `true` if this and the given layers object have at least one\n * layer in common.\n *\n * @param {Layers} layers - The layers to test.\n * @return {boolean } Whether this and the given layers object have at least one layer in common or not.\n */\n test(e) {\n return (this.mask & e.mask) !== 0;\n }\n /**\n * Returns `true` if the given layer is enabled.\n *\n * @param {number} layer - The layer to test.\n * @return {boolean } Whether the given layer is enabled or not.\n */\n isEnabled(e) {\n return (this.mask & (1 << e | 0)) !== 0;\n }\n}\nlet zu = 0;\nconst gl = /* @__PURE__ */ new w(), yi = /* @__PURE__ */ new gn(), Ln = /* @__PURE__ */ new Ne(), zs = /* @__PURE__ */ new w(), as = /* @__PURE__ */ new w(), ku = /* @__PURE__ */ new w(), Vu = /* @__PURE__ */ new gn(), xl = /* @__PURE__ */ new w(1, 0, 0), _l = /* @__PURE__ */ new w(0, 1, 0), vl = /* @__PURE__ */ new w(0, 0, 1), Ml = { type: \"added\" }, Gu = { type: \"removed\" }, Ti = { type: \"childadded\", child: null }, jr = { type: \"childremoved\", child: null };\nclass pt extends mi {\n /**\n * Constructs a new 3D object.\n */\n constructor() {\n super(), this.isObject3D = !0, Object.defineProperty(this, \"id\", { value: zu++ }), this.uuid = fn(), this.name = \"\", this.type = \"Object3D\", this.parent = null, this.children = [], this.up = pt.DEFAULT_UP.clone();\n const e = new w(), t = new xn(), n = new gn(), s = new w(1, 1, 1);\n function r() {\n n.setFromEuler(t, !1);\n }\n function a() {\n t.setFromQuaternion(n, void 0, !1);\n }\n t._onChange(r), n._onChange(a), Object.defineProperties(this, {\n /**\n * Represents the object's local position.\n *\n * @name Object3D#position\n * @type {Vector3}\n * @default (0,0,0)\n */\n position: {\n configurable: !0,\n enumerable: !0,\n value: e\n },\n /**\n * Represents the object's local rotation as Euler angles, in radians.\n *\n * @name Object3D#rotation\n * @type {Euler}\n * @default (0,0,0)\n */\n rotation: {\n configurable: !0,\n enumerable: !0,\n value: t\n },\n /**\n * Represents the object's local rotation as Quaternions.\n *\n * @name Object3D#quaternion\n * @type {Quaternion}\n */\n quaternion: {\n configurable: !0,\n enumerable: !0,\n value: n\n },\n /**\n * Represents the object's local scale.\n *\n * @name Object3D#scale\n * @type {Vector3}\n * @default (1,1,1)\n */\n scale: {\n configurable: !0,\n enumerable: !0,\n value: s\n },\n /**\n * Represents the object's model-view matrix.\n *\n * @name Object3D#modelViewMatrix\n * @type {Matrix4}\n */\n modelViewMatrix: {\n value: new Ne()\n },\n /**\n * Represents the object's normal matrix.\n *\n * @name Object3D#normalMatrix\n * @type {Matrix3}\n */\n normalMatrix: {\n value: new ze()\n }\n }), this.matrix = new Ne(), this.matrixWorld = new Ne(), this.matrixAutoUpdate = pt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Uo(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.userData = {};\n }\n /**\n * A callback that is executed immediately before a 3D object is rendered to a shadow map.\n *\n * @param {Renderer|WebGLRenderer} renderer - The renderer.\n * @param {Object3D} object - The 3D object.\n * @param {Camera} camera - The camera that is used to render the scene.\n * @param {Camera} shadowCamera - The shadow camera.\n * @param {BufferGeometry} geometry - The 3D object's geometry.\n * @param {Material} depthMaterial - The depth material.\n * @param {Object} group - The geometry group data.\n */\n onBeforeShadow() {\n }\n /**\n * A callback that is executed immediately after a 3D object is rendered to a shadow map.\n *\n * @param {Renderer|WebGLRenderer} renderer - The renderer.\n * @param {Object3D} object - The 3D object.\n * @param {Camera} camera - The camera that is used to render the scene.\n * @param {Camera} shadowCamera - The shadow camera.\n * @param {BufferGeometry} geometry - The 3D object's geometry.\n * @param {Material} depthMaterial - The depth material.\n * @param {Object} group - The geometry group data.\n */\n onAfterShadow() {\n }\n /**\n * A callback that is executed immediately before a 3D object is rendered.\n *\n * @param {Renderer|WebGLRenderer} renderer - The renderer.\n * @param {Object3D} object - The 3D object.\n * @param {Camera} camera - The camera that is used to render the scene.\n * @param {BufferGeometry} geometry - The 3D object's geometry.\n * @param {Material} material - The 3D object's material.\n * @param {Object} group - The geometry group data.\n */\n onBeforeRender() {\n }\n /**\n * A callback that is executed immediately after a 3D object is rendered.\n *\n * @param {Renderer|WebGLRenderer} renderer - The renderer.\n * @param {Object3D} object - The 3D object.\n * @param {Camera} camera - The camera that is used to render the scene.\n * @param {BufferGeometry} geometry - The 3D object's geometry.\n * @param {Material} material - The 3D object's material.\n * @param {Object} group - The geometry group data.\n */\n onAfterRender() {\n }\n /**\n * Applies the given transformation matrix to the object and updates the object's position,\n * rotation and scale.\n *\n * @param {Matrix4} matrix - The transformation matrix.\n */\n applyMatrix4(e) {\n this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale);\n }\n /**\n * Applies a rotation represented by given the quaternion to the 3D object.\n *\n * @param {Quaternion} q - The quaternion.\n * @return {Object3D} A reference to this instance.\n */\n applyQuaternion(e) {\n return this.quaternion.premultiply(e), this;\n }\n /**\n * Sets the given rotation represented as an axis/angle couple to the 3D object.\n *\n * @param {Vector3} axis - The (normalized) axis vector.\n * @param {number} angle - The angle in radians.\n */\n setRotationFromAxisAngle(e, t) {\n this.quaternion.setFromAxisAngle(e, t);\n }\n /**\n * Sets the given rotation represented as Euler angles to the 3D object.\n *\n * @param {Euler} euler - The Euler angles.\n */\n setRotationFromEuler(e) {\n this.quaternion.setFromEuler(e, !0);\n }\n /**\n * Sets the given rotation represented as rotation matrix to the 3D object.\n *\n * @param {Matrix4} m - Although a 4x4 matrix is expected, the upper 3x3 portion must be\n * a pure rotation matrix (i.e, unscaled).\n */\n setRotationFromMatrix(e) {\n this.quaternion.setFromRotationMatrix(e);\n }\n /**\n * Sets the given rotation represented as a Quaternion to the 3D object.\n *\n * @param {Quaternion} q - The Quaternion\n */\n setRotationFromQuaternion(e) {\n this.quaternion.copy(e);\n }\n /**\n * Rotates the 3D object along an axis in local space.\n *\n * @param {Vector3} axis - The (normalized) axis vector.\n * @param {number} angle - The angle in radians.\n * @return {Object3D} A reference to this instance.\n */\n rotateOnAxis(e, t) {\n return yi.setFromAxisAngle(e, t), this.quaternion.multiply(yi), this;\n }\n /**\n * Rotates the 3D object along an axis in world space.\n *\n * @param {Vector3} axis - The (normalized) axis vector.\n * @param {number} angle - The angle in radians.\n * @return {Object3D} A reference to this instance.\n */\n rotateOnWorldAxis(e, t) {\n return yi.setFromAxisAngle(e, t), this.quaternion.premultiply(yi), this;\n }\n /**\n * Rotates the 3D object around its X axis in local space.\n *\n * @param {number} angle - The angle in radians.\n * @return {Object3D} A reference to this instance.\n */\n rotateX(e) {\n return this.rotateOnAxis(xl, e);\n }\n /**\n * Rotates the 3D object around its Y axis in local space.\n *\n * @param {number} angle - The angle in radians.\n * @return {Object3D} A reference to this instance.\n */\n rotateY(e) {\n return this.rotateOnAxis(_l, e);\n }\n /**\n * Rotates the 3D object around its Z axis in local space.\n *\n * @param {number} angle - The angle in radians.\n * @return {Object3D} A reference to this instance.\n */\n rotateZ(e) {\n return this.rotateOnAxis(vl, e);\n }\n /**\n * Translate the 3D object by a distance along the given axis in local space.\n *\n * @param {Vector3} axis - The (normalized) axis vector.\n * @param {number} distance - The distance in world units.\n * @return {Object3D} A reference to this instance.\n */\n translateOnAxis(e, t) {\n return gl.copy(e).applyQuaternion(this.quaternion), this.position.add(gl.multiplyScalar(t)), this;\n }\n /**\n * Translate the 3D object by a distance along its X-axis in local space.\n *\n * @param {number} distance - The distance in world units.\n * @return {Object3D} A reference to this instance.\n */\n translateX(e) {\n return this.translateOnAxis(xl, e);\n }\n /**\n * Translate the 3D object by a distance along its Y-axis in local space.\n *\n * @param {number} distance - The distance in world units.\n * @return {Object3D} A reference to this instance.\n */\n translateY(e) {\n return this.translateOnAxis(_l, e);\n }\n /**\n * Translate the 3D object by a distance along its Z-axis in local space.\n *\n * @param {number} distance - The distance in world units.\n * @return {Object3D} A reference to this instance.\n */\n translateZ(e) {\n return this.translateOnAxis(vl, e);\n }\n /**\n * Converts the given vector from this 3D object's local space to world space.\n *\n * @param {Vector3} vector - The vector to convert.\n * @return {Vector3} The converted vector.\n */\n localToWorld(e) {\n return this.updateWorldMatrix(!0, !1), e.applyMatrix4(this.matrixWorld);\n }\n /**\n * Converts the given vector from this 3D object's word space to local space.\n *\n * @param {Vector3} vector - The vector to convert.\n * @return {Vector3} The converted vector.\n */\n worldToLocal(e) {\n return this.updateWorldMatrix(!0, !1), e.applyMatrix4(Ln.copy(this.matrixWorld).invert());\n }\n /**\n * Rotates the object to face a point in world space.\n *\n * This method does not support objects having non-uniformly-scaled parent(s).\n *\n * @param {number|Vector3} x - The x coordinate in world space. Alternatively, a vector representing a position in world space\n * @param {number} [y] - The y coordinate in world space.\n * @param {number} [z] - The z coordinate in world space.\n */\n lookAt(e, t, n) {\n e.isVector3 ? zs.copy(e) : zs.set(e, t, n);\n const s = this.parent;\n this.updateWorldMatrix(!0, !1), as.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Ln.lookAt(as, zs, this.up) : Ln.lookAt(zs, as, this.up), this.quaternion.setFromRotationMatrix(Ln), s && (Ln.extractRotation(s.matrixWorld), yi.setFromRotationMatrix(Ln), this.quaternion.premultiply(yi.invert()));\n }\n /**\n * Adds the given 3D object as a child to this 3D object. An arbitrary number of\n * objects may be added. Any current parent on an object passed in here will be\n * removed, since an object can have at most one parent.\n *\n * @fires Object3D#added\n * @fires Object3D#childadded\n * @param {Object3D} object - The 3D object to add.\n * @return {Object3D} A reference to this instance.\n */\n add(e) {\n if (arguments.length > 1) {\n for (let t = 0; t < arguments.length; t++)\n this.add(arguments[t]);\n return this;\n }\n return e === this ? (Xe(\"Object3D.add: object can't be added as a child of itself.\", e), this) : (e && e.isObject3D ? (e.removeFromParent(), e.parent = this, this.children.push(e), e.dispatchEvent(Ml), Ti.child = e, this.dispatchEvent(Ti), Ti.child = null) : Xe(\"Object3D.add: object not an instance of THREE.Object3D.\", e), this);\n }\n /**\n * Removes the given 3D object as child from this 3D object.\n * An arbitrary number of objects may be removed.\n *\n * @fires Object3D#removed\n * @fires Object3D#childremoved\n * @param {Object3D} object - The 3D object to remove.\n * @return {Object3D} A reference to this instance.\n */\n remove(e) {\n if (arguments.length > 1) {\n for (let n = 0; n < arguments.length; n++)\n this.remove(arguments[n]);\n return this;\n }\n const t = this.children.indexOf(e);\n return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(Gu), jr.child = e, this.dispatchEvent(jr), jr.child = null), this;\n }\n /**\n * Removes this 3D object from its current parent.\n *\n * @fires Object3D#removed\n * @fires Object3D#childremoved\n * @return {Object3D} A reference to this instance.\n */\n removeFromParent() {\n const e = this.parent;\n return e !== null && e.remove(this), this;\n }\n /**\n * Removes all child objects.\n *\n * @fires Object3D#removed\n * @fires Object3D#childremoved\n * @return {Object3D} A reference to this instance.\n */\n clear() {\n return this.remove(...this.children);\n }\n /**\n * Adds the given 3D object as a child of this 3D object, while maintaining the object's world\n * transform. This method does not support scene graphs having non-uniformly-scaled nodes(s).\n *\n * @fires Object3D#added\n * @fires Object3D#childadded\n * @param {Object3D} object - The 3D object to attach.\n * @return {Object3D} A reference to this instance.\n */\n attach(e) {\n return this.updateWorldMatrix(!0, !1), Ln.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Ln.multiply(e.parent.matrixWorld)), e.applyMatrix4(Ln), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Ml), Ti.child = e, this.dispatchEvent(Ti), Ti.child = null, this;\n }\n /**\n * Searches through the 3D object and its children, starting with the 3D object\n * itself, and returns the first with a matching ID.\n *\n * @param {number} id - The id.\n * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n */\n getObjectById(e) {\n return this.getObjectByProperty(\"id\", e);\n }\n /**\n * Searches through the 3D object and its children, starting with the 3D object\n * itself, and returns the first with a matching name.\n *\n * @param {string} name - The name.\n * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n */\n getObjectByName(e) {\n return this.getObjectByProperty(\"name\", e);\n }\n /**\n * Searches through the 3D object and its children, starting with the 3D object\n * itself, and returns the first with a matching property value.\n *\n * @param {string} name - The name of the property.\n * @param {any} value - The value.\n * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n */\n getObjectByProperty(e, t) {\n if (this[e] === t) return this;\n for (let n = 0, s = this.children.length; n < s; n++) {\n const a = this.children[n].getObjectByProperty(e, t);\n if (a !== void 0)\n return a;\n }\n }\n /**\n * Searches through the 3D object and its children, starting with the 3D object\n * itself, and returns all 3D objects with a matching property value.\n *\n * @param {string} name - The name of the property.\n * @param {any} value - The value.\n * @param {Array} result - The method stores the result in this array.\n * @return {Array} The found 3D objects.\n */\n getObjectsByProperty(e, t, n = []) {\n this[e] === t && n.push(this);\n const s = this.children;\n for (let r = 0, a = s.length; r < a; r++)\n s[r].getObjectsByProperty(e, t, n);\n return n;\n }\n /**\n * Returns a vector representing the position of the 3D object in world space.\n *\n * @param {Vector3} target - The target vector the result is stored to.\n * @return {Vector3} The 3D object's position in world space.\n */\n getWorldPosition(e) {\n return this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld);\n }\n /**\n * Returns a Quaternion representing the position of the 3D object in world space.\n *\n * @param {Quaternion} target - The target Quaternion the result is stored to.\n * @return {Quaternion} The 3D object's rotation in world space.\n */\n getWorldQuaternion(e) {\n return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(as, e, ku), e;\n }\n /**\n * Returns a vector representing the scale of the 3D object in world space.\n *\n * @param {Vector3} target - The target vector the result is stored to.\n * @return {Vector3} The 3D object's scale in world space.\n */\n getWorldScale(e) {\n return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(as, Vu, e), e;\n }\n /**\n * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n *\n * @param {Vector3} target - The target vector the result is stored to.\n * @return {Vector3} The 3D object's direction in world space.\n */\n getWorldDirection(e) {\n this.updateWorldMatrix(!0, !1);\n const t = this.matrixWorld.elements;\n return e.set(t[8], t[9], t[10]).normalize();\n }\n /**\n * Abstract method to get intersections between a casted ray and this\n * 3D object. Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points}\n * implement this method in order to use raycasting.\n *\n * @abstract\n * @param {Raycaster} raycaster - The raycaster.\n * @param {Array} intersects - An array holding the result of the method.\n */\n raycast() {\n }\n /**\n * Executes the callback on this 3D object and all descendants.\n *\n * Note: Modifying the scene graph inside the callback is discouraged.\n *\n * @param {Function} callback - A callback function that allows to process the current 3D object.\n */\n traverse(e) {\n e(this);\n const t = this.children;\n for (let n = 0, s = t.length; n < s; n++)\n t[n].traverse(e);\n }\n /**\n * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects.\n * Descendants of invisible 3D objects are not traversed.\n *\n * Note: Modifying the scene graph inside the callback is discouraged.\n *\n * @param {Function} callback - A callback function that allows to process the current 3D object.\n */\n traverseVisible(e) {\n if (this.visible === !1) return;\n e(this);\n const t = this.children;\n for (let n = 0, s = t.length; n < s; n++)\n t[n].traverseVisible(e);\n }\n /**\n * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors.\n *\n * Note: Modifying the scene graph inside the callback is discouraged.\n *\n * @param {Function} callback - A callback function that allows to process the current 3D object.\n */\n traverseAncestors(e) {\n const t = this.parent;\n t !== null && (e(t), t.traverseAncestors(e));\n }\n /**\n * Updates the transformation matrix in local space by computing it from the current\n * position, rotation and scale values.\n */\n updateMatrix() {\n this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0;\n }\n /**\n * Updates the transformation matrix in world space of this 3D objects and its descendants.\n *\n * To ensure correct results, this method also recomputes the 3D object's transformation matrix in\n * local space. The computation of the local and world matrix can be controlled with the\n * {@link Object3D#matrixAutoUpdate} and {@link Object3D#matrixWorldAutoUpdate} flags which are both\n * `true` by default. Set these flags to `false` if you need more control over the update matrix process.\n *\n * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even\n * when {@link Object3D#matrixWorldAutoUpdate} is set to `false`.\n */\n updateMatrixWorld(e) {\n this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (this.matrixWorldAutoUpdate === !0 && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = !1, e = !0);\n const t = this.children;\n for (let n = 0, s = t.length; n < s; n++)\n t[n].updateMatrixWorld(e);\n }\n /**\n * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the\n * update of ancestor and descendant nodes.\n *\n * @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.\n * @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.\n */\n updateWorldMatrix(e, t) {\n const n = this.parent;\n if (e === !0 && n !== null && n.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.matrixWorldAutoUpdate === !0 && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), t === !0) {\n const s = this.children;\n for (let r = 0, a = s.length; r < a; r++)\n s[r].updateWorldMatrix(!1, !0);\n }\n }\n /**\n * Serializes the 3D object into JSON.\n *\n * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized 3D object.\n * @see {@link ObjectLoader#parse}\n */\n toJSON(e) {\n const t = e === void 0 || typeof e == \"string\", n = {};\n t && (e = {\n geometries: {},\n materials: {},\n textures: {},\n images: {},\n shapes: {},\n skeletons: {},\n animations: {},\n nodes: {}\n }, n.metadata = {\n version: 4.7,\n type: \"Object\",\n generator: \"Object3D.toJSON\"\n });\n const s = {};\n s.uuid = this.uuid, s.type = this.type, this.name !== \"\" && (s.name = this.name), this.castShadow === !0 && (s.castShadow = !0), this.receiveShadow === !0 && (s.receiveShadow = !0), this.visible === !1 && (s.visible = !1), this.frustumCulled === !1 && (s.frustumCulled = !1), this.renderOrder !== 0 && (s.renderOrder = this.renderOrder), Object.keys(this.userData).length > 0 && (s.userData = this.userData), s.layers = this.layers.mask, s.matrix = this.matrix.toArray(), s.up = this.up.toArray(), this.matrixAutoUpdate === !1 && (s.matrixAutoUpdate = !1), this.isInstancedMesh && (s.type = \"InstancedMesh\", s.count = this.count, s.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (s.instanceColor = this.instanceColor.toJSON())), this.isBatchedMesh && (s.type = \"BatchedMesh\", s.perObjectFrustumCulled = this.perObjectFrustumCulled, s.sortObjects = this.sortObjects, s.drawRanges = this._drawRanges, s.reservedRanges = this._reservedRanges, s.geometryInfo = this._geometryInfo.map((o) => ({\n ...o,\n boundingBox: o.boundingBox ? o.boundingBox.toJSON() : void 0,\n boundingSphere: o.boundingSphere ? o.boundingSphere.toJSON() : void 0\n })), s.instanceInfo = this._instanceInfo.map((o) => ({ ...o })), s.availableInstanceIds = this._availableInstanceIds.slice(), s.availableGeometryIds = this._availableGeometryIds.slice(), s.nextIndexStart = this._nextIndexStart, s.nextVertexStart = this._nextVertexStart, s.geometryCount = this._geometryCount, s.maxInstanceCount = this._maxInstanceCount, s.maxVertexCount = this._maxVertexCount, s.maxIndexCount = this._maxIndexCount, s.geometryInitialized = this._geometryInitialized, s.matricesTexture = this._matricesTexture.toJSON(e), s.indirectTexture = this._indirectTexture.toJSON(e), this._colorsTexture !== null && (s.colorsTexture = this._colorsTexture.toJSON(e)), this.boundingSphere !== null && (s.boundingSphere = this.boundingSphere.toJSON()), this.boundingBox !== null && (s.boundingBox = this.boundingBox.toJSON()));\n function r(o, l) {\n return o[l.uuid] === void 0 && (o[l.uuid] = l.toJSON(e)), l.uuid;\n }\n if (this.isScene)\n this.background && (this.background.isColor ? s.background = this.background.toJSON() : this.background.isTexture && (s.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== !0 && (s.environment = this.environment.toJSON(e).uuid);\n else if (this.isMesh || this.isLine || this.isPoints) {\n s.geometry = r(e.geometries, this.geometry);\n const o = this.geometry.parameters;\n if (o !== void 0 && o.shapes !== void 0) {\n const l = o.shapes;\n if (Array.isArray(l))\n for (let c = 0, h = l.length; c < h; c++) {\n const u = l[c];\n r(e.shapes, u);\n }\n else\n r(e.shapes, l);\n }\n }\n if (this.isSkinnedMesh && (s.bindMode = this.bindMode, s.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (r(e.skeletons, this.skeleton), s.skeleton = this.skeleton.uuid)), this.material !== void 0)\n if (Array.isArray(this.material)) {\n const o = [];\n for (let l = 0, c = this.material.length; l < c; l++)\n o.push(r(e.materials, this.material[l]));\n s.material = o;\n } else\n s.material = r(e.materials, this.material);\n if (this.children.length > 0) {\n s.children = [];\n for (let o = 0; o < this.children.length; o++)\n s.children.push(this.children[o].toJSON(e).object);\n }\n if (this.animations.length > 0) {\n s.animations = [];\n for (let o = 0; o < this.animations.length; o++) {\n const l = this.animations[o];\n s.animations.push(r(e.animations, l));\n }\n }\n if (t) {\n const o = a(e.geometries), l = a(e.materials), c = a(e.textures), h = a(e.images), u = a(e.shapes), d = a(e.skeletons), p = a(e.animations), g = a(e.nodes);\n o.length > 0 && (n.geometries = o), l.length > 0 && (n.materials = l), c.length > 0 && (n.textures = c), h.length > 0 && (n.images = h), u.length > 0 && (n.shapes = u), d.length > 0 && (n.skeletons = d), p.length > 0 && (n.animations = p), g.length > 0 && (n.nodes = g);\n }\n return n.object = s, n;\n function a(o) {\n const l = [];\n for (const c in o) {\n const h = o[c];\n delete h.metadata, l.push(h);\n }\n return l;\n }\n }\n /**\n * Returns a new 3D object with copied values from this instance.\n *\n * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are also cloned.\n * @return {Object3D} A clone of this instance.\n */\n clone(e) {\n return new this.constructor().copy(this, e);\n }\n /**\n * Copies the values of the given 3D object to this instance.\n *\n * @param {Object3D} source - The 3D object to copy.\n * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are cloned.\n * @return {Object3D} A reference to this instance.\n */\n copy(e, t = !0) {\n if (this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.rotation.order = e.rotation.order, this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldAutoUpdate = e.matrixWorldAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.animations = e.animations.slice(), this.userData = JSON.parse(JSON.stringify(e.userData)), t === !0)\n for (let n = 0; n < e.children.length; n++) {\n const s = e.children[n];\n this.add(s.clone());\n }\n return this;\n }\n}\npt.DEFAULT_UP = /* @__PURE__ */ new w(0, 1, 0);\npt.DEFAULT_MATRIX_AUTO_UPDATE = !0;\npt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;\nconst on = /* @__PURE__ */ new w(), In = /* @__PURE__ */ new w(), qr = /* @__PURE__ */ new w(), Un = /* @__PURE__ */ new w(), Ei = /* @__PURE__ */ new w(), wi = /* @__PURE__ */ new w(), Sl = /* @__PURE__ */ new w(), Yr = /* @__PURE__ */ new w(), Kr = /* @__PURE__ */ new w(), Zr = /* @__PURE__ */ new w(), $r = /* @__PURE__ */ new Je(), Jr = /* @__PURE__ */ new Je(), Qr = /* @__PURE__ */ new Je();\nclass un {\n /**\n * Constructs a new triangle.\n *\n * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle.\n * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle.\n * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle.\n */\n constructor(e = new w(), t = new w(), n = new w()) {\n this.a = e, this.b = t, this.c = n;\n }\n /**\n * Computes the normal vector of a triangle.\n *\n * @param {Vector3} a - The first corner of the triangle.\n * @param {Vector3} b - The second corner of the triangle.\n * @param {Vector3} c - The third corner of the triangle.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The triangle's normal.\n */\n static getNormal(e, t, n, s) {\n s.subVectors(n, t), on.subVectors(e, t), s.cross(on);\n const r = s.lengthSq();\n return r > 0 ? s.multiplyScalar(1 / Math.sqrt(r)) : s.set(0, 0, 0);\n }\n /**\n * Computes a barycentric coordinates from the given vector.\n * Returns `null` if the triangle is degenerate.\n *\n * @param {Vector3} point - A point in 3D space.\n * @param {Vector3} a - The first corner of the triangle.\n * @param {Vector3} b - The second corner of the triangle.\n * @param {Vector3} c - The third corner of the triangle.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The barycentric coordinates for the given point\n */\n static getBarycoord(e, t, n, s, r) {\n on.subVectors(s, t), In.subVectors(n, t), qr.subVectors(e, t);\n const a = on.dot(on), o = on.dot(In), l = on.dot(qr), c = In.dot(In), h = In.dot(qr), u = a * c - o * o;\n if (u === 0)\n return r.set(0, 0, 0), null;\n const d = 1 / u, p = (c * l - o * h) * d, g = (a * h - o * l) * d;\n return r.set(1 - p - g, g, p);\n }\n /**\n * Returns `true` if the given point, when projected onto the plane of the\n * triangle, lies within the triangle.\n *\n * @param {Vector3} point - The point in 3D space to test.\n * @param {Vector3} a - The first corner of the triangle.\n * @param {Vector3} b - The second corner of the triangle.\n * @param {Vector3} c - The third corner of the triangle.\n * @return {boolean} Whether the given point, when projected onto the plane of the\n * triangle, lies within the triangle or not.\n */\n static containsPoint(e, t, n, s) {\n return this.getBarycoord(e, t, n, s, Un) === null ? !1 : Un.x >= 0 && Un.y >= 0 && Un.x + Un.y <= 1;\n }\n /**\n * Computes the value barycentrically interpolated for the given point on the\n * triangle. Returns `null` if the triangle is degenerate.\n *\n * @param {Vector3} point - Position of interpolated point.\n * @param {Vector3} p1 - The first corner of the triangle.\n * @param {Vector3} p2 - The second corner of the triangle.\n * @param {Vector3} p3 - The third corner of the triangle.\n * @param {Vector3} v1 - Value to interpolate of first vertex.\n * @param {Vector3} v2 - Value to interpolate of second vertex.\n * @param {Vector3} v3 - Value to interpolate of third vertex.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The interpolated value.\n */\n static getInterpolation(e, t, n, s, r, a, o, l) {\n return this.getBarycoord(e, t, n, s, Un) === null ? (l.x = 0, l.y = 0, \"z\" in l && (l.z = 0), \"w\" in l && (l.w = 0), null) : (l.setScalar(0), l.addScaledVector(r, Un.x), l.addScaledVector(a, Un.y), l.addScaledVector(o, Un.z), l);\n }\n /**\n * Computes the value barycentrically interpolated for the given attribute and indices.\n *\n * @param {BufferAttribute} attr - The attribute to interpolate.\n * @param {number} i1 - Index of first vertex.\n * @param {number} i2 - Index of second vertex.\n * @param {number} i3 - Index of third vertex.\n * @param {Vector3} barycoord - The barycoordinate value to use to interpolate.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The interpolated attribute value.\n */\n static getInterpolatedAttribute(e, t, n, s, r, a) {\n return $r.setScalar(0), Jr.setScalar(0), Qr.setScalar(0), $r.fromBufferAttribute(e, t), Jr.fromBufferAttribute(e, n), Qr.fromBufferAttribute(e, s), a.setScalar(0), a.addScaledVector($r, r.x), a.addScaledVector(Jr, r.y), a.addScaledVector(Qr, r.z), a;\n }\n /**\n * Returns `true` if the triangle is oriented towards the given direction.\n *\n * @param {Vector3} a - The first corner of the triangle.\n * @param {Vector3} b - The second corner of the triangle.\n * @param {Vector3} c - The third corner of the triangle.\n * @param {Vector3} direction - The (normalized) direction vector.\n * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n */\n static isFrontFacing(e, t, n, s) {\n return on.subVectors(n, t), In.subVectors(e, t), on.cross(In).dot(s) < 0;\n }\n /**\n * Sets the triangle's vertices by copying the given values.\n *\n * @param {Vector3} a - The first corner of the triangle.\n * @param {Vector3} b - The second corner of the triangle.\n * @param {Vector3} c - The third corner of the triangle.\n * @return {Triangle} A reference to this triangle.\n */\n set(e, t, n) {\n return this.a.copy(e), this.b.copy(t), this.c.copy(n), this;\n }\n /**\n * Sets the triangle's vertices by copying the given array values.\n *\n * @param {Array} points - An array with 3D points.\n * @param {number} i0 - The array index representing the first corner of the triangle.\n * @param {number} i1 - The array index representing the second corner of the triangle.\n * @param {number} i2 - The array index representing the third corner of the triangle.\n * @return {Triangle} A reference to this triangle.\n */\n setFromPointsAndIndices(e, t, n, s) {\n return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[s]), this;\n }\n /**\n * Sets the triangle's vertices by copying the given attribute values.\n *\n * @param {BufferAttribute} attribute - A buffer attribute with 3D points data.\n * @param {number} i0 - The attribute index representing the first corner of the triangle.\n * @param {number} i1 - The attribute index representing the second corner of the triangle.\n * @param {number} i2 - The attribute index representing the third corner of the triangle.\n * @return {Triangle} A reference to this triangle.\n */\n setFromAttributeAndIndices(e, t, n, s) {\n return this.a.fromBufferAttribute(e, t), this.b.fromBufferAttribute(e, n), this.c.fromBufferAttribute(e, s), this;\n }\n /**\n * Returns a new triangle with copied values from this instance.\n *\n * @return {Triangle} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the values of the given triangle to this instance.\n *\n * @param {Triangle} triangle - The triangle to copy.\n * @return {Triangle} A reference to this triangle.\n */\n copy(e) {\n return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;\n }\n /**\n * Computes the area of the triangle.\n *\n * @return {number} The triangle's area.\n */\n getArea() {\n return on.subVectors(this.c, this.b), In.subVectors(this.a, this.b), on.cross(In).length() * 0.5;\n }\n /**\n * Computes the midpoint of the triangle.\n *\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The triangle's midpoint.\n */\n getMidpoint(e) {\n return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n }\n /**\n * Computes the normal of the triangle.\n *\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The triangle's normal.\n */\n getNormal(e) {\n return un.getNormal(this.a, this.b, this.c, e);\n }\n /**\n * Computes a plane the triangle lies within.\n *\n * @param {Plane} target - The target vector that is used to store the method's result.\n * @return {Plane} The plane the triangle lies within.\n */\n getPlane(e) {\n return e.setFromCoplanarPoints(this.a, this.b, this.c);\n }\n /**\n * Computes a barycentric coordinates from the given vector.\n * Returns `null` if the triangle is degenerate.\n *\n * @param {Vector3} point - A point in 3D space.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The barycentric coordinates for the given point\n */\n getBarycoord(e, t) {\n return un.getBarycoord(e, this.a, this.b, this.c, t);\n }\n /**\n * Computes the value barycentrically interpolated for the given point on the\n * triangle. Returns `null` if the triangle is degenerate.\n *\n * @param {Vector3} point - Position of interpolated point.\n * @param {Vector3} v1 - Value to interpolate of first vertex.\n * @param {Vector3} v2 - Value to interpolate of second vertex.\n * @param {Vector3} v3 - Value to interpolate of third vertex.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The interpolated value.\n */\n getInterpolation(e, t, n, s, r) {\n return un.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);\n }\n /**\n * Returns `true` if the given point, when projected onto the plane of the\n * triangle, lies within the triangle.\n *\n * @param {Vector3} point - The point in 3D space to test.\n * @return {boolean} Whether the given point, when projected onto the plane of the\n * triangle, lies within the triangle or not.\n */\n containsPoint(e) {\n return un.containsPoint(e, this.a, this.b, this.c);\n }\n /**\n * Returns `true` if the triangle is oriented towards the given direction.\n *\n * @param {Vector3} direction - The (normalized) direction vector.\n * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n */\n isFrontFacing(e) {\n return un.isFrontFacing(this.a, this.b, this.c, e);\n }\n /**\n * Returns `true` if this triangle intersects with the given box.\n *\n * @param {Box3} box - The box to intersect.\n * @return {boolean} Whether this triangle intersects with the given box or not.\n */\n intersectsBox(e) {\n return e.intersectsTriangle(this);\n }\n /**\n * Returns the closest point on the triangle to the given point.\n *\n * @param {Vector3} p - The point to compute the closest point for.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The closest point on the triangle.\n */\n closestPointToPoint(e, t) {\n const n = this.a, s = this.b, r = this.c;\n let a, o;\n Ei.subVectors(s, n), wi.subVectors(r, n), Yr.subVectors(e, n);\n const l = Ei.dot(Yr), c = wi.dot(Yr);\n if (l <= 0 && c <= 0)\n return t.copy(n);\n Kr.subVectors(e, s);\n const h = Ei.dot(Kr), u = wi.dot(Kr);\n if (h >= 0 && u <= h)\n return t.copy(s);\n const d = l * u - h * c;\n if (d <= 0 && l >= 0 && h <= 0)\n return a = l / (l - h), t.copy(n).addScaledVector(Ei, a);\n Zr.subVectors(e, r);\n const p = Ei.dot(Zr), g = wi.dot(Zr);\n if (g >= 0 && p <= g)\n return t.copy(r);\n const x = p * c - l * g;\n if (x <= 0 && c >= 0 && g <= 0)\n return o = c / (c - g), t.copy(n).addScaledVector(wi, o);\n const m = h * g - p * u;\n if (m <= 0 && u - h >= 0 && p - g >= 0)\n return Sl.subVectors(r, s), o = (u - h) / (u - h + (p - g)), t.copy(s).addScaledVector(Sl, o);\n const f = 1 / (m + x + d);\n return a = x * f, o = d * f, t.copy(n).addScaledVector(Ei, a).addScaledVector(wi, o);\n }\n /**\n * Returns `true` if this triangle is equal with the given one.\n *\n * @param {Triangle} triangle - The triangle to test for equality.\n * @return {boolean} Whether this triangle is equal with the given one.\n */\n equals(e) {\n return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);\n }\n}\nconst Qc = {\n aliceblue: 15792383,\n antiquewhite: 16444375,\n aqua: 65535,\n aquamarine: 8388564,\n azure: 15794175,\n beige: 16119260,\n bisque: 16770244,\n black: 0,\n blanchedalmond: 16772045,\n blue: 255,\n blueviolet: 9055202,\n brown: 10824234,\n burlywood: 14596231,\n cadetblue: 6266528,\n chartreuse: 8388352,\n chocolate: 13789470,\n coral: 16744272,\n cornflowerblue: 6591981,\n cornsilk: 16775388,\n crimson: 14423100,\n cyan: 65535,\n darkblue: 139,\n darkcyan: 35723,\n darkgoldenrod: 12092939,\n darkgray: 11119017,\n darkgreen: 25600,\n darkgrey: 11119017,\n darkkhaki: 12433259,\n darkmagenta: 9109643,\n darkolivegreen: 5597999,\n darkorange: 16747520,\n darkorchid: 10040012,\n darkred: 9109504,\n darksalmon: 15308410,\n darkseagreen: 9419919,\n darkslateblue: 4734347,\n darkslategray: 3100495,\n darkslategrey: 3100495,\n darkturquoise: 52945,\n darkviolet: 9699539,\n deeppink: 16716947,\n deepskyblue: 49151,\n dimgray: 6908265,\n dimgrey: 6908265,\n dodgerblue: 2003199,\n firebrick: 11674146,\n floralwhite: 16775920,\n forestgreen: 2263842,\n fuchsia: 16711935,\n gainsboro: 14474460,\n ghostwhite: 16316671,\n gold: 16766720,\n goldenrod: 14329120,\n gray: 8421504,\n green: 32768,\n greenyellow: 11403055,\n grey: 8421504,\n honeydew: 15794160,\n hotpink: 16738740,\n indianred: 13458524,\n indigo: 4915330,\n ivory: 16777200,\n khaki: 15787660,\n lavender: 15132410,\n lavenderblush: 16773365,\n lawngreen: 8190976,\n lemonchiffon: 16775885,\n lightblue: 11393254,\n lightcoral: 15761536,\n lightcyan: 14745599,\n lightgoldenrodyellow: 16448210,\n lightgray: 13882323,\n lightgreen: 9498256,\n lightgrey: 13882323,\n lightpink: 16758465,\n lightsalmon: 16752762,\n lightseagreen: 2142890,\n lightskyblue: 8900346,\n lightslategray: 7833753,\n lightslategrey: 7833753,\n lightsteelblue: 11584734,\n lightyellow: 16777184,\n lime: 65280,\n limegreen: 3329330,\n linen: 16445670,\n magenta: 16711935,\n maroon: 8388608,\n mediumaquamarine: 6737322,\n mediumblue: 205,\n mediumorchid: 12211667,\n mediumpurple: 9662683,\n mediumseagreen: 3978097,\n mediumslateblue: 8087790,\n mediumspringgreen: 64154,\n mediumturquoise: 4772300,\n mediumvioletred: 13047173,\n midnightblue: 1644912,\n mintcream: 16121850,\n mistyrose: 16770273,\n moccasin: 16770229,\n navajowhite: 16768685,\n navy: 128,\n oldlace: 16643558,\n olive: 8421376,\n olivedrab: 7048739,\n orange: 16753920,\n orangered: 16729344,\n orchid: 14315734,\n palegoldenrod: 15657130,\n palegreen: 10025880,\n paleturquoise: 11529966,\n palevioletred: 14381203,\n papayawhip: 16773077,\n peachpuff: 16767673,\n peru: 13468991,\n pink: 16761035,\n plum: 14524637,\n powderblue: 11591910,\n purple: 8388736,\n rebeccapurple: 6697881,\n red: 16711680,\n rosybrown: 12357519,\n royalblue: 4286945,\n saddlebrown: 9127187,\n salmon: 16416882,\n sandybrown: 16032864,\n seagreen: 3050327,\n seashell: 16774638,\n sienna: 10506797,\n silver: 12632256,\n skyblue: 8900331,\n slateblue: 6970061,\n slategray: 7372944,\n slategrey: 7372944,\n snow: 16775930,\n springgreen: 65407,\n steelblue: 4620980,\n tan: 13808780,\n teal: 32896,\n thistle: 14204888,\n tomato: 16737095,\n turquoise: 4251856,\n violet: 15631086,\n wheat: 16113331,\n white: 16777215,\n whitesmoke: 16119285,\n yellow: 16776960,\n yellowgreen: 10145074\n}, jn = { h: 0, s: 0, l: 0 }, ks = { h: 0, s: 0, l: 0 };\nfunction ea(i, e, t) {\n return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * 6 * (2 / 3 - t) : i;\n}\nclass Se {\n /**\n * Constructs a new color.\n *\n * Note that standard method of specifying color in three.js is with a hexadecimal triplet,\n * and that method is used throughout the rest of the documentation.\n *\n * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n * @param {number} [g] - The green component.\n * @param {number} [b] - The blue component.\n */\n constructor(e, t, n) {\n return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, t, n);\n }\n /**\n * Sets the colors's components from the given values.\n *\n * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n * @param {number} [g] - The green component.\n * @param {number} [b] - The blue component.\n * @return {Color} A reference to this color.\n */\n set(e, t, n) {\n if (t === void 0 && n === void 0) {\n const s = e;\n s && s.isColor ? this.copy(s) : typeof s == \"number\" ? this.setHex(s) : typeof s == \"string\" && this.setStyle(s);\n } else\n this.setRGB(e, t, n);\n return this;\n }\n /**\n * Sets the colors's components to the given scalar value.\n *\n * @param {number} scalar - The scalar value.\n * @return {Color} A reference to this color.\n */\n setScalar(e) {\n return this.r = e, this.g = e, this.b = e, this;\n }\n /**\n * Sets this color from a hexadecimal value.\n *\n * @param {number} hex - The hexadecimal value.\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {Color} A reference to this color.\n */\n setHex(e, t = Rt) {\n return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, Ye.colorSpaceToWorking(this, t), this;\n }\n /**\n * Sets this color from RGB values.\n *\n * @param {number} r - Red channel value between `0.0` and `1.0`.\n * @param {number} g - Green channel value between `0.0` and `1.0`.\n * @param {number} b - Blue channel value between `0.0` and `1.0`.\n * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n * @return {Color} A reference to this color.\n */\n setRGB(e, t, n, s = Ye.workingColorSpace) {\n return this.r = e, this.g = t, this.b = n, Ye.colorSpaceToWorking(this, s), this;\n }\n /**\n * Sets this color from RGB values.\n *\n * @param {number} h - Hue value between `0.0` and `1.0`.\n * @param {number} s - Saturation value between `0.0` and `1.0`.\n * @param {number} l - Lightness value between `0.0` and `1.0`.\n * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n * @return {Color} A reference to this color.\n */\n setHSL(e, t, n, s = Ye.workingColorSpace) {\n if (e = Do(e, 1), t = He(t, 0, 1), n = He(n, 0, 1), t === 0)\n this.r = this.g = this.b = n;\n else {\n const r = n <= 0.5 ? n * (1 + t) : n + t - n * t, a = 2 * n - r;\n this.r = ea(a, r, e + 1 / 3), this.g = ea(a, r, e), this.b = ea(a, r, e - 1 / 3);\n }\n return Ye.colorSpaceToWorking(this, s), this;\n }\n /**\n * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,\n * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or\n * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) -\n * all 140 color names are supported).\n *\n * @param {string} style - Color as a CSS-style string.\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {Color} A reference to this color.\n */\n setStyle(e, t = Rt) {\n function n(r) {\n r !== void 0 && parseFloat(r) < 1 && Te(\"Color: Alpha component of \" + e + \" will be ignored.\");\n }\n let s;\n if (s = /^(\\w+)\\(([^\\)]*)\\)/.exec(e)) {\n let r;\n const a = s[1], o = s[2];\n switch (a) {\n case \"rgb\":\n case \"rgba\":\n if (r = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))\n return n(r[4]), this.setRGB(\n Math.min(255, parseInt(r[1], 10)) / 255,\n Math.min(255, parseInt(r[2], 10)) / 255,\n Math.min(255, parseInt(r[3], 10)) / 255,\n t\n );\n if (r = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))\n return n(r[4]), this.setRGB(\n Math.min(100, parseInt(r[1], 10)) / 100,\n Math.min(100, parseInt(r[2], 10)) / 100,\n Math.min(100, parseInt(r[3], 10)) / 100,\n t\n );\n break;\n case \"hsl\":\n case \"hsla\":\n if (r = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))\n return n(r[4]), this.setHSL(\n parseFloat(r[1]) / 360,\n parseFloat(r[2]) / 100,\n parseFloat(r[3]) / 100,\n t\n );\n break;\n default:\n Te(\"Color: Unknown color model \" + e);\n }\n } else if (s = /^\\#([A-Fa-f\\d]+)$/.exec(e)) {\n const r = s[1], a = r.length;\n if (a === 3)\n return this.setRGB(\n parseInt(r.charAt(0), 16) / 15,\n parseInt(r.charAt(1), 16) / 15,\n parseInt(r.charAt(2), 16) / 15,\n t\n );\n if (a === 6)\n return this.setHex(parseInt(r, 16), t);\n Te(\"Color: Invalid hex color \" + e);\n } else if (e && e.length > 0)\n return this.setColorName(e, t);\n return this;\n }\n /**\n * Sets this color from a color name. Faster than {@link Color#setStyle} if\n * you don't need the other CSS-style formats.\n *\n * For convenience, the list of names is exposed in `Color.NAMES` as a hash.\n * ```js\n * Color.NAMES.aliceblue // returns 0xF0F8FF\n * ```\n *\n * @param {string} style - The color name.\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {Color} A reference to this color.\n */\n setColorName(e, t = Rt) {\n const n = Qc[e.toLowerCase()];\n return n !== void 0 ? this.setHex(n, t) : Te(\"Color: Unknown color \" + e), this;\n }\n /**\n * Returns a new color with copied values from this instance.\n *\n * @return {Color} A clone of this instance.\n */\n clone() {\n return new this.constructor(this.r, this.g, this.b);\n }\n /**\n * Copies the values of the given color to this instance.\n *\n * @param {Color} color - The color to copy.\n * @return {Color} A reference to this color.\n */\n copy(e) {\n return this.r = e.r, this.g = e.g, this.b = e.b, this;\n }\n /**\n * Copies the given color into this color, and then converts this color from\n * `SRGBColorSpace` to `LinearSRGBColorSpace`.\n *\n * @param {Color} color - The color to copy/convert.\n * @return {Color} A reference to this color.\n */\n copySRGBToLinear(e) {\n return this.r = Vn(e.r), this.g = Vn(e.g), this.b = Vn(e.b), this;\n }\n /**\n * Copies the given color into this color, and then converts this color from\n * `LinearSRGBColorSpace` to `SRGBColorSpace`.\n *\n * @param {Color} color - The color to copy/convert.\n * @return {Color} A reference to this color.\n */\n copyLinearToSRGB(e) {\n return this.r = Oi(e.r), this.g = Oi(e.g), this.b = Oi(e.b), this;\n }\n /**\n * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.\n *\n * @return {Color} A reference to this color.\n */\n convertSRGBToLinear() {\n return this.copySRGBToLinear(this), this;\n }\n /**\n * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.\n *\n * @return {Color} A reference to this color.\n */\n convertLinearToSRGB() {\n return this.copyLinearToSRGB(this), this;\n }\n /**\n * Returns the hexadecimal value of this color.\n *\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {number} The hexadecimal value.\n */\n getHex(e = Rt) {\n return Ye.workingToColorSpace(It.copy(this), e), Math.round(He(It.r * 255, 0, 255)) * 65536 + Math.round(He(It.g * 255, 0, 255)) * 256 + Math.round(He(It.b * 255, 0, 255));\n }\n /**\n * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').\n *\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {string} The hexadecimal value as a string.\n */\n getHexString(e = Rt) {\n return (\"000000\" + this.getHex(e).toString(16)).slice(-6);\n }\n /**\n * Converts the colors RGB values into the HSL format and stores them into the\n * given target object.\n *\n * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result.\n * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n * @return {{h:number,s:number,l:number}} The HSL representation of this color.\n */\n getHSL(e, t = Ye.workingColorSpace) {\n Ye.workingToColorSpace(It.copy(this), t);\n const n = It.r, s = It.g, r = It.b, a = Math.max(n, s, r), o = Math.min(n, s, r);\n let l, c;\n const h = (o + a) / 2;\n if (o === a)\n l = 0, c = 0;\n else {\n const u = a - o;\n switch (c = h <= 0.5 ? u / (a + o) : u / (2 - a - o), a) {\n case n:\n l = (s - r) / u + (s < r ? 6 : 0);\n break;\n case s:\n l = (r - n) / u + 2;\n break;\n case r:\n l = (n - s) / u + 4;\n break;\n }\n l /= 6;\n }\n return e.h = l, e.s = c, e.l = h, e;\n }\n /**\n * Returns the RGB values of this color and stores them into the given target object.\n *\n * @param {Color} target - The target color that is used to store the method's result.\n * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n * @return {Color} The RGB representation of this color.\n */\n getRGB(e, t = Ye.workingColorSpace) {\n return Ye.workingToColorSpace(It.copy(this), t), e.r = It.r, e.g = It.g, e.b = It.b, e;\n }\n /**\n * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.\n *\n * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n * @return {string} The CSS representation of this color.\n */\n getStyle(e = Rt) {\n Ye.workingToColorSpace(It.copy(this), e);\n const t = It.r, n = It.g, s = It.b;\n return e !== Rt ? `color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})` : `rgb(${Math.round(t * 255)},${Math.round(n * 255)},${Math.round(s * 255)})`;\n }\n /**\n * Adds the given HSL values to this color's values.\n * Internally, this converts the color's RGB values to HSL, adds HSL\n * and then converts the color back to RGB.\n *\n * @param {number} h - Hue value between `0.0` and `1.0`.\n * @param {number} s - Saturation value between `0.0` and `1.0`.\n * @param {number} l - Lightness value between `0.0` and `1.0`.\n * @return {Color} A reference to this color.\n */\n offsetHSL(e, t, n) {\n return this.getHSL(jn), this.setHSL(jn.h + e, jn.s + t, jn.l + n);\n }\n /**\n * Adds the RGB values of the given color to the RGB values of this color.\n *\n * @param {Color} color - The color to add.\n * @return {Color} A reference to this color.\n */\n add(e) {\n return this.r += e.r, this.g += e.g, this.b += e.b, this;\n }\n /**\n * Adds the RGB values of the given colors and stores the result in this instance.\n *\n * @param {Color} color1 - The first color.\n * @param {Color} color2 - The second color.\n * @return {Color} A reference to this color.\n */\n addColors(e, t) {\n return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this;\n }\n /**\n * Adds the given scalar value to the RGB values of this color.\n *\n * @param {number} s - The scalar to add.\n * @return {Color} A reference to this color.\n */\n addScalar(e) {\n return this.r += e, this.g += e, this.b += e, this;\n }\n /**\n * Subtracts the RGB values of the given color from the RGB values of this color.\n *\n * @param {Color} color - The color to subtract.\n * @return {Color} A reference to this color.\n */\n sub(e) {\n return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this;\n }\n /**\n * Multiplies the RGB values of the given color with the RGB values of this color.\n *\n * @param {Color} color - The color to multiply.\n * @return {Color} A reference to this color.\n */\n multiply(e) {\n return this.r *= e.r, this.g *= e.g, this.b *= e.b, this;\n }\n /**\n * Multiplies the given scalar value with the RGB values of this color.\n *\n * @param {number} s - The scalar to multiply.\n * @return {Color} A reference to this color.\n */\n multiplyScalar(e) {\n return this.r *= e, this.g *= e, this.b *= e, this;\n }\n /**\n * Linearly interpolates this color's RGB values toward the RGB values of the\n * given color. The alpha argument can be thought of as the ratio between\n * the two colors, where `0.0` is this color and `1.0` is the first argument.\n *\n * @param {Color} color - The color to converge on.\n * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n * @return {Color} A reference to this color.\n */\n lerp(e, t) {\n return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this;\n }\n /**\n * Linearly interpolates between the given colors and stores the result in this instance.\n * The alpha argument can be thought of as the ratio between the two colors, where `0.0`\n * is the first and `1.0` is the second color.\n *\n * @param {Color} color1 - The first color.\n * @param {Color} color2 - The second color.\n * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n * @return {Color} A reference to this color.\n */\n lerpColors(e, t, n) {\n return this.r = e.r + (t.r - e.r) * n, this.g = e.g + (t.g - e.g) * n, this.b = e.b + (t.b - e.b) * n, this;\n }\n /**\n * Linearly interpolates this color's HSL values toward the HSL values of the\n * given color. It differs from {@link Color#lerp} by not interpolating straight\n * from one color to the other, but instead going through all the hues in between\n * those two colors. The alpha argument can be thought of as the ratio between\n * the two colors, where 0.0 is this color and 1.0 is the first argument.\n *\n * @param {Color} color - The color to converge on.\n * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n * @return {Color} A reference to this color.\n */\n lerpHSL(e, t) {\n this.getHSL(jn), e.getHSL(ks);\n const n = vs(jn.h, ks.h, t), s = vs(jn.s, ks.s, t), r = vs(jn.l, ks.l, t);\n return this.setHSL(n, s, r), this;\n }\n /**\n * Sets the color's RGB components from the given 3D vector.\n *\n * @param {Vector3} v - The vector to set.\n * @return {Color} A reference to this color.\n */\n setFromVector3(e) {\n return this.r = e.x, this.g = e.y, this.b = e.z, this;\n }\n /**\n * Transforms this color with the given 3x3 matrix.\n *\n * @param {Matrix3} m - The matrix.\n * @return {Color} A reference to this color.\n */\n applyMatrix3(e) {\n const t = this.r, n = this.g, s = this.b, r = e.elements;\n return this.r = r[0] * t + r[3] * n + r[6] * s, this.g = r[1] * t + r[4] * n + r[7] * s, this.b = r[2] * t + r[5] * n + r[8] * s, this;\n }\n /**\n * Returns `true` if this color is equal with the given one.\n *\n * @param {Color} c - The color to test for equality.\n * @return {boolean} Whether this bounding color is equal with the given one.\n */\n equals(e) {\n return e.r === this.r && e.g === this.g && e.b === this.b;\n }\n /**\n * Sets this color's RGB components from the given array.\n *\n * @param {Array} array - An array holding the RGB values.\n * @param {number} [offset=0] - The offset into the array.\n * @return {Color} A reference to this color.\n */\n fromArray(e, t = 0) {\n return this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this;\n }\n /**\n * Writes the RGB components of this color to the given array. If no array is provided,\n * the method returns a new instance.\n *\n * @param {Array} [array=[]] - The target array holding the color components.\n * @param {number} [offset=0] - Index of the first element in the array.\n * @return {Array} The color components.\n */\n toArray(e = [], t = 0) {\n return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e;\n }\n /**\n * Sets the components of this color from the given buffer attribute.\n *\n * @param {BufferAttribute} attribute - The buffer attribute holding color data.\n * @param {number} index - The index into the attribute.\n * @return {Color} A reference to this color.\n */\n fromBufferAttribute(e, t) {\n return this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), this;\n }\n /**\n * This methods defines the serialization result of this class. Returns the color\n * as a hexadecimal value.\n *\n * @return {number} The hexadecimal value.\n */\n toJSON() {\n return this.getHex();\n }\n *[Symbol.iterator]() {\n yield this.r, yield this.g, yield this.b;\n }\n}\nconst It = /* @__PURE__ */ new Se();\nSe.NAMES = Qc;\nlet Hu = 0;\nclass tn extends mi {\n /**\n * Constructs a new material.\n */\n constructor() {\n super(), this.isMaterial = !0, Object.defineProperty(this, \"id\", { value: Hu++ }), this.uuid = fn(), this.name = \"\", this.type = \"Material\", this.blending = Fi, this.side = En, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = ba, this.blendDst = ya, this.blendEquation = cn, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Se(0, 0, 0), this.blendAlpha = 0, this.depthFunc = Vi, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = co, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = xi, this.stencilZFail = xi, this.stencilZPass = xi, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;\n }\n /**\n * Sets the alpha value to be used when running an alpha test. The material\n * will not be rendered if the opacity is lower than this value.\n *\n * @type {number}\n * @readonly\n * @default 0\n */\n get alphaTest() {\n return this._alphaTest;\n }\n set alphaTest(e) {\n this._alphaTest > 0 != e > 0 && this.version++, this._alphaTest = e;\n }\n /**\n * An optional callback that is executed immediately before the material is used to render a 3D object.\n *\n * This method can only be used when rendering with {@link WebGLRenderer}.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Scene} scene - The scene.\n * @param {Camera} camera - The camera that is used to render the scene.\n * @param {BufferGeometry} geometry - The 3D object's geometry.\n * @param {Object3D} object - The 3D object.\n * @param {Object} group - The geometry group data.\n */\n onBeforeRender() {\n }\n /**\n * An optional callback that is executed immediately before the shader\n * program is compiled. This function is called with the shader source code\n * as a parameter. Useful for the modification of built-in materials.\n *\n * This method can only be used when rendering with {@link WebGLRenderer}. The\n * recommended approach when customizing materials is to use `WebGPURenderer` with the new\n * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).\n *\n * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.\n * @param {WebGLRenderer} renderer - A reference to the renderer.\n */\n onBeforeCompile() {\n }\n /**\n * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify\n * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached\n * shader or recompile the shader for this material as needed.\n *\n * This method can only be used when rendering with {@link WebGLRenderer}.\n *\n * @return {string} The custom program cache key.\n */\n customProgramCacheKey() {\n return this.onBeforeCompile.toString();\n }\n /**\n * This method can be used to set default values from parameter objects.\n * It is a generic implementation so it can be used with different types\n * of materials.\n *\n * @param {Object} [values] - The material values to set.\n */\n setValues(e) {\n if (e !== void 0)\n for (const t in e) {\n const n = e[t];\n if (n === void 0) {\n Te(`Material: parameter '${t}' has value of undefined.`);\n continue;\n }\n const s = this[t];\n if (s === void 0) {\n Te(`Material: '${t}' is not a property of THREE.${this.type}.`);\n continue;\n }\n s && s.isColor ? s.set(n) : s && s.isVector3 && n && n.isVector3 ? s.copy(n) : this[t] = n;\n }\n }\n /**\n * Serializes the material into JSON.\n *\n * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized material.\n * @see {@link ObjectLoader#parse}\n */\n toJSON(e) {\n const t = e === void 0 || typeof e == \"string\";\n t && (e = {\n textures: {},\n images: {}\n });\n const n = {\n metadata: {\n version: 4.7,\n type: \"Material\",\n generator: \"Material.toJSON\"\n }\n };\n n.uuid = this.uuid, n.type = this.type, this.name !== \"\" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== Fi && (n.blending = this.blending), this.side !== En && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== ba && (n.blendSrc = this.blendSrc), this.blendDst !== ya && (n.blendDst = this.blendDst), this.blendEquation !== cn && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== Vi && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== co && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== xi && (n.stencilFail = this.stencilFail), this.stencilZFail !== xi && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== xi && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== \"round\" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== \"round\" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData);\n function s(r) {\n const a = [];\n for (const o in r) {\n const l = r[o];\n delete l.metadata, a.push(l);\n }\n return a;\n }\n if (t) {\n const r = s(e.textures), a = s(e.images);\n r.length > 0 && (n.textures = r), a.length > 0 && (n.images = a);\n }\n return n;\n }\n /**\n * Returns a new material with copied values from this instance.\n *\n * @return {Material} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the values of the given material to this instance.\n *\n * @param {Material} source - The material to copy.\n * @return {Material} A reference to this instance.\n */\n copy(e) {\n this.name = e.name, this.blending = e.blending, this.side = e.side, this.vertexColors = e.vertexColors, this.opacity = e.opacity, this.transparent = e.transparent, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.blendColor.copy(e.blendColor), this.blendAlpha = e.blendAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.stencilWriteMask = e.stencilWriteMask, this.stencilFunc = e.stencilFunc, this.stencilRef = e.stencilRef, this.stencilFuncMask = e.stencilFuncMask, this.stencilFail = e.stencilFail, this.stencilZFail = e.stencilZFail, this.stencilZPass = e.stencilZPass, this.stencilWrite = e.stencilWrite;\n const t = e.clippingPlanes;\n let n = null;\n if (t !== null) {\n const s = t.length;\n n = new Array(s);\n for (let r = 0; r !== s; ++r)\n n[r] = t[r].clone();\n }\n return this.clippingPlanes = n, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaHash = e.alphaHash, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.forceSinglePass = e.forceSinglePass, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n *\n * @fires Material#dispose\n */\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n /**\n * Setting this property to `true` indicates the engine the material\n * needs to be recompiled.\n *\n * @type {boolean}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n e === !0 && this.version++;\n }\n}\nclass Bt extends tn {\n /**\n * Constructs a new mesh basic material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshBasicMaterial = !0, this.type = \"MeshBasicMaterial\", this.color = new Se(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xn(), this.combine = So, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.fog = !0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.fog = e.fog, this;\n }\n}\nconst Bn = /* @__PURE__ */ Wu();\nfunction Wu() {\n const i = new ArrayBuffer(4), e = new Float32Array(i), t = new Uint32Array(i), n = new Uint32Array(512), s = new Uint32Array(512);\n for (let l = 0; l < 256; ++l) {\n const c = l - 127;\n c < -27 ? (n[l] = 0, n[l | 256] = 32768, s[l] = 24, s[l | 256] = 24) : c < -14 ? (n[l] = 1024 >> -c - 14, n[l | 256] = 1024 >> -c - 14 | 32768, s[l] = -c - 1, s[l | 256] = -c - 1) : c <= 15 ? (n[l] = c + 15 << 10, n[l | 256] = c + 15 << 10 | 32768, s[l] = 13, s[l | 256] = 13) : c < 128 ? (n[l] = 31744, n[l | 256] = 64512, s[l] = 24, s[l | 256] = 24) : (n[l] = 31744, n[l | 256] = 64512, s[l] = 13, s[l | 256] = 13);\n }\n const r = new Uint32Array(2048), a = new Uint32Array(64), o = new Uint32Array(64);\n for (let l = 1; l < 1024; ++l) {\n let c = l << 13, h = 0;\n for (; (c & 8388608) === 0; )\n c <<= 1, h -= 8388608;\n c &= -8388609, h += 947912704, r[l] = c | h;\n }\n for (let l = 1024; l < 2048; ++l)\n r[l] = 939524096 + (l - 1024 << 13);\n for (let l = 1; l < 31; ++l)\n a[l] = l << 23;\n a[31] = 1199570944, a[32] = 2147483648;\n for (let l = 33; l < 63; ++l)\n a[l] = 2147483648 + (l - 32 << 23);\n a[63] = 3347054592;\n for (let l = 1; l < 64; ++l)\n l !== 32 && (o[l] = 1024);\n return {\n floatView: e,\n uint32View: t,\n baseTable: n,\n shiftTable: s,\n mantissaTable: r,\n exponentTable: a,\n offsetTable: o\n };\n}\nfunction Xu(i) {\n Math.abs(i) > 65504 && Te(\"DataUtils.toHalfFloat(): Value out of range.\"), i = He(i, -65504, 65504), Bn.floatView[0] = i;\n const e = Bn.uint32View[0], t = e >> 23 & 511;\n return Bn.baseTable[t] + ((e & 8388607) >> Bn.shiftTable[t]);\n}\nfunction ju(i) {\n const e = i >> 10;\n return Bn.uint32View[0] = Bn.mantissaTable[Bn.offsetTable[e] + (i & 1023)] + Bn.exponentTable[e], Bn.floatView[0];\n}\nclass Vs {\n /**\n * Returns a half precision floating point value (FP16) from the given single\n * precision floating point value (FP32).\n *\n * @param {number} val - A single precision floating point value.\n * @return {number} The FP16 value.\n */\n static toHalfFloat(e) {\n return Xu(e);\n }\n /**\n * Returns a single precision floating point value (FP32) from the given half\n * precision floating point value (FP16).\n *\n * @param {number} val - A half precision floating point value.\n * @return {number} The FP32 value.\n */\n static fromHalfFloat(e) {\n return ju(e);\n }\n}\nconst vt = /* @__PURE__ */ new w(), Gs = /* @__PURE__ */ new le();\nlet qu = 0;\nclass kt {\n /**\n * Constructs a new buffer attribute.\n *\n * @param {TypedArray} array - The array holding the attribute data.\n * @param {number} itemSize - The item size.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n */\n constructor(e, t, n = !1) {\n if (Array.isArray(e))\n throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\n this.isBufferAttribute = !0, Object.defineProperty(this, \"id\", { value: qu++ }), this.name = \"\", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = ho, this.updateRanges = [], this.gpuType = Xt, this.version = 0;\n }\n /**\n * A callback function that is executed after the renderer has transferred the attribute\n * array data to the GPU.\n */\n onUploadCallback() {\n }\n /**\n * Flag to indicate that this attribute has changed and should be re-sent to\n * the GPU. Set this to `true` when you modify the value of the array.\n *\n * @type {number}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n e === !0 && this.version++;\n }\n /**\n * Sets the usage of this buffer attribute.\n *\n * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n * @return {BufferAttribute} A reference to this buffer attribute.\n */\n setUsage(e) {\n return this.usage = e, this;\n }\n /**\n * Adds a range of data in the data array to be updated on the GPU.\n *\n * @param {number} start - Position at which to start update.\n * @param {number} count - The number of components to update.\n */\n addUpdateRange(e, t) {\n this.updateRanges.push({ start: e, count: t });\n }\n /**\n * Clears the update ranges.\n */\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n /**\n * Copies the values of the given buffer attribute to this instance.\n *\n * @param {BufferAttribute} source - The buffer attribute to copy.\n * @return {BufferAttribute} A reference to this instance.\n */\n copy(e) {\n return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.usage = e.usage, this.gpuType = e.gpuType, this;\n }\n /**\n * Copies a vector from the given buffer attribute to this one. The start\n * and destination position in the attribute buffers are represented by the\n * given indices.\n *\n * @param {number} index1 - The destination index into this buffer attribute.\n * @param {BufferAttribute} attribute - The buffer attribute to copy from.\n * @param {number} index2 - The source index into the given buffer attribute.\n * @return {BufferAttribute} A reference to this instance.\n */\n copyAt(e, t, n) {\n e *= this.itemSize, n *= t.itemSize;\n for (let s = 0, r = this.itemSize; s < r; s++)\n this.array[e + s] = t.array[n + s];\n return this;\n }\n /**\n * Copies the given array data into this buffer attribute.\n *\n * @param {(TypedArray|Array)} array - The array to copy.\n * @return {BufferAttribute} A reference to this instance.\n */\n copyArray(e) {\n return this.array.set(e), this;\n }\n /**\n * Applies the given 3x3 matrix to the given attribute. Works with\n * item size `2` and `3`.\n *\n * @param {Matrix3} m - The matrix to apply.\n * @return {BufferAttribute} A reference to this instance.\n */\n applyMatrix3(e) {\n if (this.itemSize === 2)\n for (let t = 0, n = this.count; t < n; t++)\n Gs.fromBufferAttribute(this, t), Gs.applyMatrix3(e), this.setXY(t, Gs.x, Gs.y);\n else if (this.itemSize === 3)\n for (let t = 0, n = this.count; t < n; t++)\n vt.fromBufferAttribute(this, t), vt.applyMatrix3(e), this.setXYZ(t, vt.x, vt.y, vt.z);\n return this;\n }\n /**\n * Applies the given 4x4 matrix to the given attribute. Only works with\n * item size `3`.\n *\n * @param {Matrix4} m - The matrix to apply.\n * @return {BufferAttribute} A reference to this instance.\n */\n applyMatrix4(e) {\n for (let t = 0, n = this.count; t < n; t++)\n vt.fromBufferAttribute(this, t), vt.applyMatrix4(e), this.setXYZ(t, vt.x, vt.y, vt.z);\n return this;\n }\n /**\n * Applies the given 3x3 normal matrix to the given attribute. Only works with\n * item size `3`.\n *\n * @param {Matrix3} m - The normal matrix to apply.\n * @return {BufferAttribute} A reference to this instance.\n */\n applyNormalMatrix(e) {\n for (let t = 0, n = this.count; t < n; t++)\n vt.fromBufferAttribute(this, t), vt.applyNormalMatrix(e), this.setXYZ(t, vt.x, vt.y, vt.z);\n return this;\n }\n /**\n * Applies the given 4x4 matrix to the given attribute. Only works with\n * item size `3` and with direction vectors.\n *\n * @param {Matrix4} m - The matrix to apply.\n * @return {BufferAttribute} A reference to this instance.\n */\n transformDirection(e) {\n for (let t = 0, n = this.count; t < n; t++)\n vt.fromBufferAttribute(this, t), vt.transformDirection(e), this.setXYZ(t, vt.x, vt.y, vt.z);\n return this;\n }\n /**\n * Sets the given array data in the buffer attribute.\n *\n * @param {(TypedArray|Array)} value - The array data to set.\n * @param {number} [offset=0] - The offset in this buffer attribute's array.\n * @return {BufferAttribute} A reference to this instance.\n */\n set(e, t = 0) {\n return this.array.set(e, t), this;\n }\n /**\n * Returns the given component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} component - The component index.\n * @return {number} The returned value.\n */\n getComponent(e, t) {\n let n = this.array[e * this.itemSize + t];\n return this.normalized && (n = hn(n, this.array)), n;\n }\n /**\n * Sets the given value to the given component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} component - The component index.\n * @param {number} value - The value to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setComponent(e, t, n) {\n return this.normalized && (n = tt(n, this.array)), this.array[e * this.itemSize + t] = n, this;\n }\n /**\n * Returns the x component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The x component.\n */\n getX(e) {\n let t = this.array[e * this.itemSize];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Sets the x component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setX(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.array[e * this.itemSize] = t, this;\n }\n /**\n * Returns the y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The y component.\n */\n getY(e) {\n let t = this.array[e * this.itemSize + 1];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Sets the y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} y - The value to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setY(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.array[e * this.itemSize + 1] = t, this;\n }\n /**\n * Returns the z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The z component.\n */\n getZ(e) {\n let t = this.array[e * this.itemSize + 2];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Sets the z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} z - The value to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setZ(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.array[e * this.itemSize + 2] = t, this;\n }\n /**\n * Returns the w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The w component.\n */\n getW(e) {\n let t = this.array[e * this.itemSize + 3];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Sets the w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} w - The value to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setW(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.array[e * this.itemSize + 3] = t, this;\n }\n /**\n * Sets the x and y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setXY(e, t, n) {\n return e *= this.itemSize, this.normalized && (t = tt(t, this.array), n = tt(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;\n }\n /**\n * Sets the x, y and z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @param {number} z - The value for the z component to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setXYZ(e, t, n, s) {\n return e *= this.itemSize, this.normalized && (t = tt(t, this.array), n = tt(n, this.array), s = tt(s, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = s, this;\n }\n /**\n * Sets the x, y, z and w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @param {number} z - The value for the z component to set.\n * @param {number} w - The value for the w component to set.\n * @return {BufferAttribute} A reference to this instance.\n */\n setXYZW(e, t, n, s, r) {\n return e *= this.itemSize, this.normalized && (t = tt(t, this.array), n = tt(n, this.array), s = tt(s, this.array), r = tt(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = s, this.array[e + 3] = r, this;\n }\n /**\n * Sets the given callback function that is executed after the Renderer has transferred\n * the attribute array data to the GPU. Can be used to perform clean-up operations after\n * the upload when attribute data are not needed anymore on the CPU side.\n *\n * @param {Function} callback - The `onUpload()` callback.\n * @return {BufferAttribute} A reference to this instance.\n */\n onUpload(e) {\n return this.onUploadCallback = e, this;\n }\n /**\n * Returns a new buffer attribute with copied values from this instance.\n *\n * @return {BufferAttribute} A clone of this instance.\n */\n clone() {\n return new this.constructor(this.array, this.itemSize).copy(this);\n }\n /**\n * Serializes the buffer attribute into JSON.\n *\n * @return {Object} A JSON object representing the serialized buffer attribute.\n */\n toJSON() {\n const e = {\n itemSize: this.itemSize,\n type: this.array.constructor.name,\n array: Array.from(this.array),\n normalized: this.normalized\n };\n return this.name !== \"\" && (e.name = this.name), this.usage !== ho && (e.usage = this.usage), e;\n }\n}\nclass eh extends kt {\n /**\n * Constructs a new buffer attribute.\n *\n * @param {(Array|Uint16Array)} array - The array holding the attribute data.\n * @param {number} itemSize - The item size.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n */\n constructor(e, t, n) {\n super(new Uint16Array(e), t, n);\n }\n}\nclass th extends kt {\n /**\n * Constructs a new buffer attribute.\n *\n * @param {(Array|Uint32Array)} array - The array holding the attribute data.\n * @param {number} itemSize - The item size.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n */\n constructor(e, t, n) {\n super(new Uint32Array(e), t, n);\n }\n}\nclass pn extends kt {\n /**\n * Constructs a new buffer attribute.\n *\n * @param {(Array|Float32Array)} array - The array holding the attribute data.\n * @param {number} itemSize - The item size.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n */\n constructor(e, t, n) {\n super(new Float32Array(e), t, n);\n }\n}\nlet Yu = 0;\nconst Jt = /* @__PURE__ */ new Ne(), ta = /* @__PURE__ */ new pt(), Ai = /* @__PURE__ */ new w(), Kt = /* @__PURE__ */ new Pt(), os = /* @__PURE__ */ new Pt(), At = /* @__PURE__ */ new w();\nclass nn extends mi {\n /**\n * Constructs a new geometry.\n */\n constructor() {\n super(), this.isBufferGeometry = !0, Object.defineProperty(this, \"id\", { value: Yu++ }), this.uuid = fn(), this.name = \"\", this.type = \"BufferGeometry\", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};\n }\n /**\n * Returns the index of this geometry.\n *\n * @return {?BufferAttribute} The index. Returns `null` if no index is defined.\n */\n getIndex() {\n return this.index;\n }\n /**\n * Sets the given index to this geometry.\n *\n * @param {Array|BufferAttribute} index - The index to set.\n * @return {BufferGeometry} A reference to this instance.\n */\n setIndex(e) {\n return Array.isArray(e) ? this.index = new ($c(e) ? th : eh)(e, 1) : this.index = e, this;\n }\n /**\n * Sets the given indirect attribute to this geometry.\n *\n * @param {BufferAttribute} indirect - The attribute holding indirect draw calls.\n * @return {BufferGeometry} A reference to this instance.\n */\n setIndirect(e) {\n return this.indirect = e, this;\n }\n /**\n * Returns the indirect attribute of this geometry.\n *\n * @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined.\n */\n getIndirect() {\n return this.indirect;\n }\n /**\n * Returns the buffer attribute for the given name.\n *\n * @param {string} name - The attribute name.\n * @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute.\n * Returns `undefined` if not attribute has been found.\n */\n getAttribute(e) {\n return this.attributes[e];\n }\n /**\n * Sets the given attribute for the given name.\n *\n * @param {string} name - The attribute name.\n * @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set.\n * @return {BufferGeometry} A reference to this instance.\n */\n setAttribute(e, t) {\n return this.attributes[e] = t, this;\n }\n /**\n * Deletes the attribute for the given name.\n *\n * @param {string} name - The attribute name to delete.\n * @return {BufferGeometry} A reference to this instance.\n */\n deleteAttribute(e) {\n return delete this.attributes[e], this;\n }\n /**\n * Returns `true` if this geometry has an attribute for the given name.\n *\n * @param {string} name - The attribute name.\n * @return {boolean} Whether this geometry has an attribute for the given name or not.\n */\n hasAttribute(e) {\n return this.attributes[e] !== void 0;\n }\n /**\n * Adds a group to this geometry.\n *\n * @param {number} start - The first element in this draw call. That is the first\n * vertex for non-indexed geometry, otherwise the first triangle index.\n * @param {number} count - Specifies how many vertices (or indices) are part of this group.\n * @param {number} [materialIndex=0] - The material array index to use.\n */\n addGroup(e, t, n = 0) {\n this.groups.push({\n start: e,\n count: t,\n materialIndex: n\n });\n }\n /**\n * Clears all groups.\n */\n clearGroups() {\n this.groups = [];\n }\n /**\n * Sets the draw range for this geometry.\n *\n * @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index.\n * @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render.\n * For indexed BufferGeometry, `count` is the number of indices to render.\n */\n setDrawRange(e, t) {\n this.drawRange.start = e, this.drawRange.count = t;\n }\n /**\n * Applies the given 4x4 transformation matrix to the geometry.\n *\n * @param {Matrix4} matrix - The matrix to apply.\n * @return {BufferGeometry} A reference to this instance.\n */\n applyMatrix4(e) {\n const t = this.attributes.position;\n t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);\n const n = this.attributes.normal;\n if (n !== void 0) {\n const r = new ze().getNormalMatrix(e);\n n.applyNormalMatrix(r), n.needsUpdate = !0;\n }\n const s = this.attributes.tangent;\n return s !== void 0 && (s.transformDirection(e), s.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;\n }\n /**\n * Applies the rotation represented by the Quaternion to the geometry.\n *\n * @param {Quaternion} q - The Quaternion to apply.\n * @return {BufferGeometry} A reference to this instance.\n */\n applyQuaternion(e) {\n return Jt.makeRotationFromQuaternion(e), this.applyMatrix4(Jt), this;\n }\n /**\n * Rotates the geometry about the X axis. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n * real-time mesh rotation.\n *\n * @param {number} angle - The angle in radians.\n * @return {BufferGeometry} A reference to this instance.\n */\n rotateX(e) {\n return Jt.makeRotationX(e), this.applyMatrix4(Jt), this;\n }\n /**\n * Rotates the geometry about the Y axis. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n * real-time mesh rotation.\n *\n * @param {number} angle - The angle in radians.\n * @return {BufferGeometry} A reference to this instance.\n */\n rotateY(e) {\n return Jt.makeRotationY(e), this.applyMatrix4(Jt), this;\n }\n /**\n * Rotates the geometry about the Z axis. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n * real-time mesh rotation.\n *\n * @param {number} angle - The angle in radians.\n * @return {BufferGeometry} A reference to this instance.\n */\n rotateZ(e) {\n return Jt.makeRotationZ(e), this.applyMatrix4(Jt), this;\n }\n /**\n * Translates the geometry. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#position} for typical\n * real-time mesh rotation.\n *\n * @param {number} x - The x offset.\n * @param {number} y - The y offset.\n * @param {number} z - The z offset.\n * @return {BufferGeometry} A reference to this instance.\n */\n translate(e, t, n) {\n return Jt.makeTranslation(e, t, n), this.applyMatrix4(Jt), this;\n }\n /**\n * Scales the geometry. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#scale} for typical\n * real-time mesh rotation.\n *\n * @param {number} x - The x scale.\n * @param {number} y - The y scale.\n * @param {number} z - The z scale.\n * @return {BufferGeometry} A reference to this instance.\n */\n scale(e, t, n) {\n return Jt.makeScale(e, t, n), this.applyMatrix4(Jt), this;\n }\n /**\n * Rotates the geometry to face a point in 3D space. This is typically done as a one time\n * operation, and not during a loop. Use {@link Object3D#lookAt} for typical\n * real-time mesh rotation.\n *\n * @param {Vector3} vector - The target point.\n * @return {BufferGeometry} A reference to this instance.\n */\n lookAt(e) {\n return ta.lookAt(e), ta.updateMatrix(), this.applyMatrix4(ta.matrix), this;\n }\n /**\n * Center the geometry based on its bounding box.\n *\n * @return {BufferGeometry} A reference to this instance.\n */\n center() {\n return this.computeBoundingBox(), this.boundingBox.getCenter(Ai).negate(), this.translate(Ai.x, Ai.y, Ai.z), this;\n }\n /**\n * Defines a geometry by creating a `position` attribute based on the given array of points. The array\n * can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is\n * set to `0`.\n *\n * If the method is used with an existing `position` attribute, the vertex data are overwritten with the\n * data from the array. The length of the array must match the vertex count.\n *\n * @param {Array|Array} points - The points.\n * @return {BufferGeometry} A reference to this instance.\n */\n setFromPoints(e) {\n const t = this.getAttribute(\"position\");\n if (t === void 0) {\n const n = [];\n for (let s = 0, r = e.length; s < r; s++) {\n const a = e[s];\n n.push(a.x, a.y, a.z || 0);\n }\n this.setAttribute(\"position\", new pn(n, 3));\n } else {\n const n = Math.min(e.length, t.count);\n for (let s = 0; s < n; s++) {\n const r = e[s];\n t.setXYZ(s, r.x, r.y, r.z || 0);\n }\n e.length > t.count && Te(\"BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.\"), t.needsUpdate = !0;\n }\n return this;\n }\n /**\n * Computes the bounding box of the geometry, and updates the `boundingBox` member.\n * The bounding box is not computed by the engine; it must be computed by your app.\n * You may need to recompute the bounding box if the geometry vertices are modified.\n */\n computeBoundingBox() {\n this.boundingBox === null && (this.boundingBox = new Pt());\n const e = this.attributes.position, t = this.morphAttributes.position;\n if (e && e.isGLBufferAttribute) {\n Xe(\"BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.\", this), this.boundingBox.set(\n new w(-1 / 0, -1 / 0, -1 / 0),\n new w(1 / 0, 1 / 0, 1 / 0)\n );\n return;\n }\n if (e !== void 0) {\n if (this.boundingBox.setFromBufferAttribute(e), t)\n for (let n = 0, s = t.length; n < s; n++) {\n const r = t[n];\n Kt.setFromBufferAttribute(r), this.morphTargetsRelative ? (At.addVectors(this.boundingBox.min, Kt.min), this.boundingBox.expandByPoint(At), At.addVectors(this.boundingBox.max, Kt.max), this.boundingBox.expandByPoint(At)) : (this.boundingBox.expandByPoint(Kt.min), this.boundingBox.expandByPoint(Kt.max));\n }\n } else\n this.boundingBox.makeEmpty();\n (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && Xe('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this);\n }\n /**\n * Computes the bounding sphere of the geometry, and updates the `boundingSphere` member.\n * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n * You may need to recompute the bounding sphere if the geometry vertices are modified.\n */\n computeBoundingSphere() {\n this.boundingSphere === null && (this.boundingSphere = new Rn());\n const e = this.attributes.position, t = this.morphAttributes.position;\n if (e && e.isGLBufferAttribute) {\n Xe(\"BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.\", this), this.boundingSphere.set(new w(), 1 / 0);\n return;\n }\n if (e) {\n const n = this.boundingSphere.center;\n if (Kt.setFromBufferAttribute(e), t)\n for (let r = 0, a = t.length; r < a; r++) {\n const o = t[r];\n os.setFromBufferAttribute(o), this.morphTargetsRelative ? (At.addVectors(Kt.min, os.min), Kt.expandByPoint(At), At.addVectors(Kt.max, os.max), Kt.expandByPoint(At)) : (Kt.expandByPoint(os.min), Kt.expandByPoint(os.max));\n }\n Kt.getCenter(n);\n let s = 0;\n for (let r = 0, a = e.count; r < a; r++)\n At.fromBufferAttribute(e, r), s = Math.max(s, n.distanceToSquared(At));\n if (t)\n for (let r = 0, a = t.length; r < a; r++) {\n const o = t[r], l = this.morphTargetsRelative;\n for (let c = 0, h = o.count; c < h; c++)\n At.fromBufferAttribute(o, c), l && (Ai.fromBufferAttribute(e, c), At.add(Ai)), s = Math.max(s, n.distanceToSquared(At));\n }\n this.boundingSphere.radius = Math.sqrt(s), isNaN(this.boundingSphere.radius) && Xe('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this);\n }\n }\n /**\n * Calculates and adds a tangent attribute to this geometry.\n *\n * The computation is only supported for indexed geometries and if position, normal, and uv attributes\n * are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by\n * {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead.\n */\n computeTangents() {\n const e = this.index, t = this.attributes;\n if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {\n Xe(\"BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)\");\n return;\n }\n const n = t.position, s = t.normal, r = t.uv;\n this.hasAttribute(\"tangent\") === !1 && this.setAttribute(\"tangent\", new kt(new Float32Array(4 * n.count), 4));\n const a = this.getAttribute(\"tangent\"), o = [], l = [];\n for (let I = 0; I < n.count; I++)\n o[I] = new w(), l[I] = new w();\n const c = new w(), h = new w(), u = new w(), d = new le(), p = new le(), g = new le(), x = new w(), m = new w();\n function f(I, S, M) {\n c.fromBufferAttribute(n, I), h.fromBufferAttribute(n, S), u.fromBufferAttribute(n, M), d.fromBufferAttribute(r, I), p.fromBufferAttribute(r, S), g.fromBufferAttribute(r, M), h.sub(c), u.sub(c), p.sub(d), g.sub(d);\n const C = 1 / (p.x * g.y - g.x * p.y);\n isFinite(C) && (x.copy(h).multiplyScalar(g.y).addScaledVector(u, -p.y).multiplyScalar(C), m.copy(u).multiplyScalar(p.x).addScaledVector(h, -g.x).multiplyScalar(C), o[I].add(x), o[S].add(x), o[M].add(x), l[I].add(m), l[S].add(m), l[M].add(m));\n }\n let y = this.groups;\n y.length === 0 && (y = [{\n start: 0,\n count: e.count\n }]);\n for (let I = 0, S = y.length; I < S; ++I) {\n const M = y[I], C = M.start, U = M.count;\n for (let B = C, z = C + U; B < z; B += 3)\n f(\n e.getX(B + 0),\n e.getX(B + 1),\n e.getX(B + 2)\n );\n }\n const v = new w(), T = new w(), R = new w(), E = new w();\n function P(I) {\n R.fromBufferAttribute(s, I), E.copy(R);\n const S = o[I];\n v.copy(S), v.sub(R.multiplyScalar(R.dot(S))).normalize(), T.crossVectors(E, S);\n const C = T.dot(l[I]) < 0 ? -1 : 1;\n a.setXYZW(I, v.x, v.y, v.z, C);\n }\n for (let I = 0, S = y.length; I < S; ++I) {\n const M = y[I], C = M.start, U = M.count;\n for (let B = C, z = C + U; B < z; B += 3)\n P(e.getX(B + 0)), P(e.getX(B + 1)), P(e.getX(B + 2));\n }\n }\n /**\n * Computes vertex normals for the given vertex data. For indexed geometries, the method sets\n * each vertex normal to be the average of the face normals of the faces that share that vertex.\n * For non-indexed geometries, vertices are not shared, and the method sets each vertex normal\n * to be the same as the face normal.\n */\n computeVertexNormals() {\n const e = this.index, t = this.getAttribute(\"position\");\n if (t !== void 0) {\n let n = this.getAttribute(\"normal\");\n if (n === void 0)\n n = new kt(new Float32Array(t.count * 3), 3), this.setAttribute(\"normal\", n);\n else\n for (let d = 0, p = n.count; d < p; d++)\n n.setXYZ(d, 0, 0, 0);\n const s = new w(), r = new w(), a = new w(), o = new w(), l = new w(), c = new w(), h = new w(), u = new w();\n if (e)\n for (let d = 0, p = e.count; d < p; d += 3) {\n const g = e.getX(d + 0), x = e.getX(d + 1), m = e.getX(d + 2);\n s.fromBufferAttribute(t, g), r.fromBufferAttribute(t, x), a.fromBufferAttribute(t, m), h.subVectors(a, r), u.subVectors(s, r), h.cross(u), o.fromBufferAttribute(n, g), l.fromBufferAttribute(n, x), c.fromBufferAttribute(n, m), o.add(h), l.add(h), c.add(h), n.setXYZ(g, o.x, o.y, o.z), n.setXYZ(x, l.x, l.y, l.z), n.setXYZ(m, c.x, c.y, c.z);\n }\n else\n for (let d = 0, p = t.count; d < p; d += 3)\n s.fromBufferAttribute(t, d + 0), r.fromBufferAttribute(t, d + 1), a.fromBufferAttribute(t, d + 2), h.subVectors(a, r), u.subVectors(s, r), h.cross(u), n.setXYZ(d + 0, h.x, h.y, h.z), n.setXYZ(d + 1, h.x, h.y, h.z), n.setXYZ(d + 2, h.x, h.y, h.z);\n this.normalizeNormals(), n.needsUpdate = !0;\n }\n }\n /**\n * Ensures every normal vector in a geometry will have a magnitude of `1`. This will\n * correct lighting on the geometry surfaces.\n */\n normalizeNormals() {\n const e = this.attributes.normal;\n for (let t = 0, n = e.count; t < n; t++)\n At.fromBufferAttribute(e, t), At.normalize(), e.setXYZ(t, At.x, At.y, At.z);\n }\n /**\n * Return a new non-index version of this indexed geometry. If the geometry\n * is already non-indexed, the method is a NOOP.\n *\n * @return {BufferGeometry} The non-indexed version of this indexed geometry.\n */\n toNonIndexed() {\n function e(o, l) {\n const c = o.array, h = o.itemSize, u = o.normalized, d = new c.constructor(l.length * h);\n let p = 0, g = 0;\n for (let x = 0, m = l.length; x < m; x++) {\n o.isInterleavedBufferAttribute ? p = l[x] * o.data.stride + o.offset : p = l[x] * h;\n for (let f = 0; f < h; f++)\n d[g++] = c[p++];\n }\n return new kt(d, h, u);\n }\n if (this.index === null)\n return Te(\"BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.\"), this;\n const t = new nn(), n = this.index.array, s = this.attributes;\n for (const o in s) {\n const l = s[o], c = e(l, n);\n t.setAttribute(o, c);\n }\n const r = this.morphAttributes;\n for (const o in r) {\n const l = [], c = r[o];\n for (let h = 0, u = c.length; h < u; h++) {\n const d = c[h], p = e(d, n);\n l.push(p);\n }\n t.morphAttributes[o] = l;\n }\n t.morphTargetsRelative = this.morphTargetsRelative;\n const a = this.groups;\n for (let o = 0, l = a.length; o < l; o++) {\n const c = a[o];\n t.addGroup(c.start, c.count, c.materialIndex);\n }\n return t;\n }\n /**\n * Serializes the geometry into JSON.\n *\n * @return {Object} A JSON object representing the serialized geometry.\n */\n toJSON() {\n const e = {\n metadata: {\n version: 4.7,\n type: \"BufferGeometry\",\n generator: \"BufferGeometry.toJSON\"\n }\n };\n if (e.uuid = this.uuid, e.type = this.type, this.name !== \"\" && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), this.parameters !== void 0) {\n const l = this.parameters;\n for (const c in l)\n l[c] !== void 0 && (e[c] = l[c]);\n return e;\n }\n e.data = { attributes: {} };\n const t = this.index;\n t !== null && (e.data.index = {\n type: t.array.constructor.name,\n array: Array.prototype.slice.call(t.array)\n });\n const n = this.attributes;\n for (const l in n) {\n const c = n[l];\n e.data.attributes[l] = c.toJSON(e.data);\n }\n const s = {};\n let r = !1;\n for (const l in this.morphAttributes) {\n const c = this.morphAttributes[l], h = [];\n for (let u = 0, d = c.length; u < d; u++) {\n const p = c[u];\n h.push(p.toJSON(e.data));\n }\n h.length > 0 && (s[l] = h, r = !0);\n }\n r && (e.data.morphAttributes = s, e.data.morphTargetsRelative = this.morphTargetsRelative);\n const a = this.groups;\n a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));\n const o = this.boundingSphere;\n return o !== null && (e.data.boundingSphere = o.toJSON()), e;\n }\n /**\n * Returns a new geometry with copied values from this instance.\n *\n * @return {BufferGeometry} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Copies the values of the given geometry to this instance.\n *\n * @param {BufferGeometry} source - The geometry to copy.\n * @return {BufferGeometry} A reference to this instance.\n */\n copy(e) {\n this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;\n const t = {};\n this.name = e.name;\n const n = e.index;\n n !== null && this.setIndex(n.clone());\n const s = e.attributes;\n for (const c in s) {\n const h = s[c];\n this.setAttribute(c, h.clone(t));\n }\n const r = e.morphAttributes;\n for (const c in r) {\n const h = [], u = r[c];\n for (let d = 0, p = u.length; d < p; d++)\n h.push(u[d].clone(t));\n this.morphAttributes[c] = h;\n }\n this.morphTargetsRelative = e.morphTargetsRelative;\n const a = e.groups;\n for (let c = 0, h = a.length; c < h; c++) {\n const u = a[c];\n this.addGroup(u.start, u.count, u.materialIndex);\n }\n const o = e.boundingBox;\n o !== null && (this.boundingBox = o.clone());\n const l = e.boundingSphere;\n return l !== null && (this.boundingSphere = l.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n *\n * @fires BufferGeometry#dispose\n */\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n}\nconst bl = /* @__PURE__ */ new Ne(), ai = /* @__PURE__ */ new Ji(), Hs = /* @__PURE__ */ new Rn(), yl = /* @__PURE__ */ new w(), Ws = /* @__PURE__ */ new w(), Xs = /* @__PURE__ */ new w(), js = /* @__PURE__ */ new w(), na = /* @__PURE__ */ new w(), qs = /* @__PURE__ */ new w(), Tl = /* @__PURE__ */ new w(), Ys = /* @__PURE__ */ new w();\nclass ot extends pt {\n /**\n * Constructs a new mesh.\n *\n * @param {BufferGeometry} [geometry] - The mesh geometry.\n * @param {Material|Array} [material] - The mesh material.\n */\n constructor(e = new nn(), t = new Bt()) {\n super(), this.isMesh = !0, this.type = \"Mesh\", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();\n }\n copy(e, t) {\n return super.copy(e, t), e.morphTargetInfluences !== void 0 && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), e.morphTargetDictionary !== void 0 && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this.material = Array.isArray(e.material) ? e.material.slice() : e.material, this.geometry = e.geometry, this;\n }\n /**\n * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences}\n * to make sure existing morph targets can influence this 3D object.\n */\n updateMorphTargets() {\n const t = this.geometry.morphAttributes, n = Object.keys(t);\n if (n.length > 0) {\n const s = t[n[0]];\n if (s !== void 0) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let r = 0, a = s.length; r < a; r++) {\n const o = s[r].name || String(r);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[o] = r;\n }\n }\n }\n }\n /**\n * Returns the local-space position of the vertex at the given index, taking into\n * account the current animation state of both morph targets and skinning.\n *\n * @param {number} index - The vertex index.\n * @param {Vector3} target - The target object that is used to store the method's result.\n * @return {Vector3} The vertex position in local space.\n */\n getVertexPosition(e, t) {\n const n = this.geometry, s = n.attributes.position, r = n.morphAttributes.position, a = n.morphTargetsRelative;\n t.fromBufferAttribute(s, e);\n const o = this.morphTargetInfluences;\n if (r && o) {\n qs.set(0, 0, 0);\n for (let l = 0, c = r.length; l < c; l++) {\n const h = o[l], u = r[l];\n h !== 0 && (na.fromBufferAttribute(u, e), a ? qs.addScaledVector(na, h) : qs.addScaledVector(na.sub(t), h));\n }\n t.add(qs);\n }\n return t;\n }\n /**\n * Computes intersection points between a casted ray and this line.\n *\n * @param {Raycaster} raycaster - The raycaster.\n * @param {Array} intersects - The target array that holds the intersection points.\n */\n raycast(e, t) {\n const n = this.geometry, s = this.material, r = this.matrixWorld;\n s !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), Hs.copy(n.boundingSphere), Hs.applyMatrix4(r), ai.copy(e.ray).recast(e.near), !(Hs.containsPoint(ai.origin) === !1 && (ai.intersectSphere(Hs, yl) === null || ai.origin.distanceToSquared(yl) > (e.far - e.near) ** 2)) && (bl.copy(r).invert(), ai.copy(e.ray).applyMatrix4(bl), !(n.boundingBox !== null && ai.intersectsBox(n.boundingBox) === !1) && this._computeIntersections(e, t, ai)));\n }\n _computeIntersections(e, t, n) {\n let s;\n const r = this.geometry, a = this.material, o = r.index, l = r.attributes.position, c = r.attributes.uv, h = r.attributes.uv1, u = r.attributes.normal, d = r.groups, p = r.drawRange;\n if (o !== null)\n if (Array.isArray(a))\n for (let g = 0, x = d.length; g < x; g++) {\n const m = d[g], f = a[m.materialIndex], y = Math.max(m.start, p.start), v = Math.min(o.count, Math.min(m.start + m.count, p.start + p.count));\n for (let T = y, R = v; T < R; T += 3) {\n const E = o.getX(T), P = o.getX(T + 1), I = o.getX(T + 2);\n s = Ks(this, f, e, n, c, h, u, E, P, I), s && (s.faceIndex = Math.floor(T / 3), s.face.materialIndex = m.materialIndex, t.push(s));\n }\n }\n else {\n const g = Math.max(0, p.start), x = Math.min(o.count, p.start + p.count);\n for (let m = g, f = x; m < f; m += 3) {\n const y = o.getX(m), v = o.getX(m + 1), T = o.getX(m + 2);\n s = Ks(this, a, e, n, c, h, u, y, v, T), s && (s.faceIndex = Math.floor(m / 3), t.push(s));\n }\n }\n else if (l !== void 0)\n if (Array.isArray(a))\n for (let g = 0, x = d.length; g < x; g++) {\n const m = d[g], f = a[m.materialIndex], y = Math.max(m.start, p.start), v = Math.min(l.count, Math.min(m.start + m.count, p.start + p.count));\n for (let T = y, R = v; T < R; T += 3) {\n const E = T, P = T + 1, I = T + 2;\n s = Ks(this, f, e, n, c, h, u, E, P, I), s && (s.faceIndex = Math.floor(T / 3), s.face.materialIndex = m.materialIndex, t.push(s));\n }\n }\n else {\n const g = Math.max(0, p.start), x = Math.min(l.count, p.start + p.count);\n for (let m = g, f = x; m < f; m += 3) {\n const y = m, v = m + 1, T = m + 2;\n s = Ks(this, a, e, n, c, h, u, y, v, T), s && (s.faceIndex = Math.floor(m / 3), t.push(s));\n }\n }\n }\n}\nfunction Ku(i, e, t, n, s, r, a, o) {\n let l;\n if (e.side === zt ? l = n.intersectTriangle(a, r, s, !0, o) : l = n.intersectTriangle(s, r, a, e.side === En, o), l === null) return null;\n Ys.copy(o), Ys.applyMatrix4(i.matrixWorld);\n const c = t.ray.origin.distanceTo(Ys);\n return c < t.near || c > t.far ? null : {\n distance: c,\n point: Ys.clone(),\n object: i\n };\n}\nfunction Ks(i, e, t, n, s, r, a, o, l, c) {\n i.getVertexPosition(o, Ws), i.getVertexPosition(l, Xs), i.getVertexPosition(c, js);\n const h = Ku(i, e, t, n, Ws, Xs, js, Tl);\n if (h) {\n const u = new w();\n un.getBarycoord(Tl, Ws, Xs, js, u), s && (h.uv = un.getInterpolatedAttribute(s, o, l, c, u, new le())), r && (h.uv1 = un.getInterpolatedAttribute(r, o, l, c, u, new le())), a && (h.normal = un.getInterpolatedAttribute(a, o, l, c, u, new w()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1));\n const d = {\n a: o,\n b: l,\n c,\n normal: new w(),\n materialIndex: 0\n };\n un.getNormal(Ws, Xs, js, d.normal), h.face = d, h.barycoord = u;\n }\n return h;\n}\nclass fi extends nn {\n /**\n * Constructs a new box geometry.\n *\n * @param {number} [width=1] - The width. That is, the length of the edges parallel to the X axis.\n * @param {number} [height=1] - The height. That is, the length of the edges parallel to the Y axis.\n * @param {number} [depth=1] - The depth. That is, the length of the edges parallel to the Z axis.\n * @param {number} [widthSegments=1] - Number of segmented rectangular faces along the width of the sides.\n * @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides.\n * @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides.\n */\n constructor(e = 1, t = 1, n = 1, s = 1, r = 1, a = 1) {\n super(), this.type = \"BoxGeometry\", this.parameters = {\n width: e,\n height: t,\n depth: n,\n widthSegments: s,\n heightSegments: r,\n depthSegments: a\n };\n const o = this;\n s = Math.floor(s), r = Math.floor(r), a = Math.floor(a);\n const l = [], c = [], h = [], u = [];\n let d = 0, p = 0;\n g(\"z\", \"y\", \"x\", -1, -1, n, t, e, a, r, 0), g(\"z\", \"y\", \"x\", 1, -1, n, t, -e, a, r, 1), g(\"x\", \"z\", \"y\", 1, 1, e, n, t, s, a, 2), g(\"x\", \"z\", \"y\", 1, -1, e, n, -t, s, a, 3), g(\"x\", \"y\", \"z\", 1, -1, e, t, n, s, r, 4), g(\"x\", \"y\", \"z\", -1, -1, e, t, -n, s, r, 5), this.setIndex(l), this.setAttribute(\"position\", new pn(c, 3)), this.setAttribute(\"normal\", new pn(h, 3)), this.setAttribute(\"uv\", new pn(u, 2));\n function g(x, m, f, y, v, T, R, E, P, I, S) {\n const M = T / P, C = R / I, U = T / 2, B = R / 2, z = E / 2, W = P + 1, k = I + 1;\n let ee = 0, X = 0;\n const $ = new w();\n for (let Q = 0; Q < k; Q++) {\n const ge = Q * C - B;\n for (let we = 0; we < W; we++) {\n const Oe = we * M - U;\n $[x] = Oe * y, $[m] = ge * v, $[f] = z, c.push($.x, $.y, $.z), $[x] = 0, $[m] = 0, $[f] = E > 0 ? 1 : -1, h.push($.x, $.y, $.z), u.push(we / P), u.push(1 - Q / I), ee += 1;\n }\n }\n for (let Q = 0; Q < I; Q++)\n for (let ge = 0; ge < P; ge++) {\n const we = d + ge + W * Q, Oe = d + ge + W * (Q + 1), Ke = d + (ge + 1) + W * (Q + 1), $e = d + (ge + 1) + W * Q;\n l.push(we, Oe, $e), l.push(Oe, Ke, $e), X += 6;\n }\n o.addGroup(p, X, S), p += X, d += ee;\n }\n }\n copy(e) {\n return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n }\n /**\n * Factory method for creating an instance of this class from the given\n * JSON object.\n *\n * @param {Object} data - A JSON object representing the serialized geometry.\n * @return {BoxGeometry} A new instance.\n */\n static fromJSON(e) {\n return new fi(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);\n }\n}\nfunction qi(i) {\n const e = {};\n for (const t in i) {\n e[t] = {};\n for (const n in i[t]) {\n const s = i[t][n];\n s && (s.isColor || s.isMatrix3 || s.isMatrix4 || s.isVector2 || s.isVector3 || s.isVector4 || s.isTexture || s.isQuaternion) ? s.isRenderTargetTexture ? (Te(\"UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().\"), e[t][n] = null) : e[t][n] = s.clone() : Array.isArray(s) ? e[t][n] = s.slice() : e[t][n] = s;\n }\n }\n return e;\n}\nfunction Ot(i) {\n const e = {};\n for (let t = 0; t < i.length; t++) {\n const n = qi(i[t]);\n for (const s in n)\n e[s] = n[s];\n }\n return e;\n}\nfunction Zu(i) {\n const e = [];\n for (let t = 0; t < i.length; t++)\n e.push(i[t].clone());\n return e;\n}\nfunction nh(i) {\n const e = i.getRenderTarget();\n return e === null ? i.outputColorSpace : e.isXRRenderTarget === !0 ? e.texture.colorSpace : Ye.workingColorSpace;\n}\nconst dn = { clone: qi, merge: Ot };\nvar $u = `void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`, Ju = `void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`;\nclass ht extends tn {\n /**\n * Constructs a new shader material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isShaderMaterial = !0, this.type = \"ShaderMaterial\", this.defines = {}, this.uniforms = {}, this.uniformsGroups = [], this.vertexShader = $u, this.fragmentShader = Ju, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.forceSinglePass = !0, this.extensions = {\n clipCullDistance: !1,\n // set to use vertex shader clipping\n multiDraw: !1\n // set to use vertex shader multi_draw / enable gl_DrawID\n }, this.defaultAttributeValues = {\n color: [1, 1, 1],\n uv: [0, 0],\n uv1: [0, 0]\n }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = qi(e.uniforms), this.uniformsGroups = Zu(e.uniformsGroups), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.clipping = e.clipping, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this;\n }\n toJSON(e) {\n const t = super.toJSON(e);\n t.glslVersion = this.glslVersion, t.uniforms = {};\n for (const s in this.uniforms) {\n const a = this.uniforms[s].value;\n a && a.isTexture ? t.uniforms[s] = {\n type: \"t\",\n value: a.toJSON(e).uuid\n } : a && a.isColor ? t.uniforms[s] = {\n type: \"c\",\n value: a.getHex()\n } : a && a.isVector2 ? t.uniforms[s] = {\n type: \"v2\",\n value: a.toArray()\n } : a && a.isVector3 ? t.uniforms[s] = {\n type: \"v3\",\n value: a.toArray()\n } : a && a.isVector4 ? t.uniforms[s] = {\n type: \"v4\",\n value: a.toArray()\n } : a && a.isMatrix3 ? t.uniforms[s] = {\n type: \"m3\",\n value: a.toArray()\n } : a && a.isMatrix4 ? t.uniforms[s] = {\n type: \"m4\",\n value: a.toArray()\n } : t.uniforms[s] = {\n value: a\n };\n }\n Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader, t.lights = this.lights, t.clipping = this.clipping;\n const n = {};\n for (const s in this.extensions)\n this.extensions[s] === !0 && (n[s] = !0);\n return Object.keys(n).length > 0 && (t.extensions = n), t;\n }\n}\nclass ih extends pt {\n /**\n * Constructs a new camera.\n */\n constructor() {\n super(), this.isCamera = !0, this.type = \"Camera\", this.matrixWorldInverse = new Ne(), this.projectionMatrix = new Ne(), this.projectionMatrixInverse = new Ne(), this.coordinateSystem = Tn, this._reversedDepth = !1;\n }\n /**\n * The flag that indicates whether the camera uses a reversed depth buffer.\n *\n * @type {boolean}\n * @default false\n */\n get reversedDepth() {\n return this._reversedDepth;\n }\n copy(e, t) {\n return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this.coordinateSystem = e.coordinateSystem, this;\n }\n /**\n * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n *\n * This method is overwritten since cameras have a different forward vector compared to other\n * 3D objects. A camera looks down its local, negative z-axis by default.\n *\n * @param {Vector3} target - The target vector the result is stored to.\n * @return {Vector3} The 3D object's direction in world space.\n */\n getWorldDirection(e) {\n return super.getWorldDirection(e).negate();\n }\n updateMatrixWorld(e) {\n super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert();\n }\n updateWorldMatrix(e, t) {\n super.updateWorldMatrix(e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert();\n }\n clone() {\n return new this.constructor().copy(this);\n }\n}\nconst qn = /* @__PURE__ */ new w(), El = /* @__PURE__ */ new le(), wl = /* @__PURE__ */ new le();\nclass Tt extends ih {\n /**\n * Constructs a new perspective camera.\n *\n * @param {number} [fov=50] - The vertical field of view.\n * @param {number} [aspect=1] - The aspect ratio.\n * @param {number} [near=0.1] - The camera's near plane.\n * @param {number} [far=2000] - The camera's far plane.\n */\n constructor(e = 50, t = 1, n = 0.1, s = 2e3) {\n super(), this.isPerspectiveCamera = !0, this.type = \"PerspectiveCamera\", this.fov = e, this.zoom = 1, this.near = n, this.far = s, this.focus = 10, this.aspect = t, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix();\n }\n copy(e, t) {\n return super.copy(e, t), this.fov = e.fov, this.zoom = e.zoom, this.near = e.near, this.far = e.far, this.focus = e.focus, this.aspect = e.aspect, this.view = e.view === null ? null : Object.assign({}, e.view), this.filmGauge = e.filmGauge, this.filmOffset = e.filmOffset, this;\n }\n /**\n * Sets the FOV by focal length in respect to the current {@link PerspectiveCamera#filmGauge}.\n *\n * The default film gauge is 35, so that the focal length can be specified for\n * a 35mm (full frame) camera.\n *\n * @param {number} focalLength - Values for focal length and film gauge must have the same unit.\n */\n setFocalLength(e) {\n const t = 0.5 * this.getFilmHeight() / e;\n this.fov = ji * 2 * Math.atan(t), this.updateProjectionMatrix();\n }\n /**\n * Returns the focal length from the current {@link PerspectiveCamera#fov} and\n * {@link PerspectiveCamera#filmGauge}.\n *\n * @return {number} The computed focal length.\n */\n getFocalLength() {\n const e = Math.tan(_s * 0.5 * this.fov);\n return 0.5 * this.getFilmHeight() / e;\n }\n /**\n * Returns the current vertical field of view angle in degrees considering {@link PerspectiveCamera#zoom}.\n *\n * @return {number} The effective FOV.\n */\n getEffectiveFOV() {\n return ji * 2 * Math.atan(\n Math.tan(_s * 0.5 * this.fov) / this.zoom\n );\n }\n /**\n * Returns the width of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n *\n * @return {number} The film width.\n */\n getFilmWidth() {\n return this.filmGauge * Math.min(this.aspect, 1);\n }\n /**\n * Returns the height of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n *\n * @return {number} The film width.\n */\n getFilmHeight() {\n return this.filmGauge / Math.max(this.aspect, 1);\n }\n /**\n * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n * Sets `minTarget` and `maxTarget` to the coordinates of the lower-left and upper-right corners of the view rectangle.\n *\n * @param {number} distance - The viewing distance.\n * @param {Vector2} minTarget - The lower-left corner of the view rectangle is written into this vector.\n * @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector.\n */\n getViewBounds(e, t, n) {\n qn.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse), t.set(qn.x, qn.y).multiplyScalar(-e / qn.z), qn.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse), n.set(qn.x, qn.y).multiplyScalar(-e / qn.z);\n }\n /**\n * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n *\n * @param {number} distance - The viewing distance.\n * @param {Vector2} target - The target vector that is used to store result where x is width and y is height.\n * @returns {Vector2} The view size.\n */\n getViewSize(e, t) {\n return this.getViewBounds(e, El, wl), t.subVectors(wl, El);\n }\n /**\n * Sets an offset in a larger frustum. This is useful for multi-window or\n * multi-monitor/multi-machine setups.\n *\n * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n * the monitors are in grid like this\n *```\n * +---+---+---+\n * | A | B | C |\n * +---+---+---+\n * | D | E | F |\n * +---+---+---+\n *```\n * then for each monitor you would call it like this:\n *```js\n * const w = 1920;\n * const h = 1080;\n * const fullWidth = w * 3;\n * const fullHeight = h * 2;\n *\n * // --A--\n * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n * // --B--\n * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n * // --C--\n * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n * // --D--\n * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n * // --E--\n * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n * // --F--\n * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n * ```\n *\n * Note there is no reason monitors have to be the same size or in a grid.\n *\n * @param {number} fullWidth - The full width of multiview setup.\n * @param {number} fullHeight - The full height of multiview setup.\n * @param {number} x - The horizontal offset of the subcamera.\n * @param {number} y - The vertical offset of the subcamera.\n * @param {number} width - The width of subcamera.\n * @param {number} height - The height of subcamera.\n */\n setViewOffset(e, t, n, s, r, a) {\n this.aspect = e / t, this.view === null && (this.view = {\n enabled: !0,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1\n }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = n, this.view.offsetY = s, this.view.width = r, this.view.height = a, this.updateProjectionMatrix();\n }\n /**\n * Removes the view offset from the projection matrix.\n */\n clearViewOffset() {\n this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();\n }\n /**\n * Updates the camera's projection matrix. Must be called after any change of\n * camera properties.\n */\n updateProjectionMatrix() {\n const e = this.near;\n let t = e * Math.tan(_s * 0.5 * this.fov) / this.zoom, n = 2 * t, s = this.aspect * n, r = -0.5 * s;\n const a = this.view;\n if (this.view !== null && this.view.enabled) {\n const l = a.fullWidth, c = a.fullHeight;\n r += a.offsetX * s / l, t -= a.offsetY * n / c, s *= a.width / l, n *= a.height / c;\n }\n const o = this.filmOffset;\n o !== 0 && (r += e * o / this.getFilmWidth()), this.projectionMatrix.makePerspective(r, r + s, t, t - n, e, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n }\n toJSON(e) {\n const t = super.toJSON(e);\n return t.object.fov = this.fov, t.object.zoom = this.zoom, t.object.near = this.near, t.object.far = this.far, t.object.focus = this.focus, t.object.aspect = this.aspect, this.view !== null && (t.object.view = Object.assign({}, this.view)), t.object.filmGauge = this.filmGauge, t.object.filmOffset = this.filmOffset, t;\n }\n}\nconst Ri = -90, Ci = 1;\nclass Qu extends pt {\n /**\n * Constructs a new cube camera.\n *\n * @param {number} near - The camera's near plane.\n * @param {number} far - The camera's far plane.\n * @param {WebGLCubeRenderTarget} renderTarget - The cube render target.\n */\n constructor(e, t, n) {\n super(), this.type = \"CubeCamera\", this.renderTarget = n, this.coordinateSystem = null, this.activeMipmapLevel = 0;\n const s = new Tt(Ri, Ci, e, t);\n s.layers = this.layers, this.add(s);\n const r = new Tt(Ri, Ci, e, t);\n r.layers = this.layers, this.add(r);\n const a = new Tt(Ri, Ci, e, t);\n a.layers = this.layers, this.add(a);\n const o = new Tt(Ri, Ci, e, t);\n o.layers = this.layers, this.add(o);\n const l = new Tt(Ri, Ci, e, t);\n l.layers = this.layers, this.add(l);\n const c = new Tt(Ri, Ci, e, t);\n c.layers = this.layers, this.add(c);\n }\n /**\n * Must be called when the coordinate system of the cube camera is changed.\n */\n updateCoordinateSystem() {\n const e = this.coordinateSystem, t = this.children.concat(), [n, s, r, a, o, l] = t;\n for (const c of t) this.remove(c);\n if (e === Tn)\n n.up.set(0, 1, 0), n.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), l.up.set(0, 1, 0), l.lookAt(0, 0, -1);\n else if (e === br)\n n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), l.up.set(0, -1, 0), l.lookAt(0, 0, -1);\n else\n throw new Error(\"THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: \" + e);\n for (const c of t)\n this.add(c), c.updateMatrixWorld();\n }\n /**\n * Calling this method will render the given scene with the given renderer\n * into the cube render target of the camera.\n *\n * @param {(Renderer|WebGLRenderer)} renderer - The renderer.\n * @param {Scene} scene - The scene to render.\n */\n update(e, t) {\n this.parent === null && this.updateMatrixWorld();\n const { renderTarget: n, activeMipmapLevel: s } = this;\n this.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem, this.updateCoordinateSystem());\n const [r, a, o, l, c, h] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), p = e.getActiveMipmapLevel(), g = e.xr.enabled;\n e.xr.enabled = !1;\n const x = n.texture.generateMipmaps;\n n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, s), e.render(t, r), e.setRenderTarget(n, 1, s), e.render(t, a), e.setRenderTarget(n, 2, s), e.render(t, o), e.setRenderTarget(n, 3, s), e.render(t, l), e.setRenderTarget(n, 4, s), e.render(t, c), n.texture.generateMipmaps = x, e.setRenderTarget(n, 5, s), e.render(t, h), e.setRenderTarget(u, d, p), e.xr.enabled = g, n.texture.needsPMREMUpdate = !0;\n }\n}\nclass No extends Ct {\n /**\n * Constructs a new cube texture.\n *\n * @param {Array} [images=[]] - An array holding a image for each side of a cube.\n * @param {number} [mapping=CubeReflectionMapping] - The texture mapping.\n * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n * @param {number} [magFilter=LinearFilter] - The mag filter value.\n * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n * @param {number} [format=RGBAFormat] - The texture format.\n * @param {number} [type=UnsignedByteType] - The texture type.\n * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n * @param {string} [colorSpace=NoColorSpace] - The color space value.\n */\n constructor(e = [], t = Gi, n, s, r, a, o, l, c, h) {\n super(e, t, n, s, r, a, o, l, c, h), this.isCubeTexture = !0, this.flipY = !1;\n }\n /**\n * Alias for {@link CubeTexture#image}.\n *\n * @type {Array}\n */\n get images() {\n return this.image;\n }\n set images(e) {\n this.image = e;\n }\n}\nclass ed extends St {\n /**\n * Constructs a new cube render target.\n *\n * @param {number} [size=1] - The size of the render target.\n * @param {RenderTarget~Options} [options] - The configuration object.\n */\n constructor(e = 1, t = {}) {\n super(e, e, t), this.isWebGLCubeRenderTarget = !0;\n const n = { width: e, height: e, depth: 1 }, s = [n, n, n, n, n, n];\n this.texture = new No(s), this._setTextureOptions(t), this.texture.isRenderTargetTexture = !0;\n }\n /**\n * Converts the given equirectangular texture to a cube map.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Texture} texture - The equirectangular texture.\n * @return {WebGLCubeRenderTarget} A reference to this cube render target.\n */\n fromEquirectangularTexture(e, t) {\n this.texture.type = t.type, this.texture.colorSpace = t.colorSpace, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter;\n const n = {\n uniforms: {\n tEquirect: { value: null }\n },\n vertexShader: (\n /* glsl */\n `\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t`\n ),\n fragmentShader: (\n /* glsl */\n `\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n )\n }, s = new fi(5, 5, 5), r = new ht({\n name: \"CubemapFromEquirect\",\n uniforms: qi(n.uniforms),\n vertexShader: n.vertexShader,\n fragmentShader: n.fragmentShader,\n side: zt,\n blending: Mt\n });\n r.uniforms.tEquirect.value = t;\n const a = new ot(s, r), o = t.minFilter;\n return t.minFilter === yn && (t.minFilter = bt), new Qu(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;\n }\n /**\n * Clears this cube render target.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.\n * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.\n * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.\n */\n clear(e, t = !0, n = !0, s = !0) {\n const r = e.getRenderTarget();\n for (let a = 0; a < 6; a++)\n e.setRenderTarget(this, a), e.clear(t, n, s);\n e.setRenderTarget(r);\n }\n}\nlet zn = class extends pt {\n constructor() {\n super(), this.isGroup = !0, this.type = \"Group\";\n }\n};\nconst td = { type: \"move\" };\nclass ia {\n /**\n * Constructs a new XR controller.\n */\n constructor() {\n this._targetRay = null, this._grip = null, this._hand = null;\n }\n /**\n * Returns a group representing the hand space of the XR controller.\n *\n * @return {Group} A group representing the hand space of the XR controller.\n */\n getHandSpace() {\n return this._hand === null && (this._hand = new zn(), this._hand.matrixAutoUpdate = !1, this._hand.visible = !1, this._hand.joints = {}, this._hand.inputState = { pinching: !1 }), this._hand;\n }\n /**\n * Returns a group representing the target ray space of the XR controller.\n *\n * @return {Group} A group representing the target ray space of the XR controller.\n */\n getTargetRaySpace() {\n return this._targetRay === null && (this._targetRay = new zn(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new w(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new w()), this._targetRay;\n }\n /**\n * Returns a group representing the grip space of the XR controller.\n *\n * @return {Group} A group representing the grip space of the XR controller.\n */\n getGripSpace() {\n return this._grip === null && (this._grip = new zn(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new w(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new w()), this._grip;\n }\n /**\n * Dispatches the given event to the groups representing\n * the different coordinate spaces of the XR controller.\n *\n * @param {Object} event - The event to dispatch.\n * @return {WebXRController} A reference to this instance.\n */\n dispatchEvent(e) {\n return this._targetRay !== null && this._targetRay.dispatchEvent(e), this._grip !== null && this._grip.dispatchEvent(e), this._hand !== null && this._hand.dispatchEvent(e), this;\n }\n /**\n * Connects the controller with the given XR input source.\n *\n * @param {XRInputSource} inputSource - The input source.\n * @return {WebXRController} A reference to this instance.\n */\n connect(e) {\n if (e && e.hand) {\n const t = this._hand;\n if (t)\n for (const n of e.hand.values())\n this._getHandJoint(t, n);\n }\n return this.dispatchEvent({ type: \"connected\", data: e }), this;\n }\n /**\n * Disconnects the controller from the given XR input source.\n *\n * @param {XRInputSource} inputSource - The input source.\n * @return {WebXRController} A reference to this instance.\n */\n disconnect(e) {\n return this.dispatchEvent({ type: \"disconnected\", data: e }), this._targetRay !== null && (this._targetRay.visible = !1), this._grip !== null && (this._grip.visible = !1), this._hand !== null && (this._hand.visible = !1), this;\n }\n /**\n * Updates the controller with the given input source, XR frame and reference space.\n * This updates the transformations of the groups that represent the different\n * coordinate systems of the controller.\n *\n * @param {XRInputSource} inputSource - The input source.\n * @param {XRFrame} frame - The XR frame.\n * @param {XRReferenceSpace} referenceSpace - The reference space.\n * @return {WebXRController} A reference to this instance.\n */\n update(e, t, n) {\n let s = null, r = null, a = null;\n const o = this._targetRay, l = this._grip, c = this._hand;\n if (e && t.session.visibilityState !== \"visible-blurred\") {\n if (c && e.hand) {\n a = !0;\n for (const x of e.hand.values()) {\n const m = t.getJointPose(x, n), f = this._getHandJoint(c, x);\n m !== null && (f.matrix.fromArray(m.transform.matrix), f.matrix.decompose(f.position, f.rotation, f.scale), f.matrixWorldNeedsUpdate = !0, f.jointRadius = m.radius), f.visible = m !== null;\n }\n const h = c.joints[\"index-finger-tip\"], u = c.joints[\"thumb-tip\"], d = h.position.distanceTo(u.position), p = 0.02, g = 5e-3;\n c.inputState.pinching && d > p + g ? (c.inputState.pinching = !1, this.dispatchEvent({\n type: \"pinchend\",\n handedness: e.handedness,\n target: this\n })) : !c.inputState.pinching && d <= p - g && (c.inputState.pinching = !0, this.dispatchEvent({\n type: \"pinchstart\",\n handedness: e.handedness,\n target: this\n }));\n } else\n l !== null && e.gripSpace && (r = t.getPose(e.gripSpace, n), r !== null && (l.matrix.fromArray(r.transform.matrix), l.matrix.decompose(l.position, l.rotation, l.scale), l.matrixWorldNeedsUpdate = !0, r.linearVelocity ? (l.hasLinearVelocity = !0, l.linearVelocity.copy(r.linearVelocity)) : l.hasLinearVelocity = !1, r.angularVelocity ? (l.hasAngularVelocity = !0, l.angularVelocity.copy(r.angularVelocity)) : l.hasAngularVelocity = !1));\n o !== null && (s = t.getPose(e.targetRaySpace, n), s === null && r !== null && (s = r), s !== null && (o.matrix.fromArray(s.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(s.linearVelocity)) : o.hasLinearVelocity = !1, s.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(s.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(td)));\n }\n return o !== null && (o.visible = s !== null), l !== null && (l.visible = r !== null), c !== null && (c.visible = a !== null), this;\n }\n /**\n * Returns a group representing the hand joint for the given input joint.\n *\n * @private\n * @param {Group} hand - The group representing the hand space.\n * @param {XRJointSpace} inputjoint - The hand joint data.\n * @return {Group} A group representing the hand joint for the given input joint.\n */\n _getHandJoint(e, t) {\n if (e.joints[t.jointName] === void 0) {\n const n = new zn();\n n.matrixAutoUpdate = !1, n.visible = !1, e.joints[t.jointName] = n, e.add(n);\n }\n return e.joints[t.jointName];\n }\n}\nclass Fo extends pt {\n /**\n * Constructs a new scene.\n */\n constructor() {\n super(), this.isScene = !0, this.type = \"Scene\", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new xn(), this.environmentIntensity = 1, this.environmentRotation = new xn(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < \"u\" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n }\n copy(e, t) {\n return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), this.backgroundBlurriness = e.backgroundBlurriness, this.backgroundIntensity = e.backgroundIntensity, this.backgroundRotation.copy(e.backgroundRotation), this.environmentIntensity = e.environmentIntensity, this.environmentRotation.copy(e.environmentRotation), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.matrixAutoUpdate = e.matrixAutoUpdate, this;\n }\n toJSON(e) {\n const t = super.toJSON(e);\n return this.fog !== null && (t.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness), this.backgroundIntensity !== 1 && (t.object.backgroundIntensity = this.backgroundIntensity), t.object.backgroundRotation = this.backgroundRotation.toArray(), this.environmentIntensity !== 1 && (t.object.environmentIntensity = this.environmentIntensity), t.object.environmentRotation = this.environmentRotation.toArray(), t;\n }\n}\nclass nd {\n /**\n * Constructs a new interleaved buffer.\n *\n * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.\n * @param {number} stride - The number of typed-array elements per vertex.\n */\n constructor(e, t) {\n this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = ho, this.updateRanges = [], this.version = 0, this.uuid = fn();\n }\n /**\n * A callback function that is executed after the renderer has transferred the attribute array\n * data to the GPU.\n */\n onUploadCallback() {\n }\n /**\n * Flag to indicate that this attribute has changed and should be re-sent to\n * the GPU. Set this to `true` when you modify the value of the array.\n *\n * @type {number}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n e === !0 && this.version++;\n }\n /**\n * Sets the usage of this interleaved buffer.\n *\n * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n * @return {InterleavedBuffer} A reference to this interleaved buffer.\n */\n setUsage(e) {\n return this.usage = e, this;\n }\n /**\n * Adds a range of data in the data array to be updated on the GPU.\n *\n * @param {number} start - Position at which to start update.\n * @param {number} count - The number of components to update.\n */\n addUpdateRange(e, t) {\n this.updateRanges.push({ start: e, count: t });\n }\n /**\n * Clears the update ranges.\n */\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n /**\n * Copies the values of the given interleaved buffer to this instance.\n *\n * @param {InterleavedBuffer} source - The interleaved buffer to copy.\n * @return {InterleavedBuffer} A reference to this instance.\n */\n copy(e) {\n return this.array = new e.array.constructor(e.array), this.count = e.count, this.stride = e.stride, this.usage = e.usage, this;\n }\n /**\n * Copies a vector from the given interleaved buffer to this one. The start\n * and destination position in the attribute buffers are represented by the\n * given indices.\n *\n * @param {number} index1 - The destination index into this interleaved buffer.\n * @param {InterleavedBuffer} interleavedBuffer - The interleaved buffer to copy from.\n * @param {number} index2 - The source index into the given interleaved buffer.\n * @return {InterleavedBuffer} A reference to this instance.\n */\n copyAt(e, t, n) {\n e *= this.stride, n *= t.stride;\n for (let s = 0, r = this.stride; s < r; s++)\n this.array[e + s] = t.array[n + s];\n return this;\n }\n /**\n * Sets the given array data in the interleaved buffer.\n *\n * @param {(TypedArray|Array)} value - The array data to set.\n * @param {number} [offset=0] - The offset in this interleaved buffer's array.\n * @return {InterleavedBuffer} A reference to this instance.\n */\n set(e, t = 0) {\n return this.array.set(e, t), this;\n }\n /**\n * Returns a new interleaved buffer with copied values from this instance.\n *\n * @param {Object} [data] - An object with shared array buffers that allows to retain shared structures.\n * @return {InterleavedBuffer} A clone of this instance.\n */\n clone(e) {\n e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = fn()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);\n const t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), n = new this.constructor(t, this.stride);\n return n.setUsage(this.usage), n;\n }\n /**\n * Sets the given callback function that is executed after the Renderer has transferred\n * the array data to the GPU. Can be used to perform clean-up operations after\n * the upload when data are not needed anymore on the CPU side.\n *\n * @param {Function} callback - The `onUpload()` callback.\n * @return {InterleavedBuffer} A reference to this instance.\n */\n onUpload(e) {\n return this.onUploadCallback = e, this;\n }\n /**\n * Serializes the interleaved buffer into JSON.\n *\n * @param {Object} [data] - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized interleaved buffer.\n */\n toJSON(e) {\n return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = fn()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), {\n uuid: this.uuid,\n buffer: this.array.buffer._uuid,\n type: this.array.constructor.name,\n stride: this.stride\n };\n }\n}\nconst Ft = /* @__PURE__ */ new w();\nclass Oo {\n /**\n * Constructs a new interleaved buffer attribute.\n *\n * @param {InterleavedBuffer} interleavedBuffer - The buffer holding the interleaved data.\n * @param {number} itemSize - The item size.\n * @param {number} offset - The attribute offset into the buffer.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n */\n constructor(e, t, n, s = !1) {\n this.isInterleavedBufferAttribute = !0, this.name = \"\", this.data = e, this.itemSize = t, this.offset = n, this.normalized = s;\n }\n /**\n * The item count of this buffer attribute.\n *\n * @type {number}\n * @readonly\n */\n get count() {\n return this.data.count;\n }\n /**\n * The array holding the interleaved buffer attribute data.\n *\n * @type {TypedArray}\n */\n get array() {\n return this.data.array;\n }\n /**\n * Flag to indicate that this attribute has changed and should be re-sent to\n * the GPU. Set this to `true` when you modify the value of the array.\n *\n * @type {number}\n * @default false\n * @param {boolean} value\n */\n set needsUpdate(e) {\n this.data.needsUpdate = e;\n }\n /**\n * Applies the given 4x4 matrix to the given attribute. Only works with\n * item size `3`.\n *\n * @param {Matrix4} m - The matrix to apply.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n applyMatrix4(e) {\n for (let t = 0, n = this.data.count; t < n; t++)\n Ft.fromBufferAttribute(this, t), Ft.applyMatrix4(e), this.setXYZ(t, Ft.x, Ft.y, Ft.z);\n return this;\n }\n /**\n * Applies the given 3x3 normal matrix to the given attribute. Only works with\n * item size `3`.\n *\n * @param {Matrix3} m - The normal matrix to apply.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n applyNormalMatrix(e) {\n for (let t = 0, n = this.count; t < n; t++)\n Ft.fromBufferAttribute(this, t), Ft.applyNormalMatrix(e), this.setXYZ(t, Ft.x, Ft.y, Ft.z);\n return this;\n }\n /**\n * Applies the given 4x4 matrix to the given attribute. Only works with\n * item size `3` and with direction vectors.\n *\n * @param {Matrix4} m - The matrix to apply.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n transformDirection(e) {\n for (let t = 0, n = this.count; t < n; t++)\n Ft.fromBufferAttribute(this, t), Ft.transformDirection(e), this.setXYZ(t, Ft.x, Ft.y, Ft.z);\n return this;\n }\n /**\n * Returns the given component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} component - The component index.\n * @return {number} The returned value.\n */\n getComponent(e, t) {\n let n = this.array[e * this.data.stride + this.offset + t];\n return this.normalized && (n = hn(n, this.array)), n;\n }\n /**\n * Sets the given value to the given component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} component - The component index.\n * @param {number} value - The value to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setComponent(e, t, n) {\n return this.normalized && (n = tt(n, this.array)), this.data.array[e * this.data.stride + this.offset + t] = n, this;\n }\n /**\n * Sets the x component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setX(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.data.array[e * this.data.stride + this.offset] = t, this;\n }\n /**\n * Sets the y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} y - The value to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setY(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.data.array[e * this.data.stride + this.offset + 1] = t, this;\n }\n /**\n * Sets the z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} z - The value to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setZ(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.data.array[e * this.data.stride + this.offset + 2] = t, this;\n }\n /**\n * Sets the w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} w - The value to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setW(e, t) {\n return this.normalized && (t = tt(t, this.array)), this.data.array[e * this.data.stride + this.offset + 3] = t, this;\n }\n /**\n * Returns the x component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The x component.\n */\n getX(e) {\n let t = this.data.array[e * this.data.stride + this.offset];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Returns the y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The y component.\n */\n getY(e) {\n let t = this.data.array[e * this.data.stride + this.offset + 1];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Returns the z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The z component.\n */\n getZ(e) {\n let t = this.data.array[e * this.data.stride + this.offset + 2];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Returns the w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @return {number} The w component.\n */\n getW(e) {\n let t = this.data.array[e * this.data.stride + this.offset + 3];\n return this.normalized && (t = hn(t, this.array)), t;\n }\n /**\n * Sets the x and y component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setXY(e, t, n) {\n return e = e * this.data.stride + this.offset, this.normalized && (t = tt(t, this.array), n = tt(n, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this;\n }\n /**\n * Sets the x, y and z component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @param {number} z - The value for the z component to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setXYZ(e, t, n, s) {\n return e = e * this.data.stride + this.offset, this.normalized && (t = tt(t, this.array), n = tt(n, this.array), s = tt(s, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this.data.array[e + 2] = s, this;\n }\n /**\n * Sets the x, y, z and w component of the vector at the given index.\n *\n * @param {number} index - The index into the buffer attribute.\n * @param {number} x - The value for the x component to set.\n * @param {number} y - The value for the y component to set.\n * @param {number} z - The value for the z component to set.\n * @param {number} w - The value for the w component to set.\n * @return {InterleavedBufferAttribute} A reference to this instance.\n */\n setXYZW(e, t, n, s, r) {\n return e = e * this.data.stride + this.offset, this.normalized && (t = tt(t, this.array), n = tt(n, this.array), s = tt(s, this.array), r = tt(r, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this.data.array[e + 2] = s, this.data.array[e + 3] = r, this;\n }\n /**\n * Returns a new buffer attribute with copied values from this instance.\n *\n * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n *\n * @param {Object} [data] - An object with interleaved buffers that allows to retain the interleaved property.\n * @return {BufferAttribute|InterleavedBufferAttribute} A clone of this instance.\n */\n clone(e) {\n if (e === void 0) {\n yr(\"InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.\");\n const t = [];\n for (let n = 0; n < this.count; n++) {\n const s = n * this.data.stride + this.offset;\n for (let r = 0; r < this.itemSize; r++)\n t.push(this.data.array[s + r]);\n }\n return new kt(new this.array.constructor(t), this.itemSize, this.normalized);\n } else\n return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new Oo(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);\n }\n /**\n * Serializes the buffer attribute into JSON.\n *\n * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n *\n * @param {Object} [data] - An optional value holding meta information about the serialization.\n * @return {Object} A JSON object representing the serialized buffer attribute.\n */\n toJSON(e) {\n if (e === void 0) {\n yr(\"InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.\");\n const t = [];\n for (let n = 0; n < this.count; n++) {\n const s = n * this.data.stride + this.offset;\n for (let r = 0; r < this.itemSize; r++)\n t.push(this.data.array[s + r]);\n }\n return {\n itemSize: this.itemSize,\n type: this.array.constructor.name,\n array: t,\n normalized: this.normalized\n };\n } else\n return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), {\n isInterleavedBufferAttribute: !0,\n itemSize: this.itemSize,\n data: this.data.uuid,\n offset: this.offset,\n normalized: this.normalized\n };\n }\n}\nconst Al = /* @__PURE__ */ new w(), Rl = /* @__PURE__ */ new Je(), Cl = /* @__PURE__ */ new Je(), id = /* @__PURE__ */ new w(), Pl = /* @__PURE__ */ new Ne(), Zs = /* @__PURE__ */ new w(), sa = /* @__PURE__ */ new Rn(), Dl = /* @__PURE__ */ new Ne(), ra = /* @__PURE__ */ new Ji();\nclass sd extends ot {\n /**\n * Constructs a new skinned mesh.\n *\n * @param {BufferGeometry} [geometry] - The mesh geometry.\n * @param {Material|Array} [material] - The mesh material.\n */\n constructor(e, t) {\n super(e, t), this.isSkinnedMesh = !0, this.type = \"SkinnedMesh\", this.bindMode = sl, this.bindMatrix = new Ne(), this.bindMatrixInverse = new Ne(), this.boundingBox = null, this.boundingSphere = null;\n }\n /**\n * Computes the bounding box of the skinned mesh, and updates {@link SkinnedMesh#boundingBox}.\n * The bounding box is not automatically computed by the engine; this method must be called by your app.\n * If the skinned mesh is animated, the bounding box should be recomputed per frame in order to reflect\n * the current animation state.\n */\n computeBoundingBox() {\n const e = this.geometry;\n this.boundingBox === null && (this.boundingBox = new Pt()), this.boundingBox.makeEmpty();\n const t = e.getAttribute(\"position\");\n for (let n = 0; n < t.count; n++)\n this.getVertexPosition(n, Zs), this.boundingBox.expandByPoint(Zs);\n }\n /**\n * Computes the bounding sphere of the skinned mesh, and updates {@link SkinnedMesh#boundingSphere}.\n * The bounding sphere is automatically computed by the engine once when it is needed, e.g., for ray casting\n * and view frustum culling. If the skinned mesh is animated, the bounding sphere should be recomputed\n * per frame in order to reflect the current animation state.\n */\n computeBoundingSphere() {\n const e = this.geometry;\n this.boundingSphere === null && (this.boundingSphere = new Rn()), this.boundingSphere.makeEmpty();\n const t = e.getAttribute(\"position\");\n for (let n = 0; n < t.count; n++)\n this.getVertexPosition(n, Zs), this.boundingSphere.expandByPoint(Zs);\n }\n copy(e, t) {\n return super.copy(e, t), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this;\n }\n raycast(e, t) {\n const n = this.material, s = this.matrixWorld;\n n !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), sa.copy(this.boundingSphere), sa.applyMatrix4(s), e.ray.intersectsSphere(sa) !== !1 && (Dl.copy(s).invert(), ra.copy(e.ray).applyMatrix4(Dl), !(this.boundingBox !== null && ra.intersectsBox(this.boundingBox) === !1) && this._computeIntersections(e, t, ra)));\n }\n getVertexPosition(e, t) {\n return super.getVertexPosition(e, t), this.applyBoneTransform(e, t), t;\n }\n /**\n * Binds the given skeleton to the skinned mesh.\n *\n * @param {Skeleton} skeleton - The skeleton to bind.\n * @param {Matrix4} [bindMatrix] - The bind matrix. If no bind matrix is provided,\n * the skinned mesh's world matrix will be used instead.\n */\n bind(e, t) {\n this.skeleton = e, t === void 0 && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), t = this.matrixWorld), this.bindMatrix.copy(t), this.bindMatrixInverse.copy(t).invert();\n }\n /**\n * This method sets the skinned mesh in the rest pose).\n */\n pose() {\n this.skeleton.pose();\n }\n /**\n * Normalizes the skin weights which are defined as a buffer attribute\n * in the skinned mesh's geometry.\n */\n normalizeSkinWeights() {\n const e = new Je(), t = this.geometry.attributes.skinWeight;\n for (let n = 0, s = t.count; n < s; n++) {\n e.fromBufferAttribute(t, n);\n const r = 1 / e.manhattanLength();\n r !== 1 / 0 ? e.multiplyScalar(r) : e.set(1, 0, 0, 0), t.setXYZW(n, e.x, e.y, e.z, e.w);\n }\n }\n updateMatrixWorld(e) {\n super.updateMatrixWorld(e), this.bindMode === sl ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === Qh ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : Te(\"SkinnedMesh: Unrecognized bindMode: \" + this.bindMode);\n }\n /**\n * Applies the bone transform associated with the given index to the given\n * vertex position. Returns the updated vector.\n *\n * @param {number} index - The vertex index.\n * @param {Vector3} target - The target object that is used to store the method's result.\n * the skinned mesh's world matrix will be used instead.\n * @return {Vector3} The updated vertex position.\n */\n applyBoneTransform(e, t) {\n const n = this.skeleton, s = this.geometry;\n Rl.fromBufferAttribute(s.attributes.skinIndex, e), Cl.fromBufferAttribute(s.attributes.skinWeight, e), Al.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0);\n for (let r = 0; r < 4; r++) {\n const a = Cl.getComponent(r);\n if (a !== 0) {\n const o = Rl.getComponent(r);\n Pl.multiplyMatrices(n.bones[o].matrixWorld, n.boneInverses[o]), t.addScaledVector(id.copy(Al).applyMatrix4(Pl), a);\n }\n }\n return t.applyMatrix4(this.bindMatrixInverse);\n }\n}\nclass sh extends pt {\n /**\n * Constructs a new bone.\n */\n constructor() {\n super(), this.isBone = !0, this.type = \"Bone\";\n }\n}\nclass Qi extends Ct {\n /**\n * Constructs a new data texture.\n *\n * @param {?TypedArray} [data=null] - The buffer data.\n * @param {number} [width=1] - The width of the texture.\n * @param {number} [height=1] - The height of the texture.\n * @param {number} [format=RGBAFormat] - The texture format.\n * @param {number} [type=UnsignedByteType] - The texture type.\n * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n * @param {number} [magFilter=NearestFilter] - The mag filter value.\n * @param {number} [minFilter=NearestFilter] - The min filter value.\n * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n * @param {string} [colorSpace=NoColorSpace] - The color space.\n */\n constructor(e = null, t = 1, n = 1, s, r, a, o, l, c = Dt, h = Dt, u, d) {\n super(null, a, o, l, c, h, s, r, u, d), this.isDataTexture = !0, this.image = { data: e, width: t, height: n }, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;\n }\n}\nconst Ll = /* @__PURE__ */ new Ne(), rd = /* @__PURE__ */ new Ne();\nclass Bo {\n /**\n * Constructs a new skeleton.\n *\n * @param {Array} [bones] - An array of bones.\n * @param {Array} [boneInverses] - An array of bone inverse matrices.\n * If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}.\n */\n constructor(e = [], t = []) {\n this.uuid = fn(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init();\n }\n /**\n * Initializes the skeleton. This method gets automatically called by the constructor\n * but depending on how the skeleton is created it might be necessary to call this method\n * manually.\n */\n init() {\n const e = this.bones, t = this.boneInverses;\n if (this.boneMatrices = new Float32Array(e.length * 16), t.length === 0)\n this.calculateInverses();\n else if (e.length !== t.length) {\n Te(\"Skeleton: Number of inverse bone matrices does not match amount of bones.\"), this.boneInverses = [];\n for (let n = 0, s = this.bones.length; n < s; n++)\n this.boneInverses.push(new Ne());\n }\n }\n /**\n * Computes the bone inverse matrices. This method resets {@link Skeleton#boneInverses}\n * and fills it with new matrices.\n */\n calculateInverses() {\n this.boneInverses.length = 0;\n for (let e = 0, t = this.bones.length; e < t; e++) {\n const n = new Ne();\n this.bones[e] && n.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(n);\n }\n }\n /**\n * Resets the skeleton to the base pose.\n */\n pose() {\n for (let e = 0, t = this.bones.length; e < t; e++) {\n const n = this.bones[e];\n n && n.matrixWorld.copy(this.boneInverses[e]).invert();\n }\n for (let e = 0, t = this.bones.length; e < t; e++) {\n const n = this.bones[e];\n n && (n.parent && n.parent.isBone ? (n.matrix.copy(n.parent.matrixWorld).invert(), n.matrix.multiply(n.matrixWorld)) : n.matrix.copy(n.matrixWorld), n.matrix.decompose(n.position, n.quaternion, n.scale));\n }\n }\n /**\n * Resets the skeleton to the base pose.\n */\n update() {\n const e = this.bones, t = this.boneInverses, n = this.boneMatrices, s = this.boneTexture;\n for (let r = 0, a = e.length; r < a; r++) {\n const o = e[r] ? e[r].matrixWorld : rd;\n Ll.multiplyMatrices(o, t[r]), Ll.toArray(n, r * 16);\n }\n s !== null && (s.needsUpdate = !0);\n }\n /**\n * Returns a new skeleton with copied values from this instance.\n *\n * @return {Skeleton} A clone of this instance.\n */\n clone() {\n return new Bo(this.bones, this.boneInverses);\n }\n /**\n * Computes a data texture for passing bone data to the vertex shader.\n *\n * @return {Skeleton} A reference of this instance.\n */\n computeBoneTexture() {\n let e = Math.sqrt(this.bones.length * 4);\n e = Math.ceil(e / 4) * 4, e = Math.max(e, 4);\n const t = new Float32Array(e * e * 4);\n t.set(this.boneMatrices);\n const n = new Qi(t, e, e, Zt, Xt);\n return n.needsUpdate = !0, this.boneMatrices = t, this.boneTexture = n, this;\n }\n /**\n * Searches through the skeleton's bone array and returns the first with a\n * matching name.\n *\n * @param {string} name - The name of the bone.\n * @return {Bone|undefined} The found bone. `undefined` if no bone has been found.\n */\n getBoneByName(e) {\n for (let t = 0, n = this.bones.length; t < n; t++) {\n const s = this.bones[t];\n if (s.name === e)\n return s;\n }\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n */\n dispose() {\n this.boneTexture !== null && (this.boneTexture.dispose(), this.boneTexture = null);\n }\n /**\n * Setups the skeleton by the given JSON and bones.\n *\n * @param {Object} json - The skeleton as serialized JSON.\n * @param {Object} bones - An array of bones.\n * @return {Skeleton} A reference of this instance.\n */\n fromJSON(e, t) {\n this.uuid = e.uuid;\n for (let n = 0, s = e.bones.length; n < s; n++) {\n const r = e.bones[n];\n let a = t[r];\n a === void 0 && (Te(\"Skeleton: No bone found with UUID:\", r), a = new sh()), this.bones.push(a), this.boneInverses.push(new Ne().fromArray(e.boneInverses[n]));\n }\n return this.init(), this;\n }\n /**\n * Serializes the skeleton into JSON.\n *\n * @return {Object} A JSON object representing the serialized skeleton.\n * @see {@link ObjectLoader#parse}\n */\n toJSON() {\n const e = {\n metadata: {\n version: 4.7,\n type: \"Skeleton\",\n generator: \"Skeleton.toJSON\"\n },\n bones: [],\n boneInverses: []\n };\n e.uuid = this.uuid;\n const t = this.bones, n = this.boneInverses;\n for (let s = 0, r = t.length; s < r; s++) {\n const a = t[s];\n e.bones.push(a.uuid);\n const o = n[s];\n e.boneInverses.push(o.toArray());\n }\n return e;\n }\n}\nclass uo extends kt {\n /**\n * Constructs a new instanced buffer attribute.\n *\n * @param {TypedArray} array - The array holding the attribute data.\n * @param {number} itemSize - The item size.\n * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n * @param {number} [meshPerAttribute=1] - How often a value of this buffer attribute should be repeated.\n */\n constructor(e, t, n, s = 1) {\n super(e, t, n), this.isInstancedBufferAttribute = !0, this.meshPerAttribute = s;\n }\n copy(e) {\n return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this;\n }\n toJSON() {\n const e = super.toJSON();\n return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e;\n }\n}\nconst Pi = /* @__PURE__ */ new Ne(), Il = /* @__PURE__ */ new Ne(), $s = [], Ul = /* @__PURE__ */ new Pt(), ad = /* @__PURE__ */ new Ne(), ls = /* @__PURE__ */ new ot(), cs = /* @__PURE__ */ new Rn();\nclass od extends ot {\n /**\n * Constructs a new instanced mesh.\n *\n * @param {BufferGeometry} [geometry] - The mesh geometry.\n * @param {Material|Array} [material] - The mesh material.\n * @param {number} count - The number of instances.\n */\n constructor(e, t, n) {\n super(e, t), this.isInstancedMesh = !0, this.instanceMatrix = new uo(new Float32Array(n * 16), 16), this.instanceColor = null, this.morphTexture = null, this.count = n, this.boundingBox = null, this.boundingSphere = null;\n for (let s = 0; s < n; s++)\n this.setMatrixAt(s, ad);\n }\n /**\n * Computes the bounding box of the instanced mesh, and updates {@link InstancedMesh#boundingBox}.\n * The bounding box is not automatically computed by the engine; this method must be called by your app.\n * You may need to recompute the bounding box if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n */\n computeBoundingBox() {\n const e = this.geometry, t = this.count;\n this.boundingBox === null && (this.boundingBox = new Pt()), e.boundingBox === null && e.computeBoundingBox(), this.boundingBox.makeEmpty();\n for (let n = 0; n < t; n++)\n this.getMatrixAt(n, Pi), Ul.copy(e.boundingBox).applyMatrix4(Pi), this.boundingBox.union(Ul);\n }\n /**\n * Computes the bounding sphere of the instanced mesh, and updates {@link InstancedMesh#boundingSphere}\n * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n * You may need to recompute the bounding sphere if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n */\n computeBoundingSphere() {\n const e = this.geometry, t = this.count;\n this.boundingSphere === null && (this.boundingSphere = new Rn()), e.boundingSphere === null && e.computeBoundingSphere(), this.boundingSphere.makeEmpty();\n for (let n = 0; n < t; n++)\n this.getMatrixAt(n, Pi), cs.copy(e.boundingSphere).applyMatrix4(Pi), this.boundingSphere.union(cs);\n }\n copy(e, t) {\n return super.copy(e, t), this.instanceMatrix.copy(e.instanceMatrix), e.morphTexture !== null && (this.morphTexture = e.morphTexture.clone()), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this;\n }\n /**\n * Gets the color of the defined instance.\n *\n * @param {number} index - The instance index.\n * @param {Color} color - The target object that is used to store the method's result.\n */\n getColorAt(e, t) {\n t.fromArray(this.instanceColor.array, e * 3);\n }\n /**\n * Gets the local transformation matrix of the defined instance.\n *\n * @param {number} index - The instance index.\n * @param {Matrix4} matrix - The target object that is used to store the method's result.\n */\n getMatrixAt(e, t) {\n t.fromArray(this.instanceMatrix.array, e * 16);\n }\n /**\n * Gets the morph target weights of the defined instance.\n *\n * @param {number} index - The instance index.\n * @param {Mesh} object - The target object that is used to store the method's result.\n */\n getMorphAt(e, t) {\n const n = t.morphTargetInfluences, s = this.morphTexture.source.data.data, r = n.length + 1, a = e * r + 1;\n for (let o = 0; o < n.length; o++)\n n[o] = s[a + o];\n }\n raycast(e, t) {\n const n = this.matrixWorld, s = this.count;\n if (ls.geometry = this.geometry, ls.material = this.material, ls.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), cs.copy(this.boundingSphere), cs.applyMatrix4(n), e.ray.intersectsSphere(cs) !== !1))\n for (let r = 0; r < s; r++) {\n this.getMatrixAt(r, Pi), Il.multiplyMatrices(n, Pi), ls.matrixWorld = Il, ls.raycast(e, $s);\n for (let a = 0, o = $s.length; a < o; a++) {\n const l = $s[a];\n l.instanceId = r, l.object = this, t.push(l);\n }\n $s.length = 0;\n }\n }\n /**\n * Sets the given color to the defined instance. Make sure you set the `needsUpdate` flag of\n * {@link InstancedMesh#instanceColor} to `true` after updating all the colors.\n *\n * @param {number} index - The instance index.\n * @param {Color} color - The instance color.\n */\n setColorAt(e, t) {\n this.instanceColor === null && (this.instanceColor = new uo(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3)), t.toArray(this.instanceColor.array, e * 3);\n }\n /**\n * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of\n * {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.\n *\n * @param {number} index - The instance index.\n * @param {Matrix4} matrix - The local transformation.\n */\n setMatrixAt(e, t) {\n t.toArray(this.instanceMatrix.array, e * 16);\n }\n /**\n * Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of\n * {@link InstancedMesh#morphTexture} to `true` after updating all the influences.\n *\n * @param {number} index - The instance index.\n * @param {Mesh} object - A mesh which `morphTargetInfluences` property containing the morph target weights\n * of a single instance.\n */\n setMorphAt(e, t) {\n const n = t.morphTargetInfluences, s = n.length + 1;\n this.morphTexture === null && (this.morphTexture = new Qi(new Float32Array(s * this.count), s, this.count, wo, Xt));\n const r = this.morphTexture.source.data.data;\n let a = 0;\n for (let c = 0; c < n.length; c++)\n a += n[c];\n const o = this.geometry.morphTargetsRelative ? 1 : 1 - a, l = s * e;\n r[l] = o, r.set(n, l + 1);\n }\n updateMorphTargets() {\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n */\n dispose() {\n this.dispatchEvent({ type: \"dispose\" }), this.morphTexture !== null && (this.morphTexture.dispose(), this.morphTexture = null);\n }\n}\nconst aa = /* @__PURE__ */ new w(), ld = /* @__PURE__ */ new w(), cd = /* @__PURE__ */ new ze();\nclass Sn {\n /**\n * Constructs a new plane.\n *\n * @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane.\n * @param {number} [constant=0] - The signed distance from the origin to the plane.\n */\n constructor(e = new w(1, 0, 0), t = 0) {\n this.isPlane = !0, this.normal = e, this.constant = t;\n }\n /**\n * Sets the plane components by copying the given values.\n *\n * @param {Vector3} normal - The normal.\n * @param {number} constant - The constant.\n * @return {Plane} A reference to this plane.\n */\n set(e, t) {\n return this.normal.copy(e), this.constant = t, this;\n }\n /**\n * Sets the plane components by defining `x`, `y`, `z` as the\n * plane normal and `w` as the constant.\n *\n * @param {number} x - The value for the normal's x component.\n * @param {number} y - The value for the normal's y component.\n * @param {number} z - The value for the normal's z component.\n * @param {number} w - The constant value.\n * @return {Plane} A reference to this plane.\n */\n setComponents(e, t, n, s) {\n return this.normal.set(e, t, n), this.constant = s, this;\n }\n /**\n * Sets the plane from the given normal and coplanar point (that is a point\n * that lies onto the plane).\n *\n * @param {Vector3} normal - The normal.\n * @param {Vector3} point - A coplanar point.\n * @return {Plane} A reference to this plane.\n */\n setFromNormalAndCoplanarPoint(e, t) {\n return this.normal.copy(e), this.constant = -t.dot(this.normal), this;\n }\n /**\n * Sets the plane from three coplanar points. The winding order is\n * assumed to be counter-clockwise, and determines the direction of\n * the plane normal.\n *\n * @param {Vector3} a - The first coplanar point.\n * @param {Vector3} b - The second coplanar point.\n * @param {Vector3} c - The third coplanar point.\n * @return {Plane} A reference to this plane.\n */\n setFromCoplanarPoints(e, t, n) {\n const s = aa.subVectors(n, t).cross(ld.subVectors(e, t)).normalize();\n return this.setFromNormalAndCoplanarPoint(s, e), this;\n }\n /**\n * Copies the values of the given plane to this instance.\n *\n * @param {Plane} plane - The plane to copy.\n * @return {Plane} A reference to this plane.\n */\n copy(e) {\n return this.normal.copy(e.normal), this.constant = e.constant, this;\n }\n /**\n * Normalizes the plane normal and adjusts the constant accordingly.\n *\n * @return {Plane} A reference to this plane.\n */\n normalize() {\n const e = 1 / this.normal.length();\n return this.normal.multiplyScalar(e), this.constant *= e, this;\n }\n /**\n * Negates both the plane normal and the constant.\n *\n * @return {Plane} A reference to this plane.\n */\n negate() {\n return this.constant *= -1, this.normal.negate(), this;\n }\n /**\n * Returns the signed distance from the given point to this plane.\n *\n * @param {Vector3} point - The point to compute the distance for.\n * @return {number} The signed distance.\n */\n distanceToPoint(e) {\n return this.normal.dot(e) + this.constant;\n }\n /**\n * Returns the signed distance from the given sphere to this plane.\n *\n * @param {Sphere} sphere - The sphere to compute the distance for.\n * @return {number} The signed distance.\n */\n distanceToSphere(e) {\n return this.distanceToPoint(e.center) - e.radius;\n }\n /**\n * Projects a the given point onto the plane.\n *\n * @param {Vector3} point - The point to project.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The projected point on the plane.\n */\n projectPoint(e, t) {\n return t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e));\n }\n /**\n * Returns the intersection point of the passed line and the plane. Returns\n * `null` if the line does not intersect. Returns the line's starting point if\n * the line is coplanar with the plane.\n *\n * @param {Line3} line - The line to compute the intersection for.\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {?Vector3} The intersection point.\n */\n intersectLine(e, t) {\n const n = e.delta(aa), s = this.normal.dot(n);\n if (s === 0)\n return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;\n const r = -(e.start.dot(this.normal) + this.constant) / s;\n return r < 0 || r > 1 ? null : t.copy(e.start).addScaledVector(n, r);\n }\n /**\n * Returns `true` if the given line segment intersects with (passes through) the plane.\n *\n * @param {Line3} line - The line to test.\n * @return {boolean} Whether the given line segment intersects with the plane or not.\n */\n intersectsLine(e) {\n const t = this.distanceToPoint(e.start), n = this.distanceToPoint(e.end);\n return t < 0 && n > 0 || n < 0 && t > 0;\n }\n /**\n * Returns `true` if the given bounding box intersects with the plane.\n *\n * @param {Box3} box - The bounding box to test.\n * @return {boolean} Whether the given bounding box intersects with the plane or not.\n */\n intersectsBox(e) {\n return e.intersectsPlane(this);\n }\n /**\n * Returns `true` if the given bounding sphere intersects with the plane.\n *\n * @param {Sphere} sphere - The bounding sphere to test.\n * @return {boolean} Whether the given bounding sphere intersects with the plane or not.\n */\n intersectsSphere(e) {\n return e.intersectsPlane(this);\n }\n /**\n * Returns a coplanar vector to the plane, by calculating the\n * projection of the normal at the origin onto the plane.\n *\n * @param {Vector3} target - The target vector that is used to store the method's result.\n * @return {Vector3} The coplanar point.\n */\n coplanarPoint(e) {\n return e.copy(this.normal).multiplyScalar(-this.constant);\n }\n /**\n * Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform.\n *\n * The optional normal matrix can be pre-computed like so:\n * ```js\n * const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );\n * ```\n *\n * @param {Matrix4} matrix - The transformation matrix.\n * @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix.\n * @return {Plane} A reference to this plane.\n */\n applyMatrix4(e, t) {\n const n = t || cd.getNormalMatrix(e), s = this.coplanarPoint(aa).applyMatrix4(e), r = this.normal.applyMatrix3(n).normalize();\n return this.constant = -s.dot(r), this;\n }\n /**\n * Translates the plane by the distance defined by the given offset vector.\n * Note that this only affects the plane constant and will not affect the normal vector.\n *\n * @param {Vector3} offset - The offset vector.\n * @return {Plane} A reference to this plane.\n */\n translate(e) {\n return this.constant -= e.dot(this.normal), this;\n }\n /**\n * Returns `true` if this plane is equal with the given one.\n *\n * @param {Plane} plane - The plane to test for equality.\n * @return {boolean} Whether this plane is equal with the given one.\n */\n equals(e) {\n return e.normal.equals(this.normal) && e.constant === this.constant;\n }\n /**\n * Returns a new plane with copied values from this instance.\n *\n * @return {Plane} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n}\nconst oi = /* @__PURE__ */ new Rn(), hd = /* @__PURE__ */ new le(0.5, 0.5), Js = /* @__PURE__ */ new w();\nclass zo {\n /**\n * Constructs a new frustum.\n *\n * @param {Plane} [p0] - The first plane that encloses the frustum.\n * @param {Plane} [p1] - The second plane that encloses the frustum.\n * @param {Plane} [p2] - The third plane that encloses the frustum.\n * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n */\n constructor(e = new Sn(), t = new Sn(), n = new Sn(), s = new Sn(), r = new Sn(), a = new Sn()) {\n this.planes = [e, t, n, s, r, a];\n }\n /**\n * Sets the frustum planes by copying the given planes.\n *\n * @param {Plane} [p0] - The first plane that encloses the frustum.\n * @param {Plane} [p1] - The second plane that encloses the frustum.\n * @param {Plane} [p2] - The third plane that encloses the frustum.\n * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n * @return {Frustum} A reference to this frustum.\n */\n set(e, t, n, s, r, a) {\n const o = this.planes;\n return o[0].copy(e), o[1].copy(t), o[2].copy(n), o[3].copy(s), o[4].copy(r), o[5].copy(a), this;\n }\n /**\n * Copies the values of the given frustum to this instance.\n *\n * @param {Frustum} frustum - The frustum to copy.\n * @return {Frustum} A reference to this frustum.\n */\n copy(e) {\n const t = this.planes;\n for (let n = 0; n < 6; n++)\n t[n].copy(e.planes[n]);\n return this;\n }\n /**\n * Sets the frustum planes from the given projection matrix.\n *\n * @param {Matrix4} m - The projection matrix.\n * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.\n * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n * @return {Frustum} A reference to this frustum.\n */\n setFromProjectionMatrix(e, t = Tn, n = !1) {\n const s = this.planes, r = e.elements, a = r[0], o = r[1], l = r[2], c = r[3], h = r[4], u = r[5], d = r[6], p = r[7], g = r[8], x = r[9], m = r[10], f = r[11], y = r[12], v = r[13], T = r[14], R = r[15];\n if (s[0].setComponents(c - a, p - h, f - g, R - y).normalize(), s[1].setComponents(c + a, p + h, f + g, R + y).normalize(), s[2].setComponents(c + o, p + u, f + x, R + v).normalize(), s[3].setComponents(c - o, p - u, f - x, R - v).normalize(), n)\n s[4].setComponents(l, d, m, T).normalize(), s[5].setComponents(c - l, p - d, f - m, R - T).normalize();\n else if (s[4].setComponents(c - l, p - d, f - m, R - T).normalize(), t === Tn)\n s[5].setComponents(c + l, p + d, f + m, R + T).normalize();\n else if (t === br)\n s[5].setComponents(l, d, m, T).normalize();\n else\n throw new Error(\"THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: \" + t);\n return this;\n }\n /**\n * Returns `true` if the 3D object's bounding sphere is intersecting this frustum.\n *\n * Note that the 3D object must have a geometry so that the bounding sphere can be calculated.\n *\n * @param {Object3D} object - The 3D object to test.\n * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not.\n */\n intersectsObject(e) {\n if (e.boundingSphere !== void 0)\n e.boundingSphere === null && e.computeBoundingSphere(), oi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);\n else {\n const t = e.geometry;\n t.boundingSphere === null && t.computeBoundingSphere(), oi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);\n }\n return this.intersectsSphere(oi);\n }\n /**\n * Returns `true` if the given sprite is intersecting this frustum.\n *\n * @param {Sprite} sprite - The sprite to test.\n * @return {boolean} Whether the sprite is intersecting this frustum or not.\n */\n intersectsSprite(e) {\n oi.center.set(0, 0, 0);\n const t = hd.distanceTo(e.center);\n return oi.radius = 0.7071067811865476 + t, oi.applyMatrix4(e.matrixWorld), this.intersectsSphere(oi);\n }\n /**\n * Returns `true` if the given bounding sphere is intersecting this frustum.\n *\n * @param {Sphere} sphere - The bounding sphere to test.\n * @return {boolean} Whether the bounding sphere is intersecting this frustum or not.\n */\n intersectsSphere(e) {\n const t = this.planes, n = e.center, s = -e.radius;\n for (let r = 0; r < 6; r++)\n if (t[r].distanceToPoint(n) < s)\n return !1;\n return !0;\n }\n /**\n * Returns `true` if the given bounding box is intersecting this frustum.\n *\n * @param {Box3} box - The bounding box to test.\n * @return {boolean} Whether the bounding box is intersecting this frustum or not.\n */\n intersectsBox(e) {\n const t = this.planes;\n for (let n = 0; n < 6; n++) {\n const s = t[n];\n if (Js.x = s.normal.x > 0 ? e.max.x : e.min.x, Js.y = s.normal.y > 0 ? e.max.y : e.min.y, Js.z = s.normal.z > 0 ? e.max.z : e.min.z, s.distanceToPoint(Js) < 0)\n return !1;\n }\n return !0;\n }\n /**\n * Returns `true` if the given point lies within the frustum.\n *\n * @param {Vector3} point - The point to test.\n * @return {boolean} Whether the point lies within this frustum or not.\n */\n containsPoint(e) {\n const t = this.planes;\n for (let n = 0; n < 6; n++)\n if (t[n].distanceToPoint(e) < 0)\n return !1;\n return !0;\n }\n /**\n * Returns a new frustum with copied values from this instance.\n *\n * @return {Frustum} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n}\nclass rh extends tn {\n /**\n * Constructs a new line basic material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isLineBasicMaterial = !0, this.type = \"LineBasicMaterial\", this.color = new Se(16777215), this.map = null, this.linewidth = 1, this.linecap = \"round\", this.linejoin = \"round\", this.fog = !0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.color.copy(e.color), this.map = e.map, this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.fog = e.fog, this;\n }\n}\nconst Tr = /* @__PURE__ */ new w(), Er = /* @__PURE__ */ new w(), Nl = /* @__PURE__ */ new Ne(), hs = /* @__PURE__ */ new Ji(), Qs = /* @__PURE__ */ new Rn(), oa = /* @__PURE__ */ new w(), Fl = /* @__PURE__ */ new w();\nclass ko extends pt {\n /**\n * Constructs a new line.\n *\n * @param {BufferGeometry} [geometry] - The line geometry.\n * @param {Material|Array} [material] - The line material.\n */\n constructor(e = new nn(), t = new rh()) {\n super(), this.isLine = !0, this.type = \"Line\", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();\n }\n copy(e, t) {\n return super.copy(e, t), this.material = Array.isArray(e.material) ? e.material.slice() : e.material, this.geometry = e.geometry, this;\n }\n /**\n * Computes an array of distance values which are necessary for rendering dashed lines.\n * For each vertex in the geometry, the method calculates the cumulative length from the\n * current point to the very beginning of the line.\n *\n * @return {Line} A reference to this line.\n */\n computeLineDistances() {\n const e = this.geometry;\n if (e.index === null) {\n const t = e.attributes.position, n = [0];\n for (let s = 1, r = t.count; s < r; s++)\n Tr.fromBufferAttribute(t, s - 1), Er.fromBufferAttribute(t, s), n[s] = n[s - 1], n[s] += Tr.distanceTo(Er);\n e.setAttribute(\"lineDistance\", new pn(n, 1));\n } else\n Te(\"Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");\n return this;\n }\n /**\n * Computes intersection points between a casted ray and this line.\n *\n * @param {Raycaster} raycaster - The raycaster.\n * @param {Array} intersects - The target array that holds the intersection points.\n */\n raycast(e, t) {\n const n = this.geometry, s = this.matrixWorld, r = e.params.Line.threshold, a = n.drawRange;\n if (n.boundingSphere === null && n.computeBoundingSphere(), Qs.copy(n.boundingSphere), Qs.applyMatrix4(s), Qs.radius += r, e.ray.intersectsSphere(Qs) === !1) return;\n Nl.copy(s).invert(), hs.copy(e.ray).applyMatrix4(Nl);\n const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = this.isLineSegments ? 2 : 1, h = n.index, d = n.attributes.position;\n if (h !== null) {\n const p = Math.max(0, a.start), g = Math.min(h.count, a.start + a.count);\n for (let x = p, m = g - 1; x < m; x += c) {\n const f = h.getX(x), y = h.getX(x + 1), v = er(this, e, hs, l, f, y, x);\n v && t.push(v);\n }\n if (this.isLineLoop) {\n const x = h.getX(g - 1), m = h.getX(p), f = er(this, e, hs, l, x, m, g - 1);\n f && t.push(f);\n }\n } else {\n const p = Math.max(0, a.start), g = Math.min(d.count, a.start + a.count);\n for (let x = p, m = g - 1; x < m; x += c) {\n const f = er(this, e, hs, l, x, x + 1, x);\n f && t.push(f);\n }\n if (this.isLineLoop) {\n const x = er(this, e, hs, l, g - 1, p, g - 1);\n x && t.push(x);\n }\n }\n }\n /**\n * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences}\n * to make sure existing morph targets can influence this 3D object.\n */\n updateMorphTargets() {\n const t = this.geometry.morphAttributes, n = Object.keys(t);\n if (n.length > 0) {\n const s = t[n[0]];\n if (s !== void 0) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let r = 0, a = s.length; r < a; r++) {\n const o = s[r].name || String(r);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[o] = r;\n }\n }\n }\n }\n}\nfunction er(i, e, t, n, s, r, a) {\n const o = i.geometry.attributes.position;\n if (Tr.fromBufferAttribute(o, s), Er.fromBufferAttribute(o, r), t.distanceSqToSegment(Tr, Er, oa, Fl) > n) return;\n oa.applyMatrix4(i.matrixWorld);\n const c = e.ray.origin.distanceTo(oa);\n if (!(c < e.near || c > e.far))\n return {\n distance: c,\n // What do we want? intersection point on the ray or on the segment??\n // point: raycaster.ray.at( distance ),\n point: Fl.clone().applyMatrix4(i.matrixWorld),\n index: a,\n face: null,\n faceIndex: null,\n barycoord: null,\n object: i\n };\n}\nconst Ol = /* @__PURE__ */ new w(), Bl = /* @__PURE__ */ new w();\nclass ud extends ko {\n /**\n * Constructs a new line segments.\n *\n * @param {BufferGeometry} [geometry] - The line geometry.\n * @param {Material|Array} [material] - The line material.\n */\n constructor(e, t) {\n super(e, t), this.isLineSegments = !0, this.type = \"LineSegments\";\n }\n computeLineDistances() {\n const e = this.geometry;\n if (e.index === null) {\n const t = e.attributes.position, n = [];\n for (let s = 0, r = t.count; s < r; s += 2)\n Ol.fromBufferAttribute(t, s), Bl.fromBufferAttribute(t, s + 1), n[s] = s === 0 ? 0 : n[s - 1], n[s + 1] = n[s] + Ol.distanceTo(Bl);\n e.setAttribute(\"lineDistance\", new pn(n, 1));\n } else\n Te(\"LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");\n return this;\n }\n}\nclass dd extends ko {\n /**\n * Constructs a new line loop.\n *\n * @param {BufferGeometry} [geometry] - The line geometry.\n * @param {Material|Array} [material] - The line material.\n */\n constructor(e, t) {\n super(e, t), this.isLineLoop = !0, this.type = \"LineLoop\";\n }\n}\nclass ah extends tn {\n /**\n * Constructs a new points material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isPointsMaterial = !0, this.type = \"PointsMaterial\", this.color = new Se(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = !0, this.fog = !0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.fog = e.fog, this;\n }\n}\nconst zl = /* @__PURE__ */ new Ne(), fo = /* @__PURE__ */ new Ji(), tr = /* @__PURE__ */ new Rn(), nr = /* @__PURE__ */ new w();\nclass fd extends pt {\n /**\n * Constructs a new point cloud.\n *\n * @param {BufferGeometry} [geometry] - The points geometry.\n * @param {Material|Array} [material] - The points material.\n */\n constructor(e = new nn(), t = new ah()) {\n super(), this.isPoints = !0, this.type = \"Points\", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();\n }\n copy(e, t) {\n return super.copy(e, t), this.material = Array.isArray(e.material) ? e.material.slice() : e.material, this.geometry = e.geometry, this;\n }\n /**\n * Computes intersection points between a casted ray and this point cloud.\n *\n * @param {Raycaster} raycaster - The raycaster.\n * @param {Array} intersects - The target array that holds the intersection points.\n */\n raycast(e, t) {\n const n = this.geometry, s = this.matrixWorld, r = e.params.Points.threshold, a = n.drawRange;\n if (n.boundingSphere === null && n.computeBoundingSphere(), tr.copy(n.boundingSphere), tr.applyMatrix4(s), tr.radius += r, e.ray.intersectsSphere(tr) === !1) return;\n zl.copy(s).invert(), fo.copy(e.ray).applyMatrix4(zl);\n const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = o * o, c = n.index, u = n.attributes.position;\n if (c !== null) {\n const d = Math.max(0, a.start), p = Math.min(c.count, a.start + a.count);\n for (let g = d, x = p; g < x; g++) {\n const m = c.getX(g);\n nr.fromBufferAttribute(u, m), kl(nr, m, l, s, e, t, this);\n }\n } else {\n const d = Math.max(0, a.start), p = Math.min(u.count, a.start + a.count);\n for (let g = d, x = p; g < x; g++)\n nr.fromBufferAttribute(u, g), kl(nr, g, l, s, e, t, this);\n }\n }\n /**\n * Sets the values of {@link Points#morphTargetDictionary} and {@link Points#morphTargetInfluences}\n * to make sure existing morph targets can influence this 3D object.\n */\n updateMorphTargets() {\n const t = this.geometry.morphAttributes, n = Object.keys(t);\n if (n.length > 0) {\n const s = t[n[0]];\n if (s !== void 0) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let r = 0, a = s.length; r < a; r++) {\n const o = s[r].name || String(r);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[o] = r;\n }\n }\n }\n }\n}\nfunction kl(i, e, t, n, s, r, a) {\n const o = fo.distanceSqToPoint(i);\n if (o < t) {\n const l = new w();\n fo.closestPointToPoint(i, l), l.applyMatrix4(n);\n const c = s.ray.origin.distanceTo(l);\n if (c < s.near || c > s.far) return;\n r.push({\n distance: c,\n distanceToRay: Math.sqrt(o),\n point: l,\n index: e,\n face: null,\n faceIndex: null,\n barycoord: null,\n object: a\n });\n }\n}\nclass Vo extends Ct {\n /**\n * Constructs a new depth texture.\n *\n * @param {number} width - The width of the texture.\n * @param {number} height - The height of the texture.\n * @param {number} [type=UnsignedIntType] - The texture type.\n * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n * @param {number} [magFilter=LinearFilter] - The mag filter value.\n * @param {number} [minFilter=LinearFilter] - The min filter value.\n * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n * @param {number} [format=DepthFormat] - The texture format.\n * @param {number} [depth=1] - The depth of the texture.\n */\n constructor(e, t, n = di, s, r, a, o = Dt, l = Dt, c, h = bs, u = 1) {\n if (h !== bs && h !== Xi)\n throw new Error(\"DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat\");\n const d = { width: e, height: t, depth: u };\n super(d, s, r, a, o, l, h, n, c), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;\n }\n copy(e) {\n return super.copy(e), this.source = new Io(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this;\n }\n toJSON(e) {\n const t = super.toJSON(e);\n return this.compareFunction !== null && (t.compareFunction = this.compareFunction), t;\n }\n}\nclass oh extends Ct {\n /**\n * Creates a new raw texture.\n *\n * @param {?(WebGLTexture|GPUTexture)} [sourceTexture=null] - The external texture.\n */\n constructor(e = null) {\n super(), this.sourceTexture = e, this.isExternalTexture = !0;\n }\n copy(e) {\n return super.copy(e), this.sourceTexture = e.sourceTexture, this;\n }\n}\nclass As extends nn {\n /**\n * Constructs a new plane geometry.\n *\n * @param {number} [width=1] - The width along the X axis.\n * @param {number} [height=1] - The height along the Y axis\n * @param {number} [widthSegments=1] - The number of segments along the X axis.\n * @param {number} [heightSegments=1] - The number of segments along the Y axis.\n */\n constructor(e = 1, t = 1, n = 1, s = 1) {\n super(), this.type = \"PlaneGeometry\", this.parameters = {\n width: e,\n height: t,\n widthSegments: n,\n heightSegments: s\n };\n const r = e / 2, a = t / 2, o = Math.floor(n), l = Math.floor(s), c = o + 1, h = l + 1, u = e / o, d = t / l, p = [], g = [], x = [], m = [];\n for (let f = 0; f < h; f++) {\n const y = f * d - a;\n for (let v = 0; v < c; v++) {\n const T = v * u - r;\n g.push(T, -y, 0), x.push(0, 0, 1), m.push(v / o), m.push(1 - f / l);\n }\n }\n for (let f = 0; f < l; f++)\n for (let y = 0; y < o; y++) {\n const v = y + c * f, T = y + c * (f + 1), R = y + 1 + c * (f + 1), E = y + 1 + c * f;\n p.push(v, T, E), p.push(T, R, E);\n }\n this.setIndex(p), this.setAttribute(\"position\", new pn(g, 3)), this.setAttribute(\"normal\", new pn(x, 3)), this.setAttribute(\"uv\", new pn(m, 2));\n }\n copy(e) {\n return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n }\n /**\n * Factory method for creating an instance of this class from the given\n * JSON object.\n *\n * @param {Object} data - A JSON object representing the serialized geometry.\n * @return {PlaneGeometry} A new instance.\n */\n static fromJSON(e) {\n return new As(e.width, e.height, e.widthSegments, e.heightSegments);\n }\n}\nclass pd extends ht {\n /**\n * Constructs a new raw shader material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(e), this.isRawShaderMaterial = !0, this.type = \"RawShaderMaterial\";\n }\n}\nclass Go extends tn {\n /**\n * Constructs a new mesh standard material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshStandardMaterial = !0, this.type = \"MeshStandardMaterial\", this.defines = { STANDARD: \"\" }, this.color = new Se(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Se(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Cr, this.normalScale = new le(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xn(), this.envMapIntensity = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.flatShading = !1, this.fog = !0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.defines = { STANDARD: \"\" }, this.color.copy(e.color), this.roughness = e.roughness, this.metalness = e.metalness, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.roughnessMap = e.roughnessMap, this.metalnessMap = e.metalnessMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.envMapIntensity = e.envMapIntensity, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.flatShading = e.flatShading, this.fog = e.fog, this;\n }\n}\nclass Cn extends Go {\n /**\n * Constructs a new mesh physical material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshPhysicalMaterial = !0, this.defines = {\n STANDARD: \"\",\n PHYSICAL: \"\"\n }, this.type = \"MeshPhysicalMaterial\", this.anisotropyRotation = 0, this.anisotropyMap = null, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new le(1, 1), this.clearcoatNormalMap = null, this.ior = 1.5, Object.defineProperty(this, \"reflectivity\", {\n get: function() {\n return He(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);\n },\n set: function(t) {\n this.ior = (1 + 0.4 * t) / (1 - 0.4 * t);\n }\n }), this.iridescenceMap = null, this.iridescenceIOR = 1.3, this.iridescenceThicknessRange = [100, 400], this.iridescenceThicknessMap = null, this.sheenColor = new Se(0), this.sheenColorMap = null, this.sheenRoughness = 1, this.sheenRoughnessMap = null, this.transmissionMap = null, this.thickness = 0, this.thicknessMap = null, this.attenuationDistance = 1 / 0, this.attenuationColor = new Se(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new Se(1, 1, 1), this.specularColorMap = null, this._anisotropy = 0, this._clearcoat = 0, this._dispersion = 0, this._iridescence = 0, this._sheen = 0, this._transmission = 0, this.setValues(e);\n }\n /**\n * The anisotropy strength, from `0.0` to `1.0`.\n *\n * @type {number}\n * @default 0\n */\n get anisotropy() {\n return this._anisotropy;\n }\n set anisotropy(e) {\n this._anisotropy > 0 != e > 0 && this.version++, this._anisotropy = e;\n }\n /**\n * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use\n * clear coat related properties to enable multilayer materials that have a\n * thin translucent layer over the base layer.\n *\n * @type {number}\n * @default 0\n */\n get clearcoat() {\n return this._clearcoat;\n }\n set clearcoat(e) {\n this._clearcoat > 0 != e > 0 && this.version++, this._clearcoat = e;\n }\n /**\n * The intensity of the iridescence layer, simulating RGB color shift based on the angle between\n * the surface and the viewer, from `0.0` to `1.0`.\n *\n * @type {number}\n * @default 0\n */\n get iridescence() {\n return this._iridescence;\n }\n set iridescence(e) {\n this._iridescence > 0 != e > 0 && this.version++, this._iridescence = e;\n }\n /**\n * Defines the strength of the angular separation of colors (chromatic aberration) transmitting\n * through a relatively clear volume. Any value zero or larger is valid, the typical range of\n * realistic values is `[0, 1]`. This property can be only be used with transmissive objects.\n *\n * @type {number}\n * @default 0\n */\n get dispersion() {\n return this._dispersion;\n }\n set dispersion(e) {\n this._dispersion > 0 != e > 0 && this.version++, this._dispersion = e;\n }\n /**\n * The intensity of the sheen layer, from `0.0` to `1.0`.\n *\n * @type {number}\n * @default 0\n */\n get sheen() {\n return this._sheen;\n }\n set sheen(e) {\n this._sheen > 0 != e > 0 && this.version++, this._sheen = e;\n }\n /**\n * Degree of transmission (or optical transparency), from `0.0` to `1.0`.\n *\n * Thin, transparent or semitransparent, plastic or glass materials remain\n * largely reflective even if they are fully transmissive. The transmission\n * property can be used to model these materials.\n *\n * When transmission is non-zero, `opacity` should be set to `1`.\n *\n * @type {number}\n * @default 0\n */\n get transmission() {\n return this._transmission;\n }\n set transmission(e) {\n this._transmission > 0 != e > 0 && this.version++, this._transmission = e;\n }\n copy(e) {\n return super.copy(e), this.defines = {\n STANDARD: \"\",\n PHYSICAL: \"\"\n }, this.anisotropy = e.anisotropy, this.anisotropyRotation = e.anisotropyRotation, this.anisotropyMap = e.anisotropyMap, this.clearcoat = e.clearcoat, this.clearcoatMap = e.clearcoatMap, this.clearcoatRoughness = e.clearcoatRoughness, this.clearcoatRoughnessMap = e.clearcoatRoughnessMap, this.clearcoatNormalMap = e.clearcoatNormalMap, this.clearcoatNormalScale.copy(e.clearcoatNormalScale), this.dispersion = e.dispersion, this.ior = e.ior, this.iridescence = e.iridescence, this.iridescenceMap = e.iridescenceMap, this.iridescenceIOR = e.iridescenceIOR, this.iridescenceThicknessRange = [...e.iridescenceThicknessRange], this.iridescenceThicknessMap = e.iridescenceThicknessMap, this.sheen = e.sheen, this.sheenColor.copy(e.sheenColor), this.sheenColorMap = e.sheenColorMap, this.sheenRoughness = e.sheenRoughness, this.sheenRoughnessMap = e.sheenRoughnessMap, this.transmission = e.transmission, this.transmissionMap = e.transmissionMap, this.thickness = e.thickness, this.thicknessMap = e.thicknessMap, this.attenuationDistance = e.attenuationDistance, this.attenuationColor.copy(e.attenuationColor), this.specularIntensity = e.specularIntensity, this.specularIntensityMap = e.specularIntensityMap, this.specularColor.copy(e.specularColor), this.specularColorMap = e.specularColorMap, this;\n }\n}\nclass md extends tn {\n /**\n * Constructs a new mesh normal material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshNormalMaterial = !0, this.type = \"MeshNormalMaterial\", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Cr, this.normalScale = new le(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.flatShading = !1, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.flatShading = e.flatShading, this;\n }\n}\nclass gd extends tn {\n /**\n * Constructs a new mesh lambert material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshLambertMaterial = !0, this.type = \"MeshLambertMaterial\", this.color = new Se(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Se(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Cr, this.normalScale = new le(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new xn(), this.combine = So, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.flatShading = !1, this.fog = !0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.flatShading = e.flatShading, this.fog = e.fog, this;\n }\n}\nclass lh extends tn {\n /**\n * Constructs a new mesh depth material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshDepthMaterial = !0, this.type = \"MeshDepthMaterial\", this.depthPacking = nu, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.depthPacking = e.depthPacking, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this;\n }\n}\nclass xd extends tn {\n /**\n * Constructs a new mesh distance material.\n *\n * @param {Object} [parameters] - An object with one or more properties\n * defining the material's appearance. Any property of the material\n * (including any property from inherited materials) can be passed\n * in here. Color values can be passed any type of value accepted\n * by {@link Color#set}.\n */\n constructor(e) {\n super(), this.isMeshDistanceMaterial = !0, this.type = \"MeshDistanceMaterial\", this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.setValues(e);\n }\n copy(e) {\n return super.copy(e), this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this;\n }\n}\nfunction ir(i, e) {\n return !i || i.constructor === e ? i : typeof e.BYTES_PER_ELEMENT == \"number\" ? new e(i) : Array.prototype.slice.call(i);\n}\nfunction _d(i) {\n return ArrayBuffer.isView(i) && !(i instanceof DataView);\n}\nfunction vd(i) {\n function e(s, r) {\n return i[s] - i[r];\n }\n const t = i.length, n = new Array(t);\n for (let s = 0; s !== t; ++s) n[s] = s;\n return n.sort(e), n;\n}\nfunction Vl(i, e, t) {\n const n = i.length, s = new i.constructor(n);\n for (let r = 0, a = 0; a !== n; ++r) {\n const o = t[r] * e;\n for (let l = 0; l !== e; ++l)\n s[a++] = i[o + l];\n }\n return s;\n}\nfunction ch(i, e, t, n) {\n let s = 1, r = i[0];\n for (; r !== void 0 && r[n] === void 0; )\n r = i[s++];\n if (r === void 0) return;\n let a = r[n];\n if (a !== void 0)\n if (Array.isArray(a))\n do\n a = r[n], a !== void 0 && (e.push(r.time), t.push(...a)), r = i[s++];\n while (r !== void 0);\n else if (a.toArray !== void 0)\n do\n a = r[n], a !== void 0 && (e.push(r.time), a.toArray(t, t.length)), r = i[s++];\n while (r !== void 0);\n else\n do\n a = r[n], a !== void 0 && (e.push(r.time), t.push(a)), r = i[s++];\n while (r !== void 0);\n}\nclass Rs {\n /**\n * Constructs a new interpolant.\n *\n * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n * @param {TypedArray} sampleValues - The sample values.\n * @param {number} sampleSize - The sample size\n * @param {TypedArray} [resultBuffer] - The result buffer.\n */\n constructor(e, t, n, s) {\n this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = s !== void 0 ? s : new t.constructor(n), this.sampleValues = t, this.valueSize = n, this.settings = null, this.DefaultSettings_ = {};\n }\n /**\n * Evaluate the interpolant at position `t`.\n *\n * @param {number} t - The interpolation factor.\n * @return {TypedArray} The result buffer.\n */\n evaluate(e) {\n const t = this.parameterPositions;\n let n = this._cachedIndex, s = t[n], r = t[n - 1];\n n: {\n e: {\n let a;\n t: {\n i: if (!(e < s)) {\n for (let o = n + 2; ; ) {\n if (s === void 0) {\n if (e < r) break i;\n return n = t.length, this._cachedIndex = n, this.copySampleValue_(n - 1);\n }\n if (n === o) break;\n if (r = s, s = t[++n], e < s)\n break e;\n }\n a = t.length;\n break t;\n }\n if (!(e >= r)) {\n const o = t[1];\n e < o && (n = 2, r = o);\n for (let l = n - 2; ; ) {\n if (r === void 0)\n return this._cachedIndex = 0, this.copySampleValue_(0);\n if (n === l) break;\n if (s = r, r = t[--n - 1], e >= r)\n break e;\n }\n a = n, n = 0;\n break t;\n }\n break n;\n }\n for (; n < a; ) {\n const o = n + a >>> 1;\n e < t[o] ? a = o : n = o + 1;\n }\n if (s = t[n], r = t[n - 1], r === void 0)\n return this._cachedIndex = 0, this.copySampleValue_(0);\n if (s === void 0)\n return n = t.length, this._cachedIndex = n, this.copySampleValue_(n - 1);\n }\n this._cachedIndex = n, this.intervalChanged_(n, r, s);\n }\n return this.interpolate_(n, r, e, s);\n }\n /**\n * Returns the interpolation settings.\n *\n * @return {Object} The interpolation settings.\n */\n getSettings_() {\n return this.settings || this.DefaultSettings_;\n }\n /**\n * Copies a sample value to the result buffer.\n *\n * @param {number} index - An index into the sample value buffer.\n * @return {TypedArray} The result buffer.\n */\n copySampleValue_(e) {\n const t = this.resultBuffer, n = this.sampleValues, s = this.valueSize, r = e * s;\n for (let a = 0; a !== s; ++a)\n t[a] = n[r + a];\n return t;\n }\n /**\n * Copies a sample value to the result buffer.\n *\n * @abstract\n * @param {number} i1 - An index into the sample value buffer.\n * @param {number} t0 - The previous interpolation factor.\n * @param {number} t - The current interpolation factor.\n * @param {number} t1 - The next interpolation factor.\n * @return {TypedArray} The result buffer.\n */\n interpolate_() {\n throw new Error(\"call to abstract method\");\n }\n /**\n * Optional method that is executed when the interval has changed.\n *\n * @param {number} i1 - An index into the sample value buffer.\n * @param {number} t0 - The previous interpolation factor.\n * @param {number} t - The current interpolation factor.\n */\n intervalChanged_() {\n }\n}\nclass Md extends Rs {\n /**\n * Constructs a new cubic interpolant.\n *\n * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n * @param {TypedArray} sampleValues - The sample values.\n * @param {number} sampleSize - The sample size\n * @param {TypedArray} [resultBuffer] - The result buffer.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = {\n endingStart: rl,\n endingEnd: rl\n };\n }\n intervalChanged_(e, t, n) {\n const s = this.parameterPositions;\n let r = e - 2, a = e + 1, o = s[r], l = s[a];\n if (o === void 0)\n switch (this.getSettings_().endingStart) {\n case al:\n r = e, o = 2 * t - n;\n break;\n case ol:\n r = s.length - 2, o = t + s[r] - s[r + 1];\n break;\n default:\n r = e, o = n;\n }\n if (l === void 0)\n switch (this.getSettings_().endingEnd) {\n case al:\n a = e, l = 2 * n - t;\n break;\n case ol:\n a = 1, l = n + s[1] - s[0];\n break;\n default:\n a = e - 1, l = t;\n }\n const c = (n - t) * 0.5, h = this.valueSize;\n this._weightPrev = c / (t - o), this._weightNext = c / (l - n), this._offsetPrev = r * h, this._offsetNext = a * h;\n }\n interpolate_(e, t, n, s) {\n const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, p = this._weightNext, g = (n - t) / (s - t), x = g * g, m = x * g, f = -d * m + 2 * d * x - d * g, y = (1 + d) * m + (-1.5 - 2 * d) * x + (-0.5 + d) * g + 1, v = (-1 - p) * m + (1.5 + p) * x + 0.5 * g, T = p * m - p * x;\n for (let R = 0; R !== o; ++R)\n r[R] = f * a[h + R] + y * a[c + R] + v * a[l + R] + T * a[u + R];\n return r;\n }\n}\nclass Sd extends Rs {\n /**\n * Constructs a new linear interpolant.\n *\n * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n * @param {TypedArray} sampleValues - The sample values.\n * @param {number} sampleSize - The sample size\n * @param {TypedArray} [resultBuffer] - The result buffer.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n interpolate_(e, t, n, s) {\n const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = e * o, c = l - o, h = (n - t) / (s - t), u = 1 - h;\n for (let d = 0; d !== o; ++d)\n r[d] = a[c + d] * u + a[l + d] * h;\n return r;\n }\n}\nclass bd extends Rs {\n /**\n * Constructs a new discrete interpolant.\n *\n * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n * @param {TypedArray} sampleValues - The sample values.\n * @param {number} sampleSize - The sample size\n * @param {TypedArray} [resultBuffer] - The result buffer.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n interpolate_(e) {\n return this.copySampleValue_(e - 1);\n }\n}\nclass _n {\n /**\n * Constructs a new keyframe track.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n */\n constructor(e, t, n, s) {\n if (e === void 0) throw new Error(\"THREE.KeyframeTrack: track name is undefined\");\n if (t === void 0 || t.length === 0) throw new Error(\"THREE.KeyframeTrack: no keyframes in track named \" + e);\n this.name = e, this.times = ir(t, this.TimeBufferType), this.values = ir(n, this.ValueBufferType), this.setInterpolation(s || this.DefaultInterpolation);\n }\n /**\n * Converts the keyframe track to JSON.\n *\n * @static\n * @param {KeyframeTrack} track - The keyframe track to serialize.\n * @return {Object} The serialized keyframe track as JSON.\n */\n static toJSON(e) {\n const t = e.constructor;\n let n;\n if (t.toJSON !== this.toJSON)\n n = t.toJSON(e);\n else {\n n = {\n name: e.name,\n times: ir(e.times, Array),\n values: ir(e.values, Array)\n };\n const s = e.getInterpolation();\n s !== e.DefaultInterpolation && (n.interpolation = s);\n }\n return n.type = e.ValueTypeName, n;\n }\n /**\n * Factory method for creating a new discrete interpolant.\n *\n * @static\n * @param {TypedArray} [result] - The result buffer.\n * @return {DiscreteInterpolant} The new interpolant.\n */\n InterpolantFactoryMethodDiscrete(e) {\n return new bd(this.times, this.values, this.getValueSize(), e);\n }\n /**\n * Factory method for creating a new linear interpolant.\n *\n * @static\n * @param {TypedArray} [result] - The result buffer.\n * @return {LinearInterpolant} The new interpolant.\n */\n InterpolantFactoryMethodLinear(e) {\n return new Sd(this.times, this.values, this.getValueSize(), e);\n }\n /**\n * Factory method for creating a new smooth interpolant.\n *\n * @static\n * @param {TypedArray} [result] - The result buffer.\n * @return {CubicInterpolant} The new interpolant.\n */\n InterpolantFactoryMethodSmooth(e) {\n return new Md(this.times, this.values, this.getValueSize(), e);\n }\n /**\n * Defines the interpolation factor method for this keyframe track.\n *\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.\n * @return {KeyframeTrack} A reference to this keyframe track.\n */\n setInterpolation(e) {\n let t;\n switch (e) {\n case ys:\n t = this.InterpolantFactoryMethodDiscrete;\n break;\n case Ts:\n t = this.InterpolantFactoryMethodLinear;\n break;\n case Ur:\n t = this.InterpolantFactoryMethodSmooth;\n break;\n }\n if (t === void 0) {\n const n = \"unsupported interpolation for \" + this.ValueTypeName + \" keyframe track named \" + this.name;\n if (this.createInterpolant === void 0)\n if (e !== this.DefaultInterpolation)\n this.setInterpolation(this.DefaultInterpolation);\n else\n throw new Error(n);\n return Te(\"KeyframeTrack:\", n), this;\n }\n return this.createInterpolant = t, this;\n }\n /**\n * Returns the current interpolation type.\n *\n * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.\n */\n getInterpolation() {\n switch (this.createInterpolant) {\n case this.InterpolantFactoryMethodDiscrete:\n return ys;\n case this.InterpolantFactoryMethodLinear:\n return Ts;\n case this.InterpolantFactoryMethodSmooth:\n return Ur;\n }\n }\n /**\n * Returns the value size.\n *\n * @return {number} The value size.\n */\n getValueSize() {\n return this.values.length / this.times.length;\n }\n /**\n * Moves all keyframes either forward or backward in time.\n *\n * @param {number} timeOffset - The offset to move the time values.\n * @return {KeyframeTrack} A reference to this keyframe track.\n */\n shift(e) {\n if (e !== 0) {\n const t = this.times;\n for (let n = 0, s = t.length; n !== s; ++n)\n t[n] += e;\n }\n return this;\n }\n /**\n * Scale all keyframe times by a factor (useful for frame - seconds conversions).\n *\n * @param {number} timeScale - The time scale.\n * @return {KeyframeTrack} A reference to this keyframe track.\n */\n scale(e) {\n if (e !== 1) {\n const t = this.times;\n for (let n = 0, s = t.length; n !== s; ++n)\n t[n] *= e;\n }\n return this;\n }\n /**\n * Removes keyframes before and after animation without changing any values within the defined time range.\n *\n * Note: The method does not shift around keys to the start of the track time, because for interpolated\n * keys this will change their values\n *\n * @param {number} startTime - The start time.\n * @param {number} endTime - The end time.\n * @return {KeyframeTrack} A reference to this keyframe track.\n */\n trim(e, t) {\n const n = this.times, s = n.length;\n let r = 0, a = s - 1;\n for (; r !== s && n[r] < e; )\n ++r;\n for (; a !== -1 && n[a] > t; )\n --a;\n if (++a, r !== 0 || a !== s) {\n r >= a && (a = Math.max(a, 1), r = a - 1);\n const o = this.getValueSize();\n this.times = n.slice(r, a), this.values = this.values.slice(r * o, a * o);\n }\n return this;\n }\n /**\n * Performs minimal validation on the keyframe track. Returns `true` if the values\n * are valid.\n *\n * @return {boolean} Whether the keyframes are valid or not.\n */\n validate() {\n let e = !0;\n const t = this.getValueSize();\n t - Math.floor(t) !== 0 && (Xe(\"KeyframeTrack: Invalid value size in track.\", this), e = !1);\n const n = this.times, s = this.values, r = n.length;\n r === 0 && (Xe(\"KeyframeTrack: Track is empty.\", this), e = !1);\n let a = null;\n for (let o = 0; o !== r; o++) {\n const l = n[o];\n if (typeof l == \"number\" && isNaN(l)) {\n Xe(\"KeyframeTrack: Time is not a valid number.\", this, o, l), e = !1;\n break;\n }\n if (a !== null && a > l) {\n Xe(\"KeyframeTrack: Out of order keys.\", this, o, l, a), e = !1;\n break;\n }\n a = l;\n }\n if (s !== void 0 && _d(s))\n for (let o = 0, l = s.length; o !== l; ++o) {\n const c = s[o];\n if (isNaN(c)) {\n Xe(\"KeyframeTrack: Value is not a valid number.\", this, o, c), e = !1;\n break;\n }\n }\n return e;\n }\n /**\n * Optimizes this keyframe track by removing equivalent sequential keys (which are\n * common in morph target sequences).\n *\n * @return {AnimationClip} A reference to this animation clip.\n */\n optimize() {\n const e = this.times.slice(), t = this.values.slice(), n = this.getValueSize(), s = this.getInterpolation() === Ur, r = e.length - 1;\n let a = 1;\n for (let o = 1; o < r; ++o) {\n let l = !1;\n const c = e[o], h = e[o + 1];\n if (c !== h && (o !== 1 || c !== e[0]))\n if (s)\n l = !0;\n else {\n const u = o * n, d = u - n, p = u + n;\n for (let g = 0; g !== n; ++g) {\n const x = t[u + g];\n if (x !== t[d + g] || x !== t[p + g]) {\n l = !0;\n break;\n }\n }\n }\n if (l) {\n if (o !== a) {\n e[a] = e[o];\n const u = o * n, d = a * n;\n for (let p = 0; p !== n; ++p)\n t[d + p] = t[u + p];\n }\n ++a;\n }\n }\n if (r > 0) {\n e[a] = e[r];\n for (let o = r * n, l = a * n, c = 0; c !== n; ++c)\n t[l + c] = t[o + c];\n ++a;\n }\n return a !== e.length ? (this.times = e.slice(0, a), this.values = t.slice(0, a * n)) : (this.times = e, this.values = t), this;\n }\n /**\n * Returns a new keyframe track with copied values from this instance.\n *\n * @return {KeyframeTrack} A clone of this instance.\n */\n clone() {\n const e = this.times.slice(), t = this.values.slice(), n = this.constructor, s = new n(this.name, e, t);\n return s.createInterpolant = this.createInterpolant, s;\n }\n}\n_n.prototype.ValueTypeName = \"\";\n_n.prototype.TimeBufferType = Float32Array;\n_n.prototype.ValueBufferType = Float32Array;\n_n.prototype.DefaultInterpolation = Ts;\nclass es extends _n {\n /**\n * Constructs a new boolean keyframe track.\n *\n * This keyframe track type has no `interpolation` parameter because the\n * interpolation is always discrete.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n */\n constructor(e, t, n) {\n super(e, t, n);\n }\n}\nes.prototype.ValueTypeName = \"bool\";\nes.prototype.ValueBufferType = Array;\nes.prototype.DefaultInterpolation = ys;\nes.prototype.InterpolantFactoryMethodLinear = void 0;\nes.prototype.InterpolantFactoryMethodSmooth = void 0;\nclass hh extends _n {\n /**\n * Constructs a new color keyframe track.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n}\nhh.prototype.ValueTypeName = \"color\";\nclass Yi extends _n {\n /**\n * Constructs a new number keyframe track.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n}\nYi.prototype.ValueTypeName = \"number\";\nclass yd extends Rs {\n /**\n * Constructs a new SLERP interpolant.\n *\n * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n * @param {TypedArray} sampleValues - The sample values.\n * @param {number} sampleSize - The sample size\n * @param {TypedArray} [resultBuffer] - The result buffer.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n interpolate_(e, t, n, s) {\n const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, l = (n - t) / (s - t);\n let c = e * o;\n for (let h = c + o; c !== h; c += 4)\n gn.slerpFlat(r, 0, a, c - o, a, c, l);\n return r;\n }\n}\nclass Ki extends _n {\n /**\n * Constructs a new Quaternion keyframe track.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n /**\n * Overwritten so the method returns Quaternion based interpolant.\n *\n * @static\n * @param {TypedArray} [result] - The result buffer.\n * @return {QuaternionLinearInterpolant} The new interpolant.\n */\n InterpolantFactoryMethodLinear(e) {\n return new yd(this.times, this.values, this.getValueSize(), e);\n }\n}\nKi.prototype.ValueTypeName = \"quaternion\";\nKi.prototype.InterpolantFactoryMethodSmooth = void 0;\nclass ts extends _n {\n /**\n * Constructs a new string keyframe track.\n *\n * This keyframe track type has no `interpolation` parameter because the\n * interpolation is always discrete.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n */\n constructor(e, t, n) {\n super(e, t, n);\n }\n}\nts.prototype.ValueTypeName = \"string\";\nts.prototype.ValueBufferType = Array;\nts.prototype.DefaultInterpolation = ys;\nts.prototype.InterpolantFactoryMethodLinear = void 0;\nts.prototype.InterpolantFactoryMethodSmooth = void 0;\nclass Zi extends _n {\n /**\n * Constructs a new vector keyframe track.\n *\n * @param {string} name - The keyframe track's name.\n * @param {Array} times - A list of keyframe times.\n * @param {Array} values - A list of keyframe values.\n * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n */\n constructor(e, t, n, s) {\n super(e, t, n, s);\n }\n}\nZi.prototype.ValueTypeName = \"vector\";\nclass Td {\n /**\n * Constructs a new animation clip.\n *\n * Note: Instead of instantiating an AnimationClip directly with the constructor, you can\n * use the static interface of this class for creating clips. In most cases though, animation clips\n * will automatically be created by loaders when importing animated 3D assets.\n *\n * @param {string} [name=''] - The clip's name.\n * @param {number} [duration=-1] - The clip's duration in seconds. If a negative value is passed,\n * the duration will be calculated from the passed keyframes.\n * @param {Array} tracks - An array of keyframe tracks.\n * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation\n * is blended/combined when two or more animations are simultaneously played.\n */\n constructor(e = \"\", t = -1, n = [], s = eu) {\n this.name = e, this.tracks = n, this.duration = t, this.blendMode = s, this.uuid = fn(), this.userData = {}, this.duration < 0 && this.resetDuration();\n }\n /**\n * Factory method for creating an animation clip from the given JSON.\n *\n * @static\n * @param {Object} json - The serialized animation clip.\n * @return {AnimationClip} The new animation clip.\n */\n static parse(e) {\n const t = [], n = e.tracks, s = 1 / (e.fps || 1);\n for (let a = 0, o = n.length; a !== o; ++a)\n t.push(wd(n[a]).scale(s));\n const r = new this(e.name, e.duration, t, e.blendMode);\n return r.uuid = e.uuid, r.userData = JSON.parse(e.userData || \"{}\"), r;\n }\n /**\n * Serializes the given animation clip into JSON.\n *\n * @static\n * @param {AnimationClip} clip - The animation clip to serialize.\n * @return {Object} The JSON object.\n */\n static toJSON(e) {\n const t = [], n = e.tracks, s = {\n name: e.name,\n duration: e.duration,\n tracks: t,\n uuid: e.uuid,\n blendMode: e.blendMode,\n userData: JSON.stringify(e.userData)\n };\n for (let r = 0, a = n.length; r !== a; ++r)\n t.push(_n.toJSON(n[r]));\n return s;\n }\n /**\n * Returns a new animation clip from the passed morph targets array of a\n * geometry, taking a name and the number of frames per second.\n *\n * Note: The fps parameter is required, but the animation speed can be\n * overridden via {@link AnimationAction#setDuration}.\n *\n * @static\n * @param {string} name - The name of the animation clip.\n * @param {Array} morphTargetSequence - A sequence of morph targets.\n * @param {number} fps - The Frames-Per-Second value.\n * @param {boolean} noLoop - Whether the clip should be no loop or not.\n * @return {AnimationClip} The new animation clip.\n */\n static CreateFromMorphTargetSequence(e, t, n, s) {\n const r = t.length, a = [];\n for (let o = 0; o < r; o++) {\n let l = [], c = [];\n l.push(\n (o + r - 1) % r,\n o,\n (o + 1) % r\n ), c.push(0, 1, 0);\n const h = vd(l);\n l = Vl(l, 1, h), c = Vl(c, 1, h), !s && l[0] === 0 && (l.push(r), c.push(c[0])), a.push(\n new Yi(\n \".morphTargetInfluences[\" + t[o].name + \"]\",\n l,\n c\n ).scale(1 / n)\n );\n }\n return new this(e, -1, a);\n }\n /**\n * Searches for an animation clip by name, taking as its first parameter\n * either an array of clips, or a mesh or geometry that contains an\n * array named \"animations\" property.\n *\n * @static\n * @param {(Array|Object3D)} objectOrClipArray - The array or object to search through.\n * @param {string} name - The name to search for.\n * @return {?AnimationClip} The found animation clip. Returns `null` if no clip has been found.\n */\n static findByName(e, t) {\n let n = e;\n if (!Array.isArray(e)) {\n const s = e;\n n = s.geometry && s.geometry.animations || s.animations;\n }\n for (let s = 0; s < n.length; s++)\n if (n[s].name === t)\n return n[s];\n return null;\n }\n /**\n * Returns an array of new AnimationClips created from the morph target\n * sequences of a geometry, trying to sort morph target names into\n * animation-group-based patterns like \"Walk_001, Walk_002, Run_001, Run_002...\".\n *\n * See {@link MD2Loader#parse} as an example for how the method should be used.\n *\n * @static\n * @param {Array} morphTargets - A sequence of morph targets.\n * @param {number} fps - The Frames-Per-Second value.\n * @param {boolean} noLoop - Whether the clip should be no loop or not.\n * @return {Array} An array of new animation clips.\n */\n static CreateClipsFromMorphTargetSequences(e, t, n) {\n const s = {}, r = /^([\\w-]*?)([\\d]+)$/;\n for (let o = 0, l = e.length; o < l; o++) {\n const c = e[o], h = c.name.match(r);\n if (h && h.length > 1) {\n const u = h[1];\n let d = s[u];\n d || (s[u] = d = []), d.push(c);\n }\n }\n const a = [];\n for (const o in s)\n a.push(this.CreateFromMorphTargetSequence(o, s[o], t, n));\n return a;\n }\n /**\n * Parses the `animation.hierarchy` format and returns a new animation clip.\n *\n * @static\n * @deprecated since r175.\n * @param {Object} animation - A serialized animation clip as JSON.\n * @param {Array} bones - An array of bones.\n * @return {?AnimationClip} The new animation clip.\n */\n static parseAnimation(e, t) {\n if (Te(\"AnimationClip: parseAnimation() is deprecated and will be removed with r185\"), !e)\n return Xe(\"AnimationClip: No animation in JSONLoader data.\"), null;\n const n = function(u, d, p, g, x) {\n if (p.length !== 0) {\n const m = [], f = [];\n ch(p, m, f, g), m.length !== 0 && x.push(new u(d, m, f));\n }\n }, s = [], r = e.name || \"default\", a = e.fps || 30, o = e.blendMode;\n let l = e.length || -1;\n const c = e.hierarchy || [];\n for (let u = 0; u < c.length; u++) {\n const d = c[u].keys;\n if (!(!d || d.length === 0))\n if (d[0].morphTargets) {\n const p = {};\n let g;\n for (g = 0; g < d.length; g++)\n if (d[g].morphTargets)\n for (let x = 0; x < d[g].morphTargets.length; x++)\n p[d[g].morphTargets[x]] = -1;\n for (const x in p) {\n const m = [], f = [];\n for (let y = 0; y !== d[g].morphTargets.length; ++y) {\n const v = d[g];\n m.push(v.time), f.push(v.morphTarget === x ? 1 : 0);\n }\n s.push(new Yi(\".morphTargetInfluence[\" + x + \"]\", m, f));\n }\n l = p.length * a;\n } else {\n const p = \".bones[\" + t[u].name + \"]\";\n n(\n Zi,\n p + \".position\",\n d,\n \"pos\",\n s\n ), n(\n Ki,\n p + \".quaternion\",\n d,\n \"rot\",\n s\n ), n(\n Zi,\n p + \".scale\",\n d,\n \"scl\",\n s\n );\n }\n }\n return s.length === 0 ? null : new this(r, l, s, o);\n }\n /**\n * Sets the duration of this clip to the duration of its longest keyframe track.\n *\n * @return {AnimationClip} A reference to this animation clip.\n */\n resetDuration() {\n const e = this.tracks;\n let t = 0;\n for (let n = 0, s = e.length; n !== s; ++n) {\n const r = this.tracks[n];\n t = Math.max(t, r.times[r.times.length - 1]);\n }\n return this.duration = t, this;\n }\n /**\n * Trims all tracks to the clip's duration.\n *\n * @return {AnimationClip} A reference to this animation clip.\n */\n trim() {\n for (let e = 0; e < this.tracks.length; e++)\n this.tracks[e].trim(0, this.duration);\n return this;\n }\n /**\n * Performs minimal validation on each track in the clip. Returns `true` if all\n * tracks are valid.\n *\n * @return {boolean} Whether the clip's keyframes are valid or not.\n */\n validate() {\n let e = !0;\n for (let t = 0; t < this.tracks.length; t++)\n e = e && this.tracks[t].validate();\n return e;\n }\n /**\n * Optimizes each track by removing equivalent sequential keys (which are\n * common in morph target sequences).\n *\n * @return {AnimationClip} A reference to this animation clip.\n */\n optimize() {\n for (let e = 0; e < this.tracks.length; e++)\n this.tracks[e].optimize();\n return this;\n }\n /**\n * Returns a new animation clip with copied values from this instance.\n *\n * @return {AnimationClip} A clone of this instance.\n */\n clone() {\n const e = [];\n for (let n = 0; n < this.tracks.length; n++)\n e.push(this.tracks[n].clone());\n const t = new this.constructor(this.name, this.duration, e, this.blendMode);\n return t.userData = JSON.parse(JSON.stringify(this.userData)), t;\n }\n /**\n * Serializes this animation clip into JSON.\n *\n * @return {Object} The JSON object.\n */\n toJSON() {\n return this.constructor.toJSON(this);\n }\n}\nfunction Ed(i) {\n switch (i.toLowerCase()) {\n case \"scalar\":\n case \"double\":\n case \"float\":\n case \"number\":\n case \"integer\":\n return Yi;\n case \"vector\":\n case \"vector2\":\n case \"vector3\":\n case \"vector4\":\n return Zi;\n case \"color\":\n return hh;\n case \"quaternion\":\n return Ki;\n case \"bool\":\n case \"boolean\":\n return es;\n case \"string\":\n return ts;\n }\n throw new Error(\"THREE.KeyframeTrack: Unsupported typeName: \" + i);\n}\nfunction wd(i) {\n if (i.type === void 0)\n throw new Error(\"THREE.KeyframeTrack: track type undefined, can not parse\");\n const e = Ed(i.type);\n if (i.times === void 0) {\n const t = [], n = [];\n ch(i.keys, t, n, \"value\"), i.times = t, i.values = n;\n }\n return e.parse !== void 0 ? e.parse(i) : new e(i.name, i.times, i.values, i.interpolation);\n}\nconst kn = {\n /**\n * Whether caching is enabled or not.\n *\n * @static\n * @type {boolean}\n * @default false\n */\n enabled: !1,\n /**\n * A dictionary that holds cached files.\n *\n * @static\n * @type {Object}\n */\n files: {},\n /**\n * Adds a cache entry with a key to reference the file. If this key already\n * holds a file, it is overwritten.\n *\n * @static\n * @param {string} key - The key to reference the cached file.\n * @param {Object} file - The file to be cached.\n */\n add: function(i, e) {\n this.enabled !== !1 && (this.files[i] = e);\n },\n /**\n * Gets the cached value for the given key.\n *\n * @static\n * @param {string} key - The key to reference the cached file.\n * @return {Object|undefined} The cached file. If the key does not exist `undefined` is returned.\n */\n get: function(i) {\n if (this.enabled !== !1)\n return this.files[i];\n },\n /**\n * Removes the cached file associated with the given key.\n *\n * @static\n * @param {string} key - The key to reference the cached file.\n */\n remove: function(i) {\n delete this.files[i];\n },\n /**\n * Remove all values from the cache.\n *\n * @static\n */\n clear: function() {\n this.files = {};\n }\n};\nclass Ad {\n /**\n * Constructs a new loading manager.\n *\n * @param {Function} [onLoad] - Executes when all items have been loaded.\n * @param {Function} [onProgress] - Executes when single items have been loaded.\n * @param {Function} [onError] - Executes when an error occurs.\n */\n constructor(e, t, n) {\n const s = this;\n let r = !1, a = 0, o = 0, l;\n const c = [];\n this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = n, this._abortController = null, this.itemStart = function(h) {\n o++, r === !1 && s.onStart !== void 0 && s.onStart(h, a, o), r = !0;\n }, this.itemEnd = function(h) {\n a++, s.onProgress !== void 0 && s.onProgress(h, a, o), a === o && (r = !1, s.onLoad !== void 0 && s.onLoad());\n }, this.itemError = function(h) {\n s.onError !== void 0 && s.onError(h);\n }, this.resolveURL = function(h) {\n return l ? l(h) : h;\n }, this.setURLModifier = function(h) {\n return l = h, this;\n }, this.addHandler = function(h, u) {\n return c.push(h, u), this;\n }, this.removeHandler = function(h) {\n const u = c.indexOf(h);\n return u !== -1 && c.splice(u, 2), this;\n }, this.getHandler = function(h) {\n for (let u = 0, d = c.length; u < d; u += 2) {\n const p = c[u], g = c[u + 1];\n if (p.global && (p.lastIndex = 0), p.test(h))\n return g;\n }\n return null;\n }, this.abort = function() {\n return this.abortController.abort(), this._abortController = null, this;\n };\n }\n // TODO: Revert this back to a single member variable once this issue has been fixed\n // https://github.com/cloudflare/workerd/issues/3657\n /**\n * Used for aborting ongoing requests in loaders using this manager.\n *\n * @type {AbortController}\n */\n get abortController() {\n return this._abortController || (this._abortController = new AbortController()), this._abortController;\n }\n}\nconst Rd = /* @__PURE__ */ new Ad();\nclass ei {\n /**\n * Constructs a new loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n this.manager = e !== void 0 ? e : Rd, this.crossOrigin = \"anonymous\", this.withCredentials = !1, this.path = \"\", this.resourcePath = \"\", this.requestHeader = {};\n }\n /**\n * This method needs to be implemented by all concrete loaders. It holds the\n * logic for loading assets from the backend.\n *\n * @abstract\n * @param {string} url - The path/URL of the file to be loaded.\n * @param {Function} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n * @param {onErrorCallback} [onError] - Executed when errors occur.\n */\n load() {\n }\n /**\n * A async version of {@link Loader#load}.\n *\n * @param {string} url - The path/URL of the file to be loaded.\n * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n * @return {Promise} A Promise that resolves when the asset has been loaded.\n */\n loadAsync(e, t) {\n const n = this;\n return new Promise(function(s, r) {\n n.load(e, s, t, r);\n });\n }\n /**\n * This method needs to be implemented by all concrete loaders. It holds the\n * logic for parsing the asset into three.js entities.\n *\n * @abstract\n * @param {any} data - The data to parse.\n */\n parse() {\n }\n /**\n * Sets the `crossOrigin` String to implement CORS for loading the URL\n * from a different domain that allows CORS.\n *\n * @param {string} crossOrigin - The `crossOrigin` value.\n * @return {Loader} A reference to this instance.\n */\n setCrossOrigin(e) {\n return this.crossOrigin = e, this;\n }\n /**\n * Whether the XMLHttpRequest uses credentials such as cookies, authorization\n * headers or TLS client certificates, see [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials).\n *\n * Note: This setting has no effect if you are loading files locally or from the same domain.\n *\n * @param {boolean} value - The `withCredentials` value.\n * @return {Loader} A reference to this instance.\n */\n setWithCredentials(e) {\n return this.withCredentials = e, this;\n }\n /**\n * Sets the base path for the asset.\n *\n * @param {string} path - The base path.\n * @return {Loader} A reference to this instance.\n */\n setPath(e) {\n return this.path = e, this;\n }\n /**\n * Sets the base path for dependent resources like textures.\n *\n * @param {string} resourcePath - The resource path.\n * @return {Loader} A reference to this instance.\n */\n setResourcePath(e) {\n return this.resourcePath = e, this;\n }\n /**\n * Sets the given request header.\n *\n * @param {Object} requestHeader - A [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)\n * for configuring the HTTP request.\n * @return {Loader} A reference to this instance.\n */\n setRequestHeader(e) {\n return this.requestHeader = e, this;\n }\n /**\n * This method can be implemented in loaders for aborting ongoing requests.\n *\n * @abstract\n * @return {Loader} A reference to this instance.\n */\n abort() {\n return this;\n }\n}\nei.DEFAULT_MATERIAL_NAME = \"__DEFAULT\";\nconst Nn = {};\nclass Cd extends Error {\n constructor(e, t) {\n super(e), this.response = t;\n }\n}\nclass Ho extends ei {\n /**\n * Constructs a new file loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e), this.mimeType = \"\", this.responseType = \"\", this._abortController = new AbortController();\n }\n /**\n * Starts loading from the given URL and pass the loaded response to the `onLoad()` callback.\n *\n * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n * @param {function(any)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n * @param {onErrorCallback} [onError] - Executed when errors occur.\n * @return {any|undefined} The cached resource if available.\n */\n load(e, t, n, s) {\n e === void 0 && (e = \"\"), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);\n const r = kn.get(`file:${e}`);\n if (r !== void 0)\n return this.manager.itemStart(e), setTimeout(() => {\n t && t(r), this.manager.itemEnd(e);\n }, 0), r;\n if (Nn[e] !== void 0) {\n Nn[e].push({\n onLoad: t,\n onProgress: n,\n onError: s\n });\n return;\n }\n Nn[e] = [], Nn[e].push({\n onLoad: t,\n onProgress: n,\n onError: s\n });\n const a = new Request(e, {\n headers: new Headers(this.requestHeader),\n credentials: this.withCredentials ? \"include\" : \"same-origin\",\n signal: typeof AbortSignal.any == \"function\" ? AbortSignal.any([this._abortController.signal, this.manager.abortController.signal]) : this._abortController.signal\n }), o = this.mimeType, l = this.responseType;\n fetch(a).then((c) => {\n if (c.status === 200 || c.status === 0) {\n if (c.status === 0 && Te(\"FileLoader: HTTP Status 0 received.\"), typeof ReadableStream > \"u\" || c.body === void 0 || c.body.getReader === void 0)\n return c;\n const h = Nn[e], u = c.body.getReader(), d = c.headers.get(\"X-File-Size\") || c.headers.get(\"Content-Length\"), p = d ? parseInt(d) : 0, g = p !== 0;\n let x = 0;\n const m = new ReadableStream({\n start(f) {\n y();\n function y() {\n u.read().then(({ done: v, value: T }) => {\n if (v)\n f.close();\n else {\n x += T.byteLength;\n const R = new ProgressEvent(\"progress\", { lengthComputable: g, loaded: x, total: p });\n for (let E = 0, P = h.length; E < P; E++) {\n const I = h[E];\n I.onProgress && I.onProgress(R);\n }\n f.enqueue(T), y();\n }\n }, (v) => {\n f.error(v);\n });\n }\n }\n });\n return new Response(m);\n } else\n throw new Cd(`fetch for \"${c.url}\" responded with ${c.status}: ${c.statusText}`, c);\n }).then((c) => {\n switch (l) {\n case \"arraybuffer\":\n return c.arrayBuffer();\n case \"blob\":\n return c.blob();\n case \"document\":\n return c.text().then((h) => new DOMParser().parseFromString(h, o));\n case \"json\":\n return c.json();\n default:\n if (o === \"\")\n return c.text();\n {\n const u = /charset=\"?([^;\"\\s]*)\"?/i.exec(o), d = u && u[1] ? u[1].toLowerCase() : void 0, p = new TextDecoder(d);\n return c.arrayBuffer().then((g) => p.decode(g));\n }\n }\n }).then((c) => {\n kn.add(`file:${e}`, c);\n const h = Nn[e];\n delete Nn[e];\n for (let u = 0, d = h.length; u < d; u++) {\n const p = h[u];\n p.onLoad && p.onLoad(c);\n }\n }).catch((c) => {\n const h = Nn[e];\n if (h === void 0)\n throw this.manager.itemError(e), c;\n delete Nn[e];\n for (let u = 0, d = h.length; u < d; u++) {\n const p = h[u];\n p.onError && p.onError(c);\n }\n this.manager.itemError(e);\n }).finally(() => {\n this.manager.itemEnd(e);\n }), this.manager.itemStart(e);\n }\n /**\n * Sets the expected response type.\n *\n * @param {('arraybuffer'|'blob'|'document'|'json'|'')} value - The response type.\n * @return {FileLoader} A reference to this file loader.\n */\n setResponseType(e) {\n return this.responseType = e, this;\n }\n /**\n * Sets the expected mime type of the loaded file.\n *\n * @param {string} value - The mime type.\n * @return {FileLoader} A reference to this file loader.\n */\n setMimeType(e) {\n return this.mimeType = e, this;\n }\n /**\n * Aborts ongoing fetch requests.\n *\n * @return {FileLoader} A reference to this instance.\n */\n abort() {\n return this._abortController.abort(), this._abortController = new AbortController(), this;\n }\n}\nconst Di = /* @__PURE__ */ new WeakMap();\nclass uh extends ei {\n /**\n * Constructs a new image loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e);\n }\n /**\n * Starts loading from the given URL and passes the loaded image\n * to the `onLoad()` callback. The method also returns a new `Image` object which can\n * directly be used for texture creation. If you do it this way, the texture\n * may pop up in your scene once the respective loading process is finished.\n *\n * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n * @param {function(Image)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} onProgress - Unsupported in this loader.\n * @param {onErrorCallback} onError - Executed when errors occur.\n * @return {Image} The image.\n */\n load(e, t, n, s) {\n this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);\n const r = this, a = kn.get(`image:${e}`);\n if (a !== void 0) {\n if (a.complete === !0)\n r.manager.itemStart(e), setTimeout(function() {\n t && t(a), r.manager.itemEnd(e);\n }, 0);\n else {\n let u = Di.get(a);\n u === void 0 && (u = [], Di.set(a, u)), u.push({ onLoad: t, onError: s });\n }\n return a;\n }\n const o = Es(\"img\");\n function l() {\n h(), t && t(this);\n const u = Di.get(this) || [];\n for (let d = 0; d < u.length; d++) {\n const p = u[d];\n p.onLoad && p.onLoad(this);\n }\n Di.delete(this), r.manager.itemEnd(e);\n }\n function c(u) {\n h(), s && s(u), kn.remove(`image:${e}`);\n const d = Di.get(this) || [];\n for (let p = 0; p < d.length; p++) {\n const g = d[p];\n g.onError && g.onError(u);\n }\n Di.delete(this), r.manager.itemError(e), r.manager.itemEnd(e);\n }\n function h() {\n o.removeEventListener(\"load\", l, !1), o.removeEventListener(\"error\", c, !1);\n }\n return o.addEventListener(\"load\", l, !1), o.addEventListener(\"error\", c, !1), e.slice(0, 5) !== \"data:\" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), kn.add(`image:${e}`, o), r.manager.itemStart(e), o.src = e, o;\n }\n}\nclass dh extends ei {\n /**\n * Constructs a new cube texture loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e);\n }\n /**\n * Starts loading from the given URL and pass the fully loaded cube texture\n * to the `onLoad()` callback. The method also returns a new cube texture object which can\n * directly be used for material creation. If you do it this way, the cube texture\n * may pop up in your scene once the respective loading process is finished.\n *\n * @param {Array} urls - Array of 6 URLs to images, one for each side of the\n * cube texture. The urls should be specified in the following order: pos-x,\n * neg-x, pos-y, neg-y, pos-z, neg-z. An array of data URIs are allowed as well.\n * @param {function(CubeTexture)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} onProgress - Unsupported in this loader.\n * @param {onErrorCallback} onError - Executed when errors occur.\n * @return {CubeTexture} The cube texture.\n */\n load(e, t, n, s) {\n const r = new No();\n r.colorSpace = Rt;\n const a = new uh(this.manager);\n a.setCrossOrigin(this.crossOrigin), a.setPath(this.path);\n let o = 0;\n function l(c) {\n a.load(e[c], function(h) {\n r.images[c] = h, o++, o === 6 && (r.needsUpdate = !0, t && t(r));\n }, void 0, s);\n }\n for (let c = 0; c < e.length; ++c)\n l(c);\n return r;\n }\n}\nclass Pd extends ei {\n /**\n * Constructs a new data texture loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e);\n }\n /**\n * Starts loading from the given URL and passes the loaded data texture\n * to the `onLoad()` callback. The method also returns a new texture object which can\n * directly be used for material creation. If you do it this way, the texture\n * may pop up in your scene once the respective loading process is finished.\n *\n * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n * @param {function(DataTexture)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n * @param {onErrorCallback} onError - Executed when errors occur.\n * @return {DataTexture} The data texture.\n */\n load(e, t, n, s) {\n const r = this, a = new Qi(), o = new Ho(this.manager);\n return o.setResponseType(\"arraybuffer\"), o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(r.withCredentials), o.load(e, function(l) {\n let c;\n try {\n c = r.parse(l);\n } catch (h) {\n if (s !== void 0)\n s(h);\n else {\n h(h);\n return;\n }\n }\n c.image !== void 0 ? a.image = c.image : c.data !== void 0 && (a.image.width = c.width, a.image.height = c.height, a.image.data = c.data), a.wrapS = c.wrapS !== void 0 ? c.wrapS : en, a.wrapT = c.wrapT !== void 0 ? c.wrapT : en, a.magFilter = c.magFilter !== void 0 ? c.magFilter : bt, a.minFilter = c.minFilter !== void 0 ? c.minFilter : bt, a.anisotropy = c.anisotropy !== void 0 ? c.anisotropy : 1, c.colorSpace !== void 0 && (a.colorSpace = c.colorSpace), c.flipY !== void 0 && (a.flipY = c.flipY), c.format !== void 0 && (a.format = c.format), c.type !== void 0 && (a.type = c.type), c.mipmaps !== void 0 && (a.mipmaps = c.mipmaps, a.minFilter = yn), c.mipmapCount === 1 && (a.minFilter = bt), c.generateMipmaps !== void 0 && (a.generateMipmaps = c.generateMipmaps), a.needsUpdate = !0, t && t(a, c);\n }, n, s), a;\n }\n}\nclass fh extends ei {\n /**\n * Constructs a new texture loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e);\n }\n /**\n * Starts loading from the given URL and pass the fully loaded texture\n * to the `onLoad()` callback. The method also returns a new texture object which can\n * directly be used for material creation. If you do it this way, the texture\n * may pop up in your scene once the respective loading process is finished.\n *\n * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n * @param {function(Texture)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} onProgress - Unsupported in this loader.\n * @param {onErrorCallback} onError - Executed when errors occur.\n * @return {Texture} The texture.\n */\n load(e, t, n, s) {\n const r = new Ct(), a = new uh(this.manager);\n return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(o) {\n r.image = o, r.needsUpdate = !0, t !== void 0 && t(r);\n }, n, s), r;\n }\n}\nclass Cs extends pt {\n /**\n * Constructs a new light.\n *\n * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n * @param {number} [intensity=1] - The light's strength/intensity.\n */\n constructor(e, t = 1) {\n super(), this.isLight = !0, this.type = \"Light\", this.color = new Se(e), this.intensity = t;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n */\n dispose() {\n }\n copy(e, t) {\n return super.copy(e, t), this.color.copy(e.color), this.intensity = e.intensity, this;\n }\n toJSON(e) {\n const t = super.toJSON(e);\n return t.object.color = this.color.getHex(), t.object.intensity = this.intensity, this.groundColor !== void 0 && (t.object.groundColor = this.groundColor.getHex()), this.distance !== void 0 && (t.object.distance = this.distance), this.angle !== void 0 && (t.object.angle = this.angle), this.decay !== void 0 && (t.object.decay = this.decay), this.penumbra !== void 0 && (t.object.penumbra = this.penumbra), this.shadow !== void 0 && (t.object.shadow = this.shadow.toJSON()), this.target !== void 0 && (t.object.target = this.target.uuid), t;\n }\n}\nconst la = /* @__PURE__ */ new Ne(), Gl = /* @__PURE__ */ new w(), Hl = /* @__PURE__ */ new w();\nclass Wo {\n /**\n * Constructs a new light shadow.\n *\n * @param {Camera} camera - The light's view of the world.\n */\n constructor(e) {\n this.camera = e, this.intensity = 1, this.bias = 0, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new le(512, 512), this.mapType = mn, this.map = null, this.mapPass = null, this.matrix = new Ne(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new zo(), this._frameExtents = new le(1, 1), this._viewportCount = 1, this._viewports = [\n new Je(0, 0, 1, 1)\n ];\n }\n /**\n * Used internally by the renderer to get the number of viewports that need\n * to be rendered for this shadow.\n *\n * @return {number} The viewport count.\n */\n getViewportCount() {\n return this._viewportCount;\n }\n /**\n * Gets the shadow cameras frustum. Used internally by the renderer to cull objects.\n *\n * @return {Frustum} The shadow camera frustum.\n */\n getFrustum() {\n return this._frustum;\n }\n /**\n * Update the matrices for the camera and shadow, used internally by the renderer.\n *\n * @param {Light} light - The light for which the shadow is being rendered.\n */\n updateMatrices(e) {\n const t = this.camera, n = this.matrix;\n Gl.setFromMatrixPosition(e.matrixWorld), t.position.copy(Gl), Hl.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(Hl), t.updateMatrixWorld(), la.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(la, t.coordinateSystem, t.reversedDepth), t.reversedDepth ? n.set(\n 0.5,\n 0,\n 0,\n 0.5,\n 0,\n 0.5,\n 0,\n 0.5,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ) : n.set(\n 0.5,\n 0,\n 0,\n 0.5,\n 0,\n 0.5,\n 0,\n 0.5,\n 0,\n 0,\n 0.5,\n 0.5,\n 0,\n 0,\n 0,\n 1\n ), n.multiply(la);\n }\n /**\n * Returns a viewport definition for the given viewport index.\n *\n * @param {number} viewportIndex - The viewport index.\n * @return {Vector4} The viewport.\n */\n getViewport(e) {\n return this._viewports[e];\n }\n /**\n * Returns the frame extends.\n *\n * @return {Vector2} The frame extends.\n */\n getFrameExtents() {\n return this._frameExtents;\n }\n /**\n * Frees the GPU-related resources allocated by this instance. Call this\n * method whenever this instance is no longer used in your app.\n */\n dispose() {\n this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose();\n }\n /**\n * Copies the values of the given light shadow instance to this instance.\n *\n * @param {LightShadow} source - The light shadow to copy.\n * @return {LightShadow} A reference to this light shadow instance.\n */\n copy(e) {\n return this.camera = e.camera.clone(), this.intensity = e.intensity, this.bias = e.bias, this.radius = e.radius, this.autoUpdate = e.autoUpdate, this.needsUpdate = e.needsUpdate, this.normalBias = e.normalBias, this.blurSamples = e.blurSamples, this.mapSize.copy(e.mapSize), this;\n }\n /**\n * Returns a new light shadow instance with copied values from this instance.\n *\n * @return {LightShadow} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n /**\n * Serializes the light shadow into JSON.\n *\n * @return {Object} A JSON object representing the serialized light shadow.\n * @see {@link ObjectLoader#parse}\n */\n toJSON() {\n const e = {};\n return this.intensity !== 1 && (e.intensity = this.intensity), this.bias !== 0 && (e.bias = this.bias), this.normalBias !== 0 && (e.normalBias = this.normalBias), this.radius !== 1 && (e.radius = this.radius), (this.mapSize.x !== 512 || this.mapSize.y !== 512) && (e.mapSize = this.mapSize.toArray()), e.camera = this.camera.toJSON(!1).object, delete e.camera.matrix, e;\n }\n}\nclass Dd extends Wo {\n /**\n * Constructs a new spot light shadow.\n */\n constructor() {\n super(new Tt(50, 1, 0.5, 500)), this.isSpotLightShadow = !0, this.focus = 1, this.aspect = 1;\n }\n updateMatrices(e) {\n const t = this.camera, n = ji * 2 * e.angle * this.focus, s = this.mapSize.width / this.mapSize.height * this.aspect, r = e.distance || t.far;\n (n !== t.fov || s !== t.aspect || r !== t.far) && (t.fov = n, t.aspect = s, t.far = r, t.updateProjectionMatrix()), super.updateMatrices(e);\n }\n copy(e) {\n return super.copy(e), this.focus = e.focus, this;\n }\n}\nclass Ld extends Cs {\n /**\n * Constructs a new spot light.\n *\n * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n * @param {number} [angle=Math.PI/3] - Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`.\n * @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`.\n * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n */\n constructor(e, t, n = 0, s = Math.PI / 3, r = 0, a = 2) {\n super(e, t), this.isSpotLight = !0, this.type = \"SpotLight\", this.position.copy(pt.DEFAULT_UP), this.updateMatrix(), this.target = new pt(), this.distance = n, this.angle = s, this.penumbra = r, this.decay = a, this.map = null, this.shadow = new Dd();\n }\n /**\n * The light's power. Power is the luminous power of the light measured in lumens (lm).\n * Changing the power will also change the light's intensity.\n *\n * @type {number}\n */\n get power() {\n return this.intensity * Math.PI;\n }\n set power(e) {\n this.intensity = e / Math.PI;\n }\n dispose() {\n this.shadow.dispose();\n }\n copy(e, t) {\n return super.copy(e, t), this.distance = e.distance, this.angle = e.angle, this.penumbra = e.penumbra, this.decay = e.decay, this.target = e.target.clone(), this.shadow = e.shadow.clone(), this;\n }\n}\nconst Wl = /* @__PURE__ */ new Ne(), us = /* @__PURE__ */ new w(), ca = /* @__PURE__ */ new w();\nclass Id extends Wo {\n /**\n * Constructs a new point light shadow.\n */\n constructor() {\n super(new Tt(90, 1, 0.5, 500)), this.isPointLightShadow = !0, this._frameExtents = new le(4, 2), this._viewportCount = 6, this._viewports = [\n // These viewports map a cube-map onto a 2D texture with the\n // following orientation:\n //\n // xzXZ\n // y Y\n //\n // X - Positive x direction\n // x - Negative x direction\n // Y - Positive y direction\n // y - Negative y direction\n // Z - Positive z direction\n // z - Negative z direction\n // positive X\n new Je(2, 1, 1, 1),\n // negative X\n new Je(0, 1, 1, 1),\n // positive Z\n new Je(3, 1, 1, 1),\n // negative Z\n new Je(1, 1, 1, 1),\n // positive Y\n new Je(3, 0, 1, 1),\n // negative Y\n new Je(1, 0, 1, 1)\n ], this._cubeDirections = [\n new w(1, 0, 0),\n new w(-1, 0, 0),\n new w(0, 0, 1),\n new w(0, 0, -1),\n new w(0, 1, 0),\n new w(0, -1, 0)\n ], this._cubeUps = [\n new w(0, 1, 0),\n new w(0, 1, 0),\n new w(0, 1, 0),\n new w(0, 1, 0),\n new w(0, 0, 1),\n new w(0, 0, -1)\n ];\n }\n /**\n * Update the matrices for the camera and shadow, used internally by the renderer.\n *\n * @param {Light} light - The light for which the shadow is being rendered.\n * @param {number} [viewportIndex=0] - The viewport index.\n */\n updateMatrices(e, t = 0) {\n const n = this.camera, s = this.matrix, r = e.distance || n.far;\n r !== n.far && (n.far = r, n.updateProjectionMatrix()), us.setFromMatrixPosition(e.matrixWorld), n.position.copy(us), ca.copy(n.position), ca.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(ca), n.updateMatrixWorld(), s.makeTranslation(-us.x, -us.y, -us.z), Wl.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Wl, n.coordinateSystem, n.reversedDepth);\n }\n}\nclass Ud extends Cs {\n /**\n * Constructs a new point light.\n *\n * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n */\n constructor(e, t, n = 0, s = 2) {\n super(e, t), this.isPointLight = !0, this.type = \"PointLight\", this.distance = n, this.decay = s, this.shadow = new Id();\n }\n /**\n * The light's power. Power is the luminous power of the light measured in lumens (lm).\n * Changing the power will also change the light's intensity.\n *\n * @type {number}\n */\n get power() {\n return this.intensity * 4 * Math.PI;\n }\n set power(e) {\n this.intensity = e / (4 * Math.PI);\n }\n dispose() {\n this.shadow.dispose();\n }\n copy(e, t) {\n return super.copy(e, t), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this;\n }\n}\nclass pi extends ih {\n /**\n * Constructs a new orthographic camera.\n *\n * @param {number} [left=-1] - The left plane of the camera's frustum.\n * @param {number} [right=1] - The right plane of the camera's frustum.\n * @param {number} [top=1] - The top plane of the camera's frustum.\n * @param {number} [bottom=-1] - The bottom plane of the camera's frustum.\n * @param {number} [near=0.1] - The camera's near plane.\n * @param {number} [far=2000] - The camera's far plane.\n */\n constructor(e = -1, t = 1, n = 1, s = -1, r = 0.1, a = 2e3) {\n super(), this.isOrthographicCamera = !0, this.type = \"OrthographicCamera\", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = n, this.bottom = s, this.near = r, this.far = a, this.updateProjectionMatrix();\n }\n copy(e, t) {\n return super.copy(e, t), this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.near = e.near, this.far = e.far, this.zoom = e.zoom, this.view = e.view === null ? null : Object.assign({}, e.view), this;\n }\n /**\n * Sets an offset in a larger frustum. This is useful for multi-window or\n * multi-monitor/multi-machine setups.\n *\n * @param {number} fullWidth - The full width of multiview setup.\n * @param {number} fullHeight - The full height of multiview setup.\n * @param {number} x - The horizontal offset of the subcamera.\n * @param {number} y - The vertical offset of the subcamera.\n * @param {number} width - The width of subcamera.\n * @param {number} height - The height of subcamera.\n * @see {@link PerspectiveCamera#setViewOffset}\n */\n setViewOffset(e, t, n, s, r, a) {\n this.view === null && (this.view = {\n enabled: !0,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1\n }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = n, this.view.offsetY = s, this.view.width = r, this.view.height = a, this.updateProjectionMatrix();\n }\n /**\n * Removes the view offset from the projection matrix.\n */\n clearViewOffset() {\n this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();\n }\n /**\n * Updates the camera's projection matrix. Must be called after any change of\n * camera properties.\n */\n updateProjectionMatrix() {\n const e = (this.right - this.left) / (2 * this.zoom), t = (this.top - this.bottom) / (2 * this.zoom), n = (this.right + this.left) / 2, s = (this.top + this.bottom) / 2;\n let r = n - e, a = n + e, o = s + t, l = s - t;\n if (this.view !== null && this.view.enabled) {\n const c = (this.right - this.left) / this.view.fullWidth / this.zoom, h = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n r += c * this.view.offsetX, a = r + c * this.view.width, o -= h * this.view.offsetY, l = o - h * this.view.height;\n }\n this.projectionMatrix.makeOrthographic(r, a, o, l, this.near, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n }\n toJSON(e) {\n const t = super.toJSON(e);\n return t.object.zoom = this.zoom, t.object.left = this.left, t.object.right = this.right, t.object.top = this.top, t.object.bottom = this.bottom, t.object.near = this.near, t.object.far = this.far, this.view !== null && (t.object.view = Object.assign({}, this.view)), t;\n }\n}\nclass Nd extends Wo {\n /**\n * Constructs a new directional light shadow.\n */\n constructor() {\n super(new pi(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0;\n }\n}\nclass ph extends Cs {\n /**\n * Constructs a new directional light.\n *\n * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n * @param {number} [intensity=1] - The light's strength/intensity.\n */\n constructor(e, t) {\n super(e, t), this.isDirectionalLight = !0, this.type = \"DirectionalLight\", this.position.copy(pt.DEFAULT_UP), this.updateMatrix(), this.target = new pt(), this.shadow = new Nd();\n }\n dispose() {\n this.shadow.dispose();\n }\n copy(e) {\n return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this;\n }\n}\nclass mh extends Cs {\n /**\n * Constructs a new ambient light.\n *\n * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n * @param {number} [intensity=1] - The light's strength/intensity.\n */\n constructor(e, t) {\n super(e, t), this.isAmbientLight = !0, this.type = \"AmbientLight\";\n }\n}\nclass Ms {\n /**\n * Extracts the base URL from the given URL.\n *\n * @param {string} url -The URL to extract the base URL from.\n * @return {string} The extracted base URL.\n */\n static extractUrlBase(e) {\n const t = e.lastIndexOf(\"/\");\n return t === -1 ? \"./\" : e.slice(0, t + 1);\n }\n /**\n * Resolves relative URLs against the given path. Absolute paths, data urls,\n * and blob URLs will be returned as is. Invalid URLs will return an empty\n * string.\n *\n * @param {string} url -The URL to resolve.\n * @param {string} path - The base path for relative URLs to be resolved against.\n * @return {string} The resolved URL.\n */\n static resolveURL(e, t) {\n return typeof e != \"string\" || e === \"\" ? \"\" : (/^https?:\\/\\//i.test(t) && /^\\//.test(e) && (t = t.replace(/(^https?:\\/\\/[^\\/]+).*/i, \"$1\")), /^(https?:)?\\/\\//i.test(e) || /^data:.*,.*$/i.test(e) || /^blob:.*$/i.test(e) ? e : t + e);\n }\n}\nconst ha = /* @__PURE__ */ new WeakMap();\nclass Fd extends ei {\n /**\n * Constructs a new image bitmap loader.\n *\n * @param {LoadingManager} [manager] - The loading manager.\n */\n constructor(e) {\n super(e), this.isImageBitmapLoader = !0, typeof createImageBitmap > \"u\" && Te(\"ImageBitmapLoader: createImageBitmap() not supported.\"), typeof fetch > \"u\" && Te(\"ImageBitmapLoader: fetch() not supported.\"), this.options = { premultiplyAlpha: \"none\" }, this._abortController = new AbortController();\n }\n /**\n * Sets the given loader options. The structure of the object must match the `options` parameter of\n * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).\n *\n * @param {Object} options - The loader options to set.\n * @return {ImageBitmapLoader} A reference to this image bitmap loader.\n */\n setOptions(e) {\n return this.options = e, this;\n }\n /**\n * Starts loading from the given URL and pass the loaded image bitmap to the `onLoad()` callback.\n *\n * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.\n * @param {onProgressCallback} onProgress - Unsupported in this loader.\n * @param {onErrorCallback} onError - Executed when errors occur.\n * @return {ImageBitmap|undefined} The image bitmap.\n */\n load(e, t, n, s) {\n e === void 0 && (e = \"\"), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);\n const r = this, a = kn.get(`image-bitmap:${e}`);\n if (a !== void 0) {\n if (r.manager.itemStart(e), a.then) {\n a.then((c) => {\n if (ha.has(a) === !0)\n s && s(ha.get(a)), r.manager.itemError(e), r.manager.itemEnd(e);\n else\n return t && t(c), r.manager.itemEnd(e), c;\n });\n return;\n }\n return setTimeout(function() {\n t && t(a), r.manager.itemEnd(e);\n }, 0), a;\n }\n const o = {};\n o.credentials = this.crossOrigin === \"anonymous\" ? \"same-origin\" : \"include\", o.headers = this.requestHeader, o.signal = typeof AbortSignal.any == \"function\" ? AbortSignal.any([this._abortController.signal, this.manager.abortController.signal]) : this._abortController.signal;\n const l = fetch(e, o).then(function(c) {\n return c.blob();\n }).then(function(c) {\n return createImageBitmap(c, Object.assign(r.options, { colorSpaceConversion: \"none\" }));\n }).then(function(c) {\n return kn.add(`image-bitmap:${e}`, c), t && t(c), r.manager.itemEnd(e), c;\n }).catch(function(c) {\n s && s(c), ha.set(l, c), kn.remove(`image-bitmap:${e}`), r.manager.itemError(e), r.manager.itemEnd(e);\n });\n kn.add(`image-bitmap:${e}`, l), r.manager.itemStart(e);\n }\n /**\n * Aborts ongoing fetch requests.\n *\n * @return {ImageBitmapLoader} A reference to this instance.\n */\n abort() {\n return this._abortController.abort(), this._abortController = new AbortController(), this;\n }\n}\nclass Od extends Tt {\n /**\n * Constructs a new array camera.\n *\n * @param {Array} [array=[]] - An array of perspective sub cameras.\n */\n constructor(e = []) {\n super(), this.isArrayCamera = !0, this.isMultiViewCamera = !1, this.cameras = e;\n }\n}\nclass Bd {\n /**\n * Constructs a new clock.\n *\n * @param {boolean} [autoStart=true] - Whether to automatically start the clock when\n * `getDelta()` is called for the first time.\n */\n constructor(e = !0) {\n this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1;\n }\n /**\n * Starts the clock. When `autoStart` is set to `true`, the method is automatically\n * called by the class.\n */\n start() {\n this.startTime = performance.now(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = !0;\n }\n /**\n * Stops the clock.\n */\n stop() {\n this.getElapsedTime(), this.running = !1, this.autoStart = !1;\n }\n /**\n * Returns the elapsed time in seconds.\n *\n * @return {number} The elapsed time.\n */\n getElapsedTime() {\n return this.getDelta(), this.elapsedTime;\n }\n /**\n * Returns the delta time in seconds.\n *\n * @return {number} The delta time.\n */\n getDelta() {\n let e = 0;\n if (this.autoStart && !this.running)\n return this.start(), 0;\n if (this.running) {\n const t = performance.now();\n e = (t - this.oldTime) / 1e3, this.oldTime = t, this.elapsedTime += e;\n }\n return e;\n }\n}\nconst Xo = \"\\\\[\\\\]\\\\.:\\\\/\", zd = new RegExp(\"[\" + Xo + \"]\", \"g\"), jo = \"[^\" + Xo + \"]\", kd = \"[^\" + Xo.replace(\"\\\\.\", \"\") + \"]\", Vd = /* @__PURE__ */ /((?:WC+[\\/:])*)/.source.replace(\"WC\", jo), Gd = /* @__PURE__ */ /(WCOD+)?/.source.replace(\"WCOD\", kd), Hd = /* @__PURE__ */ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace(\"WC\", jo), Wd = /* @__PURE__ */ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace(\"WC\", jo), Xd = new RegExp(\n \"^\" + Vd + Gd + Hd + Wd + \"$\"\n), jd = [\"material\", \"materials\", \"bones\", \"map\"];\nclass qd {\n constructor(e, t, n) {\n const s = n || nt.parseTrackName(t);\n this._targetGroup = e, this._bindings = e.subscribe_(t, s);\n }\n getValue(e, t) {\n this.bind();\n const n = this._targetGroup.nCachedObjects_, s = this._bindings[n];\n s !== void 0 && s.getValue(e, t);\n }\n setValue(e, t) {\n const n = this._bindings;\n for (let s = this._targetGroup.nCachedObjects_, r = n.length; s !== r; ++s)\n n[s].setValue(e, t);\n }\n bind() {\n const e = this._bindings;\n for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t)\n e[t].bind();\n }\n unbind() {\n const e = this._bindings;\n for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t)\n e[t].unbind();\n }\n}\nclass nt {\n /**\n * Constructs a new property binding.\n *\n * @param {Object} rootNode - The root node.\n * @param {string} path - The path.\n * @param {?Object} [parsedPath] - The parsed path.\n */\n constructor(e, t, n) {\n this.path = t, this.parsedPath = n || nt.parseTrackName(t), this.node = nt.findNode(e, this.parsedPath.nodeName), this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n }\n /**\n * Factory method for creating a property binding from the given parameters.\n *\n * @static\n * @param {Object} root - The root node.\n * @param {string} path - The path.\n * @param {?Object} [parsedPath] - The parsed path.\n * @return {PropertyBinding|Composite} The created property binding or composite.\n */\n static create(e, t, n) {\n return e && e.isAnimationObjectGroup ? new nt.Composite(e, t, n) : new nt(e, t, n);\n }\n /**\n * Replaces spaces with underscores and removes unsupported characters from\n * node names, to ensure compatibility with parseTrackName().\n *\n * @param {string} name - Node name to be sanitized.\n * @return {string} The sanitized node name.\n */\n static sanitizeNodeName(e) {\n return e.replace(/\\s/g, \"_\").replace(zd, \"\");\n }\n /**\n * Parses the given track name (an object path to an animated property) and\n * returns an object with information about the path. Matches strings in the following forms:\n *\n * - nodeName.property\n * - nodeName.property[accessor]\n * - nodeName.material.property[accessor]\n * - uuid.property[accessor]\n * - uuid.objectName[objectIndex].propertyName[propertyIndex]\n * - parentName/nodeName.property\n * - parentName/parentName/nodeName.property[index]\n * - .bone[Armature.DEF_cog].position\n * - scene:helium_balloon_model:helium_balloon_model.position\n *\n * @static\n * @param {string} trackName - The track name to parse.\n * @return {Object} The parsed track name as an object.\n */\n static parseTrackName(e) {\n const t = Xd.exec(e);\n if (t === null)\n throw new Error(\"PropertyBinding: Cannot parse trackName: \" + e);\n const n = {\n // directoryName: matches[ 1 ], // (tschw) currently unused\n nodeName: t[2],\n objectName: t[3],\n objectIndex: t[4],\n propertyName: t[5],\n // required\n propertyIndex: t[6]\n }, s = n.nodeName && n.nodeName.lastIndexOf(\".\");\n if (s !== void 0 && s !== -1) {\n const r = n.nodeName.substring(s + 1);\n jd.indexOf(r) !== -1 && (n.nodeName = n.nodeName.substring(0, s), n.objectName = r);\n }\n if (n.propertyName === null || n.propertyName.length === 0)\n throw new Error(\"PropertyBinding: can not parse propertyName from trackName: \" + e);\n return n;\n }\n /**\n * Searches for a node in the hierarchy of the given root object by the given\n * node name.\n *\n * @static\n * @param {Object} root - The root object.\n * @param {string|number} nodeName - The name of the node.\n * @return {?Object} The found node. Returns `null` if no object was found.\n */\n static findNode(e, t) {\n if (t === void 0 || t === \"\" || t === \".\" || t === -1 || t === e.name || t === e.uuid)\n return e;\n if (e.skeleton) {\n const n = e.skeleton.getBoneByName(t);\n if (n !== void 0)\n return n;\n }\n if (e.children) {\n const n = function(r) {\n for (let a = 0; a < r.length; a++) {\n const o = r[a];\n if (o.name === t || o.uuid === t)\n return o;\n const l = n(o.children);\n if (l) return l;\n }\n return null;\n }, s = n(e.children);\n if (s)\n return s;\n }\n return null;\n }\n // these are used to \"bind\" a nonexistent property\n _getValue_unavailable() {\n }\n _setValue_unavailable() {\n }\n // Getters\n _getValue_direct(e, t) {\n e[t] = this.targetObject[this.propertyName];\n }\n _getValue_array(e, t) {\n const n = this.resolvedProperty;\n for (let s = 0, r = n.length; s !== r; ++s)\n e[t++] = n[s];\n }\n _getValue_arrayElement(e, t) {\n e[t] = this.resolvedProperty[this.propertyIndex];\n }\n _getValue_toArray(e, t) {\n this.resolvedProperty.toArray(e, t);\n }\n // Direct\n _setValue_direct(e, t) {\n this.targetObject[this.propertyName] = e[t];\n }\n _setValue_direct_setNeedsUpdate(e, t) {\n this.targetObject[this.propertyName] = e[t], this.targetObject.needsUpdate = !0;\n }\n _setValue_direct_setMatrixWorldNeedsUpdate(e, t) {\n this.targetObject[this.propertyName] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0;\n }\n // EntireArray\n _setValue_array(e, t) {\n const n = this.resolvedProperty;\n for (let s = 0, r = n.length; s !== r; ++s)\n n[s] = e[t++];\n }\n _setValue_array_setNeedsUpdate(e, t) {\n const n = this.resolvedProperty;\n for (let s = 0, r = n.length; s !== r; ++s)\n n[s] = e[t++];\n this.targetObject.needsUpdate = !0;\n }\n _setValue_array_setMatrixWorldNeedsUpdate(e, t) {\n const n = this.resolvedProperty;\n for (let s = 0, r = n.length; s !== r; ++s)\n n[s] = e[t++];\n this.targetObject.matrixWorldNeedsUpdate = !0;\n }\n // ArrayElement\n _setValue_arrayElement(e, t) {\n this.resolvedProperty[this.propertyIndex] = e[t];\n }\n _setValue_arrayElement_setNeedsUpdate(e, t) {\n this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.needsUpdate = !0;\n }\n _setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t) {\n this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0;\n }\n // HasToFromArray\n _setValue_fromArray(e, t) {\n this.resolvedProperty.fromArray(e, t);\n }\n _setValue_fromArray_setNeedsUpdate(e, t) {\n this.resolvedProperty.fromArray(e, t), this.targetObject.needsUpdate = !0;\n }\n _setValue_fromArray_setMatrixWorldNeedsUpdate(e, t) {\n this.resolvedProperty.fromArray(e, t), this.targetObject.matrixWorldNeedsUpdate = !0;\n }\n _getValue_unbound(e, t) {\n this.bind(), this.getValue(e, t);\n }\n _setValue_unbound(e, t) {\n this.bind(), this.setValue(e, t);\n }\n /**\n * Creates a getter / setter pair for the property tracked by this binding.\n */\n bind() {\n let e = this.node;\n const t = this.parsedPath, n = t.objectName, s = t.propertyName;\n let r = t.propertyIndex;\n if (e || (e = nt.findNode(this.rootNode, t.nodeName), this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) {\n Te(\"PropertyBinding: No target node found for track: \" + this.path + \".\");\n return;\n }\n if (n) {\n let c = t.objectIndex;\n switch (n) {\n case \"materials\":\n if (!e.material) {\n Xe(\"PropertyBinding: Can not bind to material as node does not have a material.\", this);\n return;\n }\n if (!e.material.materials) {\n Xe(\"PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\", this);\n return;\n }\n e = e.material.materials;\n break;\n case \"bones\":\n if (!e.skeleton) {\n Xe(\"PropertyBinding: Can not bind to bones as node does not have a skeleton.\", this);\n return;\n }\n e = e.skeleton.bones;\n for (let h = 0; h < e.length; h++)\n if (e[h].name === c) {\n c = h;\n break;\n }\n break;\n case \"map\":\n if (\"map\" in e) {\n e = e.map;\n break;\n }\n if (!e.material) {\n Xe(\"PropertyBinding: Can not bind to material as node does not have a material.\", this);\n return;\n }\n if (!e.material.map) {\n Xe(\"PropertyBinding: Can not bind to material.map as node.material does not have a map.\", this);\n return;\n }\n e = e.material.map;\n break;\n default:\n if (e[n] === void 0) {\n Xe(\"PropertyBinding: Can not bind to objectName of node undefined.\", this);\n return;\n }\n e = e[n];\n }\n if (c !== void 0) {\n if (e[c] === void 0) {\n Xe(\"PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\", this, e);\n return;\n }\n e = e[c];\n }\n }\n const a = e[s];\n if (a === void 0) {\n const c = t.nodeName;\n Xe(\"PropertyBinding: Trying to update property for track: \" + c + \".\" + s + \" but it wasn't found.\", e);\n return;\n }\n let o = this.Versioning.None;\n this.targetObject = e, e.isMaterial === !0 ? o = this.Versioning.NeedsUpdate : e.isObject3D === !0 && (o = this.Versioning.MatrixWorldNeedsUpdate);\n let l = this.BindingType.Direct;\n if (r !== void 0) {\n if (s === \"morphTargetInfluences\") {\n if (!e.geometry) {\n Xe(\"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\", this);\n return;\n }\n if (!e.geometry.morphAttributes) {\n Xe(\"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\", this);\n return;\n }\n e.morphTargetDictionary[r] !== void 0 && (r = e.morphTargetDictionary[r]);\n }\n l = this.BindingType.ArrayElement, this.resolvedProperty = a, this.propertyIndex = r;\n } else a.fromArray !== void 0 && a.toArray !== void 0 ? (l = this.BindingType.HasFromToArray, this.resolvedProperty = a) : Array.isArray(a) ? (l = this.BindingType.EntireArray, this.resolvedProperty = a) : this.propertyName = s;\n this.getValue = this.GetterByBindingType[l], this.setValue = this.SetterByBindingTypeAndVersioning[l][o];\n }\n /**\n * Unbinds the property.\n */\n unbind() {\n this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n }\n}\nnt.Composite = qd;\nnt.prototype.BindingType = {\n Direct: 0,\n EntireArray: 1,\n ArrayElement: 2,\n HasFromToArray: 3\n};\nnt.prototype.Versioning = {\n None: 0,\n NeedsUpdate: 1,\n MatrixWorldNeedsUpdate: 2\n};\nnt.prototype.GetterByBindingType = [\n nt.prototype._getValue_direct,\n nt.prototype._getValue_array,\n nt.prototype._getValue_arrayElement,\n nt.prototype._getValue_toArray\n];\nnt.prototype.SetterByBindingTypeAndVersioning = [\n [\n // Direct\n nt.prototype._setValue_direct,\n nt.prototype._setValue_direct_setNeedsUpdate,\n nt.prototype._setValue_direct_setMatrixWorldNeedsUpdate\n ],\n [\n // EntireArray\n nt.prototype._setValue_array,\n nt.prototype._setValue_array_setNeedsUpdate,\n nt.prototype._setValue_array_setMatrixWorldNeedsUpdate\n ],\n [\n // ArrayElement\n nt.prototype._setValue_arrayElement,\n nt.prototype._setValue_arrayElement_setNeedsUpdate,\n nt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate\n ],\n [\n // HasToFromArray\n nt.prototype._setValue_fromArray,\n nt.prototype._setValue_fromArray_setNeedsUpdate,\n nt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate\n ]\n];\nconst Xl = /* @__PURE__ */ new Ne();\nclass jl {\n /**\n * Constructs a new raycaster.\n *\n * @param {Vector3} origin - The origin vector where the ray casts from.\n * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n * @param {number} [near=0] - All results returned are further away than near. Near can't be negative.\n * @param {number} [far=Infinity] - All results returned are closer than far. Far can't be lower than near.\n */\n constructor(e, t, n = 0, s = 1 / 0) {\n this.ray = new Ji(e, t), this.near = n, this.far = s, this.camera = null, this.layers = new Uo(), this.params = {\n Mesh: {},\n Line: { threshold: 1 },\n LOD: {},\n Points: { threshold: 1 },\n Sprite: {}\n };\n }\n /**\n * Updates the ray with a new origin and direction by copying the values from the arguments.\n *\n * @param {Vector3} origin - The origin vector where the ray casts from.\n * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n */\n set(e, t) {\n this.ray.set(e, t);\n }\n /**\n * Uses the given coordinates and camera to compute a new origin and direction for the internal ray.\n *\n * @param {Vector2} coords - 2D coordinates of the mouse, in normalized device coordinates (NDC).\n * X and Y components should be between `-1` and `1`.\n * @param {Camera} camera - The camera from which the ray should originate.\n */\n setFromCamera(e, t) {\n t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t) : t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t) : Xe(\"Raycaster: Unsupported camera type: \" + t.type);\n }\n /**\n * Uses the given WebXR controller to compute a new origin and direction for the internal ray.\n *\n * @param {WebXRController} controller - The controller to copy the position and direction from.\n * @return {Raycaster} A reference to this raycaster.\n */\n setFromXRController(e) {\n return Xl.identity().extractRotation(e.matrixWorld), this.ray.origin.setFromMatrixPosition(e.matrixWorld), this.ray.direction.set(0, 0, -1).applyMatrix4(Xl), this;\n }\n /**\n * The intersection point of a raycaster intersection test.\n * @typedef {Object} Raycaster~Intersection\n * @property {number} distance - The distance from the ray's origin to the intersection point.\n * @property {number} distanceToRay - Some 3D objects e.g. {@link Points} provide the distance of the\n * intersection to the nearest point on the ray. For other objects it will be `undefined`.\n * @property {Vector3} point - The intersection point, in world coordinates.\n * @property {Object} face - The face that has been intersected.\n * @property {number} faceIndex - The face index.\n * @property {Object3D} object - The 3D object that has been intersected.\n * @property {Vector2} uv - U,V coordinates at point of intersection.\n * @property {Vector2} uv1 - Second set of U,V coordinates at point of intersection.\n * @property {Vector3} uv1 - Interpolated normal vector at point of intersection.\n * @property {number} instanceId - The index number of the instance where the ray\n * intersects the {@link InstancedMesh}.\n */\n /**\n * Checks all intersection between the ray and the object with or without the\n * descendants. Intersections are returned sorted by distance, closest first.\n *\n * `Raycaster` delegates to the `raycast()` method of the passed 3D object, when\n * evaluating whether the ray intersects the object or not. This allows meshes to respond\n * differently to ray casting than lines or points.\n *\n * Note that for meshes, faces must be pointed towards the origin of the ray in order\n * to be detected; intersections of the ray passing through the back of a face will not\n * be detected. To raycast against both faces of an object, you'll want to set {@link Material#side}\n * to `THREE.DoubleSide`.\n *\n * @param {Object3D} object - The 3D object to check for intersection with the ray.\n * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n * Otherwise it only checks intersection with the object.\n * @param {Array} [intersects=[]] The target array that holds the result of the method.\n * @return {Array} An array holding the intersection points.\n */\n intersectObject(e, t = !0, n = []) {\n return po(e, this, n, t), n.sort(ql), n;\n }\n /**\n * Checks all intersection between the ray and the objects with or without\n * the descendants. Intersections are returned sorted by distance, closest first.\n *\n * @param {Array} objects - The 3D objects to check for intersection with the ray.\n * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n * Otherwise it only checks intersection with the object.\n * @param {Array} [intersects=[]] The target array that holds the result of the method.\n * @return {Array} An array holding the intersection points.\n */\n intersectObjects(e, t = !0, n = []) {\n for (let s = 0, r = e.length; s < r; s++)\n po(e[s], this, n, t);\n return n.sort(ql), n;\n }\n}\nfunction ql(i, e) {\n return i.distance - e.distance;\n}\nfunction po(i, e, t, n) {\n let s = !0;\n if (i.layers.test(e.layers) && i.raycast(e, t) === !1 && (s = !1), s === !0 && n === !0) {\n const r = i.children;\n for (let a = 0, o = r.length; a < o; a++)\n po(r[a], e, t, !0);\n }\n}\nclass Yl {\n /**\n * Constructs a new spherical.\n *\n * @param {number} [radius=1] - The radius, or the Euclidean distance (straight-line distance) from the point to the origin.\n * @param {number} [phi=0] - The polar angle in radians from the y (up) axis.\n * @param {number} [theta=0] - The equator/azimuthal angle in radians around the y (up) axis.\n */\n constructor(e = 1, t = 0, n = 0) {\n this.radius = e, this.phi = t, this.theta = n;\n }\n /**\n * Sets the spherical components by copying the given values.\n *\n * @param {number} radius - The radius.\n * @param {number} phi - The polar angle.\n * @param {number} theta - The azimuthal angle.\n * @return {Spherical} A reference to this spherical.\n */\n set(e, t, n) {\n return this.radius = e, this.phi = t, this.theta = n, this;\n }\n /**\n * Copies the values of the given spherical to this instance.\n *\n * @param {Spherical} other - The spherical to copy.\n * @return {Spherical} A reference to this spherical.\n */\n copy(e) {\n return this.radius = e.radius, this.phi = e.phi, this.theta = e.theta, this;\n }\n /**\n * Restricts the polar angle [page:.phi phi] to be between `0.000001` and pi -\n * `0.000001`.\n *\n * @return {Spherical} A reference to this spherical.\n */\n makeSafe() {\n return this.phi = He(this.phi, 1e-6, Math.PI - 1e-6), this;\n }\n /**\n * Sets the spherical components from the given vector which is assumed to hold\n * Cartesian coordinates.\n *\n * @param {Vector3} v - The vector to set.\n * @return {Spherical} A reference to this spherical.\n */\n setFromVector3(e) {\n return this.setFromCartesianCoords(e.x, e.y, e.z);\n }\n /**\n * Sets the spherical components from the given Cartesian coordinates.\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n * @param {number} z - The z value.\n * @return {Spherical} A reference to this spherical.\n */\n setFromCartesianCoords(e, t, n) {\n return this.radius = Math.sqrt(e * e + t * t + n * n), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, n), this.phi = Math.acos(He(t / this.radius, -1, 1))), this;\n }\n /**\n * Returns a new spherical with copied values from this instance.\n *\n * @return {Spherical} A clone of this instance.\n */\n clone() {\n return new this.constructor().copy(this);\n }\n}\nclass Yd extends mi {\n /**\n * Constructs a new controls instance.\n *\n * @param {Object3D} object - The object that is managed by the controls.\n * @param {?HTMLElement} domElement - The HTML element used for event listeners.\n */\n constructor(e, t = null) {\n super(), this.object = e, this.domElement = t, this.enabled = !0, this.state = -1, this.keys = {}, this.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null }, this.touches = { ONE: null, TWO: null };\n }\n /**\n * Connects the controls to the DOM. This method has so called \"side effects\" since\n * it adds the module's event listeners to the DOM.\n *\n * @param {HTMLElement} element - The DOM element to connect to.\n */\n connect(e) {\n if (e === void 0) {\n Te(\"Controls: connect() now requires an element.\");\n return;\n }\n this.domElement !== null && this.disconnect(), this.domElement = e;\n }\n /**\n * Disconnects the controls from the DOM.\n */\n disconnect() {\n }\n /**\n * Call this method if you no longer want use to the controls. It frees all internal\n * resources and removes all event listeners.\n */\n dispose() {\n }\n /**\n * Controls should implement this method if they have to update their internal state\n * per simulation step.\n *\n * @param {number} [delta] - The time delta in seconds.\n */\n update() {\n }\n}\nfunction Kl(i, e, t, n) {\n const s = Kd(n);\n switch (t) {\n // https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml\n case jc:\n return i * e;\n case wo:\n return i * e / s.components * s.byteLength;\n case Ao:\n return i * e / s.components * s.byteLength;\n case Ro:\n return i * e * 2 / s.components * s.byteLength;\n case Co:\n return i * e * 2 / s.components * s.byteLength;\n case qc:\n return i * e * 3 / s.components * s.byteLength;\n case Zt:\n return i * e * 4 / s.components * s.byteLength;\n case Po:\n return i * e * 4 / s.components * s.byteLength;\n // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/\n case dr:\n case fr:\n return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 8;\n case pr:\n case mr:\n return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;\n // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/\n case Na:\n case Oa:\n return Math.max(i, 16) * Math.max(e, 8) / 4;\n case Ua:\n case Fa:\n return Math.max(i, 8) * Math.max(e, 8) / 2;\n // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/\n case Ba:\n case za:\n return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 8;\n case ka:\n return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;\n // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/\n case Va:\n return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;\n case Ga:\n return Math.floor((i + 4) / 5) * Math.floor((e + 3) / 4) * 16;\n case Ha:\n return Math.floor((i + 4) / 5) * Math.floor((e + 4) / 5) * 16;\n case Wa:\n return Math.floor((i + 5) / 6) * Math.floor((e + 4) / 5) * 16;\n case Xa:\n return Math.floor((i + 5) / 6) * Math.floor((e + 5) / 6) * 16;\n case ja:\n return Math.floor((i + 7) / 8) * Math.floor((e + 4) / 5) * 16;\n case qa:\n return Math.floor((i + 7) / 8) * Math.floor((e + 5) / 6) * 16;\n case Ya:\n return Math.floor((i + 7) / 8) * Math.floor((e + 7) / 8) * 16;\n case Ka:\n return Math.floor((i + 9) / 10) * Math.floor((e + 4) / 5) * 16;\n case Za:\n return Math.floor((i + 9) / 10) * Math.floor((e + 5) / 6) * 16;\n case $a:\n return Math.floor((i + 9) / 10) * Math.floor((e + 7) / 8) * 16;\n case Ja:\n return Math.floor((i + 9) / 10) * Math.floor((e + 9) / 10) * 16;\n case Qa:\n return Math.floor((i + 11) / 12) * Math.floor((e + 9) / 10) * 16;\n case eo:\n return Math.floor((i + 11) / 12) * Math.floor((e + 11) / 12) * 16;\n // https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/\n case to:\n case no:\n case io:\n return Math.ceil(i / 4) * Math.ceil(e / 4) * 16;\n // https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/\n case so:\n case ro:\n return Math.ceil(i / 4) * Math.ceil(e / 4) * 8;\n case ao:\n case oo:\n return Math.ceil(i / 4) * Math.ceil(e / 4) * 16;\n }\n throw new Error(\n `Unable to determine texture byte length for ${t} format.`\n );\n}\nfunction Kd(i) {\n switch (i) {\n case mn:\n case Gc:\n return { byteLength: 1, components: 1 };\n case Ss:\n case Hc:\n case xt:\n return { byteLength: 2, components: 1 };\n case To:\n case Eo:\n return { byteLength: 2, components: 4 };\n case di:\n case yo:\n case Xt:\n return { byteLength: 4, components: 1 };\n case Wc:\n case Xc:\n return { byteLength: 4, components: 3 };\n }\n throw new Error(`Unknown texture type ${i}.`);\n}\ntypeof __THREE_DEVTOOLS__ < \"u\" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"register\", { detail: {\n revision: \"181\"\n} }));\ntypeof window < \"u\" && (window.__THREE__ ? Te(\"WARNING: Multiple instances of Three.js being imported.\") : window.__THREE__ = \"181\");\nfunction gh() {\n let i = null, e = !1, t = null, n = null;\n function s(r, a) {\n t(r, a), n = i.requestAnimationFrame(s);\n }\n return {\n start: function() {\n e !== !0 && t !== null && (n = i.requestAnimationFrame(s), e = !0);\n },\n stop: function() {\n i.cancelAnimationFrame(n), e = !1;\n },\n setAnimationLoop: function(r) {\n t = r;\n },\n setContext: function(r) {\n i = r;\n }\n };\n}\nfunction Zd(i) {\n const e = /* @__PURE__ */ new WeakMap();\n function t(o, l) {\n const c = o.array, h = o.usage, u = c.byteLength, d = i.createBuffer();\n i.bindBuffer(l, d), i.bufferData(l, c, h), o.onUploadCallback();\n let p;\n if (c instanceof Float32Array)\n p = i.FLOAT;\n else if (typeof Float16Array < \"u\" && c instanceof Float16Array)\n p = i.HALF_FLOAT;\n else if (c instanceof Uint16Array)\n o.isFloat16BufferAttribute ? p = i.HALF_FLOAT : p = i.UNSIGNED_SHORT;\n else if (c instanceof Int16Array)\n p = i.SHORT;\n else if (c instanceof Uint32Array)\n p = i.UNSIGNED_INT;\n else if (c instanceof Int32Array)\n p = i.INT;\n else if (c instanceof Int8Array)\n p = i.BYTE;\n else if (c instanceof Uint8Array)\n p = i.UNSIGNED_BYTE;\n else if (c instanceof Uint8ClampedArray)\n p = i.UNSIGNED_BYTE;\n else\n throw new Error(\"THREE.WebGLAttributes: Unsupported buffer data format: \" + c);\n return {\n buffer: d,\n type: p,\n bytesPerElement: c.BYTES_PER_ELEMENT,\n version: o.version,\n size: u\n };\n }\n function n(o, l, c) {\n const h = l.array, u = l.updateRanges;\n if (i.bindBuffer(c, o), u.length === 0)\n i.bufferSubData(c, 0, h);\n else {\n u.sort((p, g) => p.start - g.start);\n let d = 0;\n for (let p = 1; p < u.length; p++) {\n const g = u[d], x = u[p];\n x.start <= g.start + g.count + 1 ? g.count = Math.max(\n g.count,\n x.start + x.count - g.start\n ) : (++d, u[d] = x);\n }\n u.length = d + 1;\n for (let p = 0, g = u.length; p < g; p++) {\n const x = u[p];\n i.bufferSubData(\n c,\n x.start * h.BYTES_PER_ELEMENT,\n h,\n x.start,\n x.count\n );\n }\n l.clearUpdateRanges();\n }\n l.onUploadCallback();\n }\n function s(o) {\n return o.isInterleavedBufferAttribute && (o = o.data), e.get(o);\n }\n function r(o) {\n o.isInterleavedBufferAttribute && (o = o.data);\n const l = e.get(o);\n l && (i.deleteBuffer(l.buffer), e.delete(o));\n }\n function a(o, l) {\n if (o.isInterleavedBufferAttribute && (o = o.data), o.isGLBufferAttribute) {\n const h = e.get(o);\n (!h || h.version < o.version) && e.set(o, {\n buffer: o.buffer,\n type: o.type,\n bytesPerElement: o.elementSize,\n version: o.version\n });\n return;\n }\n const c = e.get(o);\n if (c === void 0)\n e.set(o, t(o, l));\n else if (c.version < o.version) {\n if (c.size !== o.array.byteLength)\n throw new Error(\"THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.\");\n n(c.buffer, o, l), c.version = o.version;\n }\n }\n return {\n get: s,\n remove: r,\n update: a\n };\n}\nvar $d = `#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif`, Jd = `#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif`, Qd = `#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif`, ef = `#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`, tf = `#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif`, nf = `#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif`, sf = `#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif`, rf = `#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif`, af = `#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif`, of = `#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif`, lf = `vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif`, cf = `vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif`, hf = `float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated`, uf = `#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif`, df = `#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif`, ff = `#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif`, pf = `#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`, mf = `#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`, gf = `#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`, xf = `#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif`, _f = `#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif`, vf = `#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif`, Mf = `#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif`, Sf = `#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated`, bf = `#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`, yf = `vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif`, Tf = `#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`, Ef = `#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif`, wf = `#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`, Af = `#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`, Rf = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\", Cf = `vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}`, Pf = `#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif`, Df = `#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n#endif`, Lf = `#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif`, If = `#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif`, Uf = `#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif`, Nf = `#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`, Ff = `#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`, Of = `#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`, Bf = `#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif`, zf = `#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}`, kf = `#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`, Vf = `LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`, Gf = `varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert`, Hf = `uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif`, Wf = `#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif`, Xf = `ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`, jf = `varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon`, qf = `BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`, Yf = `varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong`, Kf = `PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif`, Zf = `uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 uv = vec2( roughness, dotNV );\n\treturn texture2D( dfgLUT, uv ).rg;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness );\n\tvec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness );\n\tvec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y;\n\tvec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y;\n\tfloat Ess_V = dfgV.x + dfgV.y;\n\tfloat Ess_L = dfgL.x + dfgL.y;\n\tfloat Ems_V = 1.0 - Ess_V;\n\tfloat Ems_L = 1.0 - Ess_L;\n\tvec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619;\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON );\n\tfloat compensationFactor = Ems_V * Ems_L;\n\tvec3 multiScatter = Fms * compensationFactor;\n\treturn singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`, $f = `\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`, Jf = `#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif`, Qf = `#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif`, ep = `#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`, tp = `#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`, np = `#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`, ip = `#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif`, sp = `#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif`, rp = `#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`, ap = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`, op = `#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`, lp = `float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`, cp = `#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`, hp = `#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif`, up = `#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif`, dp = `#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif`, fp = `#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif`, pp = `#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif`, mp = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;`, gp = `#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif`, xp = `#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`, _p = `#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`, vp = `#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif`, Mp = `#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif`, Sp = `#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif`, bp = `#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif`, yp = `#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif`, Tp = `#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`, Ep = `#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );`, wp = `vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}`, Ap = `#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`, Rp = `vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`, Cp = `#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`, Pp = `#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif`, Dp = `float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`, Lp = `#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`, Ip = `#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\tfloat depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\treturn step( depth, compare );\n\t\t#else\n\t\t\treturn step( compare, depth );\n\t\t#endif\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\tfloat hard_shadow = step( distribution.x, compare );\n\t\t#else\n\t\t\tfloat hard_shadow = step( compare, distribution.x );\n\t\t#endif\n\t\tif ( hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif`, Up = `#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif`, Np = `#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif`, Fp = `float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}`, Op = `#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`, Bp = `#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif`, zp = `#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`, kp = `#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif`, Vp = `float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`, Gp = `#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`, Hp = `#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`, Wp = `#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }`, Xp = `#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif`, jp = `#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif`, qp = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif`, Yp = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif`, Kp = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif`, Zp = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif`;\nconst $p = `varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}`, Jp = `uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}`, Qp = `varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`, em = `#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}`, tm = `varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`, nm = `uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}`, im = `#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}`, sm = `#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}`, rm = `#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}`, am = `#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}`, om = `varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}`, lm = `uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}`, cm = `uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include