!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],n):n(e.BAS={},e.THREE)}(this,function(e,n){"use strict";function t(e,t){n.ShaderMaterial.call(this);var r=e.uniformValues;if(delete e.uniformValues,this.setValues(e),this.uniforms=n.UniformsUtils.merge([t,this.uniforms]),this.setUniformValues(r),r&&(r.map&&(this.defines.USE_MAP=""),r.normalMap&&(this.defines.USE_NORMALMAP=""),r.envMap&&(this.defines.USE_ENVMAP=""),r.aoMap&&(this.defines.USE_AOMAP=""),r.specularMap&&(this.defines.USE_SPECULARMAP=""),r.alphaMap&&(this.defines.USE_ALPHAMAP=""),r.lightMap&&(this.defines.USE_LIGHTMAP=""),r.emissiveMap&&(this.defines.USE_EMISSIVEMAP=""),r.bumpMap&&(this.defines.USE_BUMPMAP=""),r.displacementMap&&(this.defines.USE_DISPLACEMENTMAP=""),r.roughnessMap&&(this.defines.USE_DISPLACEMENTMAP=""),r.roughnessMap&&(this.defines.USE_ROUGHNESSMAP=""),r.metalnessMap&&(this.defines.USE_METALNESSMAP=""),r.envMap)){this.defines.USE_ENVMAP="";var i="ENVMAP_TYPE_CUBE",a="ENVMAP_MODE_REFLECTION",o="ENVMAP_BLENDING_MULTIPLY";switch(r.envMap.mapping){case n.CubeReflectionMapping:case n.CubeRefractionMapping:i="ENVMAP_TYPE_CUBE";break;case n.CubeUVReflectionMapping:case n.CubeUVRefractionMapping:i="ENVMAP_TYPE_CUBE_UV";break;case n.EquirectangularReflectionMapping:case n.EquirectangularRefractionMapping:i="ENVMAP_TYPE_EQUIREC";break;case n.SphericalReflectionMapping:i="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case n.CubeRefractionMapping:case n.EquirectangularRefractionMapping:a="ENVMAP_MODE_REFRACTION"}switch(r.combine){case n.MixOperation:o="ENVMAP_BLENDING_MIX";break;case n.AddOperation:o="ENVMAP_BLENDING_ADD";break;case n.MultiplyOperation:default:o="ENVMAP_BLENDING_MULTIPLY"}this.defines[i]="",this.defines[o]="",this.defines[a]=""}}function r(e){this.varyingParameters=[],this.vertexParameters=[],this.vertexFunctions=[],this.vertexInit=[],this.vertexNormal=[],this.vertexPosition=[],this.vertexColor=[],this.vertexPostMorph=[],this.vertexPostSkinning=[],this.fragmentFunctions=[],this.fragmentParameters=[],this.fragmentInit=[],this.fragmentMap=[],this.fragmentDiffuse=[],t.call(this,e,n.ShaderLib.basic.uniforms),this.lights=!1,this.vertexShader=this.concatVertexShader(),this.fragmentShader=this.concatFragmentShader()}function i(e){this.varyingParameters=[],this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexNormal=[],this.vertexPosition=[],this.vertexColor=[],this.vertexPostMorph=[],this.vertexPostSkinning=[],this.fragmentFunctions=[],this.fragmentParameters=[],this.fragmentInit=[],this.fragmentMap=[],this.fragmentDiffuse=[],this.fragmentEmissive=[],this.fragmentSpecular=[],t.call(this,e,n.ShaderLib.lambert.uniforms),this.lights=!0,this.vertexShader=this.concatVertexShader(),this.fragmentShader=this.concatFragmentShader()}function a(e){this.varyingParameters=[],this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexNormal=[],this.vertexPosition=[],this.vertexColor=[],this.fragmentFunctions=[],this.fragmentParameters=[],this.fragmentInit=[],this.fragmentMap=[],this.fragmentDiffuse=[],this.fragmentEmissive=[],this.fragmentSpecular=[],t.call(this,e,n.ShaderLib.phong.uniforms),this.lights=!0,this.vertexShader=this.concatVertexShader(),this.fragmentShader=this.concatFragmentShader()}function o(e){this.varyingParameters=[],this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexNormal=[],this.vertexPosition=[],this.vertexColor=[],this.vertexPostMorph=[],this.vertexPostSkinning=[],this.fragmentFunctions=[],this.fragmentParameters=[],this.fragmentInit=[],this.fragmentMap=[],this.fragmentDiffuse=[],this.fragmentRoughness=[],this.fragmentMetalness=[],this.fragmentEmissive=[],t.call(this,e,n.ShaderLib.standard.uniforms),this.lights=!0,this.vertexShader=this.concatVertexShader(),this.fragmentShader=this.concatFragmentShader()}function s(e){this.varyingParameters=[],this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexPosition=[],this.vertexColor=[],this.fragmentFunctions=[],this.fragmentParameters=[],this.fragmentInit=[],this.fragmentMap=[],this.fragmentDiffuse=[],this.fragmentShape=[],t.call(this,e,n.ShaderLib.points.uniforms),this.vertexShader=this.concatVertexShader(),this.fragmentShader=this.concatFragmentShader()}function f(e){this.depthPacking=n.RGBADepthPacking,this.clipping=!0,this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexPosition=[],this.vertexPostMorph=[],this.vertexPostSkinning=[],t.call(this,e),this.uniforms=n.UniformsUtils.merge([n.ShaderLib.depth.uniforms,this.uniforms]),this.vertexShader=this.concatVertexShader(),this.fragmentShader=n.ShaderLib.depth.fragmentShader}function l(e){this.depthPacking=n.RGBADepthPacking,this.clipping=!0,this.vertexFunctions=[],this.vertexParameters=[],this.vertexInit=[],this.vertexPosition=[],this.vertexPostMorph=[],this.vertexPostSkinning=[],t.call(this,e),this.uniforms=n.UniformsUtils.merge([n.ShaderLib.distanceRGBA.uniforms,this.uniforms]),this.vertexShader=this.concatVertexShader(),this.fragmentShader=n.ShaderLib.distanceRGBA.fragmentShader}function c(e,t){n.BufferGeometry.call(this),this.prefabGeometry=e,this.isPrefabBufferGeometry=e.isBufferGeometry,this.prefabCount=t,this.isPrefabBufferGeometry?this.prefabVertexCount=e.attributes.position.count:this.prefabVertexCount=e.vertices.length,this.bufferIndices(),this.bufferPositions()}function u(e,t){n.BufferGeometry.call(this),Array.isArray(e)?this.prefabGeometries=e:this.prefabGeometries=[e],this.prefabGeometriesCount=this.prefabGeometries.length,this.prefabCount=t*this.prefabGeometriesCount,this.repeatCount=t,this.prefabVertexCounts=this.prefabGeometries.map(function(e){return e.isBufferGeometry?e.attributes.position.count:e.vertices.length}),this.repeatVertexCount=this.prefabVertexCounts.reduce(function(e,n){return e+n},0),this.bufferIndices(),this.bufferPositions()}function p(e,t){n.BufferGeometry.call(this),this.modelGeometry=e,this.faceCount=this.modelGeometry.faces.length,this.vertexCount=this.modelGeometry.vertices.length,(t=t||{}).computeCentroids&&this.computeCentroids(),this.bufferIndices(),this.bufferPositions(t.localizeFaces)}function d(e){n.BufferGeometry.call(this),this.pointCount=e,this.bufferPositions()}function m(e,n,t,r,i){this.key=e,this.start=n,this.duration=t,this.transition=r,this.compiler=i,this.trail=0}function h(){this.duration=0,this.timeKey="tTime",this.segments={},this.__key=0}t.prototype=Object.assign(Object.create(n.ShaderMaterial.prototype),{constructor:t,setUniformValues:function(e){var n=this;if(e){Object.keys(e).forEach(function(t){t in n.uniforms&&(n.uniforms[t].value=e[t])})}},stringifyChunk:function(e){return this[e]?"string"==typeof this[e]?this[e]:this[e].join("\n"):""}}),(r.prototype=Object.create(t.prototype)).constructor=r,r.prototype.concatVertexShader=function(){return"\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n\n "+this.stringifyChunk("vertexInit")+"\n \n #include \n #include \n #include \n #include \n \n #ifdef USE_ENVMAP\n \n #include \n \n "+this.stringifyChunk("vertexNormal")+"\n \n #include \n #include \n #include \n \n #endif\n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n "+this.stringifyChunk("vertexColor")+"\n \n #include \n \n "+this.stringifyChunk("vertexPostMorph")+"\n \n #include \n\n "+this.stringifyChunk("vertexPostSkinning")+"\n\n #include \n #include \n \n #include \n #include \n #include \n #include \n }"},r.prototype.concatFragmentShader=function(){return"\n uniform vec3 diffuse;\n uniform float opacity;\n \n "+this.stringifyChunk("fragmentParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("fragmentFunctions")+"\n \n #ifndef FLAT_SHADED\n \n varying vec3 vNormal;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n void main() {\n \n "+this.stringifyChunk("fragmentInit")+"\n \n #include \n\n vec4 diffuseColor = vec4( diffuse, opacity );\n\n "+this.stringifyChunk("fragmentDiffuse")+"\n \n #include \n \n "+(this.stringifyChunk("fragmentMap")||"#include ")+"\n \n #include \n #include \n #include \n #include \n \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n \n // accumulation (baked indirect lighting only)\n #ifdef USE_LIGHTMAP\n \n reflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n \n #else\n \n reflectedLight.indirectDiffuse += vec3( 1.0 );\n \n #endif\n \n // modulation\n #include \n \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n \n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n \n #include \n \n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n #include \n #include \n #include \n #include \n }"},(i.prototype=Object.create(t.prototype)).constructor=i,i.prototype.concatVertexShader=function(){return"\n #define LAMBERT\n\n varying vec3 vLightFront;\n \n #ifdef DOUBLE_SIDED\n \n varying vec3 vLightBack;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("vertexInit")+"\n \n #include \n #include \n #include \n \n #include \n \n "+this.stringifyChunk("vertexNormal")+"\n \n #include \n #include \n #include \n #include \n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n "+this.stringifyChunk("vertexColor")+"\n \n #include \n \n "+this.stringifyChunk("vertexPostMorph")+"\n \n #include \n\n "+this.stringifyChunk("vertexPostSkinning")+"\n \n #include \n #include \n #include \n \n #include \n #include \n #include \n #include \n #include \n }"},i.prototype.concatFragmentShader=function(){return"\n uniform vec3 diffuse;\n uniform vec3 emissive;\n uniform float opacity;\n \n varying vec3 vLightFront;\n \n #ifdef DOUBLE_SIDED\n \n varying vec3 vLightBack;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("fragmentFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("fragmentInit")+"\n \n #include \n\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n\t\n "+this.stringifyChunk("fragmentDiffuse")+"\n \n #include \n\n "+(this.stringifyChunk("fragmentMap")||"#include ")+"\n\n #include \n #include \n #include \n #include \n\n "+this.stringifyChunk("fragmentEmissive")+"\n\n #include \n \n // accumulation\n reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n \n #include \n \n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n \n #ifdef DOUBLE_SIDED\n \n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n \n #else\n \n reflectedLight.directDiffuse = vLightFront;\n \n #endif\n \n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n \n // modulation\n #include \n \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n \n #include \n \n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n #include \n #include \n #include \n #include \n #include \n }"},(a.prototype=Object.create(t.prototype)).constructor=a,a.prototype.concatVertexShader=function(){return"\n #define PHONG\n\n varying vec3 vViewPosition;\n \n #ifndef FLAT_SHADED\n \n varying vec3 vNormal;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("vertexInit")+"\n \n #include \n #include \n #include \n \n #include \n \n "+this.stringifyChunk("vertexNormal")+"\n \n #include \n #include \n #include \n #include \n \n #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n \n vNormal = normalize( transformedNormal );\n \n #endif\n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n "+this.stringifyChunk("vertexColor")+"\n \n #include \n #include \n #include \n #include \n #include \n #include \n \n vViewPosition = - mvPosition.xyz;\n \n #include \n #include \n #include \n #include \n }"},a.prototype.concatFragmentShader=function(){return"\n #define PHONG\n\n uniform vec3 diffuse;\n uniform vec3 emissive;\n uniform vec3 specular;\n uniform float shininess;\n uniform float opacity;\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("fragmentFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("fragmentInit")+"\n \n #include \n \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n \n "+this.stringifyChunk("fragmentDiffuse")+"\n \n #include \n\n "+(this.stringifyChunk("fragmentMap")||"#include ")+"\n\n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentEmissive")+"\n \n #include \n \n // accumulation\n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentSpecular")+"\n \n // modulation\n #include \n \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n \n #include \n \n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n #include \n #include \n #include \n #include \n #include \n \n }"},(o.prototype=Object.create(t.prototype)).constructor=o,o.prototype.concatVertexShader=function(){return"\n #define PHYSICAL\n\n varying vec3 vViewPosition;\n \n #ifndef FLAT_SHADED\n \n varying vec3 vNormal;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n\n "+this.stringifyChunk("vertexInit")+"\n\n #include \n #include \n #include \n \n #include \n \n "+this.stringifyChunk("vertexNormal")+"\n \n #include \n #include \n #include \n #include \n \n #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n \n vNormal = normalize( transformedNormal );\n \n #endif\n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n "+this.stringifyChunk("vertexColor")+"\n \n #include \n \n "+this.stringifyChunk("vertexPostMorph")+"\n \n #include \n\n "+this.stringifyChunk("vertexPostSkinning")+"\n \n #include \n #include \n #include \n #include \n \n vViewPosition = - mvPosition.xyz;\n \n #include \n #include \n #include \n }"},o.prototype.concatFragmentShader=function(){return"\n #define PHYSICAL\n \n uniform vec3 diffuse;\n uniform vec3 emissive;\n uniform float roughness;\n uniform float metalness;\n uniform float opacity;\n \n #ifndef STANDARD\n uniform float clearCoat;\n uniform float clearCoatRoughness;\n #endif\n \n varying vec3 vViewPosition;\n \n #ifndef FLAT_SHADED\n \n varying vec3 vNormal;\n \n #endif\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("fragmentFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("fragmentInit")+"\n \n #include \n \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n \n "+this.stringifyChunk("fragmentDiffuse")+"\n \n #include \n\n "+(this.stringifyChunk("fragmentMap")||"#include ")+"\n\n #include \n #include \n #include \n \n float roughnessFactor = roughness;\n "+this.stringifyChunk("fragmentRoughness")+"\n #ifdef USE_ROUGHNESSMAP\n \n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n \n // reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n roughnessFactor *= texelRoughness.g;\n \n #endif\n \n float metalnessFactor = metalness;\n "+this.stringifyChunk("fragmentMetalness")+"\n #ifdef USE_METALNESSMAP\n \n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n \n #endif\n \n #include \n #include \n \n "+this.stringifyChunk("fragmentEmissive")+"\n \n #include \n \n // accumulation\n #include \n #include \n #include \n #include \n \n // modulation\n #include \n \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n \n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n #include \n #include \n #include \n #include \n #include \n \n }"},(s.prototype=Object.create(t.prototype)).constructor=s,s.prototype.concatVertexShader=function(){return"\n uniform float size;\n uniform float scale;\n \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("vertexInit")+"\n \n #include \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n "+this.stringifyChunk("vertexColor")+"\n \n #include \n \n #ifdef USE_SIZEATTENUATION\n gl_PointSize = size * ( scale / - mvPosition.z );\n #else\n gl_PointSize = size;\n #endif\n \n #include \n #include \n #include \n #include \n #include \n }"},s.prototype.concatFragmentShader=function(){return"\n uniform vec3 diffuse;\n uniform float opacity;\n \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("fragmentParameters")+"\n "+this.stringifyChunk("varyingParameters")+"\n "+this.stringifyChunk("fragmentFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("fragmentInit")+"\n \n #include \n \n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n \n "+this.stringifyChunk("fragmentDiffuse")+"\n \n #include \n\n "+(this.stringifyChunk("fragmentMap")||"#include ")+"\n\n #include \n #include \n \n outgoingLight = diffuseColor.rgb;\n \n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n "+this.stringifyChunk("fragmentShape")+"\n \n #include \n #include \n #include \n #include \n }"},(f.prototype=Object.create(t.prototype)).constructor=f,f.prototype.concatVertexShader=function(){return"\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n \n "+this.stringifyChunk("vertexInit")+"\n \n #include \n \n #include \n \n #ifdef USE_DISPLACEMENTMAP\n \n #include \n #include \n #include \n \n #endif\n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n\n #include \n \n "+this.stringifyChunk("vertexPostMorph")+"\n \n #include \n\n "+this.stringifyChunk("vertexPostSkinning")+"\n \n #include \n #include \n #include \n #include \n }"},(l.prototype=Object.create(t.prototype)).constructor=l,l.prototype.concatVertexShader=function(){return"\n #define DISTANCE\n\n varying vec3 vWorldPosition;\n \n #include \n #include \n #include \n #include \n #include \n #include \n \n "+this.stringifyChunk("vertexParameters")+"\n "+this.stringifyChunk("vertexFunctions")+"\n \n void main() {\n\n "+this.stringifyChunk("vertexInit")+"\n \n #include \n \n #include \n \n #ifdef USE_DISPLACEMENTMAP\n \n #include \n #include \n #include \n \n #endif\n \n #include \n \n "+this.stringifyChunk("vertexPosition")+"\n\n #include \n \n "+this.stringifyChunk("vertexPostMorph")+"\n \n #include \n\n "+this.stringifyChunk("vertexPostSkinning")+"\n \n #include \n #include \n #include \n #include \n \n vWorldPosition = worldPosition.xyz;\n \n }"},(c.prototype=Object.create(n.BufferGeometry.prototype)).constructor=c,c.prototype.bufferIndices=function(){var e=[],t=void 0;if(this.isPrefabBufferGeometry)if(this.prefabGeometry.index)t=this.prefabGeometry.index.count,e=this.prefabGeometry.index.array;else{t=this.prefabVertexCount;for(var r=0;r= 0.0 ? 1.0 : -1.0;\r\n float sqrSn = 1.0 - c * c;\r\n\r\n if (sqrSn > 2.220446049250313e-16) {\r\n float sn = sqrt(sqrSn);\r\n float len = atan(sn, c * dir);\r\n\r\n s = sin(s * len) / sn;\r\n t = sin(t * len) / sn;\r\n }\r\n\r\n float tDir = t * dir;\r\n\r\n return normalize(q0 * s + q1 * tDir);\r\n}\r\n"};m.prototype.compile=function(){return this.compiler(this)},Object.defineProperty(m.prototype,"end",{get:function(){return this.start+this.duration}}),h.segmentDefinitions={},h.register=function(e,n){return h.segmentDefinitions[e]=n,n},h.prototype.add=function(e,n,t){var r=eval,i=this.duration;void 0!==t?("number"==typeof t?i=t:"string"==typeof t&&r("start"+t),this.duration=Math.max(this.duration,i+e)):this.duration+=e;for(var a=Object.keys(n),o=void 0,s=0;s "+(e.end+e.trail).toPrecision(4)+") return;"}},x={compiler:function(e){return"\n "+_.delayDuration(e)+"\n "+_.vec3("cTranslateFrom"+e.key,e.transition.from,2)+"\n "+_.vec3("cTranslateTo"+e.key,e.transition.to,2)+"\n \n void applyTransform"+e.key+"(float time, inout vec3 v) {\n \n "+_.renderCheck(e)+"\n "+_.progress(e)+"\n \n v += mix(cTranslateFrom"+e.key+", cTranslateTo"+e.key+", progress);\n }\n "},defaultFrom:new n.Vector3(0,0,0)};h.register("translate",x);var y={compiler:function(e){var n=e.transition.origin;return"\n "+_.delayDuration(e)+"\n "+_.vec3("cScaleFrom"+e.key,e.transition.from,2)+"\n "+_.vec3("cScaleTo"+e.key,e.transition.to,2)+"\n "+(n?_.vec3("cOrigin"+e.key,n,2):"")+"\n \n void applyTransform"+e.key+"(float time, inout vec3 v) {\n \n "+_.renderCheck(e)+"\n "+_.progress(e)+"\n \n "+(n?"v -= cOrigin"+e.key+";":"")+"\n v *= mix(cScaleFrom"+e.key+", cScaleTo"+e.key+", progress);\n "+(n?"v += cOrigin"+e.key+";":"")+"\n }\n "},defaultFrom:new n.Vector3(1,1,1)};h.register("scale",y);var b={compiler:function(e){var t=new n.Vector4(e.transition.from.axis.x,e.transition.from.axis.y,e.transition.from.axis.z,e.transition.from.angle),r=e.transition.to.axis||e.transition.from.axis,i=new n.Vector4(r.x,r.y,r.z,e.transition.to.angle),a=e.transition.origin;return"\n "+_.delayDuration(e)+"\n "+_.vec4("cRotationFrom"+e.key,t,8)+"\n "+_.vec4("cRotationTo"+e.key,i,8)+"\n "+(a?_.vec3("cOrigin"+e.key,a,2):"")+"\n \n void applyTransform"+e.key+"(float time, inout vec3 v) {\n "+_.renderCheck(e)+"\n "+_.progress(e)+"\n\n "+(a?"v -= cOrigin"+e.key+";":"")+"\n vec3 axis = normalize(mix(cRotationFrom"+e.key+".xyz, cRotationTo"+e.key+".xyz, progress));\n float angle = mix(cRotationFrom"+e.key+".w, cRotationTo"+e.key+".w, progress);\n vec4 q = quatFromAxisAngle(axis, angle);\n v = rotateVector(q, v);\n "+(a?"v += cOrigin"+e.key+";":"")+"\n }\n "},defaultFrom:{axis:new n.Vector3,angle:0}};h.register("rotate",b),e.BasicAnimationMaterial=r,e.LambertAnimationMaterial=i,e.PhongAnimationMaterial=a,e.StandardAnimationMaterial=o,e.PointsAnimationMaterial=s,e.DepthAnimationMaterial=f,e.DistanceAnimationMaterial=l,e.PrefabBufferGeometry=c,e.MultiPrefabBufferGeometry=u,e.ModelBufferGeometry=p,e.PointBufferGeometry=d,e.ShaderChunk=g,e.Timeline=h,e.TimelineSegment=m,e.TimelineChunks=_,e.TranslationSegment=x,e.ScaleSegment=y,e.RotationSegment=b,e.Utils=v,Object.defineProperty(e,"__esModule",{value:!0})});