@luma.gl/gltf 9.2.5 → 9.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +78 -13
- package/dist/dist.min.js +4 -4
- package/dist/gltf/create-scenegraph-from-gltf.d.ts +2 -0
- package/dist/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/create-scenegraph-from-gltf.js +3 -1
- package/dist/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/index.cjs +83 -16
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/parsers/parse-gltf-lights.d.ts +5 -0
- package/dist/parsers/parse-gltf-lights.d.ts.map +1 -0
- package/dist/parsers/parse-gltf-lights.js +69 -0
- package/dist/parsers/parse-gltf-lights.js.map +1 -0
- package/dist/pbr/pbr-environment.d.ts +4 -4
- package/dist/pbr/pbr-environment.d.ts.map +1 -1
- package/dist/pbr/pbr-environment.js +3 -3
- package/dist/pbr/pbr-environment.js.map +1 -1
- package/package.json +6 -6
- package/src/gltf/create-scenegraph-from-gltf.ts +5 -1
- package/src/index.ts +1 -0
- package/src/parsers/parse-gltf-lights.ts +91 -0
- package/src/pbr/pbr-environment.ts +7 -7
package/dist/dist.dev.js
CHANGED
|
@@ -72,6 +72,7 @@ var __exports__ = (() => {
|
|
|
72
72
|
GLTFAnimator: () => GLTFAnimator,
|
|
73
73
|
createScenegraphsFromGLTF: () => createScenegraphsFromGLTF,
|
|
74
74
|
loadPBREnvironment: () => loadPBREnvironment,
|
|
75
|
+
parseGLTFLights: () => parseGLTFLights,
|
|
75
76
|
parsePBRMaterial: () => parsePBRMaterial
|
|
76
77
|
});
|
|
77
78
|
__reExport(bundle_exports, __toESM(require_core(), 1));
|
|
@@ -615,7 +616,7 @@ var __exports__ = (() => {
|
|
|
615
616
|
|
|
616
617
|
// src/pbr/pbr-environment.ts
|
|
617
618
|
function loadPBREnvironment(device, props) {
|
|
618
|
-
const brdfLutTexture = new import_engine.
|
|
619
|
+
const brdfLutTexture = new import_engine.DynamicTexture(device, {
|
|
619
620
|
id: "brdfLUT",
|
|
620
621
|
sampler: {
|
|
621
622
|
addressModeU: "clamp-to-edge",
|
|
@@ -669,7 +670,7 @@ var __exports__ = (() => {
|
|
|
669
670
|
FACES.forEach((face) => {
|
|
670
671
|
data[String(face)] = getTextureForFace(face);
|
|
671
672
|
});
|
|
672
|
-
return new import_engine.
|
|
673
|
+
return new import_engine.DynamicTexture(device, {
|
|
673
674
|
id,
|
|
674
675
|
dimension: "cube",
|
|
675
676
|
mipmaps: false,
|
|
@@ -894,9 +895,6 @@ var __exports__ = (() => {
|
|
|
894
895
|
parsedMaterial.generatedTextures.push(texture);
|
|
895
896
|
}
|
|
896
897
|
|
|
897
|
-
// src/parsers/parse-gltf.ts
|
|
898
|
-
var import_engine3 = __toESM(require_engine(), 1);
|
|
899
|
-
|
|
900
898
|
// ../../node_modules/@math.gl/core/dist/lib/common.js
|
|
901
899
|
var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
902
900
|
var DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
@@ -3468,6 +3466,72 @@ var __exports__ = (() => {
|
|
|
3468
3466
|
}
|
|
3469
3467
|
};
|
|
3470
3468
|
|
|
3469
|
+
// src/parsers/parse-gltf-lights.ts
|
|
3470
|
+
function parseGLTFLights(gltf) {
|
|
3471
|
+
const lightDefs = gltf.extensions?.["KHR_lights_punctual"]?.["lights"];
|
|
3472
|
+
if (!lightDefs || !Array.isArray(lightDefs) || lightDefs.length === 0) {
|
|
3473
|
+
return [];
|
|
3474
|
+
}
|
|
3475
|
+
const lights = [];
|
|
3476
|
+
for (const node of gltf.nodes || []) {
|
|
3477
|
+
const nodeLight = node.extensions?.KHR_lights_punctual;
|
|
3478
|
+
if (!nodeLight || typeof nodeLight.light !== "number") {
|
|
3479
|
+
continue;
|
|
3480
|
+
}
|
|
3481
|
+
const gltfLight = lightDefs[nodeLight.light];
|
|
3482
|
+
if (!gltfLight) {
|
|
3483
|
+
continue;
|
|
3484
|
+
}
|
|
3485
|
+
const color = gltfLight.color || [1, 1, 1];
|
|
3486
|
+
const intensity = gltfLight.intensity ?? 1;
|
|
3487
|
+
const range = gltfLight.range;
|
|
3488
|
+
switch (gltfLight.type) {
|
|
3489
|
+
case "directional":
|
|
3490
|
+
lights.push(parseDirectionalLight(node, color, intensity));
|
|
3491
|
+
break;
|
|
3492
|
+
case "point":
|
|
3493
|
+
lights.push(parsePointLight(node, color, intensity, range));
|
|
3494
|
+
break;
|
|
3495
|
+
case "spot":
|
|
3496
|
+
lights.push(parsePointLight(node, color, intensity, range));
|
|
3497
|
+
break;
|
|
3498
|
+
default:
|
|
3499
|
+
break;
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
return lights;
|
|
3503
|
+
}
|
|
3504
|
+
function parsePointLight(node, color, intensity, range) {
|
|
3505
|
+
const position = node.translation ? [...node.translation] : [0, 0, 0];
|
|
3506
|
+
let attenuation = [1, 0, 0];
|
|
3507
|
+
if (range !== void 0 && range > 0) {
|
|
3508
|
+
attenuation = [1, 0, 1 / (range * range)];
|
|
3509
|
+
}
|
|
3510
|
+
return {
|
|
3511
|
+
type: "point",
|
|
3512
|
+
position,
|
|
3513
|
+
color,
|
|
3514
|
+
intensity,
|
|
3515
|
+
attenuation
|
|
3516
|
+
};
|
|
3517
|
+
}
|
|
3518
|
+
function parseDirectionalLight(node, color, intensity) {
|
|
3519
|
+
let direction = [0, 0, -1];
|
|
3520
|
+
if (node.rotation) {
|
|
3521
|
+
const orientation = new Matrix4().fromQuaternion(node.rotation);
|
|
3522
|
+
direction = orientation.transformDirection([0, 0, -1]);
|
|
3523
|
+
}
|
|
3524
|
+
return {
|
|
3525
|
+
type: "directional",
|
|
3526
|
+
direction,
|
|
3527
|
+
color,
|
|
3528
|
+
intensity
|
|
3529
|
+
};
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
// src/parsers/parse-gltf.ts
|
|
3533
|
+
var import_engine3 = __toESM(require_engine(), 1);
|
|
3534
|
+
|
|
3471
3535
|
// src/webgl-to-webgpu/convert-webgl-topology.ts
|
|
3472
3536
|
function convertGLDrawModeToTopology(drawMode) {
|
|
3473
3537
|
switch (drawMode) {
|
|
@@ -3487,7 +3551,7 @@ var __exports__ = (() => {
|
|
|
3487
3551
|
}
|
|
3488
3552
|
|
|
3489
3553
|
// src/gltf/create-gltf-model.ts
|
|
3490
|
-
var
|
|
3554
|
+
var import_core3 = __toESM(require_core(), 1);
|
|
3491
3555
|
var import_shadertools = __toESM(require_shadertools(), 1);
|
|
3492
3556
|
var import_engine2 = __toESM(require_engine(), 1);
|
|
3493
3557
|
var SHADER = (
|
|
@@ -3595,7 +3659,7 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3595
3659
|
);
|
|
3596
3660
|
function createGLTFModel(device, options) {
|
|
3597
3661
|
const { id, geometry, parsedPPBRMaterial, vertexCount, modelOptions = {} } = options;
|
|
3598
|
-
|
|
3662
|
+
import_core3.log.info(4, "createGLTFModel defines: ", parsedPPBRMaterial.defines)();
|
|
3599
3663
|
const managedResources = [];
|
|
3600
3664
|
const parameters = {
|
|
3601
3665
|
depthWriteEnabled: true,
|
|
@@ -3736,10 +3800,10 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3736
3800
|
}
|
|
3737
3801
|
|
|
3738
3802
|
// src/gltf/gltf-animator.ts
|
|
3739
|
-
var
|
|
3803
|
+
var import_core7 = __toESM(require_core(), 1);
|
|
3740
3804
|
|
|
3741
3805
|
// src/gltf/animations/interpolate.ts
|
|
3742
|
-
var
|
|
3806
|
+
var import_core5 = __toESM(require_core(), 1);
|
|
3743
3807
|
var scratchQuaternion = new Quaternion();
|
|
3744
3808
|
function interpolate(time, { input, interpolation, output }, target, path) {
|
|
3745
3809
|
const maxTime = input[input.length - 1];
|
|
@@ -3758,7 +3822,7 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3758
3822
|
target[path] = [1, 1, 1];
|
|
3759
3823
|
break;
|
|
3760
3824
|
default:
|
|
3761
|
-
|
|
3825
|
+
import_core5.log.warn(`Bad animation path ${path}`)();
|
|
3762
3826
|
}
|
|
3763
3827
|
}
|
|
3764
3828
|
const previousTime = input[previousIndex];
|
|
@@ -3791,7 +3855,7 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3791
3855
|
}
|
|
3792
3856
|
break;
|
|
3793
3857
|
default:
|
|
3794
|
-
|
|
3858
|
+
import_core5.log.warn(`Interpolation ${interpolation} not supported`)();
|
|
3795
3859
|
break;
|
|
3796
3860
|
}
|
|
3797
3861
|
}
|
|
@@ -3871,7 +3935,7 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3871
3935
|
}
|
|
3872
3936
|
/** @deprecated Use .setTime(). Will be removed (deck.gl is using this) */
|
|
3873
3937
|
animate(time) {
|
|
3874
|
-
|
|
3938
|
+
import_core7.log.warn("GLTFAnimator#animate is deprecated. Use GLTFAnimator#setTime instead")();
|
|
3875
3939
|
this.setTime(time);
|
|
3876
3940
|
}
|
|
3877
3941
|
setTime(time) {
|
|
@@ -3983,7 +4047,8 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
3983
4047
|
const scenes = parseGLTF(device, gltf, options);
|
|
3984
4048
|
const animations = parseGLTFAnimations(gltf);
|
|
3985
4049
|
const animator = new GLTFAnimator({ animations });
|
|
3986
|
-
|
|
4050
|
+
const lights = parseGLTFLights(gltf);
|
|
4051
|
+
return { scenes, animator, lights };
|
|
3987
4052
|
}
|
|
3988
4053
|
return __toCommonJS(bundle_exports);
|
|
3989
4054
|
})();
|
package/dist/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['luma'] = factory();
|
|
6
6
|
else root['luma'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var ve=Object.create;var st=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var it=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),qe=(n,t)=>{for(var e in t)st(n,e,{get:t[e],enumerable:!0})},rt=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ze(t))!Fe.call(n,s)&&s!==e&&st(n,s,{get:()=>t[s],enumerable:!(r=ke(t,s))||r.enumerable});return n},ct=(n,t,e)=>(rt(n,t,"default"),e&&rt(e,t,"default")),z=(n,t,e)=>(e=n!=null?ve(be(n)):{},rt(t||!n||!n.__esModule?st(e,"default",{value:n,enumerable:!0}):e,n)),Be=n=>rt(st({},"__esModule",{value:!0}),n);var D=it((cs,jt)=>{jt.exports=globalThis.luma});var ot=it((os,Qt)=>{Qt.exports=globalThis.luma});var zt=it((fi,xn)=>{xn.exports=globalThis.luma});var Te=it((yc,ye)=>{ye.exports=globalThis.luma});var et={};qe(et,{GLTFAnimator:()=>X,createScenegraphsFromGLTF:()=>ue,loadPBREnvironment:()=>mn,parsePBRMaterial:()=>xt});ct(et,z(D(),1));var kt=z(ot(),1);function V(n,t){if(!n)throw new Error(t||"loader assertion failed.")}var b={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ce=b.self||b.window||b.global||{},Ve=b.window||b.self||b.global||{},Ue=b.global||b.self||b.window||{},De=b.document||{};var Ot=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ye=Zt&&parseFloat(Zt[1])||0;var $e="",Kt={};function Lt(n){for(let t in Kt)if(n.startsWith(t)){let e=Kt[t];n=n.replace(t,e)}return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${$e}${n}`),n}var Jt="4.3.2";var Ge=globalThis.loaders?.parseImageNode,Rt=typeof Image<"u",Nt=typeof ImageBitmap<"u",We=Boolean(Ge),Pt=Ot?!0:We;function tn(n){switch(n){case"auto":return Nt||Rt||Pt;case"imagebitmap":return Nt;case"image":return Rt;case"data":return Pt;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}function nn(){if(Nt)return"imagebitmap";if(Rt)return"image";if(Pt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function en(n){let t=Xe(n);if(!t)throw new Error("Not an image");return t}function _t(n){return at(n)}function at(n){switch(en(n)){case"data":return n;case"image":case"imagebitmap":let t=document.createElement("canvas"),e=t.getContext("2d");if(!e)throw new Error("getImageData");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}function Xe(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&n instanceof Image?"image":n&&typeof n=="object"&&n.data&&n.width&&n.height?"data":null}var He=/^data:image\/svg\+xml/,je=/\.svg((\?|#).*)?$/;function ft(n){return n&&(He.test(n)||je.test(n))}function rn(n,t){if(ft(t)){let r=new TextDecoder().decode(n);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(r)}`}return It(n,t)}function It(n,t){if(ft(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}async function ht(n,t,e){let r=rn(n,e),s=self.URL||self.webkitURL,i=typeof r!="string"&&s.createObjectURL(r);try{return await Qe(i||r,t)}finally{i&&s.revokeObjectURL(i)}}async function Qe(n,t){let e=new Image;return e.src=n,t.image&&t.image.decode&&e.decode?(await e.decode(),e):await new Promise((r,s)=>{try{e.onload=()=>r(e),e.onerror=i=>{let c=i instanceof Error?i.message:"error";s(new Error(c))}}catch(i){s(i)}})}var Ze={},sn=!0;async function cn(n,t,e){let r;ft(e)?r=await ht(n,t,e):r=It(n,e);let s=t&&t.imagebitmap;return await Ke(r,s)}async function Ke(n,t=null){if((Je(t)||!sn)&&(t=null),t)try{return await createImageBitmap(n,t)}catch(e){console.warn(e),sn=!1}return await createImageBitmap(n)}function Je(n){for(let t in n||Ze)return!1;return!0}function on(n){return!rr(n,"ftyp",4)||!(n[8]&96)?null:tr(n)}function tr(n){switch(nr(n,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function nr(n,t,e){return String.fromCharCode(...n.slice(t,e))}function er(n){return[...n].map(t=>t.charCodeAt(0))}function rr(n,t,e=0){let r=er(t);for(let s=0;s<r.length;++s)if(r[s]!==n[s+e])return!1;return!0}var F=!1,j=!0;function lt(n){let t=Q(n);return ir(t)||ar(t)||cr(t)||or(t)||sr(t)}function sr(n){let t=new Uint8Array(n instanceof DataView?n.buffer:n),e=on(t);return e?{mimeType:e.mimeType,width:0,height:0}:null}function ir(n){let t=Q(n);return t.byteLength>=24&&t.getUint32(0,F)===2303741511?{mimeType:"image/png",width:t.getUint32(16,F),height:t.getUint32(20,F)}:null}function cr(n){let t=Q(n);return t.byteLength>=10&&t.getUint32(0,F)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,j),height:t.getUint16(8,j)}:null}function or(n){let t=Q(n);return t.byteLength>=14&&t.getUint16(0,F)===16973&&t.getUint32(2,j)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,j),height:t.getUint32(22,j)}:null}function ar(n){let t=Q(n);if(!(t.byteLength>=3&&t.getUint16(0,F)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:r,sofMarkers:s}=fr(),i=2;for(;i+9<t.byteLength;){let c=t.getUint16(i,F);if(s.has(c))return{mimeType:"image/jpeg",height:t.getUint16(i+5,F),width:t.getUint16(i+7,F)};if(!r.has(c))return null;i+=2,i+=t.getUint16(i,F)}return null}function fr(){let n=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)n.add(e);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Q(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}async function an(n,t){let{mimeType:e}=lt(n)||{},r=globalThis.loaders?.parseImageNode;return V(r),await r(n,e)}async function fn(n,t,e){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=e||{},c=hr(s),o;switch(c){case"imagebitmap":o=await cn(n,t,i);break;case"image":o=await ht(n,t,i);break;case"data":o=await an(n,t);break;default:V(!1)}return s==="data"&&(o=at(o)),o}function hr(n){switch(n){case"auto":case"data":return nn();default:return tn(n),n}}var lr=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],pr=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],mr={image:{type:"auto",decode:!0}},pt={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Jt,mimeTypes:pr,extensions:lr,parse:fn,tests:[n=>Boolean(lt(new DataView(n)))],options:mr};function mt(n,t,e){let r=typeof n=="function"?n({...t,...e}):n,s=t.baseUrl;return s&&(r=s[s.length-1]==="/"?`${s}${r}`:`${s}/${r}`),Lt(r)}var xr=n=>n&&typeof n=="object";async function hn(n,t,e={}){return await ut(n,t,e)}async function ut(n,t,e){return Array.isArray(n)?await dr(n,t,e):xr(n)?await Mr(n,t,e):await t(n,e)}async function Mr(n,t,e){let r=[],s={};for(let i in n){let c=n[i],o=ut(c,t,e).then(a=>{s[i]=a});r.push(o)}return await Promise.all(r),s}async function dr(n,t,e={}){let r=n.map(s=>ut(s,t,e));return await Promise.all(r)}async function ln(n,t,e){return await hn(n,r=>vt(r,t,e))}async function vt(n,t,e){let s=await(await fetch(n,e.fetch)).arrayBuffer();return await t(s,e)}async function Z(n,t={}){let e=await gr(n,t);return await ln(e,pt.parse,t)}async function gr(n,t,e={}){let r=t&&t.image&&t.image.mipLevels||0;return r!==0?await yr(n,r,t,e):mt(n,t,e)}async function yr(n,t,e,r){let s=[];if(t==="auto"){let i=mt(n,e,{...r,lod:0}),c=await vt(i,pt.parse,e),{width:o,height:a}=_t(c);t=Tr({width:o,height:a}),s.push(i)}V(t>0);for(let i=s.length;i<t;++i){let c=mt(n,e,{...r,lod:i});s.push(c)}return s}function Tr(n){return 1+Math.floor(Math.log2(Math.max(n.width,n.height)))}function mn(n,t){let e=new kt.AsyncTexture(n,{id:"brdfLUT",sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"},data:Z(t.brdfLutUrl)}),r=pn(n,{id:"DiffuseEnvSampler",getTextureForFace:i=>Z(t.getTexUrl("diffuse",i,0)),sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"}}),s=pn(n,{id:"SpecularEnvSampler",getTextureForFace:i=>{let c=[];for(let o=0;o<=t.specularMipLevels-1;o++)c.push(Z(t.getTexUrl("specular",i,o)));return c},sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"}});return{brdfLutTexture:e,diffuseEnvSampler:r,specularEnvSampler:s}}var Ar=[0,1,2,3,4,5];function pn(n,{id:t,getTextureForFace:e,sampler:r}){let s={};return Ar.forEach(i=>{s[String(i)]=e(i)}),new kt.AsyncTexture(n,{id:t,dimension:"cube",mipmaps:!1,sampler:r,data:s})}var mi=z(zt(),1),gn=z(D(),1);var hi=z(zt(),1);function dn(n){return{addressModeU:Mn(n.wrapS),addressModeV:Mn(n.wrapT),magFilter:Er(n.magFilter),...wr(n.minFilter)}}function Mn(n){switch(n){case 33071:return"clamp-to-edge";case 10497:return"repeat";case 33648:return"mirror-repeat";default:return}}function Er(n){switch(n){case 9728:return"nearest";case 9729:return"linear";default:return}}function wr(n){switch(n){case 9728:return{minFilter:"nearest"};case 9729:return{minFilter:"linear"};case 9984:return{minFilter:"nearest",mipmapFilter:"nearest"};case 9985:return{minFilter:"linear",mipmapFilter:"nearest"};case 9986:return{minFilter:"nearest",mipmapFilter:"linear"};case 9987:return{minFilter:"linear",mipmapFilter:"linear"};default:return{}}}function xt(n,t,e,r){let s={defines:{MANUAL_SRGB:!0,SRGB_FAST_APPROXIMATION:!0},bindings:{},uniforms:{camera:[0,0,0],metallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};s.defines.USE_TEX_LOD=!0;let{imageBasedLightingEnvironment:i}=r;return i&&(s.bindings.pbr_diffuseEnvSampler=i.diffuseEnvSampler.texture,s.bindings.pbr_specularEnvSampler=i.specularEnvSampler.texture,s.bindings.pbr_BrdfLUT=i.brdfLutTexture.texture,s.uniforms.scaleIBLAmbient=[1,1]),r?.pbrDebug&&(s.defines.PBR_DEBUG=!0,s.uniforms.scaleDiffBaseMR=[0,0,0,0],s.uniforms.scaleFGDSpec=[0,0,0,0]),e.NORMAL&&(s.defines.HAS_NORMALS=!0),e.TANGENT&&r?.useTangents&&(s.defines.HAS_TANGENTS=!0),e.TEXCOORD_0&&(s.defines.HAS_UV=!0),r?.imageBasedLightingEnvironment&&(s.defines.USE_IBL=!0),r?.lights&&(s.defines.USE_LIGHTS=!0),t&&Sr(n,t,s),s}function Sr(n,t,e){if(e.uniforms.unlit=Boolean(t.unlit),t.pbrMetallicRoughness&&Or(n,t.pbrMetallicRoughness,e),t.normalTexture){K(n,t.normalTexture,"pbr_normalSampler","HAS_NORMALMAP",e);let{scale:r=1}=t.normalTexture;e.uniforms.normalScale=r}if(t.occlusionTexture){K(n,t.occlusionTexture,"pbr_occlusionSampler","HAS_OCCLUSIONMAP",e);let{strength:r=1}=t.occlusionTexture;e.uniforms.occlusionStrength=r}switch(t.emissiveTexture&&(K(n,t.emissiveTexture,"pbr_emissiveSampler","HAS_EMISSIVEMAP",e),e.uniforms.emissiveFactor=t.emissiveFactor||[0,0,0]),t.alphaMode||"MASK"){case"MASK":let{alphaCutoff:r=.5}=t;e.defines.ALPHA_CUTOFF=!0,e.uniforms.alphaCutoff=r;break;case"BLEND":gn.log.warn("glTF BLEND alphaMode might not work well because it requires mesh sorting")(),e.parameters.blend=!0,e.parameters.blendColorOperation="add",e.parameters.blendColorSrcFactor="src-alpha",e.parameters.blendColorDstFactor="one-minus-src-alpha",e.parameters.blendAlphaOperation="add",e.parameters.blendAlphaSrcFactor="one",e.parameters.blendAlphaDstFactor="one-minus-src-alpha",e.glParameters.blend=!0,e.glParameters.blendEquation=32774,e.glParameters.blendFunc=[770,771,1,771];break}}function Or(n,t,e){t.baseColorTexture&&K(n,t.baseColorTexture,"pbr_baseColorSampler","HAS_BASECOLORMAP",e),e.uniforms.baseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&K(n,t.metallicRoughnessTexture,"pbr_metallicRoughnessSampler","HAS_METALROUGHNESSMAP",e);let{metallicFactor:r=1,roughnessFactor:s=1}=t;e.uniforms.metallicRoughnessValues=[r,s]}function K(n,t,e,r,s){let i=t.texture.source.image,c;i.compressed?c=i:c={data:i};let o={wrapS:10497,wrapT:10497,...t?.texture?.sampler},a=n.createTexture({id:t.uniformName||t.id,sampler:dn(o),...c});s.bindings[e]=a,r&&(s.defines[r]=!0),s.generatedTextures.push(a)}var W=z(ot(),1);var gi=1/Math.PI*180,yi=1/180*Math.PI,Lr={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Lr}};var L=globalThis.mathgl.config;function yn(n,{precision:t=L.precision}={}){return n=Rr(n),`${parseFloat(n.toPrecision(t))}`}function Y(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function bt(n,t,e){let r=L.EPSILON;e&&(L.EPSILON=e);try{if(n===t)return!0;if(Y(n)&&Y(t)){if(n.length!==t.length)return!1;for(let s=0;s<n.length;++s)if(!bt(n[s],t[s]))return!1;return!0}return n&&n.equals?n.equals(t):t&&t.equals?t.equals(n):typeof n=="number"&&typeof t=="number"?Math.abs(n-t)<=L.EPSILON*Math.max(1,Math.abs(n),Math.abs(t)):!1}finally{L.EPSILON=r}}function Rr(n){return Math.round(n/L.EPSILON)*L.EPSILON}var C=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,e=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}toArray(t=[],e=0){for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Y(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(L)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+yn(this[r],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!bt(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){if(r===void 0)return this.lerp(this,t,e);for(let s=0;s<this.ELEMENTS;++s){let i=t[s],c=typeof e=="number"?e:e[s];this[s]=i+r*(c-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]+=e[r];return this.check()}subtract(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]-=e[r];return this.check()}scale(t){if(typeof t=="number")for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(L.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}get elements(){return this}};function Nr(n,t){if(n.length!==t)return!1;for(let e=0;e<n.length;++e)if(!Number.isFinite(n[e]))return!1;return!0}function S(n){if(!Number.isFinite(n))throw new Error(`Invalid number ${JSON.stringify(n)}`);return n}function $(n,t,e=""){if(L.debug&&!Nr(n,t))throw new Error(`math.gl: ${e} some fields set to invalid numbers'`);return n}function Ft(n,t){if(!n)throw new Error(`math.gl assertion ${t}`)}var Mt=class extends C{get x(){return this[0]}set x(t){this[0]=S(t)}get y(){return this[1]}set y(t){this[1]=S(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){let s=this[r]-t[r];e+=s*s}return S(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return S(e)}normalize(){let t=this.magnitude();if(t!==0)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]*=e[r];return this.check()}divide(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ft(t>=0&&t<this.ELEMENTS,"index is out of range"),S(this[t])}setComponent(t,e){return Ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}};var R=typeof Float32Array<"u"?Float32Array:Array;var _i=Math.PI/180;function Pr(){let n=new R(2);return R!=Float32Array&&(n[0]=0,n[1]=0),n}function En(n,t,e){let r=t[0],s=t[1];return n[0]=e[0]*r+e[4]*s+e[12],n[1]=e[1]*r+e[5]*s+e[13],n}var Ii=function(){let n=Pr();return function(t,e,r,s,i,c){let o,a;for(e||(e=2),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,o=r;o<a;o+=e)n[0]=t[o],n[1]=t[o+1],i(n,n,c),t[o]=n[0],t[o+1]=n[1];return t}}();function wn(n,t,e){let r=t[0],s=t[1],i=e[3]*r+e[7]*s||1;return n[0]=(e[0]*r+e[4]*s)/i,n[1]=(e[1]*r+e[5]*s)/i,n}function Sn(n,t,e){let r=t[0],s=t[1],i=t[2],c=e[3]*r+e[7]*s+e[11]*i||1;return n[0]=(e[0]*r+e[4]*s+e[8]*i)/c,n[1]=(e[1]*r+e[5]*s+e[9]*i)/c,n[2]=(e[2]*r+e[6]*s+e[10]*i)/c,n}function On(n,t,e){let r=t[0],s=t[1];return n[0]=e[0]*r+e[2]*s,n[1]=e[1]*r+e[3]*s,n[2]=t[2],n[3]=t[3],n}function Ln(n,t,e){let r=t[0],s=t[1],i=t[2];return n[0]=e[0]*r+e[3]*s+e[6]*i,n[1]=e[1]*r+e[4]*s+e[7]*i,n[2]=e[2]*r+e[5]*s+e[8]*i,n[3]=t[3],n}function qt(){let n=new R(3);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function _r(n){let t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function Bt(n,t,e){let r=new R(3);return r[0]=n,r[1]=t,r[2]=e,r}function Rn(n,t){let e=t[0],r=t[1],s=t[2],i=e*e+r*r+s*s;return i>0&&(i=1/Math.sqrt(i)),n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n}function Nn(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function dt(n,t,e){let r=t[0],s=t[1],i=t[2],c=e[0],o=e[1],a=e[2];return n[0]=s*a-i*o,n[1]=i*c-r*a,n[2]=r*o-s*c,n}function gt(n,t,e){let r=t[0],s=t[1],i=t[2],c=e[3]*r+e[7]*s+e[11]*i+e[15];return c=c||1,n[0]=(e[0]*r+e[4]*s+e[8]*i+e[12])/c,n[1]=(e[1]*r+e[5]*s+e[9]*i+e[13])/c,n[2]=(e[2]*r+e[6]*s+e[10]*i+e[14])/c,n}function Pn(n,t,e){let r=e[0],s=e[1],i=e[2],c=e[3],o=t[0],a=t[1],f=t[2],h=s*f-i*a,l=i*o-r*f,p=r*a-s*o,m=s*p-i*l,x=i*h-r*p,M=r*l-s*h,d=c*2;return h*=d,l*=d,p*=d,m*=2,x*=2,M*=2,n[0]=o+h+m,n[1]=a+l+x,n[2]=f+p+M,n}var _n=_r;var ki=function(){let n=qt();return function(t,e,r,s,i,c){let o,a;for(e||(e=3),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,o=r;o<a;o+=e)n[0]=t[o],n[1]=t[o+1],n[2]=t[o+2],i(n,n,c),t[o]=n[0],t[o+1]=n[1],t[o+2]=n[2];return t}}();var yt,G=class extends Mt{static get ZERO(){return yt||(yt=new G(0,0,0,0),Object.freeze(yt)),yt}constructor(t=0,e=0,r=0,s=0){super(-0,-0,-0,-0),Y(t)&&arguments.length===1?this.copy(t):(L.debug&&(S(t),S(e),S(r),S(s)),this[0]=t,this[1]=e,this[2]=r,this[3]=s)}set(t,e,r,s){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return L.debug&&(S(t.x),S(t.y),S(t.z),S(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=S(t)}get w(){return this[3]}set w(t){this[3]=S(t)}transform(t){return gt(this,this,t),this.check()}transformByMatrix3(t){return Ln(this,this,t),this.check()}transformByMatrix2(t){return On(this,this,t),this.check()}transformByQuaternion(t){return Pn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var Tt=class extends C{toString(){let t="[";if(L.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=` ${this[r*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=S(r),this}getColumn(t,e=new Array(this.RANK).fill(-0)){let r=t*this.RANK;for(let s=0;s<this.RANK;++s)e[s]=this[r+s];return e}setColumn(t,e){let r=t*this.RANK;for(let s=0;s<this.RANK;++s)this[r+s]=e[s];return this}};function In(){let n=new R(9);return R!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function vr(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function un(n,t){if(n===t){let e=t[1],r=t[2],s=t[3],i=t[6],c=t[7],o=t[11];n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=i,n[11]=t[14],n[12]=s,n[13]=c,n[14]=o}else n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15];return n}function vn(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],c=t[4],o=t[5],a=t[6],f=t[7],h=t[8],l=t[9],p=t[10],m=t[11],x=t[12],M=t[13],d=t[14],E=t[15],O=e*o-r*c,g=e*a-s*c,y=e*f-i*c,T=r*a-s*o,A=r*f-i*o,N=s*f-i*a,P=h*M-l*x,_=h*d-p*x,I=h*E-m*x,u=l*d-p*M,v=l*E-m*M,k=p*E-m*d,w=O*k-g*v+y*u+T*I-A*_+N*P;return w?(w=1/w,n[0]=(o*k-a*v+f*u)*w,n[1]=(s*v-r*k-i*u)*w,n[2]=(M*N-d*A+E*T)*w,n[3]=(p*A-l*N-m*T)*w,n[4]=(a*I-c*k-f*_)*w,n[5]=(e*k-s*I+i*_)*w,n[6]=(d*y-x*N-E*g)*w,n[7]=(h*N-p*y+m*g)*w,n[8]=(c*v-o*I+f*P)*w,n[9]=(r*I-e*v-i*P)*w,n[10]=(x*A-M*y+E*O)*w,n[11]=(l*y-h*A-m*O)*w,n[12]=(o*_-c*u-a*P)*w,n[13]=(e*u-r*_+s*P)*w,n[14]=(M*g-x*T-d*O)*w,n[15]=(h*T-l*g+p*O)*w,n):null}function kn(n){let t=n[0],e=n[1],r=n[2],s=n[3],i=n[4],c=n[5],o=n[6],a=n[7],f=n[8],h=n[9],l=n[10],p=n[11],m=n[12],x=n[13],M=n[14],d=n[15],E=t*c-e*i,O=t*o-r*i,g=e*o-r*c,y=f*x-h*m,T=f*M-l*m,A=h*M-l*x,N=t*A-e*T+r*y,P=i*A-c*T+o*y,_=f*g-h*O+l*E,I=m*g-x*O+M*E;return a*N-s*P+d*_-p*I}function Ct(n,t,e){let r=t[0],s=t[1],i=t[2],c=t[3],o=t[4],a=t[5],f=t[6],h=t[7],l=t[8],p=t[9],m=t[10],x=t[11],M=t[12],d=t[13],E=t[14],O=t[15],g=e[0],y=e[1],T=e[2],A=e[3];return n[0]=g*r+y*o+T*l+A*M,n[1]=g*s+y*a+T*p+A*d,n[2]=g*i+y*f+T*m+A*E,n[3]=g*c+y*h+T*x+A*O,g=e[4],y=e[5],T=e[6],A=e[7],n[4]=g*r+y*o+T*l+A*M,n[5]=g*s+y*a+T*p+A*d,n[6]=g*i+y*f+T*m+A*E,n[7]=g*c+y*h+T*x+A*O,g=e[8],y=e[9],T=e[10],A=e[11],n[8]=g*r+y*o+T*l+A*M,n[9]=g*s+y*a+T*p+A*d,n[10]=g*i+y*f+T*m+A*E,n[11]=g*c+y*h+T*x+A*O,g=e[12],y=e[13],T=e[14],A=e[15],n[12]=g*r+y*o+T*l+A*M,n[13]=g*s+y*a+T*p+A*d,n[14]=g*i+y*f+T*m+A*E,n[15]=g*c+y*h+T*x+A*O,n}function zn(n,t,e){let r=e[0],s=e[1],i=e[2],c,o,a,f,h,l,p,m,x,M,d,E;return t===n?(n[12]=t[0]*r+t[4]*s+t[8]*i+t[12],n[13]=t[1]*r+t[5]*s+t[9]*i+t[13],n[14]=t[2]*r+t[6]*s+t[10]*i+t[14],n[15]=t[3]*r+t[7]*s+t[11]*i+t[15]):(c=t[0],o=t[1],a=t[2],f=t[3],h=t[4],l=t[5],p=t[6],m=t[7],x=t[8],M=t[9],d=t[10],E=t[11],n[0]=c,n[1]=o,n[2]=a,n[3]=f,n[4]=h,n[5]=l,n[6]=p,n[7]=m,n[8]=x,n[9]=M,n[10]=d,n[11]=E,n[12]=c*r+h*s+x*i+t[12],n[13]=o*r+l*s+M*i+t[13],n[14]=a*r+p*s+d*i+t[14],n[15]=f*r+m*s+E*i+t[15]),n}function bn(n,t,e){let r=e[0],s=e[1],i=e[2];return n[0]=t[0]*r,n[1]=t[1]*r,n[2]=t[2]*r,n[3]=t[3]*r,n[4]=t[4]*s,n[5]=t[5]*s,n[6]=t[6]*s,n[7]=t[7]*s,n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11]*i,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Fn(n,t,e,r){let s=r[0],i=r[1],c=r[2],o=Math.sqrt(s*s+i*i+c*c),a,f,h,l,p,m,x,M,d,E,O,g,y,T,A,N,P,_,I,u,v,k,w,H;return o<1e-6?null:(o=1/o,s*=o,i*=o,c*=o,f=Math.sin(e),a=Math.cos(e),h=1-a,l=t[0],p=t[1],m=t[2],x=t[3],M=t[4],d=t[5],E=t[6],O=t[7],g=t[8],y=t[9],T=t[10],A=t[11],N=s*s*h+a,P=i*s*h+c*f,_=c*s*h-i*f,I=s*i*h-c*f,u=i*i*h+a,v=c*i*h+s*f,k=s*c*h+i*f,w=i*c*h-s*f,H=c*c*h+a,n[0]=l*N+M*P+g*_,n[1]=p*N+d*P+y*_,n[2]=m*N+E*P+T*_,n[3]=x*N+O*P+A*_,n[4]=l*I+M*u+g*v,n[5]=p*I+d*u+y*v,n[6]=m*I+E*u+T*v,n[7]=x*I+O*u+A*v,n[8]=l*k+M*w+g*H,n[9]=p*k+d*w+y*H,n[10]=m*k+E*w+T*H,n[11]=x*k+O*w+A*H,t!==n&&(n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n)}function qn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[4],c=t[5],o=t[6],a=t[7],f=t[8],h=t[9],l=t[10],p=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=i*s+f*r,n[5]=c*s+h*r,n[6]=o*s+l*r,n[7]=a*s+p*r,n[8]=f*s-i*r,n[9]=h*s-c*r,n[10]=l*s-o*r,n[11]=p*s-a*r,n}function Bn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[0],c=t[1],o=t[2],a=t[3],f=t[8],h=t[9],l=t[10],p=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=i*s-f*r,n[1]=c*s-h*r,n[2]=o*s-l*r,n[3]=a*s-p*r,n[8]=i*r+f*s,n[9]=c*r+h*s,n[10]=o*r+l*s,n[11]=a*r+p*s,n}function Cn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[0],c=t[1],o=t[2],a=t[3],f=t[4],h=t[5],l=t[6],p=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=i*s+f*r,n[1]=c*s+h*r,n[2]=o*s+l*r,n[3]=a*s+p*r,n[4]=f*s-i*r,n[5]=h*s-c*r,n[6]=l*s-o*r,n[7]=p*s-a*r,n}function Vn(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],c=e+e,o=r+r,a=s+s,f=e*c,h=r*c,l=r*o,p=s*c,m=s*o,x=s*a,M=i*c,d=i*o,E=i*a;return n[0]=1-l-x,n[1]=h+E,n[2]=p-d,n[3]=0,n[4]=h-E,n[5]=1-f-x,n[6]=m+M,n[7]=0,n[8]=p+d,n[9]=m-M,n[10]=1-f-l,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Un(n,t,e,r,s,i,c){let o=1/(e-t),a=1/(s-r),f=1/(i-c);return n[0]=i*2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i*2*a,n[6]=0,n[7]=0,n[8]=(e+t)*o,n[9]=(s+r)*a,n[10]=(c+i)*f,n[11]=-1,n[12]=0,n[13]=0,n[14]=c*i*2*f,n[15]=0,n}function kr(n,t,e,r,s){let i=1/Math.tan(t/2);if(n[0]=i/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,s!=null&&s!==1/0){let c=1/(r-s);n[10]=(s+r)*c,n[14]=2*s*r*c}else n[10]=-1,n[14]=-2*r;return n}var Dn=kr;function zr(n,t,e,r,s,i,c){let o=1/(t-e),a=1/(r-s),f=1/(i-c);return n[0]=-2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*f,n[11]=0,n[12]=(t+e)*o,n[13]=(s+r)*a,n[14]=(c+i)*f,n[15]=1,n}var Yn=zr;function $n(n,t,e,r){let s,i,c,o,a,f,h,l,p,m,x=t[0],M=t[1],d=t[2],E=r[0],O=r[1],g=r[2],y=e[0],T=e[1],A=e[2];return Math.abs(x-y)<1e-6&&Math.abs(M-T)<1e-6&&Math.abs(d-A)<1e-6?vr(n):(l=x-y,p=M-T,m=d-A,s=1/Math.sqrt(l*l+p*p+m*m),l*=s,p*=s,m*=s,i=O*m-g*p,c=g*l-E*m,o=E*p-O*l,s=Math.sqrt(i*i+c*c+o*o),s?(s=1/s,i*=s,c*=s,o*=s):(i=0,c=0,o=0),a=p*o-m*c,f=m*i-l*o,h=l*c-p*i,s=Math.sqrt(a*a+f*f+h*h),s?(s=1/s,a*=s,f*=s,h*=s):(a=0,f=0,h=0),n[0]=i,n[1]=a,n[2]=l,n[3]=0,n[4]=c,n[5]=f,n[6]=p,n[7]=0,n[8]=o,n[9]=h,n[10]=m,n[11]=0,n[12]=-(i*x+c*M+o*d),n[13]=-(a*x+f*M+h*d),n[14]=-(l*x+p*M+m*d),n[15]=1,n)}function br(){let n=new R(4);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0),n}function Gn(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n}function Wn(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n}function Xn(n){let t=n[0],e=n[1],r=n[2],s=n[3];return Math.sqrt(t*t+e*e+r*r+s*s)}function Hn(n){let t=n[0],e=n[1],r=n[2],s=n[3];return t*t+e*e+r*r+s*s}function jn(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],c=e*e+r*r+s*s+i*i;return c>0&&(c=1/Math.sqrt(c)),n[0]=e*c,n[1]=r*c,n[2]=s*c,n[3]=i*c,n}function Qn(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Zn(n,t,e,r){let s=t[0],i=t[1],c=t[2],o=t[3];return n[0]=s+r*(e[0]-s),n[1]=i+r*(e[1]-i),n[2]=c+r*(e[2]-c),n[3]=o+r*(e[3]-o),n}function Kn(n,t,e){let r=t[0],s=t[1],i=t[2],c=t[3];return n[0]=e[0]*r+e[4]*s+e[8]*i+e[12]*c,n[1]=e[1]*r+e[5]*s+e[9]*i+e[13]*c,n[2]=e[2]*r+e[6]*s+e[10]*i+e[14]*c,n[3]=e[3]*r+e[7]*s+e[11]*i+e[15]*c,n}function Jn(n,t,e){let r=t[0],s=t[1],i=t[2],c=e[0],o=e[1],a=e[2],f=e[3],h=f*r+o*i-a*s,l=f*s+a*r-c*i,p=f*i+c*s-o*r,m=-c*r-o*s-a*i;return n[0]=h*f+m*-c+l*-a-p*-o,n[1]=l*f+m*-o+p*-c-h*-a,n[2]=p*f+m*-a+h*-o-l*-c,n[3]=t[3],n}var Gi=function(){let n=br();return function(t,e,r,s,i,c){let o,a;for(e||(e=4),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,o=r;o<a;o+=e)n[0]=t[o],n[1]=t[o+1],n[2]=t[o+2],n[3]=t[o+3],i(n,n,c),t[o]=n[0],t[o+1]=n[1],t[o+2]=n[2],t[o+3]=n[3];return t}}();var Dt;(function(n){n[n.COL0ROW0=0]="COL0ROW0",n[n.COL0ROW1=1]="COL0ROW1",n[n.COL0ROW2=2]="COL0ROW2",n[n.COL0ROW3=3]="COL0ROW3",n[n.COL1ROW0=4]="COL1ROW0",n[n.COL1ROW1=5]="COL1ROW1",n[n.COL1ROW2=6]="COL1ROW2",n[n.COL1ROW3=7]="COL1ROW3",n[n.COL2ROW0=8]="COL2ROW0",n[n.COL2ROW1=9]="COL2ROW1",n[n.COL2ROW2=10]="COL2ROW2",n[n.COL2ROW3=11]="COL2ROW3",n[n.COL3ROW0=12]="COL3ROW0",n[n.COL3ROW1=13]="COL3ROW1",n[n.COL3ROW2=14]="COL3ROW2",n[n.COL3ROW3=15]="COL3ROW3"})(Dt||(Dt={}));var qr=45*Math.PI/180,Br=1,Vt=.1,Ut=500,Cr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),B=class extends Tt{static get IDENTITY(){return Ur()}static get ZERO(){return Vr()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Dt}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,s,i,c,o,a,f,h,l,p,m,x,M,d){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this[4]=i,this[5]=c,this[6]=o,this[7]=a,this[8]=f,this[9]=h,this[10]=l,this[11]=p,this[12]=m,this[13]=x,this[14]=M,this[15]=d,this.check()}setRowMajor(t,e,r,s,i,c,o,a,f,h,l,p,m,x,M,d){return this[0]=t,this[1]=i,this[2]=f,this[3]=m,this[4]=e,this[5]=c,this[6]=h,this[7]=x,this[8]=r,this[9]=o,this[10]=l,this[11]=M,this[12]=s,this[13]=a,this[14]=p,this[15]=d,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(Cr)}fromObject(t){return this.check()}fromQuaternion(t){return Vn(this,t),this.check()}frustum(t){let{left:e,right:r,bottom:s,top:i,near:c=Vt,far:o=Ut}=t;return o===1/0?Dr(this,e,r,s,i,c):Un(this,e,r,s,i,c,o),this.check()}lookAt(t){let{eye:e,center:r=[0,0,0],up:s=[0,1,0]}=t;return $n(this,e,r,s),this.check()}ortho(t){let{left:e,right:r,bottom:s,top:i,near:c=Vt,far:o=Ut}=t;return Yn(this,e,r,s,i,c,o),this.check()}orthographic(t){let{fovy:e=qr,aspect:r=Br,focalDistance:s=1,near:i=Vt,far:c=Ut}=t;te(e);let o=e/2,a=s*Math.tan(o),f=a*r;return this.ortho({left:-f,right:f,bottom:-a,top:a,near:i,far:c})}perspective(t){let{fovy:e=45*Math.PI/180,aspect:r=1,near:s=.1,far:i=500}=t;return te(e),Dn(this,e,r,s,i),this.check()}determinant(){return kn(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];let r=this.getScale(e),s=1/r[0],i=1/r[1],c=1/r[2];return t[0]=this[0]*s,t[1]=this[1]*i,t[2]=this[2]*c,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*i,t[6]=this[6]*c,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*i,t[10]=this[10]*c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];let r=this.getScale(e),s=1/r[0],i=1/r[1],c=1/r[2];return t[0]=this[0]*s,t[1]=this[1]*i,t[2]=this[2]*c,t[3]=this[4]*s,t[4]=this[5]*i,t[5]=this[6]*c,t[6]=this[8]*s,t[7]=this[9]*i,t[8]=this[10]*c,t}transpose(){return un(this,this),this.check()}invert(){return vn(this,this),this.check()}multiplyLeft(t){return Ct(this,t,this),this.check()}multiplyRight(t){return Ct(this,this,t),this.check()}rotateX(t){return qn(this,this,t),this.check()}rotateY(t){return Bn(this,this,t),this.check()}rotateZ(t){return Cn(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return Fn(this,this,t,e),this.check()}scale(t){return bn(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return zn(this,this,t),this.check()}transform(t,e){return t.length===4?(e=Kn(e||[-0,-0,-0,-0],t,this),$(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){let{length:r}=t,s;switch(r){case 2:s=En(e||[-0,-0],t,this);break;case 3:s=gt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $(s,t.length),s}transformAsVector(t,e){let r;switch(t.length){case 2:r=wn(e||[-0,-0],t,this);break;case 3:r=Sn(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $(r,t.length),r}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}},At,Et;function Vr(){return At||(At=new B([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(At)),At}function Ur(){return Et||(Et=new B,Object.freeze(Et)),Et}function te(n){if(n>Math.PI*2)throw Error("expected radians")}function Dr(n,t,e,r,s,i){let c=2*i/(e-t),o=2*i/(s-r),a=(e+t)/(e-t),f=(s+r)/(s-r),h=-1,l=-1,p=-2*i;return n[0]=c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=0,n[7]=0,n[8]=a,n[9]=f,n[10]=h,n[11]=l,n[12]=0,n[13]=0,n[14]=p,n[15]=0,n}function ne(){let n=new R(4);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function ee(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function Yt(n,t,e){e=e*.5;let r=Math.sin(e);return n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=Math.cos(e),n}function $t(n,t,e){let r=t[0],s=t[1],i=t[2],c=t[3],o=e[0],a=e[1],f=e[2],h=e[3];return n[0]=r*h+c*o+s*f-i*a,n[1]=s*h+c*a+i*o-r*f,n[2]=i*h+c*f+r*a-s*o,n[3]=c*h-r*o-s*a-i*f,n}function re(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],c=t[3],o=Math.sin(e),a=Math.cos(e);return n[0]=r*a+c*o,n[1]=s*a+i*o,n[2]=i*a-s*o,n[3]=c*a-r*o,n}function se(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],c=t[3],o=Math.sin(e),a=Math.cos(e);return n[0]=r*a-i*o,n[1]=s*a+c*o,n[2]=i*a+r*o,n[3]=c*a-s*o,n}function ie(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],c=t[3],o=Math.sin(e),a=Math.cos(e);return n[0]=r*a+s*o,n[1]=s*a-r*o,n[2]=i*a+c*o,n[3]=c*a-i*o,n}function ce(n,t){let e=t[0],r=t[1],s=t[2];return n[0]=e,n[1]=r,n[2]=s,n[3]=Math.sqrt(Math.abs(1-e*e-r*r-s*s)),n}function tt(n,t,e,r){let s=t[0],i=t[1],c=t[2],o=t[3],a=e[0],f=e[1],h=e[2],l=e[3],p,m,x,M,d;return p=s*a+i*f+c*h+o*l,p<0&&(p=-p,a=-a,f=-f,h=-h,l=-l),1-p>1e-6?(m=Math.acos(p),d=Math.sin(m),x=Math.sin((1-r)*m)/d,M=Math.sin(r*m)/d):(x=1-r,M=r),n[0]=x*s+M*a,n[1]=x*i+M*f,n[2]=x*c+M*h,n[3]=x*o+M*l,n}function oe(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],c=e*e+r*r+s*s+i*i,o=c?1/c:0;return n[0]=-e*o,n[1]=-r*o,n[2]=-s*o,n[3]=i*o,n}function ae(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=t[3],n}function Gt(n,t){let e=t[0]+t[4]+t[8],r;if(e>0)r=Math.sqrt(e+1),n[3]=.5*r,r=.5/r,n[0]=(t[5]-t[7])*r,n[1]=(t[6]-t[2])*r,n[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let i=(s+1)%3,c=(s+2)%3;r=Math.sqrt(t[s*3+s]-t[i*3+i]-t[c*3+c]+1),n[s]=.5*r,r=.5/r,n[3]=(t[i*3+c]-t[c*3+i])*r,n[i]=(t[i*3+s]+t[s*3+i])*r,n[c]=(t[c*3+s]+t[s*3+c])*r}return n}var fe=Gn;var he=Wn,le=Qn,pe=Zn,me=Xn;var xe=Hn;var Me=jn;var de=function(){let n=qt(),t=Bt(1,0,0),e=Bt(0,1,0);return function(r,s,i){let c=Nn(s,i);return c<-.999999?(dt(n,t,s),_n(n)<1e-6&&dt(n,e,s),Rn(n,n),Yt(r,n,Math.PI),r):c>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(dt(n,s,i),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+c,Me(r,r))}}(),ic=function(){let n=ne(),t=ne();return function(e,r,s,i,c,o){return tt(n,r,c,o),tt(t,s,i,o),tt(e,n,t,2*o*(1-o)),e}}(),cc=function(){let n=In();return function(t,e,r,s){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=s[0],n[4]=s[1],n[7]=s[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],Me(t,Gt(t,n))}}();var Yr=[0,0,0,1],nt=class extends C{constructor(t=0,e=0,r=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,e,r,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,r,s){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return Gt(this,t),this.check()}fromAxisRotation(t,e){return Yt(this,t,e),this.check()}identity(){return ee(this),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=S(t)}get y(){return this[1]}set y(t){this[1]=S(t)}get z(){return this[2]}set z(t){this[2]=S(t)}get w(){return this[3]}set w(t){this[3]=S(t)}len(){return me(this)}lengthSquared(){return xe(this)}dot(t){return le(this,t)}rotationTo(t,e){return de(this,t,e),this.check()}add(t){return fe(this,this,t),this.check()}calculateW(){return ce(this,this),this.check()}conjugate(){return ae(this,this),this.check()}invert(){return oe(this,this),this.check()}lerp(t,e,r){return r===void 0?this.lerp(this,t,e):(pe(this,t,e,r),this.check())}multiplyRight(t){return $t(this,this,t),this.check()}multiplyLeft(t){return $t(this,t,this),this.check()}normalize(){let t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,t===0&&(this[3]=1),this.check()}rotateX(t){return re(this,this,t),this.check()}rotateY(t){return se(this,this,t),this.check()}rotateZ(t){return ie(this,this,t),this.check()}scale(t){return he(this,this,t),this.check()}slerp(t,e,r){let s,i,c;switch(arguments.length){case 1:({start:s=Yr,target:i,ratio:c}=t);break;case 2:s=this,i=t,c=e;break;default:s=t,i=e,c=r}return tt(this,s,i,c),this.check()}transformVector4(t,e=new G){return Jn(e,t,this),$(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var U;(function(n){n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(U||(U={}));function ge(n){switch(n){case U.POINTS:return"point-list";case U.LINES:return"line-list";case U.LINE_STRIP:return"line-strip";case U.TRIANGLES:return"triangle-list";case U.TRIANGLE_STRIP:return"triangle-strip";default:throw new Error(String(n))}}var Ae=z(D(),1),Ee=z(Te(),1),wt=z(ot(),1),$r=`
|
|
7
|
+
"use strict";var __exports__=(()=>{var be=Object.create;var st=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var it=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Ce=(n,t)=>{for(var e in t)st(n,e,{get:t[e],enumerable:!0})},rt=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Fe(t))!Be.call(n,s)&&s!==e&&st(n,s,{get:()=>t[s],enumerable:!(r=ze(t,s))||r.enumerable});return n},ot=(n,t,e)=>(rt(n,t,"default"),e&&rt(e,t,"default")),b=(n,t,e)=>(e=n!=null?be(qe(n)):{},rt(t||!n||!n.__esModule?st(e,"default",{value:n,enumerable:!0}):e,n)),Ve=n=>rt(st({},"__esModule",{value:!0}),n);var D=it((fs,Qt)=>{Qt.exports=globalThis.luma});var ct=it((hs,Kt)=>{Kt.exports=globalThis.luma});var zt=it((pi,Mn)=>{Mn.exports=globalThis.luma});var Ee=it((Lo,Ae)=>{Ae.exports=globalThis.luma});var et={};Ce(et,{GLTFAnimator:()=>H,createScenegraphsFromGLTF:()=>ke,loadPBREnvironment:()=>xn,parseGLTFLights:()=>wt,parsePBRMaterial:()=>xt});ot(et,b(D(),1));var bt=b(ct(),1);function V(n,t){if(!n)throw new Error(t||"loader assertion failed.")}var F={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ue=F.self||F.window||F.global||{},De=F.window||F.self||F.global||{},Ye=F.global||F.self||F.window||{},$e=F.document||{};var Ot=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ge=Zt&&parseFloat(Zt[1])||0;var We="",Jt={};function Rt(n){for(let t in Jt)if(n.startsWith(t)){let e=Jt[t];n=n.replace(t,e)}return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${We}${n}`),n}var tn="4.3.2";var He=globalThis.loaders?.parseImageNode,Nt=typeof Image<"u",ut=typeof ImageBitmap<"u",Xe=Boolean(He),_t=Ot?!0:Xe;function nn(n){switch(n){case"auto":return ut||Nt||_t;case"imagebitmap":return ut;case"image":return Nt;case"data":return _t;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}function en(){if(ut)return"imagebitmap";if(Nt)return"image";if(_t)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function rn(n){let t=je(n);if(!t)throw new Error("Not an image");return t}function Pt(n){return at(n)}function at(n){switch(rn(n)){case"data":return n;case"image":case"imagebitmap":let t=document.createElement("canvas"),e=t.getContext("2d");if(!e)throw new Error("getImageData");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}function je(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&n instanceof Image?"image":n&&typeof n=="object"&&n.data&&n.width&&n.height?"data":null}var Qe=/^data:image\/svg\+xml/,Ke=/\.svg((\?|#).*)?$/;function ft(n){return n&&(Qe.test(n)||Ke.test(n))}function sn(n,t){if(ft(t)){let r=new TextDecoder().decode(n);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(r=unescape(encodeURIComponent(r)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(r)}`}return It(n,t)}function It(n,t){if(ft(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}async function ht(n,t,e){let r=sn(n,e),s=self.URL||self.webkitURL,i=typeof r!="string"&&s.createObjectURL(r);try{return await Ze(i||r,t)}finally{i&&s.revokeObjectURL(i)}}async function Ze(n,t){let e=new Image;return e.src=n,t.image&&t.image.decode&&e.decode?(await e.decode(),e):await new Promise((r,s)=>{try{e.onload=()=>r(e),e.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var Je={},on=!0;async function cn(n,t,e){let r;ft(e)?r=await ht(n,t,e):r=It(n,e);let s=t&&t.imagebitmap;return await tr(r,s)}async function tr(n,t=null){if((nr(t)||!on)&&(t=null),t)try{return await createImageBitmap(n,t)}catch(e){console.warn(e),on=!1}return await createImageBitmap(n)}function nr(n){for(let t in n||Je)return!1;return!0}function an(n){return!ir(n,"ftyp",4)||!(n[8]&96)?null:er(n)}function er(n){switch(rr(n,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function rr(n,t,e){return String.fromCharCode(...n.slice(t,e))}function sr(n){return[...n].map(t=>t.charCodeAt(0))}function ir(n,t,e=0){let r=sr(t);for(let s=0;s<r.length;++s)if(r[s]!==n[s+e])return!1;return!0}var q=!1,j=!0;function lt(n){let t=Q(n);return cr(t)||hr(t)||ar(t)||fr(t)||or(t)}function or(n){let t=new Uint8Array(n instanceof DataView?n.buffer:n),e=an(t);return e?{mimeType:e.mimeType,width:0,height:0}:null}function cr(n){let t=Q(n);return t.byteLength>=24&&t.getUint32(0,q)===2303741511?{mimeType:"image/png",width:t.getUint32(16,q),height:t.getUint32(20,q)}:null}function ar(n){let t=Q(n);return t.byteLength>=10&&t.getUint32(0,q)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,j),height:t.getUint16(8,j)}:null}function fr(n){let t=Q(n);return t.byteLength>=14&&t.getUint16(0,q)===16973&&t.getUint32(2,j)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,j),height:t.getUint32(22,j)}:null}function hr(n){let t=Q(n);if(!(t.byteLength>=3&&t.getUint16(0,q)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:r,sofMarkers:s}=lr(),i=2;for(;i+9<t.byteLength;){let o=t.getUint16(i,q);if(s.has(o))return{mimeType:"image/jpeg",height:t.getUint16(i+5,q),width:t.getUint16(i+7,q)};if(!r.has(o))return null;i+=2,i+=t.getUint16(i,q)}return null}function lr(){let n=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)n.add(e);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Q(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}async function fn(n,t){let{mimeType:e}=lt(n)||{},r=globalThis.loaders?.parseImageNode;return V(r),await r(n,e)}async function hn(n,t,e){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=e||{},o=pr(s),c;switch(o){case"imagebitmap":c=await cn(n,t,i);break;case"image":c=await ht(n,t,i);break;case"data":c=await fn(n,t);break;default:V(!1)}return s==="data"&&(c=at(c)),c}function pr(n){switch(n){case"auto":case"data":return en();default:return nn(n),n}}var mr=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],xr=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Mr={image:{type:"auto",decode:!0}},pt={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:tn,mimeTypes:xr,extensions:mr,parse:hn,tests:[n=>Boolean(lt(new DataView(n)))],options:Mr};function mt(n,t,e){let r=typeof n=="function"?n({...t,...e}):n,s=t.baseUrl;return s&&(r=s[s.length-1]==="/"?`${s}${r}`:`${s}/${r}`),Rt(r)}var dr=n=>n&&typeof n=="object";async function ln(n,t,e={}){return await vt(n,t,e)}async function vt(n,t,e){return Array.isArray(n)?await yr(n,t,e):dr(n)?await gr(n,t,e):await t(n,e)}async function gr(n,t,e){let r=[],s={};for(let i in n){let o=n[i],c=vt(o,t,e).then(a=>{s[i]=a});r.push(c)}return await Promise.all(r),s}async function yr(n,t,e={}){let r=n.map(s=>vt(s,t,e));return await Promise.all(r)}async function pn(n,t,e){return await ln(n,r=>kt(r,t,e))}async function kt(n,t,e){let s=await(await fetch(n,e.fetch)).arrayBuffer();return await t(s,e)}async function K(n,t={}){let e=await Tr(n,t);return await pn(e,pt.parse,t)}async function Tr(n,t,e={}){let r=t&&t.image&&t.image.mipLevels||0;return r!==0?await Ar(n,r,t,e):mt(n,t,e)}async function Ar(n,t,e,r){let s=[];if(t==="auto"){let i=mt(n,e,{...r,lod:0}),o=await kt(i,pt.parse,e),{width:c,height:a}=Pt(o);t=Er({width:c,height:a}),s.push(i)}V(t>0);for(let i=s.length;i<t;++i){let o=mt(n,e,{...r,lod:i});s.push(o)}return s}function Er(n){return 1+Math.floor(Math.log2(Math.max(n.width,n.height)))}function xn(n,t){let e=new bt.DynamicTexture(n,{id:"brdfLUT",sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"},data:K(t.brdfLutUrl)}),r=mn(n,{id:"DiffuseEnvSampler",getTextureForFace:i=>K(t.getTexUrl("diffuse",i,0)),sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"}}),s=mn(n,{id:"SpecularEnvSampler",getTextureForFace:i=>{let o=[];for(let c=0;c<=t.specularMipLevels-1;c++)o.push(K(t.getTexUrl("specular",i,c)));return o},sampler:{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"linear",magFilter:"linear"}});return{brdfLutTexture:e,diffuseEnvSampler:r,specularEnvSampler:s}}var wr=[0,1,2,3,4,5];function mn(n,{id:t,getTextureForFace:e,sampler:r}){let s={};return wr.forEach(i=>{s[String(i)]=e(i)}),new bt.DynamicTexture(n,{id:t,dimension:"cube",mipmaps:!1,sampler:r,data:s})}var di=b(zt(),1),yn=b(D(),1);var mi=b(zt(),1);function gn(n){return{addressModeU:dn(n.wrapS),addressModeV:dn(n.wrapT),magFilter:Sr(n.magFilter),...Lr(n.minFilter)}}function dn(n){switch(n){case 33071:return"clamp-to-edge";case 10497:return"repeat";case 33648:return"mirror-repeat";default:return}}function Sr(n){switch(n){case 9728:return"nearest";case 9729:return"linear";default:return}}function Lr(n){switch(n){case 9728:return{minFilter:"nearest"};case 9729:return{minFilter:"linear"};case 9984:return{minFilter:"nearest",mipmapFilter:"nearest"};case 9985:return{minFilter:"linear",mipmapFilter:"nearest"};case 9986:return{minFilter:"nearest",mipmapFilter:"linear"};case 9987:return{minFilter:"linear",mipmapFilter:"linear"};default:return{}}}function xt(n,t,e,r){let s={defines:{MANUAL_SRGB:!0,SRGB_FAST_APPROXIMATION:!0},bindings:{},uniforms:{camera:[0,0,0],metallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};s.defines.USE_TEX_LOD=!0;let{imageBasedLightingEnvironment:i}=r;return i&&(s.bindings.pbr_diffuseEnvSampler=i.diffuseEnvSampler.texture,s.bindings.pbr_specularEnvSampler=i.specularEnvSampler.texture,s.bindings.pbr_BrdfLUT=i.brdfLutTexture.texture,s.uniforms.scaleIBLAmbient=[1,1]),r?.pbrDebug&&(s.defines.PBR_DEBUG=!0,s.uniforms.scaleDiffBaseMR=[0,0,0,0],s.uniforms.scaleFGDSpec=[0,0,0,0]),e.NORMAL&&(s.defines.HAS_NORMALS=!0),e.TANGENT&&r?.useTangents&&(s.defines.HAS_TANGENTS=!0),e.TEXCOORD_0&&(s.defines.HAS_UV=!0),r?.imageBasedLightingEnvironment&&(s.defines.USE_IBL=!0),r?.lights&&(s.defines.USE_LIGHTS=!0),t&&Or(n,t,s),s}function Or(n,t,e){if(e.uniforms.unlit=Boolean(t.unlit),t.pbrMetallicRoughness&&Rr(n,t.pbrMetallicRoughness,e),t.normalTexture){Z(n,t.normalTexture,"pbr_normalSampler","HAS_NORMALMAP",e);let{scale:r=1}=t.normalTexture;e.uniforms.normalScale=r}if(t.occlusionTexture){Z(n,t.occlusionTexture,"pbr_occlusionSampler","HAS_OCCLUSIONMAP",e);let{strength:r=1}=t.occlusionTexture;e.uniforms.occlusionStrength=r}switch(t.emissiveTexture&&(Z(n,t.emissiveTexture,"pbr_emissiveSampler","HAS_EMISSIVEMAP",e),e.uniforms.emissiveFactor=t.emissiveFactor||[0,0,0]),t.alphaMode||"MASK"){case"MASK":let{alphaCutoff:r=.5}=t;e.defines.ALPHA_CUTOFF=!0,e.uniforms.alphaCutoff=r;break;case"BLEND":yn.log.warn("glTF BLEND alphaMode might not work well because it requires mesh sorting")(),e.parameters.blend=!0,e.parameters.blendColorOperation="add",e.parameters.blendColorSrcFactor="src-alpha",e.parameters.blendColorDstFactor="one-minus-src-alpha",e.parameters.blendAlphaOperation="add",e.parameters.blendAlphaSrcFactor="one",e.parameters.blendAlphaDstFactor="one-minus-src-alpha",e.glParameters.blend=!0,e.glParameters.blendEquation=32774,e.glParameters.blendFunc=[770,771,1,771];break}}function Rr(n,t,e){t.baseColorTexture&&Z(n,t.baseColorTexture,"pbr_baseColorSampler","HAS_BASECOLORMAP",e),e.uniforms.baseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&Z(n,t.metallicRoughnessTexture,"pbr_metallicRoughnessSampler","HAS_METALROUGHNESSMAP",e);let{metallicFactor:r=1,roughnessFactor:s=1}=t;e.uniforms.metallicRoughnessValues=[r,s]}function Z(n,t,e,r,s){let i=t.texture.source.image,o;i.compressed?o=i:o={data:i};let c={wrapS:10497,wrapT:10497,...t?.texture?.sampler},a=n.createTexture({id:t.uniformName||t.id,sampler:gn(c),...o});s.bindings[e]=a,r&&(s.defines[r]=!0),s.generatedTextures.push(a)}var Ai=1/Math.PI*180,Ei=1/180*Math.PI,Nr={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Nr}};var O=globalThis.mathgl.config;function Tn(n,{precision:t=O.precision}={}){return n=ur(n),`${parseFloat(n.toPrecision(t))}`}function Y(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Ft(n,t,e){let r=O.EPSILON;e&&(O.EPSILON=e);try{if(n===t)return!0;if(Y(n)&&Y(t)){if(n.length!==t.length)return!1;for(let s=0;s<n.length;++s)if(!Ft(n[s],t[s]))return!1;return!0}return n&&n.equals?n.equals(t):t&&t.equals?t.equals(n):typeof n=="number"&&typeof t=="number"?Math.abs(n-t)<=O.EPSILON*Math.max(1,Math.abs(n),Math.abs(t)):!1}finally{O.EPSILON=r}}function ur(n){return Math.round(n/O.EPSILON)*O.EPSILON}var C=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,e=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=t[r+e];return this.check()}toArray(t=[],e=0){for(let r=0;r<this.ELEMENTS;++r)t[e+r]=this[r];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Y(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(O)}formatString(t){let e="";for(let r=0;r<this.ELEMENTS;++r)e+=(r>0?", ":"")+Tn(this[r],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!Ft(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,r){if(r===void 0)return this.lerp(this,t,e);for(let s=0;s<this.ELEMENTS;++s){let i=t[s],o=typeof e=="number"?e:e[s];this[s]=i+r*(o-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t[r]),e[r]);return this.check()}add(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]+=e[r];return this.check()}subtract(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]-=e[r];return this.check()}scale(t){if(typeof t=="number")for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(O.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],t),e);return this.check()}get elements(){return this}};function _r(n,t){if(n.length!==t)return!1;for(let e=0;e<n.length;++e)if(!Number.isFinite(n[e]))return!1;return!0}function S(n){if(!Number.isFinite(n))throw new Error(`Invalid number ${JSON.stringify(n)}`);return n}function $(n,t,e=""){if(O.debug&&!_r(n,t))throw new Error(`math.gl: ${e} some fields set to invalid numbers'`);return n}function qt(n,t){if(!n)throw new Error(`math.gl assertion ${t}`)}var Mt=class extends C{get x(){return this[0]}set x(t){this[0]=S(t)}get y(){return this[1]}set y(t){this[1]=S(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let r=0;r<this.ELEMENTS;++r){let s=this[r]-t[r];e+=s*s}return S(e)}dot(t){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*t[r];return S(e)}normalize(){let t=this.magnitude();if(t!==0)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]*=e[r];return this.check()}divide(...t){for(let e of t)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return qt(t>=0&&t<this.ELEMENTS,"index is out of range"),S(this[t])}setComponent(t,e){return qt(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}};var R=typeof Float32Array<"u"?Float32Array:Array;var vi=Math.PI/180;function Pr(){let n=new R(2);return R!=Float32Array&&(n[0]=0,n[1]=0),n}function wn(n,t,e){let r=t[0],s=t[1];return n[0]=e[0]*r+e[4]*s+e[12],n[1]=e[1]*r+e[5]*s+e[13],n}var ki=function(){let n=Pr();return function(t,e,r,s,i,o){let c,a;for(e||(e=2),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,c=r;c<a;c+=e)n[0]=t[c],n[1]=t[c+1],i(n,n,o),t[c]=n[0],t[c+1]=n[1];return t}}();function Sn(n,t,e){let r=t[0],s=t[1],i=e[3]*r+e[7]*s||1;return n[0]=(e[0]*r+e[4]*s)/i,n[1]=(e[1]*r+e[5]*s)/i,n}function Ln(n,t,e){let r=t[0],s=t[1],i=t[2],o=e[3]*r+e[7]*s+e[11]*i||1;return n[0]=(e[0]*r+e[4]*s+e[8]*i)/o,n[1]=(e[1]*r+e[5]*s+e[9]*i)/o,n[2]=(e[2]*r+e[6]*s+e[10]*i)/o,n}function On(n,t,e){let r=t[0],s=t[1];return n[0]=e[0]*r+e[2]*s,n[1]=e[1]*r+e[3]*s,n[2]=t[2],n[3]=t[3],n}function Rn(n,t,e){let r=t[0],s=t[1],i=t[2];return n[0]=e[0]*r+e[3]*s+e[6]*i,n[1]=e[1]*r+e[4]*s+e[7]*i,n[2]=e[2]*r+e[5]*s+e[8]*i,n[3]=t[3],n}function Bt(){let n=new R(3);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function Ir(n){let t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function Ct(n,t,e){let r=new R(3);return r[0]=n,r[1]=t,r[2]=e,r}function Nn(n,t){let e=t[0],r=t[1],s=t[2],i=e*e+r*r+s*s;return i>0&&(i=1/Math.sqrt(i)),n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n}function un(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function dt(n,t,e){let r=t[0],s=t[1],i=t[2],o=e[0],c=e[1],a=e[2];return n[0]=s*a-i*c,n[1]=i*o-r*a,n[2]=r*c-s*o,n}function gt(n,t,e){let r=t[0],s=t[1],i=t[2],o=e[3]*r+e[7]*s+e[11]*i+e[15];return o=o||1,n[0]=(e[0]*r+e[4]*s+e[8]*i+e[12])/o,n[1]=(e[1]*r+e[5]*s+e[9]*i+e[13])/o,n[2]=(e[2]*r+e[6]*s+e[10]*i+e[14])/o,n}function _n(n,t,e){let r=e[0],s=e[1],i=e[2],o=e[3],c=t[0],a=t[1],f=t[2],h=s*f-i*a,l=i*c-r*f,p=r*a-s*c,m=s*p-i*l,x=i*h-r*p,M=r*l-s*h,d=o*2;return h*=d,l*=d,p*=d,m*=2,x*=2,M*=2,n[0]=c+h+m,n[1]=a+l+x,n[2]=f+p+M,n}var Pn=Ir;var Fi=function(){let n=Bt();return function(t,e,r,s,i,o){let c,a;for(e||(e=3),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,c=r;c<a;c+=e)n[0]=t[c],n[1]=t[c+1],n[2]=t[c+2],i(n,n,o),t[c]=n[0],t[c+1]=n[1],t[c+2]=n[2];return t}}();var yt,G=class extends Mt{static get ZERO(){return yt||(yt=new G(0,0,0,0),Object.freeze(yt)),yt}constructor(t=0,e=0,r=0,s=0){super(-0,-0,-0,-0),Y(t)&&arguments.length===1?this.copy(t):(O.debug&&(S(t),S(e),S(r),S(s)),this[0]=t,this[1]=e,this[2]=r,this[3]=s)}set(t,e,r,s){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return O.debug&&(S(t.x),S(t.y),S(t.z),S(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=S(t)}get w(){return this[3]}set w(t){this[3]=S(t)}transform(t){return gt(this,this,t),this.check()}transformByMatrix3(t){return Rn(this,this,t),this.check()}transformByMatrix2(t){return On(this,this,t),this.check()}transformByQuaternion(t){return _n(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var Tt=class extends C{toString(){let t="[";if(O.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let r=0;r<this.RANK;++r)t+=` ${this[r*this.RANK+e]}`}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=` ${this[e]}`}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,r){return this[e*this.RANK+t]=S(r),this}getColumn(t,e=new Array(this.RANK).fill(-0)){let r=t*this.RANK;for(let s=0;s<this.RANK;++s)e[s]=this[r+s];return e}setColumn(t,e){let r=t*this.RANK;for(let s=0;s<this.RANK;++s)this[r+s]=e[s];return this}};function In(){let n=new R(9);return R!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function br(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function vn(n,t){if(n===t){let e=t[1],r=t[2],s=t[3],i=t[6],o=t[7],c=t[11];n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=i,n[11]=t[14],n[12]=s,n[13]=o,n[14]=c}else n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15];return n}function kn(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],o=t[4],c=t[5],a=t[6],f=t[7],h=t[8],l=t[9],p=t[10],m=t[11],x=t[12],M=t[13],d=t[14],E=t[15],L=e*c-r*o,g=e*a-s*o,y=e*f-i*o,T=r*a-s*c,A=r*f-i*c,N=s*f-i*a,u=h*M-l*x,_=h*d-p*x,P=h*E-m*x,I=l*d-p*M,v=l*E-m*M,k=p*E-m*d,w=L*k-g*v+y*I+T*P-A*_+N*u;return w?(w=1/w,n[0]=(c*k-a*v+f*I)*w,n[1]=(s*v-r*k-i*I)*w,n[2]=(M*N-d*A+E*T)*w,n[3]=(p*A-l*N-m*T)*w,n[4]=(a*P-o*k-f*_)*w,n[5]=(e*k-s*P+i*_)*w,n[6]=(d*y-x*N-E*g)*w,n[7]=(h*N-p*y+m*g)*w,n[8]=(o*v-c*P+f*u)*w,n[9]=(r*P-e*v-i*u)*w,n[10]=(x*A-M*y+E*L)*w,n[11]=(l*y-h*A-m*L)*w,n[12]=(c*_-o*I-a*u)*w,n[13]=(e*I-r*_+s*u)*w,n[14]=(M*g-x*T-d*L)*w,n[15]=(h*T-l*g+p*L)*w,n):null}function bn(n){let t=n[0],e=n[1],r=n[2],s=n[3],i=n[4],o=n[5],c=n[6],a=n[7],f=n[8],h=n[9],l=n[10],p=n[11],m=n[12],x=n[13],M=n[14],d=n[15],E=t*o-e*i,L=t*c-r*i,g=e*c-r*o,y=f*x-h*m,T=f*M-l*m,A=h*M-l*x,N=t*A-e*T+r*y,u=i*A-o*T+c*y,_=f*g-h*L+l*E,P=m*g-x*L+M*E;return a*N-s*u+d*_-p*P}function Vt(n,t,e){let r=t[0],s=t[1],i=t[2],o=t[3],c=t[4],a=t[5],f=t[6],h=t[7],l=t[8],p=t[9],m=t[10],x=t[11],M=t[12],d=t[13],E=t[14],L=t[15],g=e[0],y=e[1],T=e[2],A=e[3];return n[0]=g*r+y*c+T*l+A*M,n[1]=g*s+y*a+T*p+A*d,n[2]=g*i+y*f+T*m+A*E,n[3]=g*o+y*h+T*x+A*L,g=e[4],y=e[5],T=e[6],A=e[7],n[4]=g*r+y*c+T*l+A*M,n[5]=g*s+y*a+T*p+A*d,n[6]=g*i+y*f+T*m+A*E,n[7]=g*o+y*h+T*x+A*L,g=e[8],y=e[9],T=e[10],A=e[11],n[8]=g*r+y*c+T*l+A*M,n[9]=g*s+y*a+T*p+A*d,n[10]=g*i+y*f+T*m+A*E,n[11]=g*o+y*h+T*x+A*L,g=e[12],y=e[13],T=e[14],A=e[15],n[12]=g*r+y*c+T*l+A*M,n[13]=g*s+y*a+T*p+A*d,n[14]=g*i+y*f+T*m+A*E,n[15]=g*o+y*h+T*x+A*L,n}function zn(n,t,e){let r=e[0],s=e[1],i=e[2],o,c,a,f,h,l,p,m,x,M,d,E;return t===n?(n[12]=t[0]*r+t[4]*s+t[8]*i+t[12],n[13]=t[1]*r+t[5]*s+t[9]*i+t[13],n[14]=t[2]*r+t[6]*s+t[10]*i+t[14],n[15]=t[3]*r+t[7]*s+t[11]*i+t[15]):(o=t[0],c=t[1],a=t[2],f=t[3],h=t[4],l=t[5],p=t[6],m=t[7],x=t[8],M=t[9],d=t[10],E=t[11],n[0]=o,n[1]=c,n[2]=a,n[3]=f,n[4]=h,n[5]=l,n[6]=p,n[7]=m,n[8]=x,n[9]=M,n[10]=d,n[11]=E,n[12]=o*r+h*s+x*i+t[12],n[13]=c*r+l*s+M*i+t[13],n[14]=a*r+p*s+d*i+t[14],n[15]=f*r+m*s+E*i+t[15]),n}function Fn(n,t,e){let r=e[0],s=e[1],i=e[2];return n[0]=t[0]*r,n[1]=t[1]*r,n[2]=t[2]*r,n[3]=t[3]*r,n[4]=t[4]*s,n[5]=t[5]*s,n[6]=t[6]*s,n[7]=t[7]*s,n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11]*i,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function qn(n,t,e,r){let s=r[0],i=r[1],o=r[2],c=Math.sqrt(s*s+i*i+o*o),a,f,h,l,p,m,x,M,d,E,L,g,y,T,A,N,u,_,P,I,v,k,w,X;return c<1e-6?null:(c=1/c,s*=c,i*=c,o*=c,f=Math.sin(e),a=Math.cos(e),h=1-a,l=t[0],p=t[1],m=t[2],x=t[3],M=t[4],d=t[5],E=t[6],L=t[7],g=t[8],y=t[9],T=t[10],A=t[11],N=s*s*h+a,u=i*s*h+o*f,_=o*s*h-i*f,P=s*i*h-o*f,I=i*i*h+a,v=o*i*h+s*f,k=s*o*h+i*f,w=i*o*h-s*f,X=o*o*h+a,n[0]=l*N+M*u+g*_,n[1]=p*N+d*u+y*_,n[2]=m*N+E*u+T*_,n[3]=x*N+L*u+A*_,n[4]=l*P+M*I+g*v,n[5]=p*P+d*I+y*v,n[6]=m*P+E*I+T*v,n[7]=x*P+L*I+A*v,n[8]=l*k+M*w+g*X,n[9]=p*k+d*w+y*X,n[10]=m*k+E*w+T*X,n[11]=x*k+L*w+A*X,t!==n&&(n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n)}function Bn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[4],o=t[5],c=t[6],a=t[7],f=t[8],h=t[9],l=t[10],p=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=i*s+f*r,n[5]=o*s+h*r,n[6]=c*s+l*r,n[7]=a*s+p*r,n[8]=f*s-i*r,n[9]=h*s-o*r,n[10]=l*s-c*r,n[11]=p*s-a*r,n}function Cn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[0],o=t[1],c=t[2],a=t[3],f=t[8],h=t[9],l=t[10],p=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=i*s-f*r,n[1]=o*s-h*r,n[2]=c*s-l*r,n[3]=a*s-p*r,n[8]=i*r+f*s,n[9]=o*r+h*s,n[10]=c*r+l*s,n[11]=a*r+p*s,n}function Vn(n,t,e){let r=Math.sin(e),s=Math.cos(e),i=t[0],o=t[1],c=t[2],a=t[3],f=t[4],h=t[5],l=t[6],p=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=i*s+f*r,n[1]=o*s+h*r,n[2]=c*s+l*r,n[3]=a*s+p*r,n[4]=f*s-i*r,n[5]=h*s-o*r,n[6]=l*s-c*r,n[7]=p*s-a*r,n}function Un(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],o=e+e,c=r+r,a=s+s,f=e*o,h=r*o,l=r*c,p=s*o,m=s*c,x=s*a,M=i*o,d=i*c,E=i*a;return n[0]=1-l-x,n[1]=h+E,n[2]=p-d,n[3]=0,n[4]=h-E,n[5]=1-f-x,n[6]=m+M,n[7]=0,n[8]=p+d,n[9]=m-M,n[10]=1-f-l,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Dn(n,t,e,r,s,i,o){let c=1/(e-t),a=1/(s-r),f=1/(i-o);return n[0]=i*2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i*2*a,n[6]=0,n[7]=0,n[8]=(e+t)*c,n[9]=(s+r)*a,n[10]=(o+i)*f,n[11]=-1,n[12]=0,n[13]=0,n[14]=o*i*2*f,n[15]=0,n}function zr(n,t,e,r,s){let i=1/Math.tan(t/2);if(n[0]=i/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,s!=null&&s!==1/0){let o=1/(r-s);n[10]=(s+r)*o,n[14]=2*s*r*o}else n[10]=-1,n[14]=-2*r;return n}var Yn=zr;function Fr(n,t,e,r,s,i,o){let c=1/(t-e),a=1/(r-s),f=1/(i-o);return n[0]=-2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*f,n[11]=0,n[12]=(t+e)*c,n[13]=(s+r)*a,n[14]=(o+i)*f,n[15]=1,n}var $n=Fr;function Gn(n,t,e,r){let s,i,o,c,a,f,h,l,p,m,x=t[0],M=t[1],d=t[2],E=r[0],L=r[1],g=r[2],y=e[0],T=e[1],A=e[2];return Math.abs(x-y)<1e-6&&Math.abs(M-T)<1e-6&&Math.abs(d-A)<1e-6?br(n):(l=x-y,p=M-T,m=d-A,s=1/Math.sqrt(l*l+p*p+m*m),l*=s,p*=s,m*=s,i=L*m-g*p,o=g*l-E*m,c=E*p-L*l,s=Math.sqrt(i*i+o*o+c*c),s?(s=1/s,i*=s,o*=s,c*=s):(i=0,o=0,c=0),a=p*c-m*o,f=m*i-l*c,h=l*o-p*i,s=Math.sqrt(a*a+f*f+h*h),s?(s=1/s,a*=s,f*=s,h*=s):(a=0,f=0,h=0),n[0]=i,n[1]=a,n[2]=l,n[3]=0,n[4]=o,n[5]=f,n[6]=p,n[7]=0,n[8]=c,n[9]=h,n[10]=m,n[11]=0,n[12]=-(i*x+o*M+c*d),n[13]=-(a*x+f*M+h*d),n[14]=-(l*x+p*M+m*d),n[15]=1,n)}function qr(){let n=new R(4);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0),n}function Wn(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n}function Hn(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n}function Xn(n){let t=n[0],e=n[1],r=n[2],s=n[3];return Math.sqrt(t*t+e*e+r*r+s*s)}function jn(n){let t=n[0],e=n[1],r=n[2],s=n[3];return t*t+e*e+r*r+s*s}function Qn(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],o=e*e+r*r+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),n[0]=e*o,n[1]=r*o,n[2]=s*o,n[3]=i*o,n}function Kn(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Zn(n,t,e,r){let s=t[0],i=t[1],o=t[2],c=t[3];return n[0]=s+r*(e[0]-s),n[1]=i+r*(e[1]-i),n[2]=o+r*(e[2]-o),n[3]=c+r*(e[3]-c),n}function Jn(n,t,e){let r=t[0],s=t[1],i=t[2],o=t[3];return n[0]=e[0]*r+e[4]*s+e[8]*i+e[12]*o,n[1]=e[1]*r+e[5]*s+e[9]*i+e[13]*o,n[2]=e[2]*r+e[6]*s+e[10]*i+e[14]*o,n[3]=e[3]*r+e[7]*s+e[11]*i+e[15]*o,n}function te(n,t,e){let r=t[0],s=t[1],i=t[2],o=e[0],c=e[1],a=e[2],f=e[3],h=f*r+c*i-a*s,l=f*s+a*r-o*i,p=f*i+o*s-c*r,m=-o*r-c*s-a*i;return n[0]=h*f+m*-o+l*-a-p*-c,n[1]=l*f+m*-c+p*-o-h*-a,n[2]=p*f+m*-a+h*-c-l*-o,n[3]=t[3],n}var Xi=function(){let n=qr();return function(t,e,r,s,i,o){let c,a;for(e||(e=4),r||(r=0),s?a=Math.min(s*e+r,t.length):a=t.length,c=r;c<a;c+=e)n[0]=t[c],n[1]=t[c+1],n[2]=t[c+2],n[3]=t[c+3],i(n,n,o),t[c]=n[0],t[c+1]=n[1],t[c+2]=n[2],t[c+3]=n[3];return t}}();var Yt;(function(n){n[n.COL0ROW0=0]="COL0ROW0",n[n.COL0ROW1=1]="COL0ROW1",n[n.COL0ROW2=2]="COL0ROW2",n[n.COL0ROW3=3]="COL0ROW3",n[n.COL1ROW0=4]="COL1ROW0",n[n.COL1ROW1=5]="COL1ROW1",n[n.COL1ROW2=6]="COL1ROW2",n[n.COL1ROW3=7]="COL1ROW3",n[n.COL2ROW0=8]="COL2ROW0",n[n.COL2ROW1=9]="COL2ROW1",n[n.COL2ROW2=10]="COL2ROW2",n[n.COL2ROW3=11]="COL2ROW3",n[n.COL3ROW0=12]="COL3ROW0",n[n.COL3ROW1=13]="COL3ROW1",n[n.COL3ROW2=14]="COL3ROW2",n[n.COL3ROW3=15]="COL3ROW3"})(Yt||(Yt={}));var Cr=45*Math.PI/180,Vr=1,Ut=.1,Dt=500,Ur=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),z=class extends Tt{static get IDENTITY(){return Yr()}static get ZERO(){return Dr()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Yt}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,r,s,i,o,c,a,f,h,l,p,m,x,M,d){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this[4]=i,this[5]=o,this[6]=c,this[7]=a,this[8]=f,this[9]=h,this[10]=l,this[11]=p,this[12]=m,this[13]=x,this[14]=M,this[15]=d,this.check()}setRowMajor(t,e,r,s,i,o,c,a,f,h,l,p,m,x,M,d){return this[0]=t,this[1]=i,this[2]=f,this[3]=m,this[4]=e,this[5]=o,this[6]=h,this[7]=x,this[8]=r,this[9]=c,this[10]=l,this[11]=M,this[12]=s,this[13]=a,this[14]=p,this[15]=d,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(Ur)}fromObject(t){return this.check()}fromQuaternion(t){return Un(this,t),this.check()}frustum(t){let{left:e,right:r,bottom:s,top:i,near:o=Ut,far:c=Dt}=t;return c===1/0?$r(this,e,r,s,i,o):Dn(this,e,r,s,i,o,c),this.check()}lookAt(t){let{eye:e,center:r=[0,0,0],up:s=[0,1,0]}=t;return Gn(this,e,r,s),this.check()}ortho(t){let{left:e,right:r,bottom:s,top:i,near:o=Ut,far:c=Dt}=t;return $n(this,e,r,s,i,o,c),this.check()}orthographic(t){let{fovy:e=Cr,aspect:r=Vr,focalDistance:s=1,near:i=Ut,far:o=Dt}=t;ne(e);let c=e/2,a=s*Math.tan(c),f=a*r;return this.ortho({left:-f,right:f,bottom:-a,top:a,near:i,far:o})}perspective(t){let{fovy:e=45*Math.PI/180,aspect:r=1,near:s=.1,far:i=500}=t;return ne(e),Yn(this,e,r,s,i),this.check()}determinant(){return bn(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];let r=this.getScale(e),s=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*s,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];let r=this.getScale(e),s=1/r[0],i=1/r[1],o=1/r[2];return t[0]=this[0]*s,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*s,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*s,t[7]=this[9]*i,t[8]=this[10]*o,t}transpose(){return vn(this,this),this.check()}invert(){return kn(this,this),this.check()}multiplyLeft(t){return Vt(this,t,this),this.check()}multiplyRight(t){return Vt(this,this,t),this.check()}rotateX(t){return Bn(this,this,t),this.check()}rotateY(t){return Cn(this,this,t),this.check()}rotateZ(t){return Vn(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return qn(this,this,t,e),this.check()}scale(t){return Fn(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return zn(this,this,t),this.check()}transform(t,e){return t.length===4?(e=Jn(e||[-0,-0,-0,-0],t,this),$(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){let{length:r}=t,s;switch(r){case 2:s=wn(e||[-0,-0],t,this);break;case 3:s=gt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $(s,t.length),s}transformAsVector(t,e){let r;switch(t.length){case 2:r=Sn(e||[-0,-0],t,this);break;case 3:r=Ln(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $(r,t.length),r}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,r){return this.identity().translate([t,e,r])}},At,Et;function Dr(){return At||(At=new z([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(At)),At}function Yr(){return Et||(Et=new z,Object.freeze(Et)),Et}function ne(n){if(n>Math.PI*2)throw Error("expected radians")}function $r(n,t,e,r,s,i){let o=2*i/(e-t),c=2*i/(s-r),a=(e+t)/(e-t),f=(s+r)/(s-r),h=-1,l=-1,p=-2*i;return n[0]=o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=c,n[6]=0,n[7]=0,n[8]=a,n[9]=f,n[10]=h,n[11]=l,n[12]=0,n[13]=0,n[14]=p,n[15]=0,n}function ee(){let n=new R(4);return R!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function re(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function $t(n,t,e){e=e*.5;let r=Math.sin(e);return n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=Math.cos(e),n}function Gt(n,t,e){let r=t[0],s=t[1],i=t[2],o=t[3],c=e[0],a=e[1],f=e[2],h=e[3];return n[0]=r*h+o*c+s*f-i*a,n[1]=s*h+o*a+i*c-r*f,n[2]=i*h+o*f+r*a-s*c,n[3]=o*h-r*c-s*a-i*f,n}function se(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],c=Math.sin(e),a=Math.cos(e);return n[0]=r*a+o*c,n[1]=s*a+i*c,n[2]=i*a-s*c,n[3]=o*a-r*c,n}function ie(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],c=Math.sin(e),a=Math.cos(e);return n[0]=r*a-i*c,n[1]=s*a+o*c,n[2]=i*a+r*c,n[3]=o*a-s*c,n}function oe(n,t,e){e*=.5;let r=t[0],s=t[1],i=t[2],o=t[3],c=Math.sin(e),a=Math.cos(e);return n[0]=r*a+s*c,n[1]=s*a-r*c,n[2]=i*a+o*c,n[3]=o*a-i*c,n}function ce(n,t){let e=t[0],r=t[1],s=t[2];return n[0]=e,n[1]=r,n[2]=s,n[3]=Math.sqrt(Math.abs(1-e*e-r*r-s*s)),n}function tt(n,t,e,r){let s=t[0],i=t[1],o=t[2],c=t[3],a=e[0],f=e[1],h=e[2],l=e[3],p,m,x,M,d;return p=s*a+i*f+o*h+c*l,p<0&&(p=-p,a=-a,f=-f,h=-h,l=-l),1-p>1e-6?(m=Math.acos(p),d=Math.sin(m),x=Math.sin((1-r)*m)/d,M=Math.sin(r*m)/d):(x=1-r,M=r),n[0]=x*s+M*a,n[1]=x*i+M*f,n[2]=x*o+M*h,n[3]=x*c+M*l,n}function ae(n,t){let e=t[0],r=t[1],s=t[2],i=t[3],o=e*e+r*r+s*s+i*i,c=o?1/o:0;return n[0]=-e*c,n[1]=-r*c,n[2]=-s*c,n[3]=i*c,n}function fe(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=t[3],n}function Wt(n,t){let e=t[0]+t[4]+t[8],r;if(e>0)r=Math.sqrt(e+1),n[3]=.5*r,r=.5/r,n[0]=(t[5]-t[7])*r,n[1]=(t[6]-t[2])*r,n[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;r=Math.sqrt(t[s*3+s]-t[i*3+i]-t[o*3+o]+1),n[s]=.5*r,r=.5/r,n[3]=(t[i*3+o]-t[o*3+i])*r,n[i]=(t[i*3+s]+t[s*3+i])*r,n[o]=(t[o*3+s]+t[s*3+o])*r}return n}var he=Wn;var le=Hn,pe=Kn,me=Zn,xe=Xn;var Me=jn;var de=Qn;var ge=function(){let n=Bt(),t=Ct(1,0,0),e=Ct(0,1,0);return function(r,s,i){let o=un(s,i);return o<-.999999?(dt(n,t,s),Pn(n)<1e-6&&dt(n,e,s),Nn(n,n),$t(r,n,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(dt(n,s,i),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+o,de(r,r))}}(),ao=function(){let n=ee(),t=ee();return function(e,r,s,i,o,c){return tt(n,r,o,c),tt(t,s,i,c),tt(e,n,t,2*c*(1-c)),e}}(),fo=function(){let n=In();return function(t,e,r,s){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=s[0],n[4]=s[1],n[7]=s[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],de(t,Wt(t,n))}}();var Gr=[0,0,0,1],nt=class extends C{constructor(t=0,e=0,r=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,e,r,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,r,s){return this[0]=t,this[1]=e,this[2]=r,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return Wt(this,t),this.check()}fromAxisRotation(t,e){return $t(this,t,e),this.check()}identity(){return re(this),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=S(t)}get y(){return this[1]}set y(t){this[1]=S(t)}get z(){return this[2]}set z(t){this[2]=S(t)}get w(){return this[3]}set w(t){this[3]=S(t)}len(){return xe(this)}lengthSquared(){return Me(this)}dot(t){return pe(this,t)}rotationTo(t,e){return ge(this,t,e),this.check()}add(t){return he(this,this,t),this.check()}calculateW(){return ce(this,this),this.check()}conjugate(){return fe(this,this),this.check()}invert(){return ae(this,this),this.check()}lerp(t,e,r){return r===void 0?this.lerp(this,t,e):(me(this,t,e,r),this.check())}multiplyRight(t){return Gt(this,this,t),this.check()}multiplyLeft(t){return Gt(this,t,this),this.check()}normalize(){let t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,t===0&&(this[3]=1),this.check()}rotateX(t){return se(this,this,t),this.check()}rotateY(t){return ie(this,this,t),this.check()}rotateZ(t){return oe(this,this,t),this.check()}scale(t){return le(this,this,t),this.check()}slerp(t,e,r){let s,i,o;switch(arguments.length){case 1:({start:s=Gr,target:i,ratio:o}=t);break;case 2:s=this,i=t,o=e;break;default:s=t,i=e,o=r}return tt(this,s,i,o),this.check()}transformVector4(t,e=new G){return te(e,t,this),$(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};function wt(n){let t=n.extensions?.KHR_lights_punctual?.lights;if(!t||!Array.isArray(t)||t.length===0)return[];let e=[];for(let r of n.nodes||[]){let s=r.extensions?.KHR_lights_punctual;if(!s||typeof s.light!="number")continue;let i=t[s.light];if(!i)continue;let o=i.color||[1,1,1],c=i.intensity??1,a=i.range;switch(i.type){case"directional":e.push(Wr(r,o,c));break;case"point":e.push(ye(r,o,c,a));break;case"spot":e.push(ye(r,o,c,a));break;default:break}}return e}function ye(n,t,e,r){let s=n.translation?[...n.translation]:[0,0,0],i=[1,0,0];return r!==void 0&&r>0&&(i=[1,0,1/(r*r)]),{type:"point",position:s,color:t,intensity:e,attenuation:i}}function Wr(n,t,e){let r=[0,0,-1];return n.rotation&&(r=new z().fromQuaternion(n.rotation).transformDirection([0,0,-1])),{type:"directional",direction:r,color:t,intensity:e}}var W=b(ct(),1);var U;(function(n){n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(U||(U={}));function Te(n){switch(n){case U.POINTS:return"point-list";case U.LINES:return"line-list";case U.LINE_STRIP:return"line-strip";case U.TRIANGLES:return"triangle-list";case U.TRIANGLE_STRIP:return"triangle-strip";default:throw new Error(String(n))}}var we=b(D(),1),Se=b(Ee(),1),St=b(ct(),1),Hr=`
|
|
8
8
|
layout(0) positions: vec4; // in vec4 POSITION;
|
|
9
9
|
|
|
10
10
|
#ifdef HAS_NORMALS
|
|
@@ -49,7 +49,7 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
49
49
|
vec3 pos = pbr_vPosition;
|
|
50
50
|
fragmentColor = pbr_filterColor(vec4(1.0));
|
|
51
51
|
}
|
|
52
|
-
`,
|
|
52
|
+
`,Xr=`#version 300 es
|
|
53
53
|
|
|
54
54
|
// in vec4 POSITION;
|
|
55
55
|
in vec4 positions;
|
|
@@ -88,13 +88,13 @@ layout(0) positions: vec4; // in vec4 POSITION;
|
|
|
88
88
|
pbr_setPositionNormalTangentUV(positions, _NORMAL, _TANGENT, _TEXCOORD_0);
|
|
89
89
|
gl_Position = pbrProjection.modelViewProjectionMatrix * positions;
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`,jr=`#version 300 es
|
|
92
92
|
out vec4 fragmentColor;
|
|
93
93
|
|
|
94
94
|
void main(void) {
|
|
95
95
|
vec3 pos = pbr_vPosition;
|
|
96
96
|
fragmentColor = pbr_filterColor(vec4(1.0));
|
|
97
97
|
}
|
|
98
|
-
`;function
|
|
98
|
+
`;function Le(n,t){let{id:e,geometry:r,parsedPPBRMaterial:s,vertexCount:i,modelOptions:o={}}=t;we.log.info(4,"createGLTFModel defines: ",s.defines)();let c=[],a={depthWriteEnabled:!0,depthCompare:"less",depthFormat:"depth24plus",cullMode:"back"},f={id:e,source:Hr,vs:Xr,fs:jr,geometry:r,topology:r.topology,vertexCount:i,modules:[Se.pbrMaterial],...o,defines:{...s.defines,...o.defines},parameters:{...a,...s.parameters,...o.parameters}},h=new St.Model(n,f),{camera:l,...p}={...s.uniforms,...o.uniforms,...s.bindings,...o.bindings};return h.shaderInputs.setProps({pbrMaterial:p,pbrProjection:{camera:l}}),new St.ModelNode({managedResources:c,model:h})}var Qr={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:void 0,lights:!0,useTangents:!1};function Re(n,t,e={}){let r={...Qr,...e};return t.scenes.map(i=>Kr(n,i,t.nodes,r))}function Kr(n,t,e,r){let i=(t.nodes||[]).map(c=>Ne(n,c,e,r));return new W.GroupNode({id:t.name||t.id,children:i})}function Ne(n,t,e,r){if(!t._node){let o=(t.children||[]).map(a=>Ne(n,a,e,r));t.mesh&&o.push(Zr(n,t.mesh,r));let c=new W.GroupNode({id:t.name||t.id,children:o});if(t.matrix)c.setMatrix(t.matrix);else{if(c.matrix.identity(),t.translation&&c.matrix.translate(t.translation),t.rotation){let a=new z().fromQuaternion(t.rotation);c.matrix.multiplyRight(a)}t.scale&&c.matrix.scale(t.scale)}t._node=c}let s=e.find(i=>i.id===t.id);return s._node=t._node,t._node}function Zr(n,t,e){if(!t._mesh){let s=(t.primitives||[]).map((o,c)=>Jr(n,o,c,t,e)),i=new W.GroupNode({id:t.name||t.id,children:s});t._mesh=i}return t._mesh}function Jr(n,t,e,r,s){let i=t.name||`${r.name||r.id}-primitive-${e}`,o=Te(t.mode||4),c=t.indices?t.indices.count:ts(t.attributes),a=Oe(i,t,o),f=xt(n,t.material,a.attributes,s),h=Le(n,{id:i,geometry:Oe(i,t,o),parsedPPBRMaterial:f,modelOptions:s.modelOptions,vertexCount:c});return h.bounds=[t.attributes.POSITION.min,t.attributes.POSITION.max],h}function ts(n){throw new Error("getVertexCount not implemented")}function Oe(n,t,e){let r={};for(let[s,i]of Object.entries(t.attributes)){let{components:o,size:c,value:a}=i;r[s]={size:c??o,value:a}}return new W.Geometry({id:n,topology:e,indices:t.indices.value,attributes:r})}var _e=b(D(),1);var Xt=b(D(),1);var Ht=new nt;function ue(n,{input:t,interpolation:e,output:r},s,i){let o=t[t.length-1],c=n%o,a=t.findIndex(p=>p>=c),f=Math.max(0,a-1);if(!Array.isArray(s[i]))switch(i){case"translation":s[i]=[0,0,0];break;case"rotation":s[i]=[0,0,0,1];break;case"scale":s[i]=[1,1,1];break;default:Xt.log.warn(`Bad animation path ${i}`)()}let h=t[f],l=t[a];switch(e){case"STEP":rs(s,i,r[f]);break;case"LINEAR":if(l>h){let p=(c-h)/(l-h);ns(s,i,r[f],r[a],p)}break;case"CUBICSPLINE":if(l>h){let p=(c-h)/(l-h),m=l-h,x=r[3*f+1],M=r[3*f+2],d=r[3*a+0],E=r[3*a+1];es(s,i,{p0:x,outTangent0:M,inTangent1:d,p1:E,tDiff:m,ratio:p})}break;default:Xt.log.warn(`Interpolation ${e} not supported`)();break}}function ns(n,t,e,r,s){if(!n[t])throw new Error;if(t==="rotation"){Ht.slerp({start:e,target:r,ratio:s});for(let i=0;i<Ht.length;i++)n[t][i]=Ht[i]}else for(let i=0;i<e.length;i++)n[t][i]=s*r[i]+(1-s)*e[i]}function es(n,t,{p0:e,outTangent0:r,inTangent1:s,p1:i,tDiff:o,ratio:c}){if(!n[t])throw new Error;for(let a=0;a<n[t].length;a++){let f=r[a]*o,h=s[a]*o;n[t][a]=(2*Math.pow(c,3)-3*Math.pow(c,2)+1)*e[a]+(Math.pow(c,3)-2*Math.pow(c,2)+c)*f+(-2*Math.pow(c,3)+3*Math.pow(c,2))*i[a]+(Math.pow(c,3)-Math.pow(c,2))*h}}function rs(n,t,e){if(!n[t])throw new Error;for(let r=0;r<e.length;r++)n[t][r]=e[r]}var jt=class{animation;startTime=0;playing=!0;speed=1;constructor(t){this.animation=t.animation,this.animation.name||="unnamed",Object.assign(this,t)}setTime(t){if(!this.playing)return;let r=(t/1e3-this.startTime)*this.speed;this.animation.channels.forEach(({sampler:s,target:i,path:o})=>{ue(r,s,i,o),is(i,i._node)})}},H=class{animations;constructor(t){this.animations=t.animations.map((e,r)=>{let s=e.name||`Animation-${r}`;return new jt({animation:{name:s,channels:e.channels}})})}animate(t){_e.log.warn("GLTFAnimator#animate is deprecated. Use GLTFAnimator#setTime instead")(),this.setTime(t)}setTime(t){this.animations.forEach(e=>e.setTime(t))}getAnimations(){return this.animations}},ss=new z;function is(n,t){if(t.matrix.identity(),n.translation&&t.matrix.translate(n.translation),n.rotation){let e=ss.fromQuaternion(n.rotation);t.matrix.multiplyRight(e)}n.scale&&t.matrix.scale(n.scale)}var os={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pe(n){let t=cs[n.componentType],e=os[n.type],r=e*n.count,{buffer:s,byteOffset:i=0}=n.bufferView?.data??{};return{typedArray:new t(s,i+(n.byteOffset||0),r),components:e}}function ve(n){return(n.animations||[]).map((e,r)=>{let s=e.name||`Animation-${r}`,i=e.samplers.map(({input:c,interpolation:a="LINEAR",output:f})=>({input:Ie(n.accessors[c]),interpolation:a,output:Ie(n.accessors[f])})),o=e.channels.map(({sampler:c,target:a})=>({sampler:i[c],target:n.nodes[a.node??0],path:a.path}));return{name:s,channels:o}})}function Ie(n){if(!n._animation){let{typedArray:t,components:e}=Pe(n);if(e===1)n._animation=Array.from(t);else{let r=[];for(let s=0;s<t.length;s+=e)r.push(Array.from(t.slice(s,s+e)));n._animation=r}}return n._animation}function Lt(n){if(ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof ImageBitmap)return n;if(Array.isArray(n))return n.map(Lt);if(n&&typeof n=="object"){let t={};for(let e in n)t[e]=Lt(n[e]);return t}return n}function ke(n,t,e){t=Lt(t);let r=Re(n,t,e),s=ve(t),i=new H({animations:s}),o=wt(t);return{scenes:r,animator:i,lights:o}}return Ve(et);})();
|
|
99
99
|
return __exports__;
|
|
100
100
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Device } from '@luma.gl/core';
|
|
2
2
|
import { GroupNode } from '@luma.gl/engine';
|
|
3
3
|
import { GLTFPostprocessed } from '@loaders.gl/gltf';
|
|
4
|
+
import { Light } from '@luma.gl/shadertools';
|
|
4
5
|
import { type ParseGLTFOptions } from "../parsers/parse-gltf.js";
|
|
5
6
|
import { GLTFAnimator } from "./gltf-animator.js";
|
|
6
7
|
export declare function createScenegraphsFromGLTF(device: Device, gltf: GLTFPostprocessed, options?: ParseGLTFOptions): {
|
|
7
8
|
scenes: GroupNode[];
|
|
8
9
|
animator: GLTFAnimator;
|
|
10
|
+
lights: Light[];
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=create-scenegraph-from-gltf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-scenegraph-from-gltf.d.ts","sourceRoot":"","sources":["../../src/gltf/create-scenegraph-from-gltf.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAY,KAAK,gBAAgB,EAAC,iCAA8B;
|
|
1
|
+
{"version":3,"file":"create-scenegraph-from-gltf.d.ts","sourceRoot":"","sources":["../../src/gltf/create-scenegraph-from-gltf.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAY,KAAK,gBAAgB,EAAC,iCAA8B;AAEvE,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAI7C,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,gBAAgB,GACzB;IACD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAQA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { parseGLTF } from "../parsers/parse-gltf.js";
|
|
5
|
+
import { parseGLTFLights } from "../parsers/parse-gltf-lights.js";
|
|
5
6
|
import { GLTFAnimator } from "./gltf-animator.js";
|
|
6
7
|
import { parseGLTFAnimations } from "../parsers/parse-gltf-animations.js";
|
|
7
8
|
import { deepCopy } from "../utils/deep-copy.js";
|
|
@@ -11,6 +12,7 @@ export function createScenegraphsFromGLTF(device, gltf, options) {
|
|
|
11
12
|
// Note: There is a nasty dependency on injected nodes in the glTF
|
|
12
13
|
const animations = parseGLTFAnimations(gltf);
|
|
13
14
|
const animator = new GLTFAnimator({ animations });
|
|
14
|
-
|
|
15
|
+
const lights = parseGLTFLights(gltf);
|
|
16
|
+
return { scenes, animator, lights };
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=create-scenegraph-from-gltf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-scenegraph-from-gltf.js","sourceRoot":"","sources":["../../src/gltf/create-scenegraph-from-gltf.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"create-scenegraph-from-gltf.js","sourceRoot":"","sources":["../../src/gltf/create-scenegraph-from-gltf.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAMpC,OAAO,EAAC,SAAS,EAAwB,iCAA8B;AACvE,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,mBAAmB,EAAC,4CAAyC;AACrE,OAAO,EAAC,QAAQ,EAAC,8BAA2B;AAE5C,MAAM,UAAU,yBAAyB,CACvC,MAAc,EACd,IAAuB,EACvB,OAA0B;IAM1B,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAChD,kEAAkE;IAClE,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,EAAC,UAAU,EAAC,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAC,CAAC;AACpC,CAAC"}
|