@realsee/five 6.0.0-alpha.30 → 6.0.0-alpha.31
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/docs/classes/five.AnimationFrameLoop.html +1 -1
- package/docs/classes/five.BVH.html +1 -1
- package/docs/classes/five.BVHIntersect.html +1 -1
- package/docs/classes/five.BVHNode.html +1 -1
- package/docs/classes/five.BVHVector3.html +1 -1
- package/docs/classes/five.BoxBoundingVolume.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.Clipper.html +1 -1
- package/docs/classes/five.CullingVolume.html +1 -1
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.IntersectMesh.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMaterialReferenceCache.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.RegionBoundingVolume.html +1 -1
- package/docs/classes/five.RequestScheduler.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.SphereBoundingVolume.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.TextureLoader.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3DModel.html +1 -1
- package/docs/classes/five.TileCubeTextureTarget.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Tileset.html +1 -1
- package/docs/classes/five.TilesetCache.html +1 -1
- package/docs/classes/five.TilesetTraverser.html +1 -1
- package/docs/classes/five.Work.html +1 -1
- package/docs/classes/five.XRButton.html +1 -1
- package/docs/classes/gltf_loader.DDSLoader.html +1 -1
- package/docs/classes/gltf_loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFObject.html +1 -1
- package/docs/classes/gltf_loader.GLTFParser.html +1 -1
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/react.Store.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/enums/five.VolumePlaneIntersect.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AnimationFrame.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.BoundingVolume.html +1 -1
- package/docs/interfaces/five.CameraPose.html +1 -1
- package/docs/interfaces/five.ClipperParameter.html +1 -1
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.FiveInitArgs.html +1 -1
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.GestureEvent.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.ImageURLMappings.html +1 -1
- package/docs/interfaces/five.ImageURLOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModeChangeEvent.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +1 -1
- package/docs/interfaces/five.ModelLodOptions.html +1 -1
- package/docs/interfaces/five.ModelsEvent.html +1 -1
- package/docs/interfaces/five.MotionKeyframe.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +1 -1
- package/docs/interfaces/five.PBMPanoPicture.html +1 -1
- package/docs/interfaces/five.PBMParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +1 -1
- package/docs/interfaces/five.PanoTextureEvent.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -1
- package/docs/interfaces/five.Scissor.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +1 -1
- package/docs/interfaces/five.TileCubeNode.html +1 -1
- package/docs/interfaces/five.TileCubeTree.html +1 -1
- package/docs/interfaces/five.TileHeader.html +1 -1
- package/docs/interfaces/five.TilesetHeader.html +1 -1
- package/docs/interfaces/five.TilesetOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.WebXRAxesParams.html +1 -1
- package/docs/interfaces/five.WebXRControllerParams.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkInitial.html +1 -1
- package/docs/interfaces/five.WorkModel.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkOptions.html +1 -1
- package/docs/interfaces/five.WorkResolvedObserver.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorkVideo.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +1 -1
- package/docs/interfaces/five.XRControllerEvent.html +1 -1
- package/docs/interfaces/five.XRGestureEvent.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +1 -1
- package/docs/interfaces/gltf_loader.DDS.html +1 -1
- package/docs/interfaces/gltf_loader.GLTF.html +1 -1
- package/docs/interfaces/gltf_loader.GLTFReference.html +1 -1
- package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -1
- package/docs/interfaces/react.FiveActionReactCallbacks.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
- package/docs/interfaces/sticker.IntersectionLike.html +1 -1
- package/docs/interfaces/vfx.ParticleArgs.html +1 -1
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -1
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +1 -1
- package/docs/modules/five.SubscribeMixinType.html +1 -1
- package/docs/modules/five.html +1 -1
- package/docs/modules/gltf_loader.html +1 -1
- package/docs/modules/line.html +1 -1
- package/docs/modules/react.html +1 -1
- package/docs/modules/sticker.html +1 -1
- package/docs/modules/vfx.html +1 -1
- package/docs/modules/vue.html +1 -1
- package/docs/modules.html +1 -1
- package/five/index.js +7 -7
- package/gltf-loader/index.js +3 -3
- package/line/index.js +3 -3
- package/package.json +1 -1
- package/react/index.js +2 -2
- package/sticker/index.js +3 -3
- package/umd/five-gltf-loader.js +1 -1
- package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
- package/umd/five-line.js +1 -1
- package/umd/five-line.js.LICENSE.txt +14 -0
- package/umd/five-react.js.LICENSE.txt +14 -0
- package/umd/five-sticker.js +1 -1
- package/umd/five-sticker.js.LICENSE.txt +14 -0
- package/umd/five.js +1 -1
- package/vfx/index.js +2 -2
- package/vue/index.js +2 -2
package/umd/five-gltf-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_GLTFLoader=t():e.FiveSDK_GLTFLoader=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";r.r(a),r.d(a,{DDSLoader:()=>i,DRACOLoader:()=>s,GLTFLoader:()=>l,GLTFObject:()=>c,THREEGLTFLoader:()=>n});var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}Object.create,Object.create;var o=r(438),n=function(){function e(e){o.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(o.Loader.prototype),{constructor:e,load:function(e,t,r,a){var n,s=this;n=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:o.LoaderUtils.extractUrlBase(e),s.manager.itemStart(e);var i=function(t){a?a(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},c=new o.FileLoader(s.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&c.setWithCredentials(!0),c.load(e,(function(r){try{s.parse(r,n,(function(r){t(r),s.manager.itemEnd(e)}),i)}catch(e){i(e)}}),r,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,u,d){var m,y={};if("string"==typeof e)m=e;else if(o.LoaderUtils.decodeText(new Uint8Array(e,0,4))===l){try{y[r.KHR_BINARY_GLTF]=new p(e)}catch(e){return void(d&&d(e))}m=y[r.KHR_BINARY_GLTF].content}else m=o.LoaderUtils.decodeText(new Uint8Array(e));var T=JSON.parse(m);if(void 0===T.asset||T.asset.version[0]<2)d&&d(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(T.extensionsUsed)for(var M=0;M<T.extensionsUsed.length;++M){var R=T.extensionsUsed[M],A=T.extensionsRequired||[];switch(R){case r.KHR_LIGHTS_PUNCTUAL:y[R]=new n(T);break;case r.KHR_MATERIALS_CLEARCOAT:y[R]=new i;break;case r.KHR_MATERIALS_TRANSMISSION:y[R]=new c;break;case r.KHR_MATERIALS_UNLIT:y[R]=new s;break;case r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:y[R]=new g;break;case r.KHR_DRACO_MESH_COMPRESSION:y[R]=new h(T,this.dracoLoader);break;case r.MSFT_TEXTURE_DDS:y[R]=new a(this.ddsLoader);break;case r.KHR_TEXTURE_TRANSFORM:y[R]=new f;break;case r.KHR_MESH_QUANTIZATION:y[R]=new v;break;default:A.indexOf(R)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+R+'".')}}var S=new D(T,y,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});S.fileLoader.setRequestHeader(this.requestHeader),S.parse(u,d)}}});var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function a(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=e}function n(e){this.name=r.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[r.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=r.KHR_MATERIALS_UNLIT}function i(){this.name=r.KHR_MATERIALS_CLEARCOAT}function c(){this.name=r.KHR_MATERIALS_TRANSMISSION}n.prototype.loadLight=function(e){var t,r=this.lightDefs[e],a=new o.Color(16777215);void 0!==r.color&&a.fromArray(r.color);var n=void 0!==r.range?r.range:0;switch(r.type){case"directional":(t=new o.DirectionalLight(a)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new o.PointLight(a)).distance=n;break;case"spot":(t=new o.SpotLight(a)).distance=n,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,t.angle=r.spot.outerConeAngle,t.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==r.intensity&&(t.intensity=r.intensity),t.name=r.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return o.MeshBasicMaterial},s.prototype.extendParams=function(e,t,r){var a=[];e.color=new o.Color(1,1,1),e.opacity=1;var n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){var s=n.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==n.baseColorTexture&&a.push(r.assignTexture(e,"map",n.baseColorTexture))}return Promise.all(a)},i.prototype.getMaterialType=function(){return o.MeshPhysicalMaterial},i.prototype.extendParams=function(e,t,r){var a=[],n=t.extensions[this.name];if(void 0!==n.clearcoatFactor&&(e.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&a.push(r.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&a.push(r.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(a.push(r.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale)){var s=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new o.Vector2(s,s)}return Promise.all(a)},c.prototype.getMaterialType=function(){return o.MeshPhysicalMaterial},c.prototype.extendParams=function(e,t,r){var a=t.extensions[this.name];return void 0!==a.transmissionFactor&&(e.premultipliedAlpha=!0,e.transparent=!0,e.opacity=1,e.transparency=a.transmissionFactor,(e.map||e.color.r*e.color.g*e.color.b<.99)&&(e.transparency*=.75)),Promise.all([])};var l="glTF",u=12,d={JSON:1313821514,BIN:5130562};function p(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,u);if(this.header={magic:o.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=new DataView(e,u),n=0;n<a.byteLength;){var s=a.getUint32(n,!0);n+=4;var i=a.getUint32(n,!0);if(n+=4,i===d.JSON){var c=new Uint8Array(e,u+n,s);this.content=o.LoaderUtils.decodeText(c)}else if(i===d.BIN){var p=u+n;this.body=e.slice(p,p+s)}n+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function h(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=r.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function f(){this.name=r.KHR_TEXTURE_TRANSFORM}function m(e){o.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),r=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),a=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),n=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new o.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var o in i)e.uniforms[o]=i[o];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function g(){return{name:r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,r){var a=t.extensions[this.name];e.color=new o.Color(1,1,1),e.opacity=1;var n=[];if(Array.isArray(a.diffuseFactor)){var s=a.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==a.diffuseTexture&&n.push(r.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new o.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new o.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var i=a.specularGlossinessTexture;n.push(r.assignTexture(e,"glossinessMap",i)),n.push(r.assignTexture(e,"specularMap",i))}return Promise.all(n)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=o.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function v(){this.name=r.KHR_MESH_QUANTIZATION}function y(e,t,r,a){o.Interpolant.call(this,e,t,r,a)}h.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,o=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,s={},i={},c={};for(var l in n){var u=S[l]||l.toLowerCase();s[u]=n[l]}for(l in e.attributes)if(u=S[l]||l.toLowerCase(),void 0!==n[l]){var d=r.accessors[e.attributes[l]],p=T[d.componentType];c[u]=p,i[u]=!0===d.normalized}return t.getDependency("bufferView",o).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var r in e.attributes){var a=e.attributes[r],o=i[r];void 0!==o&&(a.normalized=o)}t(e)}),s,c)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(o.MeshStandardMaterial.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return o.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(o.Interpolant.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=e*a*3+a,n=0;n!==a;n++)t[n]=r[o+n];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,r,a){for(var o=this.resultBuffer,n=this.sampleValues,s=this.valueSize,i=2*s,c=3*s,l=a-t,u=(r-t)/l,d=u*u,p=d*u,h=e*c,f=h-c,m=-2*p+3*d,g=p-d,v=1-m,y=g-d+u,T=0;T!==s;T++){var M=n[f+T+s],R=n[f+T+i]*l,A=n[h+T+s],S=n[h+T]*l;o[T]=v*M+y*R+m*A+g*S}return o};var T={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},M={9728:o.NearestFilter,9729:o.LinearFilter,9984:o.NearestMipmapNearestFilter,9985:o.LinearMipmapNearestFilter,9986:o.NearestMipmapLinearFilter,9987:o.LinearMipmapLinearFilter},R={33071:o.ClampToEdgeWrapping,33648:o.MirroredRepeatWrapping,10497:o.RepeatWrapping},A={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},S={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},b={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},w={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete},L={"image/png":o.RGBAFormat,"image/jpeg":o.RGBFormat};function _(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function E(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function x(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function I(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var o=t.extras.targetNames;if(e.morphTargetInfluences.length===o.length)for(e.morphTargetDictionary={},r=0,a=o.length;r<a;r++)e.morphTargetDictionary[o[r]]=r;else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function C(e){for(var t="",r=Object.keys(e).sort(),a=0,o=r.length;a<o;a++)t+=r[a]+":"+e[r[a]]+";";return t}function D(e,r,a){this.json=e||{},this.extensions=r||{},this.options=a||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.textureLoader=new o.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new o.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function P(e,t,r){var a=t.attributes,n=[];function s(t,a){return r.getDependency("accessor",t).then((function(t){e.setAttribute(a,t)}))}for(var i in a){var c=S[i]||i.toLowerCase();c in e.attributes||n.push(s(a[i],c))}if(void 0!==t.indices&&!e.index){var l=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));n.push(l)}return x(e,t),function(e,t,r){var a=t.attributes,n=new o.Box3;if(void 0!==a.POSITION){var s=(h=r.json.accessors[a.POSITION]).min,i=h.max;if(void 0!==s&&void 0!==i){n.set(new o.Vector3(s[0],s[1],s[2]),new o.Vector3(i[0],i[1],i[2]));var c=t.targets;if(void 0!==c){for(var l=new o.Vector3,u=new o.Vector3,d=0,p=c.length;d<p;d++){var h,f=c[d];void 0!==f.POSITION&&(s=(h=r.json.accessors[f.POSITION]).min,i=h.max,void 0!==s&&void 0!==i?(u.setX(Math.max(Math.abs(s[0]),Math.abs(i[0]))),u.setY(Math.max(Math.abs(s[1]),Math.abs(i[1]))),u.setZ(Math.max(Math.abs(s[2]),Math.abs(i[2]))),l.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}n.expandByVector(l)}e.boundingBox=n;var m=new o.Sphere;n.getCenter(m.center),m.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,r),Promise.all(n).then((function(){return void 0!==t.targets?function(e,t,r){for(var a=!1,o=!1,n=0,s=t.length;n<s&&(void 0!==(l=t[n]).POSITION&&(a=!0),void 0!==l.NORMAL&&(o=!0),!a||!o);n++);if(!a&&!o)return Promise.resolve(e);var i=[],c=[];for(n=0,s=t.length;n<s;n++){var l=t[n];if(a){var u=void 0!==l.POSITION?r.getDependency("accessor",l.POSITION):e.attributes.position;i.push(u)}o&&(u=void 0!==l.NORMAL?r.getDependency("accessor",l.NORMAL):e.attributes.normal,c.push(u))}return Promise.all([Promise.all(i),Promise.all(c)]).then((function(t){var r=t[0],n=t[1];return a&&(e.morphAttributes.position=r),o&&(e.morphAttributes.normal=n),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}function O(e,t){var r=e.getIndex();if(null===r){var a=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var s=0;s<n.count;s++)a.push(s);e.setIndex(a),r=e.getIndex()}var i=r.count-2,c=[];if(t===o.TriangleFanDrawMode)for(s=1;s<=i;s++)c.push(r.getX(0)),c.push(r.getX(s)),c.push(r.getX(s+1));else for(s=0;s<i;s++)s%2==0?(c.push(r.getX(s)),c.push(r.getX(s+1)),c.push(r.getX(s+2))):(c.push(r.getX(s+2)),c.push(r.getX(s+1)),c.push(r.getX(s)));c.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=e.clone();return l.setIndex(c),l}return D.prototype.parse=function(e,t){var r=this,a=this.json,o=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var n={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};E(o,n,a),x(n,a),e(n)})).catch(t)},D.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},o={},n=0,s=t.length;n<s;n++)for(var i=t[n].joints,c=0,l=i.length;c<l;c++)e[i[c]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var p=e[u];void 0!==p.mesh&&(void 0===a[p.mesh]&&(a[p.mesh]=o[p.mesh]=0),a[p.mesh]++,void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=o},D.prototype.getDependency=function(e,t){var a=e+":"+t,o=this.cache.get(a);if(!o){switch(e){case"scene":o=this.loadScene(t);break;case"node":o=this.loadNode(t);break;case"mesh":o=this.loadMesh(t);break;case"accessor":o=this.loadAccessor(t);break;case"bufferView":o=this.loadBufferView(t);break;case"buffer":o=this.loadBuffer(t);break;case"material":o=this.loadMaterial(t);break;case"texture":o=this.loadTexture(t);break;case"skin":o=this.loadSkin(t);break;case"animation":o=this.loadAnimation(t);break;case"camera":o=this.loadCamera(t);break;case"light":o=this.extensions[r.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(a,o)}return o},D.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map((function(t,a){return r.getDependency(e,a)}))),this.cache.add(e,t)}return t},D.prototype.loadBuffer=function(e){var t=this.json.buffers[e],a=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[r.KHR_BINARY_GLTF].body);var o=this.options;return new Promise((function(e,r){a.load(_(t.uri,o.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},D.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)}))},D.prototype.loadAccessor=function(e){var t=this,r=this.json,a=this.json.accessors[e];if(void 0===a.bufferView&&void 0===a.sparse)return Promise.resolve(null);var n=[];return void 0!==a.bufferView?n.push(this.getDependency("bufferView",a.bufferView)):n.push(null),void 0!==a.sparse&&(n.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(n).then((function(e){var n,s,i=e[0],c=A[a.type],l=T[a.componentType],u=l.BYTES_PER_ELEMENT,d=u*c,p=a.byteOffset||0,h=void 0!==a.bufferView?r.bufferViews[a.bufferView].byteStride:void 0,f=!0===a.normalized;if(h&&h!==d){var m=Math.floor(p/h),g="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+m+":"+a.count,v=t.cache.get(g);v||(n=new l(i,m*h,a.count*h/u),v=new o.InterleavedBuffer(n,h/u),t.cache.add(g,v)),s=new o.InterleavedBufferAttribute(v,c,p%h/u,f)}else n=null===i?new l(a.count*c):new l(i,p,a.count*c),s=new o.BufferAttribute(n,c,f);if(void 0!==a.sparse){var y=A.SCALAR,M=T[a.sparse.indices.componentType],R=a.sparse.indices.byteOffset||0,S=a.sparse.values.byteOffset||0,b=new M(e[1],R,a.sparse.count*y),w=new l(e[2],S,a.sparse.count*c);null!==i&&(s=new o.BufferAttribute(s.array.slice(),s.itemSize,s.normalized));for(var L=0,_=b.length;L<_;L++){var E=b[L];if(s.setX(E,w[L*c]),c>=2&&s.setY(E,w[L*c+1]),c>=3&&s.setZ(E,w[L*c+2]),c>=4&&s.setW(E,w[L*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))},D.prototype.loadTexture=function(e){var t,a=this,n=this.json,s=this.options,i=this.textureLoader,c=self.URL||self.webkitURL,l=n.textures[e],u=l.extensions||{},d=(t=u[r.MSFT_TEXTURE_DDS]?n.images[u[r.MSFT_TEXTURE_DDS].source]:n.images[l.source]).uri,p=!1;return void 0!==t.bufferView&&(d=a.getDependency("bufferView",t.bufferView).then((function(e){p=!0;var r=new Blob([e],{type:t.mimeType});return d=c.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=s.manager.getHandler(e);return t||(t=u[r.MSFT_TEXTURE_DDS]?a.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:i),new Promise((function(r,a){t.load(_(e,s.path),r,void 0,a)}))})).then((function(r){!0===p&&c.revokeObjectURL(d),r.flipY=!1,l.name&&(r.name=l.name),t.mimeType in L&&(r.format=L[t.mimeType]);var s=(n.samplers||{})[l.sampler]||{};return r.magFilter=M[s.magFilter]||o.LinearFilter,r.minFilter=M[s.minFilter]||o.LinearMipmapLinearFilter,r.wrapS=R[s.wrapS]||o.RepeatWrapping,r.wrapT=R[s.wrapT]||o.RepeatWrapping,a.associations.set(r,{type:"textures",index:e}),r}))},D.prototype.assignTexture=function(e,t,a){var n=this;return this.getDependency("texture",a.index).then((function(s){if(!s.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=o.RGBFormat}if(void 0===a.texCoord||0==a.texCoord||"aoMap"===t&&1==a.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+a.texCoord+" for texture "+t+" not yet supported."),n.extensions[r.KHR_TEXTURE_TRANSFORM]){var i=void 0!==a.extensions?a.extensions[r.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var c=this.associations.get(s);s=n.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(s,i),this.associations.set(s,c)}}e[t]=s}))},D.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,a=void 0!==t.attributes.tangent,n=void 0!==t.attributes.color,s=void 0===t.attributes.normal,i=!0===e.isSkinnedMesh,c=Object.keys(t.morphAttributes).length>0,l=c&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+r.uuid,d=this.cache.get(u);d||(d=new o.PointsMaterial,o.Material.prototype.copy.call(d,r),d.color.copy(r.color),d.map=r.map,d.sizeAttenuation=!1,this.cache.add(u,d)),r=d}else if(e.isLine){u="LineBasicMaterial:"+r.uuid;var p=this.cache.get(u);p||(p=new o.LineBasicMaterial,o.Material.prototype.copy.call(p,r),p.color.copy(r.color),this.cache.add(u,p)),r=p}if(a||n||s||i||c){u="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),a&&(u+="vertex-tangents:"),n&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),c&&(u+="morph-targets:"),l&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=r.clone(),i&&(h.skinning=!0),a&&(h.vertexTangents=!0),n&&(h.vertexColors=!0),s&&(h.flatShading=!0),c&&(h.morphTargets=!0),l&&(h.morphNormals=!0),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),r.normalScale&&!a&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!a&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),e.material=r},D.prototype.loadMaterial=function(e){var t,a=this,n=this.json,s=this.extensions,i=n.materials[e],c={},l=i.extensions||{},u=[];if(l[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=d.getMaterialType(),u.push(d.extendParams(c,i,a))}else if(l[r.KHR_MATERIALS_UNLIT]){var p=s[r.KHR_MATERIALS_UNLIT];t=p.getMaterialType(),u.push(p.extendParams(c,i,a))}else{t=o.MeshStandardMaterial;var h=i.pbrMetallicRoughness||{};if(c.color=new o.Color(1,1,1),c.opacity=1,Array.isArray(h.baseColorFactor)){var f=h.baseColorFactor;c.color.fromArray(f),c.opacity=f[3]}void 0!==h.baseColorTexture&&u.push(a.assignTexture(c,"map",h.baseColorTexture)),c.metalness=void 0!==h.metallicFactor?h.metallicFactor:1,c.roughness=void 0!==h.roughnessFactor?h.roughnessFactor:1,void 0!==h.metallicRoughnessTexture&&(u.push(a.assignTexture(c,"metalnessMap",h.metallicRoughnessTexture)),u.push(a.assignTexture(c,"roughnessMap",h.metallicRoughnessTexture)))}!0===i.doubleSided&&(c.side=o.DoubleSide);var g=i.alphaMode||"OPAQUE";if("BLEND"===g?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,"MASK"===g&&(c.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(u.push(a.assignTexture(c,"normalMap",i.normalTexture)),c.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale&&c.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(u.push(a.assignTexture(c,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(c.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial&&(c.emissive=(new o.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&u.push(a.assignTexture(c,"emissiveMap",i.emissiveTexture)),l[r.KHR_MATERIALS_CLEARCOAT]){var v=s[r.KHR_MATERIALS_CLEARCOAT];t=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},a))}return l[r.KHR_MATERIALS_TRANSMISSION]&&(v=s[r.KHR_MATERIALS_TRANSMISSION],t=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},a))),Promise.all(u).then((function(){var n;return n=t===m?s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(c):new t(c),i.name&&(n.name=i.name),n.map&&(n.map.encoding=o.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=o.sRGBEncoding),x(n,i),a.associations.set(n,{type:"materials",index:e}),i.extensions&&E(s,n,i),n}))},D.prototype.loadGeometries=function(e){var t=this,a=this.extensions,n=this.primitiveCache;function s(e){return a[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return P(r,e,t)}))}for(var i,c,l=[],u=0,d=e.length;u<d;u++){var p,h=e[u],f=(void 0,(c=(i=h).extensions&&i.extensions[r.KHR_DRACO_MESH_COMPRESSION])?"draco:"+c.bufferView+":"+c.indices+":"+C(c.attributes):i.indices+":"+C(i.attributes)+":"+i.mode),m=n[f];m?l.push(m.promise):(p=h.extensions&&h.extensions[r.KHR_DRACO_MESH_COMPRESSION]?s(h):P(new o.BufferGeometry,h,t),n[f]={primitive:h,promise:p},l.push(p))}return Promise.all(l)},D.prototype.loadMesh=function(e){for(var t,r=this,a=this.json.meshes[e],n=a.primitives,s=[],i=0,c=n.length;i<c;i++){var l=void 0===n[i].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new o.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:o.FrontSide})),t.DefaultMaterial):this.getDependency("material",n[i].material);s.push(l)}return s.push(r.loadGeometries(n)),Promise.all(s).then((function(t){for(var s=t.slice(0,t.length-1),i=t[t.length-1],c=[],l=0,u=i.length;l<u;l++){var d,p=i[l],h=n[l],f=s[l];if(4===h.mode||5===h.mode||6===h.mode||void 0===h.mode)!0!==(d=!0===a.isSkinnedMesh?new o.SkinnedMesh(p,f):new o.Mesh(p,f)).isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),5===h.mode?d.geometry=O(d.geometry,o.TriangleStripDrawMode):6===h.mode&&(d.geometry=O(d.geometry,o.TriangleFanDrawMode));else if(1===h.mode)d=new o.LineSegments(p,f);else if(3===h.mode)d=new o.Line(p,f);else if(2===h.mode)d=new o.LineLoop(p,f);else{if(0!==h.mode)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new o.Points(p,f)}Object.keys(d.geometry.morphAttributes).length>0&&I(d,a),d.name=a.name||"mesh_"+e,i.length>1&&(d.name+="_"+l),x(d,a),r.assignFinalMaterial(d),c.push(d)}if(1===c.length)return c[0];var m=new o.Group;for(l=0,u=c.length;l<u;l++)m.add(c[l]);return m}))},D.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],a=r[r.type];if(a)return"perspective"===r.type?t=new o.PerspectiveCamera(o.MathUtils.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):"orthographic"===r.type&&(t=new o.OrthographicCamera(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),r.name&&(t.name=r.name),x(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},D.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},D.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],r=[],a=[],n=[],s=[],i=[],c=0,l=t.channels.length;c<l;c++){var u=t.channels[c],d=t.samplers[u.sampler],p=u.target,h=void 0!==p.node?p.node:p.id,f=void 0!==t.parameters?t.parameters[d.input]:d.input,m=void 0!==t.parameters?t.parameters[d.output]:d.output;r.push(this.getDependency("node",h)),a.push(this.getDependency("accessor",f)),n.push(this.getDependency("accessor",m)),s.push(d),i.push(p)}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(n),Promise.all(s),Promise.all(i)]).then((function(r){for(var a=r[0],n=r[1],s=r[2],i=r[3],c=r[4],l=[],u=0,d=a.length;u<d;u++){var p=a[u],h=n[u],f=s[u],m=i[u],g=c[u];if(void 0!==p){var v;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,b[g.path]){case b.weights:v=o.NumberKeyframeTrack;break;case b.rotation:v=o.QuaternionKeyframeTrack;break;default:v=o.VectorKeyframeTrack}var T=p.name?p.name:p.uuid,M=void 0!==m.interpolation?w[m.interpolation]:o.InterpolateLinear,R=[];b[g.path]===b.weights?p.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&R.push(e.name?e.name:e.uuid)})):R.push(T);var A=f.array;if(f.normalized){var S;if(A.constructor===Int8Array)S=1/127;else if(A.constructor===Uint8Array)S=1/255;else if(A.constructor==Int16Array)S=1/32767;else{if(A.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");S=1/65535}for(var L=new Float32Array(A.length),_=0,E=A.length;_<E;_++)L[_]=A[_]*S;A=L}for(_=0,E=R.length;_<E;_++){var x=new v(R[_]+"."+b[g.path],h.array,A,M);"CUBICSPLINE"===m.interpolation&&(x.createInterpolant=function(e){return new y(this.times,this.values,this.getValueSize()/3,e)},x.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(x)}}}var I=t.name?t.name:"animation_"+e;return new o.AnimationClip(I,void 0,l)}))},D.prototype.loadNode=function(e){var t,a=this.json,n=this.extensions,s=this,i=a.meshReferences,c=a.meshUses,l=a.nodes[e];return(t=[],void 0!==l.mesh&&t.push(s.getDependency("mesh",l.mesh).then((function(e){var t;if(i[l.mesh]>1){var r=c[l.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==l.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=l.weights.length;t<r;t++)e.morphTargetInfluences[t]=l.weights[t]})),t}))),void 0!==l.camera&&t.push(s.getDependency("camera",l.camera)),l.extensions&&l.extensions[r.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[r.KHR_LIGHTS_PUNCTUAL].light&&t.push(s.getDependency("light",l.extensions[r.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t)).then((function(t){var r;if((r=!0===l.isBone?new o.Bone:t.length>1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(var a=0,i=t.length;a<i;a++)r.add(t[a]);if(l.name&&(r.userData.name=l.name,r.name=o.PropertyBinding.sanitizeNodeName(l.name)),x(r,l),l.extensions&&E(n,r,l),void 0!==l.matrix){var c=new o.Matrix4;c.fromArray(l.matrix),r.applyMatrix4(c)}else void 0!==l.translation&&r.position.fromArray(l.translation),void 0!==l.rotation&&r.quaternion.fromArray(l.rotation),void 0!==l.scale&&r.scale.fromArray(l.scale);return s.associations.set(r,{type:"nodes",index:e}),r}))},D.prototype.loadScene=function(){function e(t,r,a,n){var s=a.nodes[t];return n.getDependency("node",t).then((function(e){return void 0===s.skin?e:n.getDependency("skin",s.skin).then((function(e){for(var r=[],a=0,o=(t=e).joints.length;a<o;a++)r.push(n.getDependency("node",t.joints[a]));return Promise.all(r)})).then((function(r){return e.traverse((function(e){if(e.isMesh){for(var a=[],n=[],s=0,i=r.length;s<i;s++){var c=r[s];if(c){a.push(c);var l=new o.Matrix4;void 0!==t.inverseBindMatrices&&l.fromArray(t.inverseBindMatrices.array,16*s),n.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}e.bind(new o.Skeleton(a,n),e.matrixWorld)}})),e}));var t})).then((function(t){r.add(t);var o=[];if(s.children)for(var i=s.children,c=0,l=i.length;c<l;c++){var u=i[c];o.push(e(u,t,a,n))}return Promise.all(o)}))}return function(t){var r=this.json,a=this.extensions,n=this.json.scenes[t],s=new o.Group;n.name&&(s.name=n.name),x(s,n),n.extensions&&E(a,s,n);for(var i=n.nodes||[],c=[],l=0,u=i.length;l<u;l++)c.push(e(i[l],s,r,this));return Promise.all(c).then((function(){return s}))}}(),e}(),s=function(e){o.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};s.prototype=Object.assign(Object.create(o.Loader.prototype),{constructor:s,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,r,a){var n=new o.FileLoader(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&n.setWithCredentials(!0),n.load(e,(e=>{var r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)}),r,a)},decodeDracoFile:function(e,t,r,a){var o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,o).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var a=t.attributeTypes[r];void 0!==a.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=a.name)}var o,n=JSON.stringify(t);if(s.taskCache.has(e)){var i=s.taskCache.get(e);if(i.key===n)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var c=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(c,l).then((r=>(o=r,new Promise(((r,a)=>{o._callbacks[c]={resolve:r,reject:a},o.postMessage({type:"decode",id:c,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{o&&c&&this._releaseTask(o,c)})),s.taskCache.set(e,{key:n,promise:u}),u},_createGeometry:function(e){var t=new o.BufferGeometry;e.index&&t.setIndex(new o.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var a=e.attributes[r],n=a.name,s=a.array,i=a.itemSize;t.setAttribute(n,new o.BufferAttribute(s,i))}return t},_loadLibrary:function(e,t){var r=new o.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),new Promise(((t,a)=>{r.load(e,t,void 0,a)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var a=s.DRACOWorker.toString(),o=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([o]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;return this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1})),(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),s.DRACOWorker=function(){var e,t;function r(e,t,r,a,o,n){var s,i,c=n.num_components(),l=r.num_points()*c;switch(o){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,n,s),i=new Float32Array(l);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,n,s),i=new Int8Array(l);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,n,s),i=new Int16Array(l);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,n,s),i=new Int32Array(l);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,n,s),i=new Uint8Array(l);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,n,s),i=new Uint16Array(l);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,n,s),i=new Uint32Array(l);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<l;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:a,array:i,itemSize:c}}onmessage=function(a){var o=a.data;switch(o.type){case"init":e=o.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var n=o.buffer,s=o.taskConfig;t.then((e=>{var t=e.draco,a=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(n),n.byteLength);try{var c=function(e,t,a,o){var n,s,i=o.attributeIDs,c=o.attributeTypes,l=t.GetEncodedGeometryType(a);if(l===e.TRIANGULAR_MESH)n=new e.Mesh,s=t.DecodeBufferToMesh(a,n);else{if(l!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");n=new e.PointCloud,s=t.DecodeBufferToPointCloud(a,n)}if(!s.ok()||0===n.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var d in i){var p,h,f=self[c[d]];if(o.useUniqueIDs)h=i[d],p=t.GetAttributeByUniqueId(n,h);else{if(-1===(h=t.GetAttributeId(n,e[i[d]])))continue;p=t.GetAttribute(n,h)}u.attributes.push(r(e,t,n,d,f,p))}if(l===e.TRIANGULAR_MESH){for(var m=n.num_faces(),g=new Uint32Array(3*m),v=new e.DracoInt32Array,y=0;y<m;++y){t.GetFaceFromMesh(n,y,v);for(var T=0;T<3;++T)g[3*y+T]=v.GetValue(T)}u.index={array:g,itemSize:1},e.destroy(v)}return e.destroy(n),u}(t,a,i,s),l=c.attributes.map((e=>e.array.buffer));c.index&&l.push(c.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:c},l)}catch(e){console.error(e),self.postMessage({type:"error",id:o.id,error:e.message})}finally{t.destroy(i),t.destroy(a)}}))}}},s.taskCache=new WeakMap,s.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},s.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},s.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},s.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var i=function(e){o.CompressedTextureLoader.call(this,e)};i.prototype=Object.assign(Object.create(o.CompressedTextureLoader.prototype),{constructor:i,parse:function(e,t){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function n(e,t,r,a){for(var o=r*a*4,n=new Uint8Array(e,t,o),s=new Uint8Array(o),i=0,c=0,l=0;l<a;l++)for(var u=0;u<r;u++){var d=n[c],p=n[++c],h=n[++c],f=n[++c];c++,s[i]=h,s[++i]=p,s[++i]=d,s[++i]=f,i++}return s}var s,i=a("DXT1"),c=a("DXT3"),l=a("DXT5"),u=a("ETC1"),d=new Int32Array(e,0,31);if(542327876!==d[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),r;if(4&!d[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),r;var p,h=d[21],f=!1;switch(h){case i:s=8,r.format=o.RGB_S3TC_DXT1_Format;break;case c:s=16,r.format=o.RGBA_S3TC_DXT3_Format;break;case l:s=16,r.format=o.RGBA_S3TC_DXT5_Format;break;case u:s=8,r.format=o.RGB_ETC1_Format;break;default:if(!(32===d[22]&&16711680&d[23]&&65280&d[24]&&255&d[25]&&4278190080&d[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(p=h,String.fromCharCode(255&p,p>>8&255,p>>16&255,p>>24&255))),r;f=!0,s=64,r.format=o.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var g=d[1]+4,v=r.isCubemap?6:1,y=0;y<v;y++)for(var T=r.width,M=r.height,R=0;R<r.mipmapCount;R++){if(f)var A=(S=n(e,g,T,M)).length;else{A=Math.max(4,T)/4*Math.max(4,M)/4*s;var S=new Uint8Array(e,g,A)}var b={data:S,width:T,height:M};r.mipmaps.push(b),g+=A,T=Math.max(T>>1,1),M=Math.max(M>>1,1)}return r}});var c=function(e){function r(t){var r=e.call(this)||this;return r.needsRender=!0,t&&t.children.length&&r.add.apply(r,t.children),r.mixer=new o.AnimationMixer(r),r}return t(r,e),r.prototype.clone=function(){var t=e.prototype.clone.call(this,!0),r=new o.AnimationMixer(t);return t.mixer=r,t.needsRender=!0,t},r}(o.Group),l=function(e){function r(t){var r=e.call(this,t)||this;return r.ddsLoader=new i(t),r.dracoLoader=new s(t),r.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/"),r}return t(r,e),Object.defineProperty(r,"version",{get:function(){return"6.0.0-alpha.30"},enumerable:!1,configurable:!0}),r.prototype.load=function(t,r,a,o){return e.prototype.load.call(this,t,r,a,o)},r.prototype.parse=function(t,r,a,o){return e.prototype.parse.call(this,t,r,(function(e){var t=new c(e.scene),r=e.scenes.map((function(r){return r===e.scene?t:new c(r)}));a(Object.assign(e,{scene:t,scenes:r}))}),o)},r}(n)})(),a})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_GLTFLoader=t():e.FiveSDK_GLTFLoader=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";r.r(a),r.d(a,{DDSLoader:()=>i,DRACOLoader:()=>s,GLTFLoader:()=>l,GLTFObject:()=>c,THREEGLTFLoader:()=>n});var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}Object.create,Object.create;var o=r(438),n=function(){function e(e){o.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(o.Loader.prototype),{constructor:e,load:function(e,t,r,a){var n,s=this;n=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:o.LoaderUtils.extractUrlBase(e),s.manager.itemStart(e);var i=function(t){a?a(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},c=new o.FileLoader(s.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&c.setWithCredentials(!0),c.load(e,(function(r){try{s.parse(r,n,(function(r){t(r),s.manager.itemEnd(e)}),i)}catch(e){i(e)}}),r,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,u,d){var m,y={};if("string"==typeof e)m=e;else if(o.LoaderUtils.decodeText(new Uint8Array(e,0,4))===l){try{y[r.KHR_BINARY_GLTF]=new p(e)}catch(e){return void(d&&d(e))}m=y[r.KHR_BINARY_GLTF].content}else m=o.LoaderUtils.decodeText(new Uint8Array(e));var T=JSON.parse(m);if(void 0===T.asset||T.asset.version[0]<2)d&&d(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(T.extensionsUsed)for(var M=0;M<T.extensionsUsed.length;++M){var R=T.extensionsUsed[M],A=T.extensionsRequired||[];switch(R){case r.KHR_LIGHTS_PUNCTUAL:y[R]=new n(T);break;case r.KHR_MATERIALS_CLEARCOAT:y[R]=new i;break;case r.KHR_MATERIALS_TRANSMISSION:y[R]=new c;break;case r.KHR_MATERIALS_UNLIT:y[R]=new s;break;case r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:y[R]=new g;break;case r.KHR_DRACO_MESH_COMPRESSION:y[R]=new h(T,this.dracoLoader);break;case r.MSFT_TEXTURE_DDS:y[R]=new a(this.ddsLoader);break;case r.KHR_TEXTURE_TRANSFORM:y[R]=new f;break;case r.KHR_MESH_QUANTIZATION:y[R]=new v;break;default:A.indexOf(R)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+R+'".')}}var S=new D(T,y,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});S.fileLoader.setRequestHeader(this.requestHeader),S.parse(u,d)}}});var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function a(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=e}function n(e){this.name=r.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[r.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=r.KHR_MATERIALS_UNLIT}function i(){this.name=r.KHR_MATERIALS_CLEARCOAT}function c(){this.name=r.KHR_MATERIALS_TRANSMISSION}n.prototype.loadLight=function(e){var t,r=this.lightDefs[e],a=new o.Color(16777215);void 0!==r.color&&a.fromArray(r.color);var n=void 0!==r.range?r.range:0;switch(r.type){case"directional":(t=new o.DirectionalLight(a)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new o.PointLight(a)).distance=n;break;case"spot":(t=new o.SpotLight(a)).distance=n,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,t.angle=r.spot.outerConeAngle,t.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==r.intensity&&(t.intensity=r.intensity),t.name=r.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return o.MeshBasicMaterial},s.prototype.extendParams=function(e,t,r){var a=[];e.color=new o.Color(1,1,1),e.opacity=1;var n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){var s=n.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==n.baseColorTexture&&a.push(r.assignTexture(e,"map",n.baseColorTexture))}return Promise.all(a)},i.prototype.getMaterialType=function(){return o.MeshPhysicalMaterial},i.prototype.extendParams=function(e,t,r){var a=[],n=t.extensions[this.name];if(void 0!==n.clearcoatFactor&&(e.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&a.push(r.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&a.push(r.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(a.push(r.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale)){var s=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new o.Vector2(s,s)}return Promise.all(a)},c.prototype.getMaterialType=function(){return o.MeshPhysicalMaterial},c.prototype.extendParams=function(e,t,r){var a=t.extensions[this.name];return void 0!==a.transmissionFactor&&(e.premultipliedAlpha=!0,e.transparent=!0,e.opacity=1,e.transparency=a.transmissionFactor,(e.map||e.color.r*e.color.g*e.color.b<.99)&&(e.transparency*=.75)),Promise.all([])};var l="glTF",u=12,d={JSON:1313821514,BIN:5130562};function p(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,u);if(this.header={magic:o.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=new DataView(e,u),n=0;n<a.byteLength;){var s=a.getUint32(n,!0);n+=4;var i=a.getUint32(n,!0);if(n+=4,i===d.JSON){var c=new Uint8Array(e,u+n,s);this.content=o.LoaderUtils.decodeText(c)}else if(i===d.BIN){var p=u+n;this.body=e.slice(p,p+s)}n+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function h(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=r.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function f(){this.name=r.KHR_TEXTURE_TRANSFORM}function m(e){o.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),r=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),a=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),n=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new o.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var o in i)e.uniforms[o]=i[o];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function g(){return{name:r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,r){var a=t.extensions[this.name];e.color=new o.Color(1,1,1),e.opacity=1;var n=[];if(Array.isArray(a.diffuseFactor)){var s=a.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==a.diffuseTexture&&n.push(r.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new o.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new o.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var i=a.specularGlossinessTexture;n.push(r.assignTexture(e,"glossinessMap",i)),n.push(r.assignTexture(e,"specularMap",i))}return Promise.all(n)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=o.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function v(){this.name=r.KHR_MESH_QUANTIZATION}function y(e,t,r,a){o.Interpolant.call(this,e,t,r,a)}h.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,o=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,s={},i={},c={};for(var l in n){var u=S[l]||l.toLowerCase();s[u]=n[l]}for(l in e.attributes)if(u=S[l]||l.toLowerCase(),void 0!==n[l]){var d=r.accessors[e.attributes[l]],p=T[d.componentType];c[u]=p,i[u]=!0===d.normalized}return t.getDependency("bufferView",o).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var r in e.attributes){var a=e.attributes[r],o=i[r];void 0!==o&&(a.normalized=o)}t(e)}),s,c)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(o.MeshStandardMaterial.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return o.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(o.Interpolant.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=e*a*3+a,n=0;n!==a;n++)t[n]=r[o+n];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,r,a){for(var o=this.resultBuffer,n=this.sampleValues,s=this.valueSize,i=2*s,c=3*s,l=a-t,u=(r-t)/l,d=u*u,p=d*u,h=e*c,f=h-c,m=-2*p+3*d,g=p-d,v=1-m,y=g-d+u,T=0;T!==s;T++){var M=n[f+T+s],R=n[f+T+i]*l,A=n[h+T+s],S=n[h+T]*l;o[T]=v*M+y*R+m*A+g*S}return o};var T={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},M={9728:o.NearestFilter,9729:o.LinearFilter,9984:o.NearestMipmapNearestFilter,9985:o.LinearMipmapNearestFilter,9986:o.NearestMipmapLinearFilter,9987:o.LinearMipmapLinearFilter},R={33071:o.ClampToEdgeWrapping,33648:o.MirroredRepeatWrapping,10497:o.RepeatWrapping},A={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},S={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},b={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},w={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete},L={"image/png":o.RGBAFormat,"image/jpeg":o.RGBFormat};function _(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function E(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function x(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function I(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var o=t.extras.targetNames;if(e.morphTargetInfluences.length===o.length)for(e.morphTargetDictionary={},r=0,a=o.length;r<a;r++)e.morphTargetDictionary[o[r]]=r;else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function C(e){for(var t="",r=Object.keys(e).sort(),a=0,o=r.length;a<o;a++)t+=r[a]+":"+e[r[a]]+";";return t}function D(e,r,a){this.json=e||{},this.extensions=r||{},this.options=a||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.textureLoader=new o.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new o.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function P(e,t,r){var a=t.attributes,n=[];function s(t,a){return r.getDependency("accessor",t).then((function(t){e.setAttribute(a,t)}))}for(var i in a){var c=S[i]||i.toLowerCase();c in e.attributes||n.push(s(a[i],c))}if(void 0!==t.indices&&!e.index){var l=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));n.push(l)}return x(e,t),function(e,t,r){var a=t.attributes,n=new o.Box3;if(void 0!==a.POSITION){var s=(h=r.json.accessors[a.POSITION]).min,i=h.max;if(void 0!==s&&void 0!==i){n.set(new o.Vector3(s[0],s[1],s[2]),new o.Vector3(i[0],i[1],i[2]));var c=t.targets;if(void 0!==c){for(var l=new o.Vector3,u=new o.Vector3,d=0,p=c.length;d<p;d++){var h,f=c[d];void 0!==f.POSITION&&(s=(h=r.json.accessors[f.POSITION]).min,i=h.max,void 0!==s&&void 0!==i?(u.setX(Math.max(Math.abs(s[0]),Math.abs(i[0]))),u.setY(Math.max(Math.abs(s[1]),Math.abs(i[1]))),u.setZ(Math.max(Math.abs(s[2]),Math.abs(i[2]))),l.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}n.expandByVector(l)}e.boundingBox=n;var m=new o.Sphere;n.getCenter(m.center),m.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,r),Promise.all(n).then((function(){return void 0!==t.targets?function(e,t,r){for(var a=!1,o=!1,n=0,s=t.length;n<s&&(void 0!==(l=t[n]).POSITION&&(a=!0),void 0!==l.NORMAL&&(o=!0),!a||!o);n++);if(!a&&!o)return Promise.resolve(e);var i=[],c=[];for(n=0,s=t.length;n<s;n++){var l=t[n];if(a){var u=void 0!==l.POSITION?r.getDependency("accessor",l.POSITION):e.attributes.position;i.push(u)}o&&(u=void 0!==l.NORMAL?r.getDependency("accessor",l.NORMAL):e.attributes.normal,c.push(u))}return Promise.all([Promise.all(i),Promise.all(c)]).then((function(t){var r=t[0],n=t[1];return a&&(e.morphAttributes.position=r),o&&(e.morphAttributes.normal=n),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}function O(e,t){var r=e.getIndex();if(null===r){var a=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var s=0;s<n.count;s++)a.push(s);e.setIndex(a),r=e.getIndex()}var i=r.count-2,c=[];if(t===o.TriangleFanDrawMode)for(s=1;s<=i;s++)c.push(r.getX(0)),c.push(r.getX(s)),c.push(r.getX(s+1));else for(s=0;s<i;s++)s%2==0?(c.push(r.getX(s)),c.push(r.getX(s+1)),c.push(r.getX(s+2))):(c.push(r.getX(s+2)),c.push(r.getX(s+1)),c.push(r.getX(s)));c.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=e.clone();return l.setIndex(c),l}return D.prototype.parse=function(e,t){var r=this,a=this.json,o=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var n={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};E(o,n,a),x(n,a),e(n)})).catch(t)},D.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},o={},n=0,s=t.length;n<s;n++)for(var i=t[n].joints,c=0,l=i.length;c<l;c++)e[i[c]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var p=e[u];void 0!==p.mesh&&(void 0===a[p.mesh]&&(a[p.mesh]=o[p.mesh]=0),a[p.mesh]++,void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=o},D.prototype.getDependency=function(e,t){var a=e+":"+t,o=this.cache.get(a);if(!o){switch(e){case"scene":o=this.loadScene(t);break;case"node":o=this.loadNode(t);break;case"mesh":o=this.loadMesh(t);break;case"accessor":o=this.loadAccessor(t);break;case"bufferView":o=this.loadBufferView(t);break;case"buffer":o=this.loadBuffer(t);break;case"material":o=this.loadMaterial(t);break;case"texture":o=this.loadTexture(t);break;case"skin":o=this.loadSkin(t);break;case"animation":o=this.loadAnimation(t);break;case"camera":o=this.loadCamera(t);break;case"light":o=this.extensions[r.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(a,o)}return o},D.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map((function(t,a){return r.getDependency(e,a)}))),this.cache.add(e,t)}return t},D.prototype.loadBuffer=function(e){var t=this.json.buffers[e],a=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[r.KHR_BINARY_GLTF].body);var o=this.options;return new Promise((function(e,r){a.load(_(t.uri,o.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},D.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)}))},D.prototype.loadAccessor=function(e){var t=this,r=this.json,a=this.json.accessors[e];if(void 0===a.bufferView&&void 0===a.sparse)return Promise.resolve(null);var n=[];return void 0!==a.bufferView?n.push(this.getDependency("bufferView",a.bufferView)):n.push(null),void 0!==a.sparse&&(n.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(n).then((function(e){var n,s,i=e[0],c=A[a.type],l=T[a.componentType],u=l.BYTES_PER_ELEMENT,d=u*c,p=a.byteOffset||0,h=void 0!==a.bufferView?r.bufferViews[a.bufferView].byteStride:void 0,f=!0===a.normalized;if(h&&h!==d){var m=Math.floor(p/h),g="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+m+":"+a.count,v=t.cache.get(g);v||(n=new l(i,m*h,a.count*h/u),v=new o.InterleavedBuffer(n,h/u),t.cache.add(g,v)),s=new o.InterleavedBufferAttribute(v,c,p%h/u,f)}else n=null===i?new l(a.count*c):new l(i,p,a.count*c),s=new o.BufferAttribute(n,c,f);if(void 0!==a.sparse){var y=A.SCALAR,M=T[a.sparse.indices.componentType],R=a.sparse.indices.byteOffset||0,S=a.sparse.values.byteOffset||0,b=new M(e[1],R,a.sparse.count*y),w=new l(e[2],S,a.sparse.count*c);null!==i&&(s=new o.BufferAttribute(s.array.slice(),s.itemSize,s.normalized));for(var L=0,_=b.length;L<_;L++){var E=b[L];if(s.setX(E,w[L*c]),c>=2&&s.setY(E,w[L*c+1]),c>=3&&s.setZ(E,w[L*c+2]),c>=4&&s.setW(E,w[L*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))},D.prototype.loadTexture=function(e){var t,a=this,n=this.json,s=this.options,i=this.textureLoader,c=self.URL||self.webkitURL,l=n.textures[e],u=l.extensions||{},d=(t=u[r.MSFT_TEXTURE_DDS]?n.images[u[r.MSFT_TEXTURE_DDS].source]:n.images[l.source]).uri,p=!1;return void 0!==t.bufferView&&(d=a.getDependency("bufferView",t.bufferView).then((function(e){p=!0;var r=new Blob([e],{type:t.mimeType});return d=c.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=s.manager.getHandler(e);return t||(t=u[r.MSFT_TEXTURE_DDS]?a.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:i),new Promise((function(r,a){t.load(_(e,s.path),r,void 0,a)}))})).then((function(r){!0===p&&c.revokeObjectURL(d),r.flipY=!1,l.name&&(r.name=l.name),t.mimeType in L&&(r.format=L[t.mimeType]);var s=(n.samplers||{})[l.sampler]||{};return r.magFilter=M[s.magFilter]||o.LinearFilter,r.minFilter=M[s.minFilter]||o.LinearMipmapLinearFilter,r.wrapS=R[s.wrapS]||o.RepeatWrapping,r.wrapT=R[s.wrapT]||o.RepeatWrapping,a.associations.set(r,{type:"textures",index:e}),r}))},D.prototype.assignTexture=function(e,t,a){var n=this;return this.getDependency("texture",a.index).then((function(s){if(!s.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=o.RGBFormat}if(void 0===a.texCoord||0==a.texCoord||"aoMap"===t&&1==a.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+a.texCoord+" for texture "+t+" not yet supported."),n.extensions[r.KHR_TEXTURE_TRANSFORM]){var i=void 0!==a.extensions?a.extensions[r.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var c=this.associations.get(s);s=n.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(s,i),this.associations.set(s,c)}}e[t]=s}))},D.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,a=void 0!==t.attributes.tangent,n=void 0!==t.attributes.color,s=void 0===t.attributes.normal,i=!0===e.isSkinnedMesh,c=Object.keys(t.morphAttributes).length>0,l=c&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+r.uuid,d=this.cache.get(u);d||(d=new o.PointsMaterial,o.Material.prototype.copy.call(d,r),d.color.copy(r.color),d.map=r.map,d.sizeAttenuation=!1,this.cache.add(u,d)),r=d}else if(e.isLine){u="LineBasicMaterial:"+r.uuid;var p=this.cache.get(u);p||(p=new o.LineBasicMaterial,o.Material.prototype.copy.call(p,r),p.color.copy(r.color),this.cache.add(u,p)),r=p}if(a||n||s||i||c){u="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),a&&(u+="vertex-tangents:"),n&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),c&&(u+="morph-targets:"),l&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=r.clone(),i&&(h.skinning=!0),a&&(h.vertexTangents=!0),n&&(h.vertexColors=!0),s&&(h.flatShading=!0),c&&(h.morphTargets=!0),l&&(h.morphNormals=!0),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),r.normalScale&&!a&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!a&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),e.material=r},D.prototype.loadMaterial=function(e){var t,a=this,n=this.json,s=this.extensions,i=n.materials[e],c={},l=i.extensions||{},u=[];if(l[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=d.getMaterialType(),u.push(d.extendParams(c,i,a))}else if(l[r.KHR_MATERIALS_UNLIT]){var p=s[r.KHR_MATERIALS_UNLIT];t=p.getMaterialType(),u.push(p.extendParams(c,i,a))}else{t=o.MeshStandardMaterial;var h=i.pbrMetallicRoughness||{};if(c.color=new o.Color(1,1,1),c.opacity=1,Array.isArray(h.baseColorFactor)){var f=h.baseColorFactor;c.color.fromArray(f),c.opacity=f[3]}void 0!==h.baseColorTexture&&u.push(a.assignTexture(c,"map",h.baseColorTexture)),c.metalness=void 0!==h.metallicFactor?h.metallicFactor:1,c.roughness=void 0!==h.roughnessFactor?h.roughnessFactor:1,void 0!==h.metallicRoughnessTexture&&(u.push(a.assignTexture(c,"metalnessMap",h.metallicRoughnessTexture)),u.push(a.assignTexture(c,"roughnessMap",h.metallicRoughnessTexture)))}!0===i.doubleSided&&(c.side=o.DoubleSide);var g=i.alphaMode||"OPAQUE";if("BLEND"===g?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,"MASK"===g&&(c.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(u.push(a.assignTexture(c,"normalMap",i.normalTexture)),c.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale&&c.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(u.push(a.assignTexture(c,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(c.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial&&(c.emissive=(new o.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&u.push(a.assignTexture(c,"emissiveMap",i.emissiveTexture)),l[r.KHR_MATERIALS_CLEARCOAT]){var v=s[r.KHR_MATERIALS_CLEARCOAT];t=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},a))}return l[r.KHR_MATERIALS_TRANSMISSION]&&(v=s[r.KHR_MATERIALS_TRANSMISSION],t=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},a))),Promise.all(u).then((function(){var n;return n=t===m?s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(c):new t(c),i.name&&(n.name=i.name),n.map&&(n.map.encoding=o.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=o.sRGBEncoding),x(n,i),a.associations.set(n,{type:"materials",index:e}),i.extensions&&E(s,n,i),n}))},D.prototype.loadGeometries=function(e){var t=this,a=this.extensions,n=this.primitiveCache;function s(e){return a[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return P(r,e,t)}))}for(var i,c,l=[],u=0,d=e.length;u<d;u++){var p,h=e[u],f=(void 0,(c=(i=h).extensions&&i.extensions[r.KHR_DRACO_MESH_COMPRESSION])?"draco:"+c.bufferView+":"+c.indices+":"+C(c.attributes):i.indices+":"+C(i.attributes)+":"+i.mode),m=n[f];m?l.push(m.promise):(p=h.extensions&&h.extensions[r.KHR_DRACO_MESH_COMPRESSION]?s(h):P(new o.BufferGeometry,h,t),n[f]={primitive:h,promise:p},l.push(p))}return Promise.all(l)},D.prototype.loadMesh=function(e){for(var t,r=this,a=this.json.meshes[e],n=a.primitives,s=[],i=0,c=n.length;i<c;i++){var l=void 0===n[i].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new o.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:o.FrontSide})),t.DefaultMaterial):this.getDependency("material",n[i].material);s.push(l)}return s.push(r.loadGeometries(n)),Promise.all(s).then((function(t){for(var s=t.slice(0,t.length-1),i=t[t.length-1],c=[],l=0,u=i.length;l<u;l++){var d,p=i[l],h=n[l],f=s[l];if(4===h.mode||5===h.mode||6===h.mode||void 0===h.mode)!0!==(d=!0===a.isSkinnedMesh?new o.SkinnedMesh(p,f):new o.Mesh(p,f)).isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),5===h.mode?d.geometry=O(d.geometry,o.TriangleStripDrawMode):6===h.mode&&(d.geometry=O(d.geometry,o.TriangleFanDrawMode));else if(1===h.mode)d=new o.LineSegments(p,f);else if(3===h.mode)d=new o.Line(p,f);else if(2===h.mode)d=new o.LineLoop(p,f);else{if(0!==h.mode)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new o.Points(p,f)}Object.keys(d.geometry.morphAttributes).length>0&&I(d,a),d.name=a.name||"mesh_"+e,i.length>1&&(d.name+="_"+l),x(d,a),r.assignFinalMaterial(d),c.push(d)}if(1===c.length)return c[0];var m=new o.Group;for(l=0,u=c.length;l<u;l++)m.add(c[l]);return m}))},D.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],a=r[r.type];if(a)return"perspective"===r.type?t=new o.PerspectiveCamera(o.MathUtils.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):"orthographic"===r.type&&(t=new o.OrthographicCamera(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),r.name&&(t.name=r.name),x(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},D.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},D.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],r=[],a=[],n=[],s=[],i=[],c=0,l=t.channels.length;c<l;c++){var u=t.channels[c],d=t.samplers[u.sampler],p=u.target,h=void 0!==p.node?p.node:p.id,f=void 0!==t.parameters?t.parameters[d.input]:d.input,m=void 0!==t.parameters?t.parameters[d.output]:d.output;r.push(this.getDependency("node",h)),a.push(this.getDependency("accessor",f)),n.push(this.getDependency("accessor",m)),s.push(d),i.push(p)}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(n),Promise.all(s),Promise.all(i)]).then((function(r){for(var a=r[0],n=r[1],s=r[2],i=r[3],c=r[4],l=[],u=0,d=a.length;u<d;u++){var p=a[u],h=n[u],f=s[u],m=i[u],g=c[u];if(void 0!==p){var v;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,b[g.path]){case b.weights:v=o.NumberKeyframeTrack;break;case b.rotation:v=o.QuaternionKeyframeTrack;break;default:v=o.VectorKeyframeTrack}var T=p.name?p.name:p.uuid,M=void 0!==m.interpolation?w[m.interpolation]:o.InterpolateLinear,R=[];b[g.path]===b.weights?p.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&R.push(e.name?e.name:e.uuid)})):R.push(T);var A=f.array;if(f.normalized){var S;if(A.constructor===Int8Array)S=1/127;else if(A.constructor===Uint8Array)S=1/255;else if(A.constructor==Int16Array)S=1/32767;else{if(A.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");S=1/65535}for(var L=new Float32Array(A.length),_=0,E=A.length;_<E;_++)L[_]=A[_]*S;A=L}for(_=0,E=R.length;_<E;_++){var x=new v(R[_]+"."+b[g.path],h.array,A,M);"CUBICSPLINE"===m.interpolation&&(x.createInterpolant=function(e){return new y(this.times,this.values,this.getValueSize()/3,e)},x.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(x)}}}var I=t.name?t.name:"animation_"+e;return new o.AnimationClip(I,void 0,l)}))},D.prototype.loadNode=function(e){var t,a=this.json,n=this.extensions,s=this,i=a.meshReferences,c=a.meshUses,l=a.nodes[e];return(t=[],void 0!==l.mesh&&t.push(s.getDependency("mesh",l.mesh).then((function(e){var t;if(i[l.mesh]>1){var r=c[l.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==l.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=l.weights.length;t<r;t++)e.morphTargetInfluences[t]=l.weights[t]})),t}))),void 0!==l.camera&&t.push(s.getDependency("camera",l.camera)),l.extensions&&l.extensions[r.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[r.KHR_LIGHTS_PUNCTUAL].light&&t.push(s.getDependency("light",l.extensions[r.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t)).then((function(t){var r;if((r=!0===l.isBone?new o.Bone:t.length>1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(var a=0,i=t.length;a<i;a++)r.add(t[a]);if(l.name&&(r.userData.name=l.name,r.name=o.PropertyBinding.sanitizeNodeName(l.name)),x(r,l),l.extensions&&E(n,r,l),void 0!==l.matrix){var c=new o.Matrix4;c.fromArray(l.matrix),r.applyMatrix4(c)}else void 0!==l.translation&&r.position.fromArray(l.translation),void 0!==l.rotation&&r.quaternion.fromArray(l.rotation),void 0!==l.scale&&r.scale.fromArray(l.scale);return s.associations.set(r,{type:"nodes",index:e}),r}))},D.prototype.loadScene=function(){function e(t,r,a,n){var s=a.nodes[t];return n.getDependency("node",t).then((function(e){return void 0===s.skin?e:n.getDependency("skin",s.skin).then((function(e){for(var r=[],a=0,o=(t=e).joints.length;a<o;a++)r.push(n.getDependency("node",t.joints[a]));return Promise.all(r)})).then((function(r){return e.traverse((function(e){if(e.isMesh){for(var a=[],n=[],s=0,i=r.length;s<i;s++){var c=r[s];if(c){a.push(c);var l=new o.Matrix4;void 0!==t.inverseBindMatrices&&l.fromArray(t.inverseBindMatrices.array,16*s),n.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}e.bind(new o.Skeleton(a,n),e.matrixWorld)}})),e}));var t})).then((function(t){r.add(t);var o=[];if(s.children)for(var i=s.children,c=0,l=i.length;c<l;c++){var u=i[c];o.push(e(u,t,a,n))}return Promise.all(o)}))}return function(t){var r=this.json,a=this.extensions,n=this.json.scenes[t],s=new o.Group;n.name&&(s.name=n.name),x(s,n),n.extensions&&E(a,s,n);for(var i=n.nodes||[],c=[],l=0,u=i.length;l<u;l++)c.push(e(i[l],s,r,this));return Promise.all(c).then((function(){return s}))}}(),e}(),s=function(e){o.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};s.prototype=Object.assign(Object.create(o.Loader.prototype),{constructor:s,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,r,a){var n=new o.FileLoader(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&n.setWithCredentials(!0),n.load(e,(e=>{var r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)}),r,a)},decodeDracoFile:function(e,t,r,a){var o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,o).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var a=t.attributeTypes[r];void 0!==a.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=a.name)}var o,n=JSON.stringify(t);if(s.taskCache.has(e)){var i=s.taskCache.get(e);if(i.key===n)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var c=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(c,l).then((r=>(o=r,new Promise(((r,a)=>{o._callbacks[c]={resolve:r,reject:a},o.postMessage({type:"decode",id:c,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{o&&c&&this._releaseTask(o,c)})),s.taskCache.set(e,{key:n,promise:u}),u},_createGeometry:function(e){var t=new o.BufferGeometry;e.index&&t.setIndex(new o.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var a=e.attributes[r],n=a.name,s=a.array,i=a.itemSize;t.setAttribute(n,new o.BufferAttribute(s,i))}return t},_loadLibrary:function(e,t){var r=new o.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),new Promise(((t,a)=>{r.load(e,t,void 0,a)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var a=s.DRACOWorker.toString(),o=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([o]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;return this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1})),(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),s.DRACOWorker=function(){var e,t;function r(e,t,r,a,o,n){var s,i,c=n.num_components(),l=r.num_points()*c;switch(o){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,n,s),i=new Float32Array(l);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,n,s),i=new Int8Array(l);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,n,s),i=new Int16Array(l);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,n,s),i=new Int32Array(l);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,n,s),i=new Uint8Array(l);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,n,s),i=new Uint16Array(l);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,n,s),i=new Uint32Array(l);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<l;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:a,array:i,itemSize:c}}onmessage=function(a){var o=a.data;switch(o.type){case"init":e=o.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var n=o.buffer,s=o.taskConfig;t.then((e=>{var t=e.draco,a=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(n),n.byteLength);try{var c=function(e,t,a,o){var n,s,i=o.attributeIDs,c=o.attributeTypes,l=t.GetEncodedGeometryType(a);if(l===e.TRIANGULAR_MESH)n=new e.Mesh,s=t.DecodeBufferToMesh(a,n);else{if(l!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");n=new e.PointCloud,s=t.DecodeBufferToPointCloud(a,n)}if(!s.ok()||0===n.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var d in i){var p,h,f=self[c[d]];if(o.useUniqueIDs)h=i[d],p=t.GetAttributeByUniqueId(n,h);else{if(-1===(h=t.GetAttributeId(n,e[i[d]])))continue;p=t.GetAttribute(n,h)}u.attributes.push(r(e,t,n,d,f,p))}if(l===e.TRIANGULAR_MESH){for(var m=n.num_faces(),g=new Uint32Array(3*m),v=new e.DracoInt32Array,y=0;y<m;++y){t.GetFaceFromMesh(n,y,v);for(var T=0;T<3;++T)g[3*y+T]=v.GetValue(T)}u.index={array:g,itemSize:1},e.destroy(v)}return e.destroy(n),u}(t,a,i,s),l=c.attributes.map((e=>e.array.buffer));c.index&&l.push(c.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:c},l)}catch(e){console.error(e),self.postMessage({type:"error",id:o.id,error:e.message})}finally{t.destroy(i),t.destroy(a)}}))}}},s.taskCache=new WeakMap,s.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},s.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},s.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},s.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var i=function(e){o.CompressedTextureLoader.call(this,e)};i.prototype=Object.assign(Object.create(o.CompressedTextureLoader.prototype),{constructor:i,parse:function(e,t){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function n(e,t,r,a){for(var o=r*a*4,n=new Uint8Array(e,t,o),s=new Uint8Array(o),i=0,c=0,l=0;l<a;l++)for(var u=0;u<r;u++){var d=n[c],p=n[++c],h=n[++c],f=n[++c];c++,s[i]=h,s[++i]=p,s[++i]=d,s[++i]=f,i++}return s}var s,i=a("DXT1"),c=a("DXT3"),l=a("DXT5"),u=a("ETC1"),d=new Int32Array(e,0,31);if(542327876!==d[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),r;if(4&!d[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),r;var p,h=d[21],f=!1;switch(h){case i:s=8,r.format=o.RGB_S3TC_DXT1_Format;break;case c:s=16,r.format=o.RGBA_S3TC_DXT3_Format;break;case l:s=16,r.format=o.RGBA_S3TC_DXT5_Format;break;case u:s=8,r.format=o.RGB_ETC1_Format;break;default:if(!(32===d[22]&&16711680&d[23]&&65280&d[24]&&255&d[25]&&4278190080&d[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(p=h,String.fromCharCode(255&p,p>>8&255,p>>16&255,p>>24&255))),r;f=!0,s=64,r.format=o.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var g=d[1]+4,v=r.isCubemap?6:1,y=0;y<v;y++)for(var T=r.width,M=r.height,R=0;R<r.mipmapCount;R++){if(f)var A=(S=n(e,g,T,M)).length;else{A=Math.max(4,T)/4*Math.max(4,M)/4*s;var S=new Uint8Array(e,g,A)}var b={data:S,width:T,height:M};r.mipmaps.push(b),g+=A,T=Math.max(T>>1,1),M=Math.max(M>>1,1)}return r}});var c=function(e){function r(t){var r=e.call(this)||this;return r.needsRender=!0,t&&t.children.length&&r.add.apply(r,t.children),r.mixer=new o.AnimationMixer(r),r}return t(r,e),r.prototype.clone=function(){var t=e.prototype.clone.call(this,!0),r=new o.AnimationMixer(t);return t.mixer=r,t.needsRender=!0,t},r}(o.Group),l=function(e){function r(t){var r=e.call(this,t)||this;return r.ddsLoader=new i(t),r.dracoLoader=new s(t),r.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/"),r}return t(r,e),Object.defineProperty(r,"version",{get:function(){return"6.0.0-alpha.31"},enumerable:!1,configurable:!0}),r.prototype.load=function(t,r,a,o){return e.prototype.load.call(this,t,r,a,o)},r.prototype.parse=function(t,r,a,o){return e.prototype.parse.call(this,t,r,(function(e){var t=new c(e.scene),r=e.scenes.map((function(r){return r===e.scene?t:new c(r)}));a(Object.assign(e,{scene:t,scenes:r}))}),o)},r}(n)})(),a})()));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
package/umd/five-line.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(()=>(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),P=B>=-1&&B<=1,M=v.distanceTo(A)<.5*c;if(P&&M){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),Object.defineProperty(n,"version",{get:function(){return"6.0.0-alpha.30"},enumerable:!1,configurable:!0}),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(()=>(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),P=B>=-1&&B<=1,M=v.distanceTo(A)<.5*c;if(P&&M){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),Object.defineProperty(n,"version",{get:function(){return"6.0.0-alpha.31"},enumerable:!1,configurable:!0}),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
package/umd/five-sticker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var b=y.map=new t.VideoTexture(o);b.wrapS=t.ClampToEdgeWrapping,b.wrapT=t.ClampToEdgeWrapping,b.minFilter=t.LinearFilter,b.encoding=t.sRGBEncoding,d(b,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"version",{get:function(){return"6.0.0-alpha.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var b=y.map=new t.VideoTexture(o);b.wrapS=t.ClampToEdgeWrapping,b.wrapT=t.ClampToEdgeWrapping,b.minFilter=t.LinearFilter,b.encoding=t.sRGBEncoding,d(b,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"version",{get:function(){return"6.0.0-alpha.31"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh)})(),r})()));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|