From 2c3bd4063157687248a77bd543ac94fd259294ee Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Fri, 5 May 2023 14:01:28 +0800 Subject: [PATCH] publish 1.19.0 --- CHANGELOG.md | 26 + README.md | 4 +- README_ZH.md | 4 +- build/Hilo3d.js | 6 +- build/Hilo3d.single.js | 4 +- build/math.single.js | 4 +- docs/AmbientLight.html | 351 +- docs/Animation.html | 248 + docs/AnimationStates.html | 248 + docs/AreaLight.html | 351 +- docs/AxisHelper.html | 392 +- docs/AxisNetHelper.html | 386 +- docs/BasicLoader.html | 254 +- docs/BasicMaterial.html | 394 + docs/BoxGeometry.html | 248 + docs/Buffer.html | 268 +- docs/Cache.html | 248 + docs/Camera.html | 392 +- docs/CameraHelper.html | 388 +- docs/Class.html | 248 + docs/Color.html | 248 + docs/CubeTexture.html | 248 + docs/CubeTextureLoader.html | 248 + docs/DataTexture.html | 248 + docs/DirectionalLight.html | 631 +- docs/Euler.html | 248 + docs/EulerNotifier.html | 333 +- docs/EventMixin.html | 256 +- docs/Fog.html | 248 + docs/Framebuffer.html | 262 +- docs/Frustum.html | 248 + docs/GLTFLoader.html | 248 + docs/GLTFParser.html | 248 + docs/Geometry.html | 248 + docs/GeometryData.html | 248 + docs/GeometryMaterial.html | 394 + docs/HDRLoader.html | 248 + docs/KTXLoader.html | 248 + docs/LazyTexture.html | 248 + docs/Light.html | 493 +- docs/LightManager.html | 746 +- docs/LightShadow.html | 10719 +++++++++++++ docs/LoadCache.html | 248 + docs/LoadQueue.html | 248 + docs/Loader.html | 248 + docs/Material.html | 392 + docs/Matrix3.html | 248 + docs/Matrix4.html | 274 +- docs/Matrix4Notifier.html | 412 +- docs/Mesh.html | 386 +- docs/MeshPicker.html | 248 + docs/MorphGeometry.html | 248 + docs/Node.html | 388 +- docs/OrthographicCamera.html | 392 +- docs/PBRMaterial.html | 394 + docs/PerspectiveCamera.html | 392 +- docs/Plane.html | 248 + docs/PlaneGeometry.html | 248 + docs/PointLight.html | 495 +- docs/Program.html | 270 +- docs/Quaternion.html | 1791 +-- docs/QuaternionNotifier.html | 15578 +++++++++++++++++++ docs/Ray.html | 248 + docs/RenderInfo.html | 248 + docs/RenderList.html | 248 + docs/Shader.html | 248 + docs/ShaderMaterial.html | 394 + docs/ShaderMaterialLoader.html | 248 + docs/Skeleton.html | 248 + docs/SkinedMesh.html | 386 +- docs/SphereGeometry.html | 248 + docs/SphericalHarmonics3.html | 248 + docs/SpotLight.html | 495 +- docs/Stage.html | 390 +- docs/Texture.html | 248 + docs/TextureLoader.html | 248 + docs/Ticker.html | 248 + docs/Tween.html | 248 + docs/UniformBuffer.html | 248 + docs/Vector2.html | 248 + docs/Vector3.html | 248 + docs/Vector3Notifier.html | 409 +- docs/Vector4.html | 248 + docs/VertexArrayObject.html | 278 +- docs/WebGLRenderer.html | 250 +- docs/WebGLResourceManager.html | 248 + docs/WebGLState.html | 248 + docs/WebGLSupport.html | 248 + docs/animation_Animation.js.html | 248 + docs/animation_AnimationStates.js.html | 252 +- docs/browser.html | 248 + docs/camera_Camera.js.html | 248 + docs/camera_OrthographicCamera.js.html | 248 + docs/camera_PerspectiveCamera.js.html | 248 + docs/capabilities.html | 256 +- docs/constants.html | 248 + docs/constants_Hilo.js.html | 248 + docs/constants_index.js.html | 248 + docs/constants_webgl.js.html | 248 + docs/constants_webgl2.js.html | 248 + docs/constants_webglExtensions.js.html | 248 + docs/core_Class.js.html | 248 + docs/core_EventMixin.js.html | 251 +- docs/core_Fog.js.html | 248 + docs/core_Mesh.js.html | 248 + docs/core_Node.js.html | 300 +- docs/core_Skeleton.js.html | 248 + docs/core_SkinedMesh.js.html | 248 + docs/core_Stage.js.html | 248 + docs/core_Tween.js.html | 248 + docs/extensions.html | 248 + docs/geometry_BoxGeometry.js.html | 248 + docs/geometry_Geometry.js.html | 248 + docs/geometry_GeometryData.js.html | 248 + docs/geometry_MorphGeometry.js.html | 248 + docs/geometry_PlaneGeometry.js.html | 248 + docs/geometry_SphereGeometry.js.html | 248 + docs/glType.html | 248 + docs/global.html | 275 +- docs/helper_AxisHelper.js.html | 248 + docs/helper_AxisNetHelper.js.html | 248 + docs/helper_CameraHelper.js.html | 274 +- docs/index.html | 254 +- docs/light_AmbientLight.js.html | 248 + docs/light_AreaLight.js.html | 248 + docs/light_DirectionalLight.js.html | 263 + docs/light_Light.js.html | 252 + docs/light_LightManager.js.html | 326 + docs/light_LightShadow.js.html | 2624 +++- docs/light_PointLight.js.html | 248 + docs/light_SpotLight.js.html | 248 + docs/loader_BasicLoader.js.html | 248 + docs/loader_CubeTextureLoader.js.html | 248 + docs/loader_GLTFExtensions.js.html | 248 + docs/loader_GLTFLoader.js.html | 248 + docs/loader_GLTFParser.js.html | 248 + docs/loader_HDRLoader.js.html | 248 + docs/loader_KTXLoader.js.html | 248 + docs/loader_LoadCache.js.html | 248 + docs/loader_LoadQueue.js.html | 248 + docs/loader_Loader.js.html | 248 + docs/loader_ShaderMaterialLoader.js.html | 248 + docs/loader_TextureLoader.js.html | 248 + docs/log.html | 248 + docs/material_BasicMaterial.js.html | 248 + docs/material_GeometryMaterial.js.html | 248 + docs/material_Material.js.html | 268 +- docs/material_PBRMaterial.js.html | 248 + docs/material_ShaderMaterial.js.html | 248 + docs/material_semantic.js.html | 248 + docs/math.html | 248 + docs/math_Color.js.html | 248 + docs/math_Euler.js.html | 248 + docs/math_EulerNotifier.js.html | 277 +- docs/math_Frustum.js.html | 248 + docs/math_Matrix3.js.html | 248 + docs/math_Matrix4.js.html | 250 +- docs/math_Matrix4Notifier.js.html | 330 +- docs/math_Plane.js.html | 248 + docs/math_Quaternion.js.html | 402 +- docs/math_QuaternionNotifier.js.html | 10473 +++++++++++++ docs/math_Ray.js.html | 248 + docs/math_Sphere.js.html | 248 + docs/math_SphericalHarmonics3.js.html | 248 + docs/math_Vector2.js.html | 248 + docs/math_Vector3.js.html | 248 + docs/math_Vector3Notifier.js.html | 324 +- docs/math_Vector4.js.html | 248 + docs/math_math.js.html | 248 + docs/renderer_Buffer.js.html | 249 + docs/renderer_Framebuffer.js.html | 251 +- docs/renderer_Program.js.html | 249 + docs/renderer_RenderInfo.js.html | 248 + docs/renderer_RenderList.js.html | 248 + docs/renderer_UniformBuffer.js.html | 248 + docs/renderer_VertexArrayObject.js.html | 249 + docs/renderer_WebGLRenderer.js.html | 256 +- docs/renderer_WebGLResourceManager.js.html | 248 + docs/renderer_WebGLState.js.html | 248 + docs/renderer_capabilities.js.html | 249 + docs/renderer_extensions.js.html | 248 + docs/renderer_glType.js.html | 248 + docs/renderer_logGLResource.js.html | 248 + docs/semantic.html | 248 + docs/shader_Shader.js.html | 248 + docs/texture_CubeTexture.js.html | 248 + docs/texture_DataTexture.js.html | 248 + docs/texture_LazyTexture.js.html | 248 + docs/texture_Texture.js.html | 248 + docs/util.html | 248 + docs/utils_Cache.js.html | 248 + docs/utils_MeshPicker.js.html | 248 + docs/utils_Ticker.js.html | 248 + docs/utils_WebGLSupport.js.html | 248 + docs/utils_browser.js.html | 248 + docs/utils_log.js.html | 248 + docs/utils_util.js.html | 248 + package.json | 2 +- types/index.d.ts | 509 +- 199 files changed, 90519 insertions(+), 2458 deletions(-) create mode 100644 docs/LightShadow.html create mode 100644 docs/QuaternionNotifier.html create mode 100644 docs/math_QuaternionNotifier.js.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 94497ad1..75d8feba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# [1.19.0](https://github.com/hiloteam/Hilo3d/compare/1.18.0...1.19.0) (2023-05-05) + + +### Bug Fixes + +* Fix Framebuffer unbind bug ([bd8557c](https://github.com/hiloteam/Hilo3d/commit/bd8557cac5b669b1c09cea411f463c6e349f632f)) +* Implement the transpose function only in webgl1 ([012a4f7](https://github.com/hiloteam/Hilo3d/commit/012a4f7cda33b76a03932c17525b5fafc40c0efc)) + + +### Features + +* Add material.getShadowMaterial to allow users to customize shadow material ([21fde64](https://github.com/hiloteam/Hilo3d/commit/21fde64c332f544f0acf43c0981841040bab9587)) +* Add the ability to visualize shadow camera for debug ([a327a69](https://github.com/hiloteam/Hilo3d/commit/a327a69247b48637b3e72104644b4dbaf8f75236)) +* Add the enableShadow property to lightManager to control whether to generate shadow map ([fe1b99c](https://github.com/hiloteam/Hilo3d/commit/fe1b99ceb644eabe5fc64952f16a950ebeb60be3)) +* Add the ILightManager interface, which allows users to implement their own lighting controls ([8075db3](https://github.com/hiloteam/Hilo3d/commit/8075db3f128362ed188976a81839773f46724dc7)) +* Add the onlySyncQuaternion attribute of Node to optimize performance ([0739e6a](https://github.com/hiloteam/Hilo3d/commit/0739e6ad9198cd6b91e6cd381986a8686b936a76)) +* Add worldMatrixVersion attribute to node for performance optimization ([6f8d76b](https://github.com/hiloteam/Hilo3d/commit/6f8d76b70ae563c69c5d1d89549e7f638dd663d6)) +* Store shadow map Z in four channels to optimize precision ([5bba760](https://github.com/hiloteam/Hilo3d/commit/5bba76065d8ac081a2515026f7dd9b638af07fb9)) + + +### Performance Improvements + +* Optimize the performance of node transform changes ([5a263cf](https://github.com/hiloteam/Hilo3d/commit/5a263cfdb4366295c9b749a1d205fb56495a4c98)) + + + # [1.18.0](https://github.com/hiloteam/Hilo3d/compare/1.17.0...1.18.0) (2023-01-29) diff --git a/README.md b/README.md index 0769f4d5..fbcf5028 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ English | [简体中文](./README_ZH.md) * use script tag from a [cdn][cdn-url] ``` - + ``` ### Documentation @@ -125,4 +125,4 @@ English | [简体中文](./README_ZH.md) [size-image]:https://img.badgesize.io/hiloteam/hilo3d/master/build/Hilo3d.js.svg?compression=gzip&style=flat-square [ci-url]:https://github.com/hiloteam/Hilo3d/actions?query=workflow%3A%22npm+test%22+branch%3Adev [ci-image]:https://img.shields.io/github/actions/workflow/status/hiloteam/Hilo3d/npm_test.yml?branch=dev -[cdn-url]: https://cdn.jsdelivr.net/npm/hilo3d@1.18.0/build/Hilo3d.js +[cdn-url]: https://cdn.jsdelivr.net/npm/hilo3d@1.19.0/build/Hilo3d.js diff --git a/README_ZH.md b/README_ZH.md index 239d9dc9..43933a53 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -23,7 +23,7 @@ * 使用 script 标签加载 [cdn][cdn-url] ``` - + ``` ### 文档 @@ -126,4 +126,4 @@ [size-image]:https://img.badgesize.io/hiloteam/hilo3d/master/build/Hilo3d.js.svg?compression=gzip&style=flat-square [ci-url]:https://github.com/hiloteam/Hilo3d/actions?query=workflow%3A%22npm+test%22+branch%3Adev [ci-image]:https://img.shields.io/github/actions/workflow/status/hiloteam/Hilo3d/npm_test.yml?branch=dev -[cdn-url]: https://cdn.jsdelivr.net/npm/hilo3d@1.18.0/build/Hilo3d.js +[cdn-url]: https://cdn.jsdelivr.net/npm/hilo3d@1.19.0/build/Hilo3d.js diff --git a/build/Hilo3d.js b/build/Hilo3d.js index 9b5e93a8..6968e37c 100644 --- a/build/Hilo3d.js +++ b/build/Hilo3d.js @@ -1,5 +1,5 @@ /*! - * Hilo3d 1.18.0 + * Hilo3d 1.19.0 * Copyright (c) 2017-present Alibaba Group Holding Ltd. * @license MIT */ @@ -31,9 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*i},e.equals=function(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))};var r=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var i=Math.PI/180},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=a,e.multiply=s,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},e.distance=u,e.squaredDistance=c,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*n+r*r+i*i+a*a;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=a*s),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=s+r*(n[2]-s),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,a,s,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(a=2*r.RANDOM()-1)*a+(s=2*r.RANDOM()-1)*s}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*a*c,t[3]=e*s*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*s,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2],c=n[3],f=c*r+o*a-u*i,h=c*i+u*r-s*a,l=c*a+s*i-o*r,d=-s*r-o*i-u*a;return t[0]=f*c+d*-s+h*-u-l*-o,t[1]=h*c+d*-o+l*-s-f*-u,t[2]=l*c+d*-u+f*-o-h*-s,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+a*a)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function f(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.len=f,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],u=e[2];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-u)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function a(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function s(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function l(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=f,e.sqrDist=h,e.len=a,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=f,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=a*u-i*o,t[3]=s*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-a*o,t[1]=i*u+s*o,t[2]=a*u+r*o,t[3]=s*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=a*u+s*o,t[3]=s*u-a*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=h,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),a=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=a*Math.sin(2*Math.PI*n),t[1]=a*Math.cos(2*Math.PI*n),t[2]=s*Math.sin(2*Math.PI*i),t[3]=s*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*n+r*r+i*i+a*a,o=s?1/s:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=a*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=a*u*f-s*o*c,t[1]=s*o*f+a*u*c,t[2]=s*u*c-a*o*f,t[3]=s*u*f+a*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),a=o(n(2)),s=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function f(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*f+s*o+i*c-a*u,t[1]=i*f+s*u+a*o-r*c,t[2]=a*f+s*c+r*u-i*o,t[3]=s*f-r*o-i*u-a*c,t}function h(t,e,n,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=n[0],f=n[1],h=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=a*c+s*f+o*h+u*l)<0&&(m=-m,c=-c,f=-f,h=-h,l=-l),1-m>r.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-i)*d)/_,g=Math.sin(i*d)/_):(p=1-i,g=i),t[0]=p*a+g*c,t[1]=p*s+g*f,t[2]=p*o+g*h,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+s]-e[3*s+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}e.clone=s.clone,e.fromValues=s.fromValues,e.copy=s.copy,e.set=s.set,e.add=s.add,e.mul=f,e.scale=s.scale,e.dot=s.dot,e.lerp=s.lerp;var d=e.length=s.length,m=(e.len=d,e.squaredLength=s.squaredLength),_=(e.sqrLen=m,e.normalize=s.normalize);e.exactEquals=s.exactEquals,e.equals=s.equals,e.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,i,s){var o=a.dot(i,s);return o<-.999999?(a.cross(t,e,i),a.len(t)<1e-6&&a.cross(t,n,i),a.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,s),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,_(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,a,s,o){return h(t,r,s,o),h(e,i,a,o),h(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,a,s,o,u,c,f,h,l,d,m,_,p){var g=new r.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=i,g[4]=a,g[5]=s,g[6]=o,g[7]=u,g[8]=c,g[9]=f,g[10]=h,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,r,i,a,s,o,u,c,f,h,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,I=i*c-a*u,R=f*_-h*m,O=f*p-l*m,L=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*L-M*O+I*R;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(i*y-r*N-a*S)*x,t[2]=(_*I-p*M+g*A)*x,t[3]=(l*M-h*I-d*A)*x,t[4]=(u*L-s*N-c*O)*x,t[5]=(n*N-i*L+a*O)*x,t[6]=(p*T-m*I-g*v)*x,t[7]=(f*I-l*T+d*v)*x,t[8]=(s*y-o*L+c*R)*x,t[9]=(r*L-n*y-a*R)*x,t[10]=(m*M-_*T+g*E)*x,t[11]=(h*T-f*M-d*E)*x,t[12]=(o*O-s*S-u*R)*x,t[13]=(n*S-r*O+i*R)*x,t[14]=(_*v-m*A-p*E)*x,t[15]=(f*A-h*v+l*E)*x,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-h*(u*g-c*p)+_*(u*d-c*l),t[1]=-(r*(l*g-d*p)-h*(i*g-a*p)+_*(i*d-a*l)),t[2]=r*(u*g-c*p)-o*(i*g-a*p)+_*(i*c-a*u),t[3]=-(r*(u*d-c*l)-o*(i*d-a*l)+h*(i*c-a*u)),t[4]=-(s*(l*g-d*p)-f*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-f*(i*g-a*p)+m*(i*d-a*l),t[6]=-(n*(u*g-c*p)-s*(i*g-a*p)+m*(i*c-a*u)),t[7]=n*(u*d-c*l)-s*(i*d-a*l)+f*(i*c-a*u),t[8]=s*(h*g-d*_)-f*(o*g-c*_)+m*(o*d-c*h),t[9]=-(n*(h*g-d*_)-f*(r*g-a*_)+m*(r*d-a*h)),t[10]=n*(o*g-c*_)-s*(r*g-a*_)+m*(r*c-a*o),t[11]=-(n*(o*d-c*h)-s*(r*d-a*h)+f*(r*c-a*o)),t[12]=-(s*(h*p-l*_)-f*(o*p-u*_)+m*(o*l-u*h)),t[13]=n*(h*p-l*_)-f*(r*p-i*_)+m*(r*l-i*h),t[14]=-(n*(o*p-u*_)-s*(r*p-i*_)+m*(r*u-i*o)),t[15]=n*(o*l-u*h)-s*(r*l-i*h)+f*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8],f=t[9],h=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*s-n*a)*(h*p-l*_)-(e*o-r*a)*(f*p-l*m)+(e*u-i*a)*(f*_-h*m)+(n*o-r*s)*(c*p-l*d)-(n*u-i*s)*(c*_-h*d)+(r*u-i*o)*(c*m-f*d)},e.multiply=a,e.translate=function(t,e,n){var r=n[0],i=n[1],a=n[2],s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*a+e[12],t[13]=e[1]*r+e[5]*i+e[9]*a+e[13],t[14]=e[2]*r+e[6]*i+e[10]*a+e[14],t[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(s=e[0],o=e[1],u=e[2],c=e[3],f=e[4],h=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=f,t[5]=h,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=s*r+f*i+m*a+e[12],t[13]=o*r+h*i+_*a+e[13],t[14]=u*r+l*i+p*a+e[14],t[15]=c*r+d*i+g*a+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var a,s,o,u,c,f,h,l,d,m,_,p,g,E,v,T,A,M,I,R,O,L,S,y,N=i[0],x=i[1],C=i[2],b=Math.sqrt(N*N+x*x+C*C);return b0?(n[0]=2*(c*u+l*i+f*o-h*a)/d,n[1]=2*(f*u+l*a+h*i-c*o)/d,n[2]=2*(h*u+l*o+c*a-f*i)/d):(n[0]=2*(c*u+l*i+f*o-h*a),n[1]=2*(f*u+l*a+h*i-c*o),n[2]=2*(h*u+l*o+c*a-f*i)),s(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],s=e[5],o=e[6],u=e[8],c=e[9],f=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+s*s+o*o),t[2]=Math.sqrt(u*u+c*c+f*f),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3],u=i+i,c=a+a,f=s+s,h=i*u,l=i*c,d=i*f,m=a*c,_=a*f,p=s*f,g=o*u,E=o*c,v=o*f,T=r[0],A=r[1],M=r[2];return t[0]=(1-(m+p))*T,t[1]=(l+v)*T,t[2]=(d-E)*T,t[3]=0,t[4]=(l-v)*A,t[5]=(1-(h+p))*A,t[6]=(_+g)*A,t[7]=0,t[8]=(d+E)*M,t[9]=(_-g)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=a+a,f=s+s,h=o+o,l=a*c,d=a*f,m=a*h,_=s*f,p=s*h,g=o*h,E=u*c,v=u*f,T=u*h,A=r[0],M=r[1],I=r[2],R=i[0],O=i[1],L=i[2],S=(1-(_+g))*A,y=(d+T)*A,N=(m-v)*A,x=(d-T)*M,C=(1-(l+g))*M,b=(p+E)*M,P=(m+v)*I,w=(p-E)*I,H=(1-(l+_))*I;return t[0]=S,t[1]=y,t[2]=N,t[3]=0,t[4]=x,t[5]=C,t[6]=b,t[7]=0,t[8]=P,t[9]=w,t[10]=H,t[11]=0,t[12]=n[0]+R-(S*R+x*O+P*L),t[13]=n[1]+O-(y*R+C*O+w*L),t[14]=n[2]+L-(N*R+b*O+H*L),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[1]=f+g,t[2]=l-p,t[3]=0,t[4]=f-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,a,s){var o=1/(n-e),u=1/(i-r),c=1/(a-s);return t[0]=2*a*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(s+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*a*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var a=1/Math.tan(e/2),s=void 0;return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(r-i),t[10]=(i+r)*s,t[14]=2*i*r*s):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(s+o),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(s-o)*u*.5,t[9]=(i-a)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,a,s){var o=1/(e-n),u=1/(r-i),c=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(s+a)*c,t[15]=1,t},e.lookAt=function(t,e,n,a){var s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],E=e[2],v=a[0],T=a[1],A=a[2],M=n[0],I=n[1],R=n[2];return Math.abs(p-M)0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var m=u*l-c*h,_=c*f-o*l,p=o*h-u*f;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=h*p-l*_,t[5]=l*m-f*p,t[6]=f*_-h*m,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=i,t[13]=a,t[14]=s,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],E=t[15],v=e[0],T=e[1],A=e[2],M=e[3],I=e[4],R=e[5],O=e[6],L=e[7],S=e[8],y=e[9],N=e[10],x=e[11],C=e[12],b=e[13],P=e[14],w=e[15];return Math.abs(n-v)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(s-M)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-I)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-R)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-O)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(f-L)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(h-S)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-N)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(m-x)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(_-C)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(C))&&Math.abs(p-b)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(b))&&Math.abs(g-P)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(E-w)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(w))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function a(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],E=e[15],v=n[0],T=n[1],A=n[2],M=n[3];return t[0]=v*r+T*o+A*h+M*_,t[1]=v*i+T*u+A*l+M*p,t[2]=v*a+T*c+A*d+M*g,t[3]=v*s+T*f+A*m+M*E,v=n[4],T=n[5],A=n[6],M=n[7],t[4]=v*r+T*o+A*h+M*_,t[5]=v*i+T*u+A*l+M*p,t[6]=v*a+T*c+A*d+M*g,t[7]=v*s+T*f+A*m+M*E,v=n[8],T=n[9],A=n[10],M=n[11],t[8]=v*r+T*o+A*h+M*_,t[9]=v*i+T*u+A*l+M*p,t[10]=v*a+T*c+A*d+M*g,t[11]=v*s+T*f+A*m+M*E,v=n[12],T=n[13],A=n[14],M=n[15],t[12]=v*r+T*o+A*h+M*_,t[13]=v*i+T*u+A*l+M*p,t[14]=v*a+T*c+A*d+M*g,t[15]=v*s+T*f+A*m+M*E,t}function s(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=r+r,u=i+i,c=a+a,f=r*o,h=r*u,l=r*c,d=i*u,m=i*c,_=a*c,p=s*o,g=s*u,E=s*c;return t[0]=1-(d+_),t[1]=h+E,t[2]=l-g,t[3]=0,t[4]=h-E,t[5]=1-(f+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=a,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,a,s,o,u,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=i,f[4]=a,f[5]=s,f[6]=o,f[7]=u,f[8]=c,f},e.set=function(t,e,n,r,i,a,s,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=f*s-o*c,l=-f*a+o*u,d=c*a-s*u,m=n*h+r*l+i*d;return m?(m=1/m,t[0]=h*m,t[1]=(-f*r+i*c)*m,t[2]=(o*r-i*s)*m,t[3]=l*m,t[4]=(f*n-i*u)*m,t[5]=(-o*n+i*a)*m,t[6]=d*m,t[7]=(-c*n+r*u)*m,t[8]=(s*n-r*a)*m,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8];return t[0]=s*f-o*c,t[1]=i*c-r*f,t[2]=r*o-i*s,t[3]=o*u-a*f,t[4]=n*f-i*u,t[5]=i*a-n*o,t[6]=a*c-s*u,t[7]=r*u-n*c,t[8]=n*s-r*a,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8];return e*(c*a-s*u)+n*(-c*i+s*o)+r*(u*i-a*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=u,t[6]=l*r+d*s+c,t[7]=l*i+d*o+f,t[8]=l*a+d*u+h,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*r+l*s,t[1]=d*i+l*o,t[2]=d*a+l*u,t[3]=d*s-l*r,t[4]=d*o-l*i,t[5]=d*u-l*a,t[6]=c,t[7]=f,t[8]=h,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[3]=f-g,t[6]=l+p,t[1]=f+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-h,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,I=i*c-a*u,R=f*_-h*m,O=f*p-l*m,L=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*L-M*O+I*R;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(u*L-s*N-c*O)*x,t[2]=(s*y-o*L+c*R)*x,t[3]=(i*y-r*N-a*S)*x,t[4]=(n*N-i*L+a*O)*x,t[5]=(r*L-n*y-a*R)*x,t[6]=(_*I-p*M+g*A)*x,t[7]=(p*T-m*I-g*v)*x,t[8]=(m*M-_*T+g*E)*x,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],E=e[6],v=e[7],T=e[8];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-E)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(f-v)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(v))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],E=n[6],v=n[7],T=n[8];return t[0]=l*r+d*s+m*c,t[1]=l*i+d*o+m*f,t[2]=l*a+d*u+m*h,t[3]=_*r+p*s+g*c,t[4]=_*i+p*o+g*f,t[5]=_*a+p*u+g*h,t[6]=E*r+v*s+T*c,t[7]=E*i+v*o+T*f,t[8]=E*a+v*u+T*h,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=a,e.multiply=s,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],s=Math.sin(r),o=Math.cos(r);return t[0]=i*o-a*s+n[0],t[1]=i*s+a*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));var o=i*i+a*a;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*a)*s*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],a=e[0],s=e[1];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function f(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){var e=t[0],n=t[1];return e*e+n*n}e.len=f,e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,a=e[2]/n,s=e[3]/n,o=e[4],u=e[5],c=e[6],f=e[7],h=r*o+i*u+a*c+s*f;t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=(o-r*h)/n,t[5]=(u-i*h)/n,t[6]=(c-a*h)/n,t[7]=(f-s*h)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],E=e[7];return Math.abs(n-h)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-_)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(f-E)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))};var r=s(n(0)),i=s(n(3)),a=s(n(4));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],a=.5*n[2],s=e[0],o=e[1],u=e[2],c=e[3];return t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-a*o,t[5]=i*c+a*s-r*u,t[6]=a*c+r*o-i*s,t[7]=-r*s-i*o-a*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[4],u=n[5],c=n[6],f=n[7],h=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],E=n[3];return t[0]=r*E+s*_+i*g-a*p,t[1]=i*E+s*p+a*_-r*g,t[2]=a*E+s*g+r*p-i*_,t[3]=s*E-r*_-i*p-a*g,t[4]=r*f+s*o+i*c-a*u+h*E+m*_+l*g-d*p,t[5]=i*f+s*u+a*o-r*c+l*E+m*p+d*_-h*g,t[6]=a*f+s*c+r*u-i*o+d*E+m*g+h*p-l*_,t[7]=s*f-r*o-i*u-a*c+m*E-h*_-l*p-d*g,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var f=e.dot=i.dot,h=e.length=i.length,l=(e.len=h,e.squaredLength=i.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,a,s){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=a,o[5]=s,o},e.set=function(t,e,n,r,i,a,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=n*a-r*i;return u?(u=1/u,t[0]=a*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-a*s)*u,t[5]=(r*s-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=Math.sin(n),f=Math.cos(n);return t[0]=r*f+a*c,t[1]=i*f+s*c,t[2]=r*-c+a*f,t[3]=i*-c+s*f,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r*c,t[1]=i*c,t[2]=a*f,t[3]=s*f,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=r*c+a*f+o,t[5]=i*c+s*f+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=e[0],f=e[1],h=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1],h=n[2],l=n[3],d=n[4],m=n[5];return t[0]=r*c+a*f,t[1]=i*c+s*f,t[2]=r*h+a*l,t[3]=i*h+s*l,t[4]=r*d+a*m+o,t[5]=i*d+s*m+u,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*a-i*r;return s?(s=1/s,t[0]=a*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=r*-o+a*u,t[3]=i*-o+s*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=a*u,t[3]=s*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*o+a*u,t[1]=i*o+s*u,t[2]=r*c+a*f,t[3]=i*c+s*f,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=d(n(0)),i=d(n(9)),a=d(n(8)),s=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),f=d(n(6)),h=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=a,e.mat3=s,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=f,e.vec3=h,e.vec4=l}])},function(t,e,n){"use strict";var r=function(){var t,e;try{t=Object.defineProperty,e=Object.defineProperties,t({},"$",{value:0})}catch(n){"__defineGetter__"in Object&&(t=function(t,e,n){return"value"in n&&(t[e]=n.value),"get"in n&&t.__defineGetter__(e,n.get),"set"in n&&t.__defineSetter__(e,n.set),t},e=function(e,n){for(var r in n)n.hasOwnProperty(r)&&t(e,r,n[r]);return e})}var n=function(t){for(var n=1,r=arguments.length;n>1,s=n(t[a],e);if(0===s)return[a,a];s<0?r=a+1:i=a-1}return r>i?[i,r]:[r,i]}function E(t,e,n){var r=g(t,e,n);t.splice(r[1],0,e)}function v(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?f:t instanceof Uint32Array?h:l}var A,M,I=(a(A={},o,Int8Array),a(A,u,Uint8Array),a(A,c,Int16Array),a(A,f,Uint16Array),a(A,h,Uint32Array),a(A,l,Float32Array),M=A,function(t){return M[t]||Float32Array});function R(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function P(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),a=n(1),s=n(5),o=n(10),u=new s.a,c=new s.a,f=a.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],f=n[1],h=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=f*m-h*d,g=h*l-o*m,E=o*d-f*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=f*m-h*d)*p+(g=h*l-(o+=1e-7)*m)*g+(E=o*d-f*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new f),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});f.prototype.sub=f.prototype.subtract,f.prototype.mul=f.prototype.multiply,e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(12),a=n(4),s=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;s.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(a.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(a.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=s},function(t,e,n){"use strict";var r=n(1).a.create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),i={_listeners:null,on:function(t,e,n){for(var r=this._listeners=this._listeners||{},i=r[t]=r[t]||[],a=0,s=i.length;a0){if(1===arguments.length)return delete this._listeners[t],this;for(var r=0,i=n.length;r0){var o=s.slice(0);if((n=n||new r(i,this,e))._stopped)return!1;for(var u=0;u-1&&s.splice(f,1)}}return!0}return!1}};e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(11),a=n(1),s=n(9),o=new i.a,u=a.a.create({Mixes:s.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t,e){return r.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=this.elements;return r[0]=t[e],r[1]=t[e+1],r[2]=t[e+2],r[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,i,a){return r.quat.set(this.elements,t,e,n,i),a||this.fire("update"),this},identity:function(t){return r.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return r.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,i){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),i||this.fire("update"),this},setAxisAngle:function(t,e,n){return r.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return r.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return r.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return r.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return r.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return r.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return r.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return r.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return r.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return r.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return r.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,i,a,s){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),s||this.fire("update"),this},invert:function(t){return r.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return r.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(t){return r.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return r.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,a=t.order||"ZYX",s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),f=Math.sin(i),h=Math.cos(i),l=this.elements;return"XYZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"YXZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"ZXY"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"ZYX"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"YZX"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h-s*u*f):"XZY"===a&&(l[0]=s*c*h-o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h+s*u*f),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,a,s,o,u,c){return r.mat3.set(this.elements,t,e,n,i,a,s,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var a=Math.cos(t),s=Math.sin(t);return this.set(r*a,-i*s,0,r*s,i*a,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(7),s=n(3),o=new a.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,f=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],a=n[1],o=n[2],u=n[4],c=n[5],f=n[6],h=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(f,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(h,d),this.elements[2]=Math.atan2(a,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(a,r))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(f,d),this.elements[2]=Math.atan2(a,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(h,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(f,c),this.elements[1]=Math.atan2(h,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):s.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=f},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return i(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,r){return r-e-n+t}},{key:"depp",value:function(t,e,n,r){return e+n-t+r}},{key:"ATTR",get:function(){return s}},{key:"ATTR_NAME_ID",get:function(){return u}}]),i(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){s[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=h[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a=0;c--)o[u+c]=n.apply(null,i.map((function(t){return s[t*r.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=a.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=a.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var r=c[e.name];r&&(e.data.BYTES_PER_ELEMENT?n[r]=new t.GeometryData(e.data,e.itemCount):n[r]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),r=e.attributes,i=0;for(var a in r.POSITION&&(i=r.POSITION.length/3),r)if(s[a]){var o=h[s[a]];i&&(o=r[a].length/i),n.addAttr(s[a],r[a],o)}else console.warn("Dont support attribute",a);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var r in f)e[r]&&n.addAttr(f[r],e[r].data,e[r].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function r(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,i){var a=r(i),s=n-e;return Math.round((t-e)/s*a)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,i=r(e),a=1/0,s=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,s=t.length,o=r(a),u=i-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=t.length,s=r(e),o=i-n,u=new Float32Array(a),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var r=c[n[3]].read(t,e+4);return r.geometry.type=n[3],r.geometry}(t,e))}var h,l=null,d=null;function m(t,e){return!l&&o()?(l=new s({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return f(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),f(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===h||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var r=new XMLHttpRequest;r.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)h=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));h=new Worker(t)}h.onerror=function(t){console.log("web worker error",t),h=!1,n(t)},e(h)})),r.addEventListener("error",(function(t){return n(t)})),r.open("get",t,!0),r.send()})):new Promise((function(e,n){(h=new Worker(t)).onerror=function(t){console.log("web worker init error",t),h=!1,n(t)},e(h)})))}var E=0;function v(t,e,n,i){return e=e&&o(),t=new Uint8Array(t),g(i).then((function(i){return new Promise((function(a,s){var o=E++,u=function(e){if(e.data.id===o)if(i.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=r,n.__proto__=r.prototype,a(n)}else a(f(t))};i.addEventListener("message",u),i.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(r){return e?_(t,n):f(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var r=o();return!r||t.byteLength>1048576?v(t,r,e,n):r?Promise.resolve(_(t,e)):Promise.resolve(f(t))},decompressWithJS:f,decompressWithWASM:_,decompressWithWorker:v,destory:function(){h&&(h.terminate(),h=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex,i=this.currentVertex-n+1,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r,r=i,e[this.prevCorner(t[a])]=i++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex-n+1,i=r,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r++,e[this.prevCorner(t[a])]=a?r:i;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,r=this.clers,i=r.length,a=-1,s=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,r=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&r.cal(r,t,a.plus,this.lastReadVertexIndex,t):r.cal(r,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,r=this.currentVertex--;e[n]=r;var i=t.pop();return e[this.nextCorner(i)]=r,e[this.prevCorner(i)]=-this.nextCorner(t[t.length-1]),i=t.shift(),e[this.prevCorner(i)]=r,e[this.nextCorner(i)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=this.handlesMap[this.currentFace],s=e.splice(0,t);return e.shift(),n.push(s),r[this.nextCorner(a)]=-(i+1),r[this.prevCorner(a)]=-this.nextCorner(s[s.length-1]),r[i]=-this.prevCorner(s[0]),e.push(i),e}},{key:"onHandleStart",value:function(t,e){for(var n,i=this.indices,a=3*this.currentFace,s=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(s);if(u>=0){var c,f=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,r(f));break}}return i[this.nextCorner(s)]=-(a+1),i[this.prevCorner(s)]=-this.nextCorner(n[n.length-1]),i[a]=-this.prevCorner(t[0]),(t=n.concat(t)).push(a),t}},{key:"onFaceS",value:function(t,e,n){var r=this.handlesMap,i=this.indices,a=3*this.currentFace;if(r[this.currentFace]){this.markCorner(t.pop(),t);var s=t.indexOf(r[this.currentFace]);t=s>=0?this.onHandleEnd(s,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),i[a]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(a)}return t}},{key:"onFaceM",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(a);var s=r[this.prevCorner(a[0])];r[i]=s;var o=t.pop();return r[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),r[this.nextCorner(o)]=s,o=t.shift(),r[this.prevCorner(o)]=s,r[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(i),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,r=this.clers,i=[],a=[];this.currentFace>=0;){var s="onFace"+u[r[this.currentFace]];this[s]?n=this[s](n,i,a):console.warn("has no ".concat(s)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&i(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},r=[];for(var i in n)r[n[i]]=i;n.map=r,t.exports=n},function(t,e,n){var r=n(0);function i(t,e,n,r){return new t(e.slice(n,n+r*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),a=new r,s=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=s.headerBytes,a.mode="CLERS",e=function(t,e,n,r){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),r={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,r){return n.fill(e,t,t+r),t},_printf:function(t,e){for(var r=t;n[r];)r++;var i=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new i(d);return f.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),r=n[0],i=n[1],a=n[2],s=new Float32Array(e.buffer.slice(a,a+u*i*4));m.addAttr(m.attrIdToName(r),s,i)})),m}}])&&r(e.prototype,n),t}();t.exports=a},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var r=n(34),i=n.n(r),a=n(1),s=n(5),o=a.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new s.a(0,0,0),this.direction=t.direction||new s.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new s.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),a=n(9),s=n(5),o=i.a.create({Mixes:a.a,Extends:s.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return r.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.fire("update"),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.fire("update"),this},random:function(t){return r.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this.fire("update"),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e,n){"use strict";var r=n(1),i=n(5),a=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=a},function(t,e,n){"use strict";var r=n(1),i=n(5),a=new i.a,s=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.fire("update"),this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this.fire("update"),this},identity:function(){return i.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,a){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),a||this.fire("update"),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this.fire("update"),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=f.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=f.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],u=n[1],c=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,E=o*d-u*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(E=o*d-u*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this.fire("update"),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new u.a),this.determinant()<0&&(n.x*=-1),r.copy(this),f.inverse(n),r.scale(f),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var r=n(1),i=n(9),a=n(6),s=n(13),o=a.a.DEG2RAD,u=a.a.RAD2DEG,c=r.a.create({Mixes:i.a,Extends:s.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(19),a=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5],c=n[6],f=n[7],h=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],E=n[15];return e[0].set(s-r,f-o,m-h,E-_).normalize(),e[1].set(s+r,f+o,m+h,E+_).normalize(),e[2].set(s+i,f+u,m+l,E+p).normalize(),e[3].set(s-i,f-u,m-l,E-p).normalize(),e[4].set(s-a,f-c,m-d,E-g).normalize(),e[5].set(s+a,f+c,m+d,E+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)l)return null;r(f,u,s);var m=i(n,f);if(m<0||d+m>l)return null;var _=i(o,f)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2];return t[0]=i*u-a*o,t[1]=a*s-r*u,t[2]=r*o-i*s,t}},function(t,e,n){var r=n(26),i=n(31),a=n(32),s=n(33);t.exports=function(t,e,n,u,c){var f=r(n,u);if(0!==f){var h=-(r(e,u)+c)/f;return h<0?null:(a(o,n,h),i(t,e,o))}return r(u,e)+c===0?s(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(92),i=n(26),a=n(30),s=n(93),o=n(32),u=n(31),c=[0,0,0];t.exports=function(t,e,n,f,h){a(c,f,e);var l=i(n,c);if(l<0)return null;s(c,e,n,l);var d=r(f,c),m=h*h;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,a=1/0,s=0;su){var c=o;o=u,u=c}if(ua)return 1/0;o>i&&(i=o),ua?1/0:i}t.exports=function(t,e,r,i){var a=n(e,r,i);if(a===1/0)t=null;else{t=t||[];for(var s=0;s0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=a*s),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=s+r*(n[2]-s),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,a,s,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(a=2*r.RANDOM()-1)*a+(s=2*r.RANDOM()-1)*s}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*a*c,t[3]=e*s*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*s,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2],c=n[3],f=c*r+o*a-u*i,h=c*i+u*r-s*a,l=c*a+s*i-o*r,d=-s*r-o*i-u*a;return t[0]=f*c+d*-s+h*-u-l*-o,t[1]=h*c+d*-o+l*-s-f*-u,t[2]=l*c+d*-u+f*-o-h*-s,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+a*a)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function f(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.len=f,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],u=e[2];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-u)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function a(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function s(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function l(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=f,e.sqrDist=h,e.len=a,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=f,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=a*u-i*o,t[3]=s*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-a*o,t[1]=i*u+s*o,t[2]=a*u+r*o,t[3]=s*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=a*u+s*o,t[3]=s*u-a*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=h,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),a=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=a*Math.sin(2*Math.PI*n),t[1]=a*Math.cos(2*Math.PI*n),t[2]=s*Math.sin(2*Math.PI*i),t[3]=s*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*n+r*r+i*i+a*a,o=s?1/s:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=a*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=a*u*f-s*o*c,t[1]=s*o*f+a*u*c,t[2]=s*u*c-a*o*f,t[3]=s*u*f+a*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),a=o(n(2)),s=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function f(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*f+s*o+i*c-a*u,t[1]=i*f+s*u+a*o-r*c,t[2]=a*f+s*c+r*u-i*o,t[3]=s*f-r*o-i*u-a*c,t}function h(t,e,n,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=n[0],f=n[1],h=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=a*c+s*f+o*h+u*l)<0&&(m=-m,c=-c,f=-f,h=-h,l=-l),1-m>r.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-i)*d)/_,g=Math.sin(i*d)/_):(p=1-i,g=i),t[0]=p*a+g*c,t[1]=p*s+g*f,t[2]=p*o+g*h,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+s]-e[3*s+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}e.clone=s.clone,e.fromValues=s.fromValues,e.copy=s.copy,e.set=s.set,e.add=s.add,e.mul=f,e.scale=s.scale,e.dot=s.dot,e.lerp=s.lerp;var d=e.length=s.length,m=(e.len=d,e.squaredLength=s.squaredLength),_=(e.sqrLen=m,e.normalize=s.normalize);e.exactEquals=s.exactEquals,e.equals=s.equals,e.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,i,s){var o=a.dot(i,s);return o<-.999999?(a.cross(t,e,i),a.len(t)<1e-6&&a.cross(t,n,i),a.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,s),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,_(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,a,s,o){return h(t,r,s,o),h(e,i,a,o),h(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,a,s,o,u,c,f,h,l,d,m,_,p){var g=new r.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=i,g[4]=a,g[5]=s,g[6]=o,g[7]=u,g[8]=c,g[9]=f,g[10]=h,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,r,i,a,s,o,u,c,f,h,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,I=i*c-a*u,R=f*_-h*m,O=f*p-l*m,L=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*L-M*O+I*R;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(i*y-r*N-a*S)*x,t[2]=(_*I-p*M+g*A)*x,t[3]=(l*M-h*I-d*A)*x,t[4]=(u*L-s*N-c*O)*x,t[5]=(n*N-i*L+a*O)*x,t[6]=(p*T-m*I-g*v)*x,t[7]=(f*I-l*T+d*v)*x,t[8]=(s*y-o*L+c*R)*x,t[9]=(r*L-n*y-a*R)*x,t[10]=(m*M-_*T+g*E)*x,t[11]=(h*T-f*M-d*E)*x,t[12]=(o*O-s*S-u*R)*x,t[13]=(n*S-r*O+i*R)*x,t[14]=(_*v-m*A-p*E)*x,t[15]=(f*A-h*v+l*E)*x,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-h*(u*g-c*p)+_*(u*d-c*l),t[1]=-(r*(l*g-d*p)-h*(i*g-a*p)+_*(i*d-a*l)),t[2]=r*(u*g-c*p)-o*(i*g-a*p)+_*(i*c-a*u),t[3]=-(r*(u*d-c*l)-o*(i*d-a*l)+h*(i*c-a*u)),t[4]=-(s*(l*g-d*p)-f*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-f*(i*g-a*p)+m*(i*d-a*l),t[6]=-(n*(u*g-c*p)-s*(i*g-a*p)+m*(i*c-a*u)),t[7]=n*(u*d-c*l)-s*(i*d-a*l)+f*(i*c-a*u),t[8]=s*(h*g-d*_)-f*(o*g-c*_)+m*(o*d-c*h),t[9]=-(n*(h*g-d*_)-f*(r*g-a*_)+m*(r*d-a*h)),t[10]=n*(o*g-c*_)-s*(r*g-a*_)+m*(r*c-a*o),t[11]=-(n*(o*d-c*h)-s*(r*d-a*h)+f*(r*c-a*o)),t[12]=-(s*(h*p-l*_)-f*(o*p-u*_)+m*(o*l-u*h)),t[13]=n*(h*p-l*_)-f*(r*p-i*_)+m*(r*l-i*h),t[14]=-(n*(o*p-u*_)-s*(r*p-i*_)+m*(r*u-i*o)),t[15]=n*(o*l-u*h)-s*(r*l-i*h)+f*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8],f=t[9],h=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*s-n*a)*(h*p-l*_)-(e*o-r*a)*(f*p-l*m)+(e*u-i*a)*(f*_-h*m)+(n*o-r*s)*(c*p-l*d)-(n*u-i*s)*(c*_-h*d)+(r*u-i*o)*(c*m-f*d)},e.multiply=a,e.translate=function(t,e,n){var r=n[0],i=n[1],a=n[2],s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*a+e[12],t[13]=e[1]*r+e[5]*i+e[9]*a+e[13],t[14]=e[2]*r+e[6]*i+e[10]*a+e[14],t[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(s=e[0],o=e[1],u=e[2],c=e[3],f=e[4],h=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=f,t[5]=h,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=s*r+f*i+m*a+e[12],t[13]=o*r+h*i+_*a+e[13],t[14]=u*r+l*i+p*a+e[14],t[15]=c*r+d*i+g*a+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var a,s,o,u,c,f,h,l,d,m,_,p,g,E,v,T,A,M,I,R,O,L,S,y,N=i[0],x=i[1],C=i[2],b=Math.sqrt(N*N+x*x+C*C);return b0?(n[0]=2*(c*u+l*i+f*o-h*a)/d,n[1]=2*(f*u+l*a+h*i-c*o)/d,n[2]=2*(h*u+l*o+c*a-f*i)/d):(n[0]=2*(c*u+l*i+f*o-h*a),n[1]=2*(f*u+l*a+h*i-c*o),n[2]=2*(h*u+l*o+c*a-f*i)),s(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],s=e[5],o=e[6],u=e[8],c=e[9],f=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+s*s+o*o),t[2]=Math.sqrt(u*u+c*c+f*f),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3],u=i+i,c=a+a,f=s+s,h=i*u,l=i*c,d=i*f,m=a*c,_=a*f,p=s*f,g=o*u,E=o*c,v=o*f,T=r[0],A=r[1],M=r[2];return t[0]=(1-(m+p))*T,t[1]=(l+v)*T,t[2]=(d-E)*T,t[3]=0,t[4]=(l-v)*A,t[5]=(1-(h+p))*A,t[6]=(_+g)*A,t[7]=0,t[8]=(d+E)*M,t[9]=(_-g)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=a+a,f=s+s,h=o+o,l=a*c,d=a*f,m=a*h,_=s*f,p=s*h,g=o*h,E=u*c,v=u*f,T=u*h,A=r[0],M=r[1],I=r[2],R=i[0],O=i[1],L=i[2],S=(1-(_+g))*A,y=(d+T)*A,N=(m-v)*A,x=(d-T)*M,C=(1-(l+g))*M,b=(p+E)*M,P=(m+v)*I,w=(p-E)*I,D=(1-(l+_))*I;return t[0]=S,t[1]=y,t[2]=N,t[3]=0,t[4]=x,t[5]=C,t[6]=b,t[7]=0,t[8]=P,t[9]=w,t[10]=D,t[11]=0,t[12]=n[0]+R-(S*R+x*O+P*L),t[13]=n[1]+O-(y*R+C*O+w*L),t[14]=n[2]+L-(N*R+b*O+D*L),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[1]=f+g,t[2]=l-p,t[3]=0,t[4]=f-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,a,s){var o=1/(n-e),u=1/(i-r),c=1/(a-s);return t[0]=2*a*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(s+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*a*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var a=1/Math.tan(e/2),s=void 0;return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(r-i),t[10]=(i+r)*s,t[14]=2*i*r*s):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(s+o),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(s-o)*u*.5,t[9]=(i-a)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,a,s){var o=1/(e-n),u=1/(r-i),c=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(s+a)*c,t[15]=1,t},e.lookAt=function(t,e,n,a){var s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],E=e[2],v=a[0],T=a[1],A=a[2],M=n[0],I=n[1],R=n[2];return Math.abs(p-M)0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var m=u*l-c*h,_=c*f-o*l,p=o*h-u*f;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=h*p-l*_,t[5]=l*m-f*p,t[6]=f*_-h*m,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=i,t[13]=a,t[14]=s,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],E=t[15],v=e[0],T=e[1],A=e[2],M=e[3],I=e[4],R=e[5],O=e[6],L=e[7],S=e[8],y=e[9],N=e[10],x=e[11],C=e[12],b=e[13],P=e[14],w=e[15];return Math.abs(n-v)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(s-M)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-I)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-R)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-O)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(f-L)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(h-S)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-N)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(m-x)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(_-C)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(C))&&Math.abs(p-b)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(b))&&Math.abs(g-P)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(E-w)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(w))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function a(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],E=e[15],v=n[0],T=n[1],A=n[2],M=n[3];return t[0]=v*r+T*o+A*h+M*_,t[1]=v*i+T*u+A*l+M*p,t[2]=v*a+T*c+A*d+M*g,t[3]=v*s+T*f+A*m+M*E,v=n[4],T=n[5],A=n[6],M=n[7],t[4]=v*r+T*o+A*h+M*_,t[5]=v*i+T*u+A*l+M*p,t[6]=v*a+T*c+A*d+M*g,t[7]=v*s+T*f+A*m+M*E,v=n[8],T=n[9],A=n[10],M=n[11],t[8]=v*r+T*o+A*h+M*_,t[9]=v*i+T*u+A*l+M*p,t[10]=v*a+T*c+A*d+M*g,t[11]=v*s+T*f+A*m+M*E,v=n[12],T=n[13],A=n[14],M=n[15],t[12]=v*r+T*o+A*h+M*_,t[13]=v*i+T*u+A*l+M*p,t[14]=v*a+T*c+A*d+M*g,t[15]=v*s+T*f+A*m+M*E,t}function s(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=r+r,u=i+i,c=a+a,f=r*o,h=r*u,l=r*c,d=i*u,m=i*c,_=a*c,p=s*o,g=s*u,E=s*c;return t[0]=1-(d+_),t[1]=h+E,t[2]=l-g,t[3]=0,t[4]=h-E,t[5]=1-(f+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=a,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,a,s,o,u,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=i,f[4]=a,f[5]=s,f[6]=o,f[7]=u,f[8]=c,f},e.set=function(t,e,n,r,i,a,s,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=f*s-o*c,l=-f*a+o*u,d=c*a-s*u,m=n*h+r*l+i*d;return m?(m=1/m,t[0]=h*m,t[1]=(-f*r+i*c)*m,t[2]=(o*r-i*s)*m,t[3]=l*m,t[4]=(f*n-i*u)*m,t[5]=(-o*n+i*a)*m,t[6]=d*m,t[7]=(-c*n+r*u)*m,t[8]=(s*n-r*a)*m,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8];return t[0]=s*f-o*c,t[1]=i*c-r*f,t[2]=r*o-i*s,t[3]=o*u-a*f,t[4]=n*f-i*u,t[5]=i*a-n*o,t[6]=a*c-s*u,t[7]=r*u-n*c,t[8]=n*s-r*a,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8];return e*(c*a-s*u)+n*(-c*i+s*o)+r*(u*i-a*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=u,t[6]=l*r+d*s+c,t[7]=l*i+d*o+f,t[8]=l*a+d*u+h,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*r+l*s,t[1]=d*i+l*o,t[2]=d*a+l*u,t[3]=d*s-l*r,t[4]=d*o-l*i,t[5]=d*u-l*a,t[6]=c,t[7]=f,t[8]=h,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[3]=f-g,t[6]=l+p,t[1]=f+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-h,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,I=i*c-a*u,R=f*_-h*m,O=f*p-l*m,L=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*L-M*O+I*R;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(u*L-s*N-c*O)*x,t[2]=(s*y-o*L+c*R)*x,t[3]=(i*y-r*N-a*S)*x,t[4]=(n*N-i*L+a*O)*x,t[5]=(r*L-n*y-a*R)*x,t[6]=(_*I-p*M+g*A)*x,t[7]=(p*T-m*I-g*v)*x,t[8]=(m*M-_*T+g*E)*x,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],E=e[6],v=e[7],T=e[8];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-E)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(f-v)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(v))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],E=n[6],v=n[7],T=n[8];return t[0]=l*r+d*s+m*c,t[1]=l*i+d*o+m*f,t[2]=l*a+d*u+m*h,t[3]=_*r+p*s+g*c,t[4]=_*i+p*o+g*f,t[5]=_*a+p*u+g*h,t[6]=E*r+v*s+T*c,t[7]=E*i+v*o+T*f,t[8]=E*a+v*u+T*h,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=a,e.multiply=s,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],s=Math.sin(r),o=Math.cos(r);return t[0]=i*o-a*s+n[0],t[1]=i*s+a*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));var o=i*i+a*a;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*a)*s*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],a=e[0],s=e[1];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function f(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){var e=t[0],n=t[1];return e*e+n*n}e.len=f,e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,a=e[2]/n,s=e[3]/n,o=e[4],u=e[5],c=e[6],f=e[7],h=r*o+i*u+a*c+s*f;t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=(o-r*h)/n,t[5]=(u-i*h)/n,t[6]=(c-a*h)/n,t[7]=(f-s*h)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],E=e[7];return Math.abs(n-h)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-_)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(f-E)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))};var r=s(n(0)),i=s(n(3)),a=s(n(4));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],a=.5*n[2],s=e[0],o=e[1],u=e[2],c=e[3];return t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-a*o,t[5]=i*c+a*s-r*u,t[6]=a*c+r*o-i*s,t[7]=-r*s-i*o-a*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[4],u=n[5],c=n[6],f=n[7],h=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],E=n[3];return t[0]=r*E+s*_+i*g-a*p,t[1]=i*E+s*p+a*_-r*g,t[2]=a*E+s*g+r*p-i*_,t[3]=s*E-r*_-i*p-a*g,t[4]=r*f+s*o+i*c-a*u+h*E+m*_+l*g-d*p,t[5]=i*f+s*u+a*o-r*c+l*E+m*p+d*_-h*g,t[6]=a*f+s*c+r*u-i*o+d*E+m*g+h*p-l*_,t[7]=s*f-r*o-i*u-a*c+m*E-h*_-l*p-d*g,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var f=e.dot=i.dot,h=e.length=i.length,l=(e.len=h,e.squaredLength=i.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,a,s){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=a,o[5]=s,o},e.set=function(t,e,n,r,i,a,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=n*a-r*i;return u?(u=1/u,t[0]=a*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-a*s)*u,t[5]=(r*s-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=Math.sin(n),f=Math.cos(n);return t[0]=r*f+a*c,t[1]=i*f+s*c,t[2]=r*-c+a*f,t[3]=i*-c+s*f,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r*c,t[1]=i*c,t[2]=a*f,t[3]=s*f,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=r*c+a*f+o,t[5]=i*c+s*f+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=e[0],f=e[1],h=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1],h=n[2],l=n[3],d=n[4],m=n[5];return t[0]=r*c+a*f,t[1]=i*c+s*f,t[2]=r*h+a*l,t[3]=i*h+s*l,t[4]=r*d+a*m+o,t[5]=i*d+s*m+u,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*a-i*r;return s?(s=1/s,t[0]=a*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=r*-o+a*u,t[3]=i*-o+s*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=a*u,t[3]=s*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*o+a*u,t[1]=i*o+s*u,t[2]=r*c+a*f,t[3]=i*c+s*f,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=d(n(0)),i=d(n(9)),a=d(n(8)),s=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),f=d(n(6)),h=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=a,e.mat3=s,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=f,e.vec3=h,e.vec4=l}])},function(t,e,n){"use strict";var r=function(){var t,e;try{t=Object.defineProperty,e=Object.defineProperties,t({},"$",{value:0})}catch(n){"__defineGetter__"in Object&&(t=function(t,e,n){return"value"in n&&(t[e]=n.value),"get"in n&&t.__defineGetter__(e,n.get),"set"in n&&t.__defineSetter__(e,n.set),t},e=function(e,n){for(var r in n)n.hasOwnProperty(r)&&t(e,r,n[r]);return e})}var n=function(t){for(var n=1,r=arguments.length;n>1,s=n(t[a],e);if(0===s)return[a,a];s<0?r=a+1:i=a-1}return r>i?[i,r]:[r,i]}function E(t,e,n){var r=g(t,e,n);t.splice(r[1],0,e)}function v(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?f:t instanceof Uint32Array?h:l}var A,M,I=(a(A={},o,Int8Array),a(A,u,Uint8Array),a(A,c,Int16Array),a(A,f,Uint16Array),a(A,h,Uint32Array),a(A,l,Float32Array),M=A,function(t){return M[t]||Float32Array});function R(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function P(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),a=n(1),s=n(5),o=n(9),u=new s.a,c=new s.a,f=a.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],f=n[1],h=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=f*m-h*d,g=h*l-o*m,E=o*d-f*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=f*m-h*d)*p+(g=h*l-(o+=1e-7)*m)*g+(E=o*d-f*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new f),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});f.prototype.sub=f.prototype.subtract,f.prototype.mul=f.prototype.multiply,e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(11),a=n(4),s=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;s.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(a.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(a.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=s},function(t,e,n){"use strict";var r=n(0),i=n(10),a=n(1),s=new i.a,o=a.a.create({className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t){return r.quat.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.quat.set(this.elements,t,e,n,i),this},identity:function(){return r.quat.identity(this.elements),this},rotationTo:function(t,e){return r.quat.rotationTo(this.elements,t.elements,e.elements),this},setAxes:function(t,e,n){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),this},setAxisAngle:function(t,e){return r.quat.setAxisAngle(this.elements,t.elements,e),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e){return r.quat.lerp(this.elements,this.elements,t.elements,e),this},slerp:function(t,e){return r.quat.slerp(this.elements,this.elements,t.elements,e),this},sqlerp:function(t,e,n,i,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},invert:function(){return r.quat.invert(this.elements,this.elements),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this},fromMat4:function(t){return s.fromMat4(t),this.fromMat3(s),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t){var e=.5*t.x,n=.5*t.y,r=.5*t.z,i=t.order||"ZYX",a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r),h=this.elements;return"XYZ"===i?(h[0]=a*u*f+s*o*c,h[1]=s*o*f-a*u*c,h[2]=s*u*c+a*o*f,h[3]=s*u*f-a*o*c):"YXZ"===i?(h[0]=a*u*f+s*o*c,h[1]=s*o*f-a*u*c,h[2]=s*u*c-a*o*f,h[3]=s*u*f+a*o*c):"ZXY"===i?(h[0]=a*u*f-s*o*c,h[1]=s*o*f+a*u*c,h[2]=s*u*c+a*o*f,h[3]=s*u*f-a*o*c):"ZYX"===i?(h[0]=a*u*f-s*o*c,h[1]=s*o*f+a*u*c,h[2]=s*u*c-a*o*f,h[3]=s*u*f+a*o*c):"YZX"===i?(h[0]=a*u*f+s*o*c,h[1]=s*o*f+a*u*c,h[2]=s*u*c-a*o*f,h[3]=s*u*f-a*o*c):"XZY"===i&&(h[0]=a*u*f-s*o*c,h[1]=s*o*f-a*u*c,h[2]=s*u*c+a*o*f,h[3]=s*u*f+a*o*c),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});o.prototype.mul=o.prototype.multiply,o.prototype.len=o.prototype.length,o.prototype.sqrLen=o.prototype.squaredLength,e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,a,s,o,u,c){return r.mat3.set(this.elements,t,e,n,i,a,s,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var a=Math.cos(t),s=Math.sin(t);return this.set(r*a,-i*s,0,r*s,i*a,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(7),s=n(3),o=new a.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,f=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],a=n[1],o=n[2],u=n[4],c=n[5],f=n[6],h=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(f,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(h,d),this.elements[2]=Math.atan2(a,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(a,r))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(f,d),this.elements[2]=Math.atan2(a,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(h,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(f,c),this.elements[1]=Math.atan2(h,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):s.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=f},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return i(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,r){return r-e-n+t}},{key:"depp",value:function(t,e,n,r){return e+n-t+r}},{key:"ATTR",get:function(){return s}},{key:"ATTR_NAME_ID",get:function(){return u}}]),i(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){s[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=h[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a=0;c--)o[u+c]=n.apply(null,i.map((function(t){return s[t*r.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=a.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=a.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var r=c[e.name];r&&(e.data.BYTES_PER_ELEMENT?n[r]=new t.GeometryData(e.data,e.itemCount):n[r]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),r=e.attributes,i=0;for(var a in r.POSITION&&(i=r.POSITION.length/3),r)if(s[a]){var o=h[s[a]];i&&(o=r[a].length/i),n.addAttr(s[a],r[a],o)}else console.warn("Dont support attribute",a);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var r in f)e[r]&&n.addAttr(f[r],e[r].data,e[r].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function r(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,i){var a=r(i),s=n-e;return Math.round((t-e)/s*a)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,i=r(e),a=1/0,s=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,s=t.length,o=r(a),u=i-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=t.length,s=r(e),o=i-n,u=new Float32Array(a),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var r=c[n[3]].read(t,e+4);return r.geometry.type=n[3],r.geometry}(t,e))}var h,l=null,d=null;function m(t,e){return!l&&o()?(l=new s({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return f(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),f(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===h||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var r=new XMLHttpRequest;r.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)h=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));h=new Worker(t)}h.onerror=function(t){console.log("web worker error",t),h=!1,n(t)},e(h)})),r.addEventListener("error",(function(t){return n(t)})),r.open("get",t,!0),r.send()})):new Promise((function(e,n){(h=new Worker(t)).onerror=function(t){console.log("web worker init error",t),h=!1,n(t)},e(h)})))}var E=0;function v(t,e,n,i){return e=e&&o(),t=new Uint8Array(t),g(i).then((function(i){return new Promise((function(a,s){var o=E++,u=function(e){if(e.data.id===o)if(i.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=r,n.__proto__=r.prototype,a(n)}else a(f(t))};i.addEventListener("message",u),i.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(r){return e?_(t,n):f(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var r=o();return!r||t.byteLength>1048576?v(t,r,e,n):r?Promise.resolve(_(t,e)):Promise.resolve(f(t))},decompressWithJS:f,decompressWithWASM:_,decompressWithWorker:v,destory:function(){h&&(h.terminate(),h=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex,i=this.currentVertex-n+1,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r,r=i,e[this.prevCorner(t[a])]=i++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex-n+1,i=r,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r++,e[this.prevCorner(t[a])]=a?r:i;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,r=this.clers,i=r.length,a=-1,s=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,r=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&r.cal(r,t,a.plus,this.lastReadVertexIndex,t):r.cal(r,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,r=this.currentVertex--;e[n]=r;var i=t.pop();return e[this.nextCorner(i)]=r,e[this.prevCorner(i)]=-this.nextCorner(t[t.length-1]),i=t.shift(),e[this.prevCorner(i)]=r,e[this.nextCorner(i)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=this.handlesMap[this.currentFace],s=e.splice(0,t);return e.shift(),n.push(s),r[this.nextCorner(a)]=-(i+1),r[this.prevCorner(a)]=-this.nextCorner(s[s.length-1]),r[i]=-this.prevCorner(s[0]),e.push(i),e}},{key:"onHandleStart",value:function(t,e){for(var n,i=this.indices,a=3*this.currentFace,s=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(s);if(u>=0){var c,f=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,r(f));break}}return i[this.nextCorner(s)]=-(a+1),i[this.prevCorner(s)]=-this.nextCorner(n[n.length-1]),i[a]=-this.prevCorner(t[0]),(t=n.concat(t)).push(a),t}},{key:"onFaceS",value:function(t,e,n){var r=this.handlesMap,i=this.indices,a=3*this.currentFace;if(r[this.currentFace]){this.markCorner(t.pop(),t);var s=t.indexOf(r[this.currentFace]);t=s>=0?this.onHandleEnd(s,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),i[a]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(a)}return t}},{key:"onFaceM",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(a);var s=r[this.prevCorner(a[0])];r[i]=s;var o=t.pop();return r[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),r[this.nextCorner(o)]=s,o=t.shift(),r[this.prevCorner(o)]=s,r[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(i),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,r=this.clers,i=[],a=[];this.currentFace>=0;){var s="onFace"+u[r[this.currentFace]];this[s]?n=this[s](n,i,a):console.warn("has no ".concat(s)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&i(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},r=[];for(var i in n)r[n[i]]=i;n.map=r,t.exports=n},function(t,e,n){var r=n(0);function i(t,e,n,r){return new t(e.slice(n,n+r*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),a=new r,s=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=s.headerBytes,a.mode="CLERS",e=function(t,e,n,r){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),r={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,r){return n.fill(e,t,t+r),t},_printf:function(t,e){for(var r=t;n[r];)r++;var i=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new i(d);return f.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),r=n[0],i=n[1],a=n[2],s=new Float32Array(e.buffer.slice(a,a+u*i*4));m.addAttr(m.attrIdToName(r),s,i)})),m}}])&&r(e.prototype,n),t}();t.exports=a},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var r=n(34),i=n.n(r),a=n(1),s=n(5),o=a.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new s.a(0,0,0),this.direction=t.direction||new s.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new s.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),a=n(5),s=i.a.create({Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},onUpdate:function(){},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.onUpdate(),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.onUpdate(),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.onUpdate(),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.onUpdate(),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.onUpdate(),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.onUpdate(),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.onUpdate(),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.onUpdate(),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.onUpdate(),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.onUpdate(),this},round:function(){return r.vec3.round(this.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.onUpdate(),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.onUpdate(),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.onUpdate(),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.onUpdate(),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.onUpdate(),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.onUpdate(),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},random:function(t){return r.vec3.random(this.elements,t),this.onUpdate(),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.onUpdate(),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.onUpdate(),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this.onUpdate(),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.onUpdate(),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.onUpdate(),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.onUpdate(),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.onUpdate(),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}}});e.a=s},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e,n){"use strict";var r=n(1),i=n(5),a=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=a},function(t,e,n){"use strict";var r=n(1),i=n(5),a=new i.a,s=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.onUpdate(),this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this.onUpdate(),this},identity:function(){return i.mat4.identity(this.elements),this.onUpdate(),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.onUpdate(),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.onUpdate(),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.onUpdate(),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.onUpdate(),this},premultiply:function(t){return this.multiply(t,this),this.onUpdate(),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.onUpdate(),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.onUpdate(),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.onUpdate(),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.onUpdate(),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.onUpdate(),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.onUpdate(),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.onUpdate(),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.onUpdate(),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.onUpdate(),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.onUpdate(),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new u.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,a){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),a||this.onUpdate(),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.onUpdate(),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this.onUpdate(),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.onUpdate(),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.onUpdate(),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this.onUpdate(),this},lookAt:function(t,e,n){return t.isVector3||(t=c.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},targetTo:function(t,e,n){t.isVector3||(t=c.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],u=n[1],h=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-h*d,g=h*l-o*m,E=o*d-u*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=u*m-h*d)*p+(g=h*l-(o+=1e-7)*m)*g+(E=o*d-u*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this.onUpdate(),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.onUpdate(),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.onUpdate(),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new o.a),this.determinant()<0&&(n.x*=-1),r.copy(this),c.inverse(n),r.scale(c),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=h},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(12),s=i.a.DEG2RAD,o=i.a.RAD2DEG,u=r.a.create({Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},onUpdate:function(){},updateDegrees:function(){return u.superclass.updateDegrees.call(this),this.onUpdate(),this},updateRadians:function(){return u.superclass.updateRadians.call(this),this.onUpdate(),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*s,this.onUpdate()}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*s,this.onUpdate()}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*s,this.onUpdate()}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*o,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*o,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*o,this.onUpdate()}}});e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(10),a=n(1),s=new i.a,o=a.a.create({className:"QuaternionNotifier",isQuaternionNotifier:!0,isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},onUpdate:function(){},copy:function(t){return r.quat.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this.onUpdate(),this},set:function(t,e,n,i){return r.quat.set(this.elements,t,e,n,i),this.onUpdate(),this},identity:function(){return r.quat.identity(this.elements),this.onUpdate(),this},rotationTo:function(t,e){return r.quat.rotationTo(this.elements,t.elements,e.elements),this.onUpdate(),this},setAxes:function(t,e,n){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},setAxisAngle:function(t,e){return r.quat.setAxisAngle(this.elements,t.elements,e),this.onUpdate(),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this.onUpdate(),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this.onUpdate(),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this.onUpdate(),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this.onUpdate(),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e){return r.quat.lerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},slerp:function(t,e){return r.quat.slerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},sqlerp:function(t,e,n,i,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},invert:function(){return r.quat.invert(this.elements,this.elements),this.onUpdate(),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this.onUpdate(),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this.onUpdate(),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this.onUpdate(),this},fromMat4:function(t){return s.fromMat4(t),this.fromMat3(s),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,a=t.order||"ZYX",s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),f=Math.sin(i),h=Math.cos(i),l=this.elements;return"XYZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"YXZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"ZXY"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"ZYX"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"YZX"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h-s*u*f):"XZY"===a&&(l[0]=s*c*h-o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h+s*u*f),e||this.onUpdate(),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.onUpdate()}}});o.prototype.mul=o.prototype.multiply,o.prototype.len=o.prototype.length,o.prototype.sqrLen=o.prototype.squaredLength,e.a=o},function(t,e,n){"use strict";var r=n(1),i=n(18),a=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5],c=n[6],f=n[7],h=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],E=n[15];return e[0].set(s-r,f-o,m-h,E-_).normalize(),e[1].set(s+r,f+o,m+h,E+_).normalize(),e[2].set(s+i,f+u,m+l,E+p).normalize(),e[3].set(s-i,f-u,m-l,E-p).normalize(),e[4].set(s-a,f-c,m-d,E-g).normalize(),e[5].set(s+a,f+c,m+d,E+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)l)return null;r(f,u,s);var m=i(n,f);if(m<0||d+m>l)return null;var _=i(o,f)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2];return t[0]=i*u-a*o,t[1]=a*s-r*u,t[2]=r*o-i*s,t}},function(t,e,n){var r=n(26),i=n(31),a=n(32),s=n(33);t.exports=function(t,e,n,u,c){var f=r(n,u);if(0!==f){var h=-(r(e,u)+c)/f;return h<0?null:(a(o,n,h),i(t,e,o))}return r(u,e)+c===0?s(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(92),i=n(26),a=n(30),s=n(93),o=n(32),u=n(31),c=[0,0,0];t.exports=function(t,e,n,f,h){a(c,f,e);var l=i(n,c);if(l<0)return null;s(c,e,n,l);var d=r(f,c),m=h*h;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,a=1/0,s=0;su){var c=o;o=u,u=c}if(ua)return 1/0;o>i&&(i=o),ua?1/0:i}t.exports=function(t,e,r,i){var a=n(e,r,i);if(a===1/0)t=null;else{t=t||[];for(var s=0;s0;){if(d(c)128){if(0==(u=(255&h[0])-128)||u>o-s)throw new Error("Bad scanline data");for(;u-- >0;)f[s++]=h[1]}else{if(0==(u=255&h[0])||u>o-s)throw new Error("Bad scanline data");if(f[s++]=h[1],--u>0){if(m(f,s,u)=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(103),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(35))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,s,o,u=1,c={},f=!1,h=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){m(t.data)},r=function(t){a.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(m,0,t)}:(s="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),r=function(e){t.postMessage(s+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\n\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define attribute in\n#define varying out\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n#define gl_FragColor hilo_FragData0\n#define gl_FragDepthEXT gl_FragDepth\nlayout(location = 0) out highp vec4 hilo_FragData0;"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return i})),n.d(e,"GLTFExtensions",(function(){return r})),n.d(e,"Class",(function(){return a.a})),n.d(e,"EventMixin",(function(){return s.a})),n.d(e,"Fog",(function(){return Hr})),n.d(e,"Mesh",(function(){return Br})),n.d(e,"Node",(function(){return g})),n.d(e,"SkinedMesh",(function(){return kr})),n.d(e,"Skeleton",(function(){return Yr})),n.d(e,"Stage",(function(){return gi})),n.d(e,"Tween",(function(){return Gi})),n.d(e,"version",(function(){return zr})),n.d(e,"BoxGeometry",(function(){return Vi})),n.d(e,"Geometry",(function(){return K})),n.d(e,"GeometryData",(function(){return b})),n.d(e,"MorphGeometry",(function(){return Tr})),n.d(e,"PlaneGeometry",(function(){return Yi})),n.d(e,"SphereGeometry",(function(){return qi})),n.d(e,"Camera",(function(){return O})),n.d(e,"PerspectiveCamera",(function(){return Q})),n.d(e,"OrthographicCamera",(function(){return Dn})),n.d(e,"Buffer",(function(){return jt})),n.d(e,"UniformBuffer",(function(){return Ki})),n.d(e,"capabilities",(function(){return lt})),n.d(e,"extensions",(function(){return ht})),n.d(e,"Framebuffer",(function(){return we})),n.d(e,"glType",(function(){return Ct})),n.d(e,"logGLResource",(function(){return Qi})),n.d(e,"Program",(function(){return Ft})),n.d(e,"RenderInfo",(function(){return qr})),n.d(e,"RenderList",(function(){return Jr})),n.d(e,"VertexArrayObject",(function(){return Qt})),n.d(e,"WebGLRenderer",(function(){return mi})),n.d(e,"WebGLResourceManager",(function(){return ti})),n.d(e,"WebGLState",(function(){return $r})),n.d(e,"BasicLoader",(function(){return na})),n.d(e,"CubeTextureLoader",(function(){return sa})),n.d(e,"GLTFLoader",(function(){return Xa})),n.d(e,"GLTFParser",(function(){return Ba})),n.d(e,"AliAMCExtension",(function(){return Rr})),n.d(e,"HDRLoader",(function(){return Za})),n.d(e,"KTXLoader",(function(){return $a})),n.d(e,"LoadCache",(function(){return $i})),n.d(e,"LoadQueue",(function(){return ts})),n.d(e,"ShaderMaterialLoader",(function(){return ns})),n.d(e,"TextureLoader",(function(){return is})),n.d(e,"Loader",(function(){return ia})),n.d(e,"Texture",(function(){return _e})),n.d(e,"LazyTexture",(function(){return ha})),n.d(e,"CubeTexture",(function(){return Ve})),n.d(e,"DataTexture",(function(){return qe})),n.d(e,"Shader",(function(){return Rt})),n.d(e,"BasicMaterial",(function(){return Sn})),n.d(e,"GeometryMaterial",(function(){return wn})),n.d(e,"Material",(function(){return On})),n.d(e,"PBRMaterial",(function(){return ua})),n.d(e,"semantic",(function(){return hn})),n.d(e,"ShaderMaterial",(function(){return pr})),n.d(e,"AxisHelper",(function(){return us})),n.d(e,"AxisNetHelper",(function(){return hs})),n.d(e,"CameraHelper",(function(){return _s})),n.d(e,"AmbientLight",(function(){return gs})),n.d(e,"AreaLight",(function(){return vs})),n.d(e,"DirectionalLight",(function(){return fr})),n.d(e,"CubeLightShadow",(function(){return ir})),n.d(e,"Light",(function(){return A})),n.d(e,"LightManager",(function(){return ii})),n.d(e,"LightShadow",(function(){return jn})),n.d(e,"PointLight",(function(){return sr})),n.d(e,"SpotLight",(function(){return mr})),n.d(e,"Animation",(function(){return Sa})),n.d(e,"AnimationStates",(function(){return Oa})),n.d(e,"MeshPicker",(function(){return Is})),n.d(e,"Ticker",(function(){return Rs})),n.d(e,"log",(function(){return m.a})),n.d(e,"Cache",(function(){return J})),n.d(e,"browser",(function(){return _i})),n.d(e,"WebGLSupport",(function(){return Os})),n.d(e,"constants",(function(){return P.a})),n.d(e,"Color",(function(){return Ls.Color})),n.d(e,"Euler",(function(){return Ls.Euler})),n.d(e,"EulerNotifier",(function(){return Ls.EulerNotifier})),n.d(e,"Frustum",(function(){return Ls.Frustum})),n.d(e,"math",(function(){return Ls.math})),n.d(e,"Matrix3",(function(){return Ls.Matrix3})),n.d(e,"Matrix4",(function(){return Ls.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Ls.Matrix4Notifier})),n.d(e,"Plane",(function(){return Ls.Plane})),n.d(e,"Quaternion",(function(){return Ls.Quaternion})),n.d(e,"Ray",(function(){return Ls.Ray})),n.d(e,"Sphere",(function(){return Ls.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Ls.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Ls.Vector2})),n.d(e,"Vector3",(function(){return Ls.Vector3})),n.d(e,"Vector3Notifier",(function(){return Ls.Vector3Notifier})),n.d(e,"Vector4",(function(){return Ls.Vector4}));var r={};n.r(r),n.d(r,"ALI_amc_mesh_compression",(function(){return Rr})),n.d(r,"WEB3D_quantized_attributes",(function(){return Lr})),n.d(r,"HILO_animation_clips",(function(){return Sr})),n.d(r,"ALI_animation_clips",(function(){return yr})),n.d(r,"ALI_bounding_box",(function(){return Nr})),n.d(r,"KHR_materials_pbrSpecularGlossiness",(function(){return xr})),n.d(r,"KHR_materials_clearcoat",(function(){return Cr})),n.d(r,"KHR_lights_punctual",(function(){return br})),n.d(r,"KHR_techniques_webgl",(function(){return Pr}));var i=n(4),a=n(1),s=n(9),o=n(7),u=n(21),c=n(5),f=n(17),h=n(22),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=a.a.create({Statics:{TRAVERSE_STOP_NONE:0,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:2},Mixes:s.a,isNode:!0,className:"Node",name:"",anim:null,animationId:"",jointName:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,userData:null,onUpdate:null,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new f.a(0,0,0),this._scale=new f.a(1,1,1),this._pivot=new f.a(0,0,0),this._rotation=new h.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.skeleton&&(e.skeleton.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),e.autoUpdateChildWorldMatrix||t?0:1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(2===n||1===n)return n}for(var r=this.children,i=0,a=r.length;i1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=r?this.children:[this];n.length;){e=n,n=[];for(var i=0,a=e.length;i1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(e){if(n&&!e.pointerEnabled)return 1;if(e.isMesh){var i=e.raycast(t,!1);i&&(r=r.concat(i.map((function(t){return{mesh:e,point:t}}))))}return n&&!e.pointerChildren?1:0})),r.length?(e&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),E=n(8),v=new E.a,T=a.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},shadow:null,isDirty:!1,constructor:function(t){this.color=new E.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return v.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),A=T,M=n(23),I=new o.a,R=a.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new M.a,R.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var r=t.clone();return r.transformMat4(this.viewProjectionMatrix),e&&n&&(r.x=(r.x+1)/2*e,r.y=n-(r.y+1)/2*n),r},unprojectVector:function(t,e,n){var r=t.clone();return e&&n&&(r.x=r.x/e*2-1,r.y=1-r.y/n*2),I.invert(this.viewProjectionMatrix),r.transformMat4(I),r},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=R,L=n(14),S=n(12),y=n(11),N=n(20),x={2:new L.a,3:new c.a,4:new S.a,16:new o.a},C=a.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(i.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new C(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?x[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,r=this._data;n>1?e.toArray(r,t):r[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(z.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(z.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(z.fromQuat(q.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,r,i){e.setByOffset(i,n.transformMat4(t))})),Y.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,r){n.setByOffset(r,t.transformMat3(Y).normalize())}))}if(this._tangents){var r=this.tangents;r.traverse((function(t,e,n){r.setByOffset(n,t.transformMat3(Y).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var r=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,r,i){n.setByOffset(i,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+r})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,r){var i=this[t];if(!i||n>i.length){var a=new r(n);i?(a.set(i.data),i.data=a):this[t]=new b(a,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var r=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;r[n]=e[0],r[n+1]=e[1],r[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var r=this.indices.data;e.forEach((function(e){r[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var r=this.addPoints(t,e,n);this.addIndices(r,r+1,r+2)},addRect:function(t,e,n,r){var i=this.addPoints(t,e,n,r);this.addIndices(i,i+1,i+2,i,i+2,i+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,r=0;r0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new N.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new N.a({center:new c.a(e.x,e.y,e.z)}),r=this.vertices;r?n.fromGeometryData(r):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===w)if(this.indices){for(var e=this.indices.data,n=e.length,r=new Float32Array(n*t),a=this.uvs?new Float32Array(2*n):null,s=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,f=0;f2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&r&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(i.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),Z=a.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){Z.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,r=this.aspect,i=this.fov,a=1/Math.tan(.5*d.a.degToRad(i));if(t[0]=a/r,t[5]=a,t[11]=-1,t[15]=0,n){var s=1/(e-n);t[10]=(e+n)*s,t[14]=2*n*e*s}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new K,n=Math.tan(this.fov/2*Math.PI/180),r=this.near,i=this.far,a=r*n,s=i*n,o=this.aspect*a,u=this.aspect*s,c=[-o,-a,-r],f=[o,-a,-r],h=[o,a,-r],l=[-o,a,-r],d=[-u,-s,-i],m=[u,-s,-i],_=[u,s,-i],p=[-u,s,-i];e.addRect(d,m,_,p),e.addRect(m,f,h,_),e.addRect(f,c,l,h),e.addRect(c,d,p,l),e.addRect(p,_,h,l),e.addRect(c,f,m,d),this._geometry=e}return this._geometry}}),Q=Z,J=a.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}});function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:t;this._usedExtensions[t]=e,this.gl&&this.get(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;if(this.isWebGL2&&ut[t])return ut[t];var n=ct[t];if(n){if(this.isWebGL2)return new n.WebGL2(e);var r=this._getOriginExtension(t);return r?new n.WebGL1(r):null}return this._getOriginExtension(t)},_getOriginExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};ft.use("ANGLE_instanced_arrays","instanced"),ft.use("OES_vertex_array_object","vao"),ft.use("OES_texture_float","texFloat"),ft.use("OES_element_index_uint","uintIndices"),ft.use("EXT_shader_texture_lod","shaderTextureLod"),ft.use("EXT_frag_depth","fragDepth"),ft.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic"),ft.use("WEBGL_lose_context","loseContext"),ft.use("EXT_color_buffer_float","colorBufferFloat"),ft.use("EXT_sRGB","sRGB"),ft.use("WEBGL_draw_buffers","drawBuffers");var ht=ft,lt={isWebGL2:!1,MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,MAX_RENDERBUFFER_SIZE:void 0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:void 0,MAX_CUBE_MAP_TEXTURE_SIZE:void 0,MAX_FRAGMENT_UNIFORM_VECTORS:void 0,MAX_TEXTURE_IMAGE_UNITS:void 0,MAX_TEXTURE_SIZE:void 0,MAX_VARYING_VECTORS:void 0,MAX_VERTEX_ATTRIBS:void 0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:void 0,MAX_VERTEX_UNIFORM_VECTORS:void 0,init:function(t){var e=this;this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t);["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!ht.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!ht.texFloat,this.FRAG_DEPTH=!!ht.fragDepth,this.SHADER_TEXTURE_LOD=!!ht.shaderTextureLod,this.DRAW_BUFFERS=!!ht.drawBuffers,ht.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(ht.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var r=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],i=0;i0){n=a.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},dt=n(50),mt=n.n(dt),_t=n(51),pt=n.n(_t),gt=n(52),Et=n.n(gt),vt=n(53),Tt=n.n(vt),At=new J,Mt=new J,It=a.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(36),"chunk/color.vert":n(74),"chunk/color_main.vert":n(76),"chunk/diffuse.frag":n(56),"chunk/diffuse_main.frag":n(65),"chunk/extensions.frag":n(24),"chunk/extensions.vert":n(48),"chunk/fog.frag":n(43),"chunk/fog_main.frag":n(67),"chunk/frag_color.frag":n(47),"chunk/joint.vert":n(69),"chunk/joint_main.vert":n(79),"chunk/light.frag":n(40),"chunk/lightFog.frag":n(39),"chunk/lightFog.vert":n(72),"chunk/lightFog_main.frag":n(45),"chunk/lightFog_main.vert":n(82),"chunk/logDepth.frag":n(28),"chunk/logDepth_main.frag":n(29),"chunk/logDepth.vert":n(75),"chunk/logDepth_main.vert":n(83),"chunk/morph.vert":n(73),"chunk/morph_main.vert":n(78),"chunk/normal.frag":n(38),"chunk/normal.vert":n(71),"chunk/normal_main.frag":n(44),"chunk/normal_main.vert":n(81),"chunk/pbr.frag":n(85),"chunk/pbr_main.frag":n(87),"chunk/phong.frag":n(63),"chunk/phong_main.frag":n(66),"chunk/precision.frag":n(25),"chunk/precision.vert":n(49),"chunk/transparency.frag":n(42),"chunk/transparency_main.frag":n(46),"chunk/unQuantize.vert":n(68),"chunk/unQuantize_main.vert":n(77),"chunk/uv.frag":n(37),"chunk/uv.vert":n(70),"chunk/uv_main.vert":n(80),"method/encoding.glsl":n(86),"method/getDiffuse.glsl":n(58),"method/getLightAttenuation.glsl":n(60),"method/getShadow.glsl":n(62),"method/getSpecular.glsl":n(59),"method/packFloat.glsl":n(84),"method/textureEnvMap.glsl":n(41),"method/transpose.glsl":n(57),"method/unpackFloat.glsl":n(61),"basic.frag":n(50),"basic.vert":n(51),"geometry.frag":n(52),"pbr.frag":n(53),"screen.frag":n(54),"screen.vert":n(55)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return At}},headerCache:{get:function(){return Mt}},reset:function(t){At.removeAll()},getHeaderKey:function(t,e,n,r,i){var a="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(a+="_joint"+t.skeleton.jointCount),r&&(a+="_fog_"+r.mode),a+="_"+t.geometry.getShaderKey(),i&&(a+="_fogDepth"),a},getHeader:function(t,e,n,r,i){var a=this.getHeaderKey(t,e,n,r),s=Mt.get(a);if(!s||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),r&&(o.HAS_FOG=1,r.getRenderOption(o)),i&&(o.USE_LOG_DEPTH=1,lt.FRAG_DEPTH&&(o.USE_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),s="#define SHADER_NAME ".concat(e.shaderName||e.className,"\n"),s+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",Mt.add(a,s)}return s},_getCommonHeader:function(t){var e=lt.getMaxPrecision(lt.MAX_VERTEX_PRECISION,t.vertexPrecision),n=lt.getMaxPrecision(lt.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),r=lt.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(r,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,r,i,a){var s=this.getHeader(t,e,r,i,a);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,s):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,s,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var r="";e&&(r=(r=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var i=t.className+":"+r;t.onBeforeCompile&&(i+=":"+(t.shaderCacheId||t.id));var a=At.get(i);if(!a){var s="",o=pt.a;if(t.isBasicMaterial?t.isGeometryMaterial?s+=Et.a:s+=mt.a:t.isPBRMaterial&&(s+=Tt.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,s);s=u.fs,o=u.vs}if(r){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(r,");"),"gm");o=o.replace(c,"attribute $1 $2;")}a=this.getCustomShader(o,s,n,i,!0)}if(a){var f=this._getNumId(a);null!==f&&(t._shaderNumId=f)}return a},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,r,i){var a,s=this.commonHeader;return r&&(i&&(r+=":"+n),a=At.get(r)),a||(a=new It({vs:s+n+t,fs:s+n+e}),r&&At.add(r,a)),a}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(At.removeObject(this),this._isDestroyed=!0),this}}),Rt=It,Ot=n(55),Lt=n.n(Ot),St=n(54),yt=n.n(St),Nt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],xt={},Ct={dict:xt,init:function(t){Nt.forEach((function(e){var n,r,i=e.name,a=e.uniformFuncName,s=a+"v";"Matrix"===e.type?n=r=function(e,n){void 0!==n&&t[a](e,!1,n)}:(n=function(e,n){void 0!==n&&t[a](e,n)},r=function(e,n){t[s](e,n)}),xt[t[i]]=Object.assign(e,{glValue:t[i],uniform:n,uniformArray:r})}))},get:function(t){return xt[t]}},bt=n(106),Pt=n(107),wt=P.a.VERTEX_SHADER,Ht=new J,Dt=a.a.create({Statics:{cache:{get:function(){return Ht}},reset:function(t){Ht.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.id,i=Ht.get(r);return i||(i=new Dt({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Ht.add(r,i)),i},getBlankProgram:function(t){var e=Rt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,uniformBlocks:null,program:null,gl:null,state:null,alwaysUse:!1,isWebGL2:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.uniformBlocks={},this.gl=this.state.gl,this.isWebGL2=this.state.isWebGL2,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:Dt.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),r=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&r){if(t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),t.deleteShader(n),t.deleteShader(r),!t.getProgramParameter(e,t.LINK_STATUS)){var i=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+i,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){this.isWebGL2&&(e=this._convertToGLSL300(t,e));var n=this.gl,r=n.createShader(t);if(n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){var i=n.getShaderInfoLog(r);return m.a.error("compileShaderError: "+i,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return r},_convertToGLSL300:function(t,e){return t===wt?bt+e:(Pt+e).replace(/gl_FragData\[(\d)\]/g,"hilo_FragData$1")},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),i=ht.instanced,a=function(){var r=e.getActiveAttrib(n,s),a=r.name,o=r.type,u=r.size,c=e.getAttribLocation(n,a),f=Ct.get(o),h=function(t){var n=t.type,r=void 0===n?e.FLOAT:n,i=t.normalized,a=void 0!==i&&i,s=t.stride,o=void 0===s?0:s,u=t.offset,h=void 0===u?0:u,l=t.size,d=void 0===l?f.size:l;e.vertexAttribPointer(c,d,r,a,o,h)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(i&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;i.vertexAttribDivisor(c,t)}),"Matrix"===f.type){var _=f.byteSize,p=f.size,g=Math.sqrt(p),E=4*g,v=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;v((function(e){i.vertexAttribDivisor(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:f,pointer:h,enable:l,divisor:d,addTo:m}},s=0;s1||o>1?function(t){h(c,t)}:function(t){e._dict[s]!==t&&(e._dict[s]=t,d(c,t))}})},m=0;m2&&void 0!==arguments[2]?arguments[2]:Bt;return this.createBuffer(t,Ut,e,n)},createBuffer:function(t,e,n,r){var i=n.bufferViewId,a=Vt.get(i);return a||(n.isDirty=!1,a=new Xt(t,e,n.data,r),Vt.add(i,a),a)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt;return this.createBuffer(t,Gt,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ut,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=r,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,r=this.usage;return this.bind(),e.bufferData(n,t,r),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.gl,i=this.target;return n||this.bind(),r.bufferSubData(i,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstanced(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstanced(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,r=this.indexBuffer;return this.indexType=t.type,r?t.isDirty&&(r.uploadGeometryData(t),this.vertexCount=t.length):((r=jt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=r,this.vertexCount=t.length),r},addAttribute:function(t,e,n,r){this.bind();var i=this.gl,a=e.name,s=this[a];if(!s){var o=jt.createVertexBuffer(i,t,n);o.bind(),e.enable(),e.pointer(t),s={attribute:e,buffer:o,geometryData:t},this.attributes.push(s),this[a]=s,e.addTo(this.activeStates,s),r&&r(s)}if(t.isDirty){var u=s.buffer;u.bind(),e.enable(),e.pointer(t),u.uploadGeometryData(t)}return s},addInstancedAttribute:function(t,e,n){this.bind();var r=this.gl,i=t.name,a=t.glTypeInfo,s=Wt.getTypedArray(Float32Array,e.length*a.size);e.forEach((function(t,e){void 0!==n(t)?Wt.fillArrayData(s,n(t),e*a.size):m.a.warn("no attributeData:"+i+"-"+t.name)}));var o,u=this[i];return u?(o=u.geometryData).data=s:o=new b(s,1),this.addAttribute(o,t,r.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},getResources:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.attributes&&this.attributes.forEach((function(e){t.push(e.buffer)})),this.indexBuffer&&t.push(this.indexBuffer),t},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.instancedExtension=null,this.useVao&&(this.vaoExtension.deleteVertexArray(this.vao),this.vao=null,this.vaoExtension=null),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){var n=e.attribute||{};t[n.name]=null})),this.attributes=null,this.activeStates=null,Kt.removeObject(this),this._isDestroyed=!0),this}}),Qt=Zt,Jt=P.a.TEXTURE_2D,$t=P.a.FLOAT,te=P.a.RGB,ee=P.a.RGBA,ne=P.a.RGB32F,re=P.a.RGBA32F,ie=P.a.LINEAR,ae=P.a.NEAREST,se=P.a.REPEAT,oe=P.a.CLAMP_TO_EDGE,ue=P.a.UNSIGNED_BYTE,ce=P.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,fe=P.a.UNPACK_FLIP_Y_WEBGL,he=P.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,le=P.a.BROWSER_DEFAULT_WEBGL,de=P.a.NONE,me=new J,_e=a.a.create({Statics:{cache:{get:function(){return me}},reset:function(t){me.each((function(e,n){t.deleteTexture(e),me.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Jt,internalFormat:ee,format:ee,type:ue,width:0,height:0,border:0,magFilter:ie,minFilter:ie,wrapS:se,wrapT:se,name:"",premultiplyAlpha:!1,flipY:!1,colorSpaceConversion:!0,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==ie&&this.minFilter!==ae},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==oe||this.wrapT!==oe},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,r=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),r=d.a.nextPowerOfTwo(r));var i=lt.MAX_TEXTURE_SIZE;return i&&(n>i&&(n=i),r>i&&(r=i)),{width:n,height:r}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var r=this._canvasImage;return r?(r.width=e,r.height=n,this._canvasCtx=r.getContext("2d")):((r=document.createElement("canvas")).width=e,r.height=n,this._canvasImage=r,this._canvasCtx=r.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(r.width,"x").concat(r.height),t.src),this._originImage=t,r},_glUploadTexture:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,s=t.gl,o=this.type,u=this.format,c=this.internalFormat;return this.compressed?s.compressedTexImage2D(e,r,c,i,a,this.border,n):(c=this._fixInternalFormat(t,o,u,c),n&&void 0!==n.width?s.texImage2D(e,r,c,u,this.type,n):s.texImage2D(e,r,c,i,a,this.border,u,this.type,n)),this},_fixInternalFormat:function(t,e,n,r){return t.isWebGL2?e===$t&&(n===ee?r=re:n===te&&(r=ne)):n!==r&&(r=this.format),r},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,r){e._glUploadTexture(t,e.target,n.data,r,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},_updatePixelStorei:function(){var t=this.state;t.pixelStorei(ce,this.premultiplyAlpha),t.pixelStorei(fe,!!this.flipY),t.pixelStorei(he,this.colorSpaceConversion?le:de)},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var r=this.useMipmap,i=this.useRepeat;if(this.image&&!this.image.length){if(!t.isWebGL2){var a=i||r,s=this.getSupportSize(this.image,a);this.image=this.resizeImg(this.image,s.width,s.height)}this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+lt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._uploadTexture(t),r&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=ie):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT);var o=ht.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,lt.MAX_TEXTURE_MAX_ANISOTROPY)),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var r=t.gl;t.activeTexture(r.TEXTURE0+lt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._subTextureList.forEach((function(t){var e=t[0],i=t[1],a=t[2];r.texSubImage2D(n.target,0,e,i,n.format,n.type,a)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var r=me.get(n);return r||(r=e.createTexture(),me.add(n,r),this.needUpdate=!0),this.updateTexture(t,r),this.isImageCanRelease&&this._releaseImage(),r},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),me.add(this.id,t),this},destroy:function(){var t=this.id,e=me.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),me.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),pe=P.a.FRAMEBUFFER,ge=P.a.TEXTURE_2D,Ee=P.a.RGBA,ve=P.a.UNSIGNED_BYTE,Te=P.a.COLOR_ATTACHMENT0,Ae=P.a.DEPTH_STENCIL_ATTACHMENT,Me=P.a.DEPTH_STENCIL,Ie=P.a.DEPTH_TEST,Re=P.a.CULL_FACE,Oe=P.a.TRIANGLE_STRIP,Le=P.a.NEAREST,Se=P.a.CLAMP_TO_EDGE,ye=P.a.COLOR_BUFFER_BIT,Ne=P.a.READ_FRAMEBUFFER,xe=P.a.DRAW_FRAMEBUFFER,Ce=new J,be={framebufferTarget:pe,attachment:Te,target:ge,format:Ee,internalFormat:Ee,type:ve,minFilter:Le,magFilter:Le,wrapS:Se,wrapT:Se},Pe=a.a.create({Statics:{ATTACHMENT_TYPE_TEXTURE:"TEXTURE",ATTACHMENT_TYPE_RENDERBUFFER:"RENDERBUFFER",cache:{get:function(){return Ce}},reset:function(t){Ce.each((function(t){t.reset()}))},destroy:function(t){Ce.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Me,framebufferTarget:be.framebufferTarget,target:be.target,format:be.format,internalFormat:be.internalFormat,type:be.type,minFilter:be.minFilter,magFilter:be.magFilter,wrapS:be.wrapS,wrapT:be.wrapT,data:null,attachment:be.attachment,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,colorAttachmentInfos:void 0,depthStencilAttachmentInfo:void 0,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),void 0===this.colorAttachmentInfos&&(this.colorAttachmentInfos=[{attachmentType:Pe.ATTACHMENT_TYPE_TEXTURE,framebufferTarget:this.framebufferTarget,target:this.target,format:this.format,internalFormat:this.internalFormat,type:this.type,minFilter:this.minFilter,magFilter:this.magFilter,wrapS:this.wrapS,wrapT:this.wrapT,data:this.data}]),void 0===this.depthStencilAttachmentInfo&&this.needRenderbuffer&&(this.depthStencilAttachmentInfo={attachmentType:Pe.ATTACHMENT_TYPE_RENDERBUFFER,framebufferTarget:this.framebufferTarget,attachment:Ae,internalFormat:Me}),Ce.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this._createAttachments(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},_createAttachments:function(){var t=this,e=this.colorAttachmentInfos,n=this.depthStencilAttachmentInfo,r=[];if(e&&e.forEach((function(e,n){var i=Te+n;switch(e.attachmentType){case Pe.ATTACHMENT_TYPE_RENDERBUFFER:t._createRenderbufferAttachment(e,i);break;case Pe.ATTACHMENT_TYPE_TEXTURE:default:t._createTextureAttachment(e,i)}r.push(i)})),n){var i=n.attachment;switch(n.attachmentType){case Pe.ATTACHMENT_TYPE_RENDERBUFFER:this._createRenderbufferAttachment(n,i);break;case Pe.ATTACHMENT_TYPE_TEXTURE:default:this._createTextureAttachment(n,i)}}r.length>1&<.DRAW_BUFFERS&&ht.drawBuffers.drawBuffers(r)},_createTextureAttachment:function(t,e){var n=this.state,r=n.gl,i=Object.assign({},be,t),a=new _e({minFilter:i.minFilter,magFilter:i.magFilter,internalFormat:i.internalFormat,format:i.format,type:i.type,width:this.width,height:this.height,image:i.data,wrapS:i.wrapS,wrapT:i.wrapT}),s=a.getGLTexture(n);return r.framebufferTexture2D(i.framebufferTarget,e,i.target,s,0),t.texture=a,e===Te&&(this.texture=a),a},_createRenderbufferAttachment:function(t,e){var n=this.gl,r=this.width,i=this.height,a=n.createRenderbuffer();return n.bindRenderbuffer(n.RENDERBUFFER,a),t.samples>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,t.samples,t.internalFormat,r,i):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,r,i),n.framebufferRenderbuffer(t.framebufferTarget||be.framebufferTarget,e,n.RENDERBUFFER,a),t.renderbuffer=a,a},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new E.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if(this._isInit){var s=this.gl,o=this.state,u=this.colorAttachmentInfos;if(!a){if(!u[0])return;a=u[0].texture}o.disable(Ie),o.disable(Re),i&&this.clear(i);var c=Rt.getCustomShader(Lt.a,yt.a,"","FramebufferTextureShader"),f=Ft.getProgram(c,o);f.useProgram();var h="".concat(t,"_").concat(e,"_").concat(n,"_").concat(r,"_").concat(f.id),l=Qt.getVao(s,h,{useVao:this.useVao,useInstanced:!1,mode:Oe});if(l.isDirty){l.isDirty=!1;var d=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(r*=2),t+n,e-r];l.addAttribute(new b(new Float32Array(d),2),f.attributes.a_position),l.addAttribute(new b(new Float32Array([0,1,1,1,0,0,1,0]),2),f.attributes.a_texcoord0)}o.activeTexture(s.TEXTURE0),o.bindTexture(s.TEXTURE_2D,a.getGLTexture(o)),l.draw()}},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=Object(i.getTypedArrayClass)(this.type),s=new a(n*r*4);if(this._isInit){var o=this.gl;e=this.height-e-r,this.bind(),o.readPixels(t,e,n,r,this.format,this.type,s),this.unbind()}return s},copyFramebuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.init(),this._isInit){var n=this.gl,r=e.mask,i=e.filter,a=e.srcSize,s=e.dstSize;r||(r=ye),i||(i=Le),a||(a=[0,0,t.width,t.height]),s||(s=[0,0,this.width,this.height]),n.bindFramebuffer(Ne,t.framebuffer),n.bindFramebuffer(xe,this.framebuffer),n.blitFramebuffer(a[0],a[1],a[2],a[3],s[0],s[1],s[2],s[3],r,i),n.bindFramebuffer(Ne,null),n.bindFramebuffer(xe,null)}},destroy:function(){return this._isDestroyed||(this.destroyResource(),this.gl=null,Ce.removeObject(this),this._isDestroyed=!0),this},destroyResource:function(){var t=this.gl;if(t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.colorAttachmentInfos&&this.colorAttachmentInfos.forEach((function(e){var n=e.texture,r=e.renderbuffer;e.texture=null,e.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)})),this.depthStencilAttachmentInfo)){var e=this.depthStencilAttachmentInfo,n=e.texture,r=e.renderbuffer;this.depthStencilAttachmentInfo.texture=null,this.depthStencilAttachmentInfo.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)}}}),we=Pe,He=P.a.TEXTURE_CUBE_MAP,De=P.a.RGB,Fe=P.a.LINEAR,Ue=P.a.CLAMP_TO_EDGE,Ge=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,Be=a.a.create({Extends:_e,isCubeTexture:!0,className:"CubeTexture",target:He,internalFormat:De,format:De,magFilter:Fe,minFilter:Fe,wrapS:Ue,wrapT:Ue,constructor:function(t){Be.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,r){e._glUploadTexture(t,Ge+r,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),Ve=Be,Xe=P.a.TEXTURE_2D,je=P.a.RGBA,ke=P.a.NEAREST,We=P.a.CLAMP_TO_EDGE,Ye=P.a.FLOAT,ze=a.a.create({Extends:_e,isDataTexture:!0,className:"DataTexture",target:Xe,internalFormat:je,format:je,type:Ye,magFilter:ke,minFilter:ke,wrapS:We,wrapT:We,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),r=Math.floor(n/2),a=n-r;this.width=Math.pow(2,r),this.height=Math.pow(2,a),this.DataClass=Object(i.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ze.superclass.constructor.call(this,t)}}),qe=ze;function Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1),lt.SHADER_TEXTURE_LOD&&this.enableTextureLod&&(e.USE_SHADER_TEXTURE_LOD=1),lt.DRAW_BUFFERS&&this.enableDrawBuffers&&(e.USE_DRAW_BUFFERS=1);var r=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,r.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),r.add(this.parallaxMap,"PARALLAX_MAP"),r.add(this.emission,"EMISSION_MAP"),r.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),r.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var r=this.uvTypes,i=this.option,a=t.uv||0;r[a]=1,i[e]=a,t.isCubeTexture&&(i["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var r in e)-1!==t.indexOf(Number(r))?n["HAS_TEXCOORD".concat(r)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(r,")"),"uv_".concat(r," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var r=this.getUniformInfo(n);r.isDependMesh&&!r.notSupportInstanced&&t.push({name:n,info:r})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=hn[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=Rn),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),Ln=a.a.create({Extends:On,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new E.a(.5,.5,.5),this.specular=new E.a(1,1,1),this.emission=new E.a(0,0,0),Ln.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ln.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var r=this.diffuse;return r&&r.isTexture&&(r.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),Sn=Ln,yn=P.a.POSITION,Nn=P.a.NORMAL,xn=P.a.DEPTH,Cn=P.a.DISTANCE,bn=P.a.NONE,Pn=a.a.create({Extends:Sn,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:yn,lightType:bn,writeOriginData:!1,constructor:function(t){Pn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Pn.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case yn:t.HAS_FRAG_POS=1;break;case Nn:t.HAS_NORMAL=1;break;case xn:break;case Cn:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),wn=Pn,Hn=a.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){Hn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new K,n=[this.left,this.bottom,-this.near],r=[this.right,this.bottom,-this.near],i=[this.right,this.top,-this.near],a=[this.left,this.top,-this.near],s=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(s,o,u,c),e.addRect(o,r,i,u),e.addRect(r,n,a,i),e.addRect(n,s,c,a),e.addRect(c,u,i,a),e.addRect(n,r,o,s),this._geometry=e}return this._geometry}}),Dn=Hn,Fn=P.a.DEPTH,Un=P.a.BACK,Gn=null,Bn=new E.a(1,1,1),Vn=new o.a,Xn=function(t){return t.material.castShadows},jn=a.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new we(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),Vn.multiply(this.camera.viewMatrix,t.worldMatrix);var r=n.getBounds(Vn);this.camera.near=-r.zMax,this.camera.far=-r.zMin,this.camera.left=r.xMin,this.camera.right=r.xMax,this.camera.bottom=r.yMin,this.camera.top=r.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new Dn:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),(this.light.isDirty||this._cameraMatrixVersion!==t.matrixVersion)&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion,this.light.isDirty=!1)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Gn||(Gn=new wn({vertexType:Fn,side:Un,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(Bn),r.updateViewProjectionMatrix(),hn.setCamera(r),e.forceMaterial=Gn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),hn.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){Xn(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return Xn(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),kn=P.a.DISTANCE,Wn=P.a.BACK,Yn=P.a.TEXTURE_CUBE_MAP,zn=P.a.TEXTURE0,qn=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,Kn=P.a.NEAREST,Zn=P.a.FRAMEBUFFER,Qn=P.a.FRAMEBUFFER_COMPLETE,Jn=null,$n=new E.a(0,0,0,0),tr=new c.a,er=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],nr=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},rr=a.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:jn,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){rr.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new we(this.renderer,{target:Yn,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new Ve({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:Kn,minFilter:Kn,width:1024,height:1024});return t.checkFramebufferStatus(Zn)!==Qn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(Zn)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,r=this.texture.getGLTexture(e);e.activeTexture(zn+lt.MAX_TEXTURE_INDEX),e.bindTexture(this.target,r),n.framebufferTexture2D(Zn,this.attachment,qn+t,r,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Jn||(Jn=new wn({vertexType:kn,side:Wn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(r.position);for(var i=0;i<6;i++)n.bindTexture(i),tr.fromArray(er[0],3*i).add(r.position),r.up.fromArray(er[1],3*i),r.lookAt(tr),r.updateViewProjectionMatrix(),e.clear($n),hn.setCamera(r),e.forceMaterial=Jn,this.renderShadowScene(e);r.matrix.identity(),r.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),hn.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){nr(e,n)&&t.renderMesh(e)}),(function(e){var r=e.filter((function(t){return nr(t,n)}));t.renderInstancedMeshes(r)}))}}),ir=rr,ar=a.a.create({Extends:A,isPointLight:!0,className:"PointLight",constructor:function(t){ar.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new ir({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),sr=ar,or=new o.a,ur=new c.a,cr=a.a.create({Extends:A,isDirectionalLight:!0,className:"DirectionalLight",constructor:function(t){this.direction=new c.a(0,0,1),cr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new jn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return ur.copy(this.direction).transformDirection(this.worldMatrix).normalize(),ur},getViewDirection:function(t){var e=t.getModelViewMatrix(this,or);return ur.copy(this.direction).transformDirection(e).normalize(),ur}}),fr=cr,hr=new o.a,lr=new c.a,dr=a.a.create({Extends:A,isSpotLight:!0,className:"SpotLight",_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),dr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new jn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return lr.copy(this.direction).transformDirection(this.worldMatrix).normalize(),lr},getViewDirection:function(t){var e=t.getModelViewMatrix(this,hr);return lr.copy(this.direction).transformDirection(e).normalize(),lr}}),mr=dr,_r=a.a.create({Extends:On,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){_r.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(_r.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),pr=_r,gr=n(15),Er=n.n(gr),vr=a.a.create({Extends:K,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){vr.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return K.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vr.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(i.each)(this.targets,(function(n,r){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===r?e.MORPH_HAS_POSITION=1:"normals"===r?e.MORPH_HAS_NORMAL=1:"tangents"===r&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Tr=vr,Ar={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Mr={Geometry:K,GeometryData:b};var Ir={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Ir.useAuto?Er.a.initWASM(Ir.wasmURL,Ir.memPages):Ir.useWebWorker?Er.a.initWorker(Ir.workerURL):Ir.useWASM?Er.a.initWASM(Ir.wasmURL,Ir.memPages):Promise.resolve()},parse:function(t,e,n,r){var i=Date.now(),a=e.bufferViews[t.bufferView],s=Ir.wasmURL,o=Ir.workerURL,u=Ir.useAuto,c=Ir.useWASM,f=Ir.useWebWorker,h=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);function l(e){Ir._decodeTotalTime+=Date.now()-i;var n=e.toHilo3dGeometry(Mr,r.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var r=new Tr;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&"id"!==i&&(r[i]=n[i]);r.targets={},n=r}for(var a=n.targets,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),Dr=n(16),Fr=new Dr.a,Ur=new o.a,Gr=a.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){Gr.superclass.constructor.call(this,t)},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,r=this.material,i=this.worldMatrix;if(n&&r){Ur.invert(i),Fr.copy(t),Fr.transformMat4(Ur);var a=n.raycast(Fr,r.side,e);if(a)return a.forEach((function(t){t.transformMat4(i)})),a}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},isDestroyed:{get:function(){return this._isDestroyed}},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager;return n.destroyMesh(this),this.material&&e&&this.material.destroyTextures(),this.off(),this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),Br=Gr,Vr=new o.a,Xr=new o.a,jr=a.a.create({Extends:Br,isSkinedMesh:!0,className:"SkinedMesh",useInstanced:!1,jointMatTexture:null,frustumTest:!1,skeleton:null,constructor:function(t){jr.superclass.constructor.call(this,t)},getJointMat:function(){var t=this;if(this.skeleton&&!(this.skeleton.jointCount<=0)){var e=this.skeleton.jointNodeList,n=this.skeleton.inverseBindMatrices,r=16*this.skeleton.jointCount;return this.jointMat&&this.jointMat.length===r||(this.jointMat=new Float32Array(r)),this.clonedFrom?Xr.invert(this.clonedFrom.worldMatrix):Xr.invert(this.worldMatrix),e.forEach((function(e,r){Vr.copy(Xr),Vr.multiply(e.worldMatrix),Vr.multiply(n[r]),Vr.toArray(t.jointMat,16*r)})),this.jointMat}},resetJointNamesByNodeName:function(t){this.skeleton.resetJointNamesByNodeName(t)},resetSkinIndices:function(t){var e=this.skeleton;if(e){var n=this.geometry,r=n.skinIndices;if(r){this.material.isDirty=!0,n.isDirty=!0,r.isDirty=!0;var i=new S.a;r.traverse((function(n,a,s){n.elements.forEach((function(n,r){var a=e.jointNames[n],s=t.jointNames.indexOf(a);s>=0?i.elements[r]=s:m.a.warnOnce("SkinedMesh.resetSkinIndices","SkinedMesh.resetSkinIndices: no jointName found!",a)})),r.setByOffset(s,i)}))}}},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new qe({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=Br.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,skeleton:this.skeleton.clone()}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jr.superclass.getRenderOption.call(this,t);var e=this.skeleton.jointCount;if(e&&(t.JOINT_COUNT=e,lt.VERTEX_TEXTURE_FLOAT)){var n=(lt.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),kr=jr,Wr=a.a.create({isSkeleton:!0,className:"Skeleton",userData:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.jointNodeList=[],this.jointNames=[],this.inverseBindMatrices=[],Object.assign(this,t)},jointCount:{get:function(){return this.jointNodeList.length}},_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,t&&this._initJointNodeList()}},_initJointNodeList:function(){var t={};this.rootNode.traverse((function(e){t[e.jointName]=e})),this.jointNodeList=this.jointNames.map((function(e){return t[e]}))},resetJointNamesByNodeName:function(t){var e=this.jointNames;this.jointNodeList.forEach((function(n,r){var i=t.rootNode.getChildByName(n.name);i&&(e[r]=i.jointName)}))},clone:function(t){var e=new Wr;return e.copy(this,t),e},copy:function(t,e){return this.inverseBindMatrices=t.inverseBindMatrices,this.jointNames=t.jointNames.slice(),void 0===e&&(e=t.rootNode),this.rootNode=e,this}}),Yr=Wr,zr="1.18.0",qr=a.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),Kr=new c.a,Zr=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;if(n!==r)return n-r;var i=t.material._shaderNumId||0,a=e.material._shaderNumId||0;return i!==a?i-a:t._sortRenderZ-e._sortRenderZ},Qr=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;return n!==r?n-r:e._sortRenderZ-t._sortRenderZ},Jr=a.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var r in n){var i=n[r];i.length>2&&e?e(i):i.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(Qr),this.opaqueList.sort(Zr)},addMesh:function(t,e){var n=t.material,r=t.geometry;if(n&&r){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var i=this.instancedDict,a=n.id+"_"+r.id,s=i[a];i[a]||(s=i[a]=[]),s.push(t)}else t.worldMatrix.getTranslation(Kr),Kr.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=Kr.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),$r=a.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,isWebGL2:!1,constructor:function(t){this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t),this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,r){this.set4("colorMask",t,e,n,r)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,r){this.set4("blendFuncSeparate",t,e,n,r)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,r){this.set4("viewport",t,e,n,r)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n||(r[0]=e,r[1]=n,this.gl[t](e,n))},set3:function(t,e,n,r){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n&&i[2]===r||(i[0]=e,i[1]=n,i[2]=r,this.gl[t](e,n,r))},set4:function(t,e,n,r,i){var a=this._dict[t];a||(a=this._dict[t]=[]),a[0]===e&&a[1]===n&&a[2]===r&&a[3]===i||(a[0]=e,a[1]=n,a[2]=r,a[3]=i,this.gl[t](e,n,r,i))},get:function(t){return this._dict[t]}}),ti=a.a.create({Mixes:s.a,className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){this._needDestroyResources=[],this._meshDict={},Object.assign(this,t)},destroyMesh:function(t){var e=this;this.getMeshResources(t).forEach((function(t){e.destroyIfNoRef(t)})),delete this._meshDict[t.id]},getMeshResources:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._meshDict[t.id];return n&&n.forEach((function(t){e.push(t),t.getResources&&t.getResources(e)})),e},addMeshResources:function(t,e){var n=t.id,r=this._meshDict;r[n]||(r[n]=[]);var i=r[n];e.forEach((function(t){-1===i.indexOf(t)&&i.push(t)}))},destroyIfNoRef:function(t){var e=this._needDestroyResources;return t&&e.indexOf(t)<0&&e.push(t),this},getUsedResources:function(t){var e=this,n=[];return t&&t.traverse((function(t){t.isMesh&&!t.isDestroyed&&e.getMeshResources(t,n)})),n},destroyUnsuedResource:function(t){var e=this,n=this._needDestroyResources;if(0===n.length)return this;var r=this.getUsedResources(t);return n.forEach((function(t){r.indexOf(t)<0&&t&&t.destroy&&!t.alwaysUse&&(e.fire("destroyResource",t.id),t.destroy())})),this.reset(),this},reset:function(){return this._needDestroyResources.length=0,this}}),ei=new o.a,ni=new c.a,ri=new Float32Array([0,0,0]),ii=a.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.each)(this.lightInfo,(function(n,r){if("uid"!==r&&n){e[r]=n;var i=t.getShadowMapCount(r);i&&(e[r+"_SMC"]=i)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(r.push(o.lightShadow.framebuffer.texture),i.push(o.lightShadow.width),i.push(o.lightShadow.height),s.push(o.lightShadow.minBias,o.lightShadow.maxBias),ei.copy(t.worldMatrix),ei.premultiply(o.lightShadow.camera.viewProjectionMatrix),ei.toArray(a,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return r.length&&(o.shadowMap=r,o.shadowMapSize=new Float32Array(i),o.shadowBias=new Float32Array(s),o.lightSpaceMatrix=new Float32Array(a)),o},getSpotInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[],c=[],f=[];this.spotLights.forEach((function(h,l){var d=3*l;h.getRealColor().toRGBArray(e,d),h.toInfoArray(n,d),h.getViewDirection(t).toArray(i,d),f.push(h.range),a.push(h._cutoffCos,h._outerCutoffCos),t.getModelViewMatrix(h,ei),ei.getTranslation(ni),ni.toArray(r,d),h.shadow&&h.lightShadow&&(s.push(h.lightShadow.framebuffer.texture),o.push(h.lightShadow.width),o.push(h.lightShadow.height),c.push(h.lightShadow.minBias,h.lightShadow.maxBias),ei.multiply(h.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),ei.toArray(u,16*l))}));var h={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),dirs:new Float32Array(i),cutoffs:new Float32Array(a),ranges:new Float32Array(f)};return s.length&&(h.shadowMap=s,h.shadowMapSize=new Float32Array(o),h.shadowBias=new Float32Array(c),h.lightSpaceMatrix=new Float32Array(u)),h},getPointInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[];this.pointLights.forEach((function(c,f){var h=3*f;c.getRealColor().toRGBArray(e,h),c.toInfoArray(n,h),u.push(c.range),t.getModelViewMatrix(c,ei),ei.getTranslation(ni),ni.toArray(r,h),c.shadow&&c.lightShadow&&(i.push(c.lightShadow.framebuffer.texture),s.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(a,16*f),o[2*f]=c.lightShadow.camera.near,o[2*f+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),ranges:new Float32Array(u)};return i.length&&(c.shadowMap=i,c.shadowBias=new Float32Array(s),c.lightSpaceMatrix=new Float32Array(a),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,r=[],i=[],a=[],s=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(r,c),t.getModelViewMatrix(o,ei),ei.getTranslation(ni),ni.toArray(i,c);var f=ei.getRotation();ei.fromQuat(f),ni.set(.5*o.width,0,0),ni.transformMat4(ei),ni.toArray(a,c),ni.set(0,.5*o.height,0),ni.transformMat4(ei),ni.toArray(s,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(r),poses:new Float32Array(i),width:new Float32Array(a),height:new Float32Array(s),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return ri[0]=ri[1]=ri[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();ri[0]+=e.r,ri[1]+=e.g,ri[2]+=e.b})),ri[0]=Math.min(1,ri[0]),ri[1]=Math.min(1,ri[1]),ri[2]=Math.min(1,ri[2]),ri},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,r=this.directionalLights,i=this.pointLights,a=this.spotLights,s=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=i.length,e.DIRECTIONAL_LIGHTS=r.length,e.SPOT_LIGHTS=a.length,e.AREA_LIGHTS=s.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=i.filter(o).length,e.SHADOW_SPOT_LIGHTS=a.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=r.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo(),this.updateCustomInfo&&this.updateCustomInfo(this,t)},updateCustomInfo:null,getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),ai=P.a.DEPTH_TEST,si=P.a.STENCIL_TEST,oi=P.a.SAMPLE_ALPHA_TO_COVERAGE,ui=P.a.CULL_FACE,ci=P.a.FRONT_AND_BACK,fi=P.a.BLEND,hi=P.a.LINES,li=P.a.STATIC_DRAW,di=P.a.DYNAMIC_DRAW,mi=a.a.create({Mixes:s.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,forceMaterial:null,isInitFailed:!1,_isInit:!1,_isContextLost:!1,isWebGL2:!1,preferWebGL2:!1,constructor:function(t){this.clearColor=new E.a(1,1,1),Object.assign(this,t),this.renderInfo=new qr,this.renderList=new Jr,this.lightManager=new ii,this.resourceManager=new ti},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var r=this.domElement;this.width=t,this.height=e,r.width=t,r.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,r){var i=this.state,a=this.gl;i&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=a.drawingBufferWidth),void 0===r&&(r=a.drawingBufferHeight),i.viewport(t,e,n,r))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};if(!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0),this.preferWebGL2)try{this.gl=this.domElement.getContext("webgl2",e),this.isWebGL2=!0}catch(t){this.isWebGL2=!1,this.gl=null}this.gl||(this.gl=this.domElement.getContext("webgl",e),this.isWebGL2=!1);var n=this.gl;n.viewport(0,0,this.width,this.height),Ct.init(n),ht.init(n),lt.init(n),Rt.init(this),this.state=new $r(n),ht.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,this.useFramebuffer&&(this.framebuffer=new we(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){var e=this.gl;this._isContextLost=!0,t.preventDefault(),Ft.reset(e),Rt.reset(e),_e.reset(e),jt.reset(e),Qt.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null,this.fire("webglContextLost")},_onContextRestore:function(t){var e=this.gl;this._isContextLost=!1,ht.reset(e),we.reset(e),this.fire("webglContextRestored")},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(ai),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(ai)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(oi):e.disable(oi)},setupCullFace:function(t){var e=this.state;e.frontFace(t.frontFace),t.cullFace&&t.cullFaceType!==ci?(e.enable(ui),e.cullFace(t.cullFaceType)):e.disable(ui)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(fi),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(fi)},setupStencil:function(t){if(this.stencil){var e=this.state;t.stencilTest?(e.enable(si),e.stencilMask(t.stencilMask),e.stencilFunc(t.stencilFunc,t.stencilFuncRef,t.stencilFuncMask),e.stencilOp(t.stencilOpFail,t.stencilOpZFail,t.stencilOpZPass)):e.disable(si)}},setupUniforms:function(t,e,n,r){var i=this.forceMaterial||e.material;if(this.isWebGL2){var a=i.uniformBlocks;for(var s in t.uniformBlocks){var o=a[s];o&&(t[s]=o)}}for(var u in t.uniforms){var c=i.getUniformInfo(u),f=t.uniforms[u];if(!c.isBlankInfo&&(r||c.isDependMesh&&!n)){var h=c.get(e,i,f);null!=h&&(t[u]=h)}}},setupVao:function(t,e,n){var r=n.geometry,i=r.isStatic;if(t.isDirty||!i||r.isDirty){t.isDirty=!1;var a=this.forceMaterial||n.material,s=a.attributes,o=i?li:di;for(var u in s){var c=e.attributes[u];if(c){var f=a.getAttributeData(u,n,c);null!=f&&t.addAttribute(f,c,o)}}r.indices&&t.addIndexBuffer(r.indices,o),r.isDirty=!1}r.vertexCount&&(t.vertexCount=r.vertexCount)},setupMaterial:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.forceMaterial||e.material;(i.isDirty||this._lastMaterial!==i)&&(this.setupDepthTest(i),this.setupSampleAlphaToCoverage(i),this.setupCullFace(i),this.setupBlend(i),this.setupStencil(i),r=!0),this.setupUniforms(t,e,n,r),i.isDirty=!1,this._lastMaterial=i},setupMesh:function(t,e){var n=this.gl,r=this.state,i=this.lightManager,a=this.resourceManager,s=t.geometry,o=this.forceMaterial||t.material,u=Rt.getShader(t,o,e,i,this.fog,this.useLogDepth),c=Ft.getProgram(u,r);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&s.mode!==hi&&s.convertToLinesMode();var f=s.id+c.id,h=Qt.getVao(n,f,{useInstanced:e,useVao:this.useVao,mode:s.mode});return this.setupVao(h,c,t),a.addMeshResources(t,[h,u,c]),{vao:h,program:c,geometry:s}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var r=this.renderList,i=this.renderInfo,a=this.lightManager,s=this.resourceManager,o=this.state;this.fog=t.fog,a.reset(),i.reset(),r.reset(),hn.init(this,o,e,a,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?r.addMesh(t,e):t.isLight&&a.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),r.sort(),a.createShadowMap(this,e),a.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),s.destroyUnsuedResource(t)}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),n.depthMask(!0);var r=e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT;this.stencil&&(n.stencilMask(!0),r|=e.STENCIL_BUFFER_BIT),e.clear(r)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},clearStencil:function(){var t=this.gl;this.state.stencilMask(!0),t.clear(t.STENCIL_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,r=this.setupMesh(e,!0),i=r.vao,a=r.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,r=e.info,s=a.attributes[n];s&&i.addInstancedAttribute(s,t,(function(t){return r.get(t)}))})),i.drawInstance(t.length),this.addRenderInfo(i.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(Ft.reset(t),Rt.reset(t),jt.reset(t),Qt.reset(t),this.state.reset(t),_e.reset(t),we.destroy(t))}}),_i=function(){var t,e=navigator.userAgent,n=document,r=window,i=n.documentElement,a={iphone:/iphone/i.test(e),ipad:/ipad/i.test(e),ipod:/ipod/i.test(e),ios:/iphone|ipad|ipod/i.test(e),android:/android/i.test(e),webkit:/webkit/i.test(e),chrome:/chrome/i.test(e),safari:/safari/i.test(e),firefox:/firefox/i.test(e),ie:/msie/i.test(e),opera:/opera/i.test(e),supportTouch:"ontouchstart"in r,supportCanvas:!!n.createElement("canvas").getContext,supportStorage:void 0,supportOrientation:"orientation"in r||"orientation"in r.screen,supportDeviceMotion:"ondevicemotion"in r};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),a.supportStorage=!0}catch(t){a.supportStorage=!1,m.a.warn("LocalStorage disabled")}t=a.webkit||a.firefox?"webkit":a.opera?"o":a.ie?"ms":"",a.jsVendor=t;var s=a.cssVendor="-"+t+"-";try{var o=n.createElement("div"),u=o.style,c=void 0!==u[t+"Transform"],f=void 0!==u[t+"Perspective"];f&&(o.id="test3d",(u=n.createElement("style")).textContent="@media ("+s+"transform-3d){#test3d{height:3px}}",n.head.appendChild(u),i.appendChild(o),f=3===o.offsetHeight,n.head.removeChild(u),i.removeChild(o)),a.supportTransform=c,a.supportTransform3D=f}catch(t){a.supportTransform=!1,a.supportTransform3D=!1}var h=a.supportTouch,l=h?"touchstart":"mousedown",d=h?"touchmove":"mousemove",_=h?"touchend":"mouseup";return a.POINTER_START=l,a.POINTER_MOVE=d,a.POINTER_END=_,a}(),pi=a.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,width:0,height:0,canvas:null,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}pi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat(zr))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new mi(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,r){if(void 0===n&&(n=this.pixelRatio),r||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var i=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,r),i.style.width=this.width+"px",i.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,r){return this.resize(n,r,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.canvas,i=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?r.addEventListener(t,i,!1):r.removeEventListener(t,i)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,r=t.type,i=0===r.indexOf("touch"),a=t;if(i){var s=t.touches,o=t.changedTouches;s&&s.length?a=s[0]:o&&o.length&&(a=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(a.pageX||a.clientX)-u.left,f=(a.pageY||a.clientY)-u.top;t.stageX=c,t.stageY=f,t.stopPropagation=function(){this._stopPropagationed=!0};var h=this.getMeshResultAtPoint(c,f,!0),l=h.mesh;t.hitPoint=h.point;var d="mouseout"===r;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===r?m="touchout":"mousemove"!==r&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==r&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!i){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}_i.android&&"touchmove"===r&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(i.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.camera,i=this._ray;i||(i=this._ray=new Dr.a),i.fromCamera(r,t,e,this.width,this.height);var a=this.raycast(i,!0,n);if(a)return a[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var s=this._stageResultAtPoint.point;return s.copy(r.unprojectVector(s.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return pi.superclass.destroy.call(this,this.renderer),this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),gi=pi;function Ei(){return+new Date}var vi=a.a.create({constructor:function(t,e,n,r){var i=this;for(var a in i.target=t,i._startTime=0,i._seekTime=0,i._pausedTime=0,i._pausedStartTime=0,i._reverseFlag=1,i._repeatCount=0,3===arguments.length&&(r=n,n=e,e=null),r)i[a]=r[a];i._fromProps=e,i._toProps=n,!r.duration&&r.time&&(i.duration=r.time||0,i.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,r=t||e,i=this._fromProps={},a=this._toProps={};for(var s in t=t||n,e=e||n,r)a[s]=e[s]||0,n[s]=i[s]=t[s]||0;return this},start:function(){var t=this;return t._startTime=Ei()+t.delay,t._seekTime=0,t._pausedTime=0,t._reverseFlag=1,t._repeatCount=0,t.paused=!1,t.isStart=!1,t.isComplete=!1,vi.add(t),t},stop:function(){return vi.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=Ei(),this},resume:function(){var t=this;return t.paused=!1,t._pausedStartTime&&(t._pausedTime+=Ei()-t._pausedStartTime),t._pausedStartTime=0,t},seek:function(t,e){var n=this,r=Ei();return n._startTime=r,n._seekTime=t,n._pausedTime=0,void 0!==e&&(n.paused=e),n._update(r,!0),vi.add(n),n},link:function(t){var e,n,r=t.delay,i=this._startTime;return"string"==typeof r&&(e=0===r.indexOf("+"),n=0===r.indexOf("-"),r=e||n?Number(r.substr(1))*(e?1:-1):Number(r)),t.delay=r,t._startTime=e||n?i+this.duration+r:i+r,this._next=t,vi.remove(t),t},_render:function(t){var e=this.target,n=this._fromProps;for(var r in n)e[r]=n[r]+(this._toProps[r]-n[r])*t},_update:function(t,e){var n=this;if(n.paused&&!e)return!1;if(n.isComplete)return!0;var r=t-n._startTime-n._pausedTime+n._seekTime;if(r<0)return!1;var i,a=r/n.duration;a<=0?a=0:a>=1&&(a=1);var s=n.ease?n.ease(a):a;n.reverse&&n.isStart&&(n._reverseFlag<0&&(a=1-a,s=1-s),a<1e-7&&(n.repeat>0&&n._repeatCount++>=n.repeat||0===n.repeat&&!n.loop?n.isComplete=!0:(n._startTime=Ei(),n._pausedTime=0,n._reverseFlag*=-1))),n.isStart||(n.setProps(n._fromProps,n._toProps),n.isStart=!0,n.onStart&&n.onStart.call(n,n)),n.time=r,n._render(s),(i=n.onUpdate)&&i.call(n,s,n),a>=1&&(n.reverse?(n._startTime=Ei(),n._pausedTime=0,n._reverseFlag*=-1):n.loop||n.repeat>0&&n._repeatCount++0&&u<=t?(o._render(a),o.time=r,vi.add(o)):n.isComplete&&(u<0||u>t)&&o.start()}return!!n.isComplete&&((i=n.onComplete)&&i.call(n,n),!0)},Statics:{_tweens:[],tick:function(){var t,e,n=vi._tweens,r=n.length;for(e=0;e-1&&r.splice(e,1);else for(e=0;e1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Bi.superclass._raycast.call(this,t,e)}}),Vi=Bi,Xi=P.a.FRONT,ji=P.a.BACK,ki=[0,0,1],Wi=a.a.create({Extends:K,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){Wi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),r=this.width/t,i=this.height/e,a=new Float32Array(3*n),s=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,f=0;f<=e;f++)for(var h=0;h<=t;h++){var l=f*(t+1)+h;if(a[3*l]=h*r-this.width/2,a[3*l+1]=this.height/2-f*i,s[3*l]=0,s[3*l+1]=0,s[3*l+2]=1,o[2*l]=h/t,o[2*l+1]=1-f/e,f0||n<0))return null;if(e===ji&&(r<0||n>0))return null;var i=t.intersectsPlane(ki,0);if(i){var a=i.x,s=i.y,o=.5*this.width,u=.5*this.height;if(a>=-o&&a<=o&&s>=-u&&s<=u)return[i]}return null}}),Yi=Wi,zi=a.a.create({Extends:K,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){zi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,r=(n+1)*(e+1),i=n*e,a=new Float32Array(3*r),s=new Float32Array(4*r),o=new Float32Array(2*r),u=new Uint16Array(6*i),c=0,f=0,h=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,E=_*g,v=Math.cos(E)*t,T=Math.sin(E)*t,A=0;A<=n;A++){var M=A/n,I=m*M,R=Math.cos(I),O=Math.sin(I),L=R*T,S=O*T,y=O,N=-R;if(s[h++]=y,s[h++]=0,s[h++]=N,s[h++]=1,a[f++]=L,a[f++]=v,a[f++]=S,o[l++]=M,o[l++]=g,p>0&&A>0){var x=d,C=x-1,P=C-n-1,w=x-n-1;u[c++]=P,u[c++]=w,u[c++]=x,u[c++]=P,u[c++]=x,u[c++]=C}d++}this.vertices=new b(a,3),this.indices=new b(u,1),this.uvs=new b(o,2),this.tangents=new b(s,4),this.normals=new b(new Float32Array(a),3)},_raycast:function(t,e){return zi.superclass._raycast.call(this,t,e)}}),qi=zi,Ki=a.a.create({className:"UniformBuffer",isUniformBuffer:!0,isDirty:!1,data:{get:function(){return this._data},set:function(t){this._data=t,this.isDirty=!0}},_data:null,_buffer:null,constructor:function(t){this.data=t},getBuffer:function(t){return this._buffer||(this._buffer=new jt(t,t.UNIFORM_BUFFER,null,t.DYNAMIC_DRAW)),this.isDirty&&(this._buffer.bufferData(this.data),this.isDirty=!1),this._buffer},destroy:function(){this._buffer&&(this._buffer.destroy(),this._buffer=null),this.isDirty=!0}}),Zi=[Rt,Ft,jt,Qt,_e,we],Qi=function(){var t="";return Zi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t),t},Ji=a.a.create({Mixes:s.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var r={key:t,state:e,data:n};this._files[t]=r,this.fire("update",r),this.fire("update:".concat(r.key),r)}},get:function(t){return this.enabled?this._files[t]:null},getLoaded:function(t){var e=this.get(t);return e&&e.state===Ji.LOADED?e.data:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Ji.LOADED?Promise.resolve(t.data):t.state===Ji.FAILED?Promise.reject():new Promise((function(n,r){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Ji.LOADED?n(e.data):e.state===Ji.FAILED&&r(e.data)}),!0)})):Promise.reject()}}),$i=Ji,ta=new $i,ea=a.a.create({Mixes:s.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:ta,enalbeCache:function(){ta.enabled=!0},disableCache:function(){ta.enabled=!1},deleteCache:function(t){ta.remove(t)},clearCache:function(){ta.clear()},cache:{get:function(){return ta},set:function(){m.a.warn("BasicLoader.cache is readonly!")}},TYPE_IMAGE:"img",TYPE_JSON:"json",TYPE_BUFFER:"buffer",TYPE_TEXT:"text"},load:function(t){var e=t.src,n=t.type;if(!n){var r=Object(i.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(r)&&(n="img"),n||(n=t.defaultType)}return n===ea.TYPE_IMAGE?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,r=new Uint8Array(n),i=0;i=300)r(new TypeError("Network request failed for ".concat(a.status)));else{var e="response"in a?a.response:a.responseText;if(t.type===ea.TYPE_JSON)try{e=JSON.parse(e)}catch(t){return void r(new TypeError("JSON.parse error"+t))}n(e)}},a.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request timed out"))},a.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(a.withCredentials=!0),t.type===ea.TYPE_BUFFER&&(a.responseType="arraybuffer"),Object(i.each)(t.headers,(function(t,e){a.setRequestHeader(e,t)})),a.send(t.body||null)}))}}),na=ea,ra=a.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){ra._loaderClassMap[t]=e},getLoader:function(t){if(!ra._loaders[t]){var e=ra._loaderClassMap[t]?ra._loaderClassMap[t]:na;ra._loaders[t]=new e}return ra._loaders[t]}},preHandlerUrl:null,load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(i.getExtension)(t.src),r=ra.getLoader(n),a=t;return this.preHandlerUrl&&((a=Object.assign({},t)).src=this.preHandlerUrl(t.src)),r.load(a)}}),ia=ra,aa=a.a.create({Extends:na,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){aa.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new Ve(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});ia.addLoader("CubeTexture",aa);var sa=aa,oa=a.a.create({Extends:On,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnvMap:null,isSpecularEnvMapIncludeMipmaps:!1,emission:null,emissionFactor:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,clearcoatFactor:0,clearcoatMap:null,clearcoatRoughnessFactor:0,clearcoatRoughnessMap:null,clearcoatNormalMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new E.a(1,1,1),this.specular=new E.a(1,1,1),this.emissionFactor=new E.a(0,0,0),oa.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_emissionFactor:"EMISSIONFACTOR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3",u_clearcoatFactor:"CLEARCOATFACTOR",u_clearcoatRoughnessFactor:"CLEARCOATROUGHNESSFACTOR"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP",u_clearcoatMap:"CLEARCOATMAP",u_clearcoatRoughnessMap:"CLEARCOATROUGHNESSMAP",u_clearcoatNormalMap:"CLEARCOATNORMALMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oa.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),lt.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),this.specularEnvMap&&this.isSpecularEnvMapIncludeMipmaps&&(t.IS_SPECULAR_ENV_MAP_INCLUDE_MIPMAPS=1),this.clearcoatFactor>0&&(t.HAS_CLEARCOAT=1,t.HAS_NORMAL=1,this.clearcoatMap&&e.add(this.clearcoatMap,"CLEARCOAT_MAP"),this.clearcoatNormalMap&&e.add(this.clearcoatNormalMap,"CLEARCOAT_NORMAL_MAP"),this.clearcoatRoughnessMap&&e.add(this.clearcoatRoughnessMap,"CLEARCOAT_ROUGHNESS_MAP")),e.update(),t}}),ua=oa,ca=new Image;ca.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var fa=a.a.create({Extends:_e,Mixes:s.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),fa.superclass.constructor.call(this,t),this.image=this.placeHolder||ca},load:function(t){var e=this;return fa.loader=fa.loader||new ia,fa.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),fa.superclass._releaseImage.call(this)}}),ha=fa,la=n(13);function da(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ma(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;r--)Ma[r]=t[r]+n*(e[r]-t[r]);return Ma}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,r){var a=t.length/3;if(void 0===e)return 1===a?t[1]:t.slice(a,-a);var s=t[1],o=t[2],u=e[1],c=e[0];return a>1&&(s=t.slice(a,-a),o=t.slice(-a),u=e.slice(a,-a),c=e.slice(0,a)),s.hermite?s.hermite(s,o.scale(r),u,c.scale(r),n):s.isQuaternion?(s.fromArray(this._cubicSpline(s.elements,o.elements,u.elements,c.elements,r,n),0,!0),s.normalize(!0)):(Object(i.isArrayLike)(s)||(s=[s],o=[o],u=[u],c=[c]),s=this._cubicSpline(s,o,u,c,r,n)),s},_cubicSpline:function(t,e,n,r,i,a){var s=a*a,o=s*a,u=2*o-3*s+1,c=o-2*s+a,f=-2*o+3*s,h=o-s;Ma.length=0;for(var l=t.length-1;l>=0;l--)Ma[l]=t[l]*u+c*e[l]*i+n[l]*f+h*r[l]*i;return Ma}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ra.StateType[t]||Ra._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ra._extraStateHandlers.type[String(t).toUpperCase()]=t,Ra._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){var e=Object(i.getIndexFromSortedArray)(this.keyTime,t,Ia);return e[0]<0&&(e[0]=0),e[1]>=this.keyTime.length&&(e[1]=this.keyTime.length-1),e},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=da(this.findIndexByTime(t),2),n=e[0],r=e[1],a=this.keyTime[n],s=this.keyTime[r],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===r){var u=this.interpolation(o);return this.type===Ra.StateType.ROTATION&&(u=_a.fromEuler(Aa.fromArray(u))),u.elements||u}var c=this.getStateByIndex(r),f=s-a,h=(t-a)/f;this.type===Ra.StateType.ROTATION?Object(i.isArrayLike)(o[0])?(o[0]=_a.fromEuler(Aa.fromArray(o[0])),o[1]=pa.fromEuler(Aa.fromArray(o[1])),o[2]=ga.fromEuler(Aa.fromArray(o[2])),c[0]=Ea.fromEuler(Aa.fromArray(c[0])),c[1]=va.fromEuler(Aa.fromArray(c[1])),c[2]=Ta.fromEuler(Aa.fromArray(c[2]))):(o=_a.fromEuler(Aa.fromArray(o)),c=pa.fromEuler(Aa.fromArray(c))):this.type===Ra.StateType.QUATERNION&&(Object(i.isArrayLike)(o[0])?(o[0]=_a.fromArray(o[0]),o[1]=pa.fromArray(o[1]),o[2]=ga.fromArray(o[2]),c[0]=Ea.fromArray(c[0]),c[1]=va.fromArray(c[1]),c[2]=Ta.fromArray(c[2])):(o=_a.fromArray(o),c=pa.fromArray(c)));var l=this.interpolation(o,c,h,f);return l.elements||l},interpolation:function(t,e,n,r){return Ra.interpolation[this.interpolationType](t,e,n,r)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],r=e.length;e=e.slice();for(var i=0;ie[a]){var o=e[a];e[a]=e[s],e[s]=o,o=n[a],n[a]=n[s],n[s]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ra.StateType.ROTATION&&(n=Ra.StateType.QUATERNION);var r=this.getState(t);if(r){var i="updateNode"+n;this[i]?this[i](e,r):Ra._extraStateHandlers.handler[n]?Ra._extraStateHandlers.handler[n].call(this,e,r):m.a.warnOnce(i,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),Oa=Ra,La=a.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:s.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this._initNodeNameMap()}},_animStatesList:null,animStatesList:{get:function(){return this._animStatesList},set:function(t){this._animStatesList=t,this._initClipTime()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.clips={},this._animStatesList=[],Object.assign(this,t)},addClip:function(t,e,n,r){this.clips[t]={start:e,end:n,animStatesList:r}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},_initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=0,this.clipEndTime=t.endTime},_initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var r=this.clips[t];r?(n=r.start,e=r.end,r.animStatesList&&(this.animStatesList=r.animStatesList,this._initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,La._anims.push(this)},stop:function(){this.paused=!0;var t=La._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Sa=La;function ya(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Na(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Na(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},i.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Ga.extensionHandlers[t]},parseExtension:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t[e],a=this.getExtensionHandler(e);return a&&a.parse?a.parse(i,this,n,r):n},parseExtensions:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.each(t,(function(t,i){if(!r.ignoreExtensions||!r.ignoreExtensions[i]){var a=n.getExtensionHandler(i),s=r.methodName||"parse";a&&a[s]&&(e=a[s](t,n,e,r))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),r=n.getUint32(4,!0),a=n.getUint32(8,!0),s=12;if(r<2){var o=n.getUint32(s,!0);e=new Uint8Array(t,20,o),e=i.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==r)throw new Error("Dont support glTF version ".concat(r));for(;sa*i.BYTES_PER_ELEMENT)s.array=new i(s.buffer,s.byteOffset,s.byteLength/i.BYTES_PER_ELEMENT),r=new b(s.array,a,{offset:n.byteOffset||0,stride:s.byteStride,bufferViewId:s.id});else{var u,c=(n.byteOffset||0)+s.byteOffset;if(c%i.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new i(s.buffer.slice(c,c+o*i.BYTES_PER_ELEMENT));else u=new i(s.buffer,c,o);r=new b(u,a)}return n.sparse&&(r||(r=new b(new i(o),a)),r=this.sparseAccessorHandler(r,n.sparse)),r=this.parseExtensions(n.extensions,r,{isDecode:e,isAccessor:!0}),n.data=r,n.normalized&&(r.normalized=!0),r},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var r=this.getAccessorData(t,e);if(!r.stride&&!r.offset&&1===r.size)return r.data;var i=[];return r.traverse((function(t){i.push(t.toArray?t.toArray():t)})),n.array=i,i},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case xa:e.blend=!0;break;case Ca:e.depthTest=!0;break;case ba:e.cullFace=!0}})),i.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Pa?wa:Pa:e.side=Ha)},createMorphGeometry:function(t,e){var n=this,r=new Tr,a=r.targets={};return i.each(t.targets,(function(t){i.each(t,(function(t,e){var r=Ua[e].name;a[r]||(a[r]=[]);var i=n.getAccessorData(t,!0);a[r].push(i)}))})),r.weights=e||new Float32Array(t.targets.length),r},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var r=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(r)return r.mode=n,r}t||(t=new K({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var i=e.attributes;for(var a in i){var s=Ua[a];if(s){var o=!(this.isUnQuantizeInShader&&s.decodeMatName);t[s.name]=this.getAccessorData(i[a],o),o||(t[s.decodeMatName]=t[s.name].decodeMat,delete t[s.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(a,"!"))}return t},handlerSkinedMesh:function(t,e){e&&(t.skeleton=e,this.useInstanced&&(t.useInstanced=!0))},fixProgressiveGeometry:function(t,e){t._geometry=e,this.isProgressive&&t._meshes&&t._meshes.forEach((function(t){t.visible=!0,t.geometry=e}))},parseGeometries:function(){var t=this,e=i.serialRun(this.json.meshes,(function(e){return i.serialRun(e.primitives,(function(n){var r;n.targets&&n.targets.length&&(r=t.createMorphGeometry(n,e.weights)),n._geometry=r;var i=t.handlerGeometry(r,n);return i&&i.then?i.then((function(e){t.fixProgressiveGeometry(n,e)}),(function(t){m.a.error("geometry parse error",t)})):(t.fixProgressiveGeometry(n,i),i)}))}));return this.isProgressive?null:e},parseMesh:function(t,e,n){var r=this,i=this.json.meshes[t];i.primitives.forEach((function(a){var s,o=r.skins&&r.skins[n.skin];if(a.meshNode)s=a.meshNode.clone();else{var u=r.materials[a.material]||new Sn;s=new(o?kr:Br)({geometry:a._geometry,material:u,name:"mesh-"+(i.name||t)}),a.meshNode=s}r.handlerSkinedMesh(s,o),r.isProgressive&&!s.geometry&&(s.visible=!1,a._meshes=a._meshes||[],a._meshes.push(s)),e.addChild(s),r.meshes.push(s)}))},parseCameras:function(){var t=this;this.cameras={};var e=window.innerWidth/window.innerHeight;i.each(this.json.cameras,(function(n,r){var i;"perspective"===n.type&&n.perspective?((i=new Q).fov=d.a.radToDeg(n.perspective.yfov),i.near=n.perspective.znear,i.far=n.perspective.zfar,n.aspectRatio?i.aspect=n.aspectRatio:i.aspect=e):"orthographic"===n.type&&n.orthographic&&((i=new Dn).near=n.orthographic.znear,i.far=n.orthographic.zfar,i.right=n.orthographic.xmag,i.left=-1*i.right,i.top=n.orthographic.ymag,i.bottom=-1*i.top),(i=t.parseExtensions(n.extensions,i,{isCamera:!0}))&&(i.name=n.name||r,t.cameras[r]=i)}))},handlerNodeTransform:function(t,e){e.matrix?t.matrix.fromArray(e.matrix):(e.rotation&&t.quaternion.fromArray(e.rotation),e.scale&&t.setScale(e.scale[0],e.scale[1],e.scale[2]),e.translation&&(t.x=e.translation[0],t.y=e.translation[1],t.z=e.translation[2]))},parseNode:function(t,e){var n,r=this,i=this.json.nodes[t];i||m.a.warn("GLTFParser.parseNode: nodes[".concat(t,"] has nothing.")),n=new g({name:i.name,animationId:t}),n=this.parseExtensions(i.extensions,n,{isNode:!0}),"camera"in i&&this.cameras[i.camera]&&n.addChild(this.cameras[i.camera]),this.handlerNodeTransform(n,i),i.jointName?(n.jointName=i.jointName,this.jointMap[n.jointName]=n):this.isGLTF2&&(n.jointName=t,this.jointMap[t]=n),i.meshes?i.meshes.forEach((function(t){return r.parseMesh(t,n,i)})):"mesh"in i&&this.parseMesh(i.mesh,n,i),i.children&&i.children.forEach((function(t){return r.parseNode(t,n)})),e.addChild(n)},parseAnimations:function(){var t=this;if(!this.json.animations)return null;var e=this.isMultiAnim,n={},r=[],a={};return i.each(this.json.animations,(function(i){i.channels.forEach((function(e){var n=e.target.path,s=e.target.id;t.isGLTF2&&(s=e.target.node);var o=i.samplers[e.sampler],u=t.isGLTF2?o.input:i.parameters[o.input],c=t.isGLTF2?o.output:i.parameters[n],f=t.getArrayByAccessor(u,!0),h=t.getArrayByAccessor(c,!0);"rotation"===n&&(n="quaternion");var l=new Oa({interpolationType:o.interpolation||"LINEAR",nodeName:s,keyTime:f,states:h,type:Oa.getType(n)});r.push(l),a[s]=!0})),e&&r.length&&(n[i.name]={animStatesList:r},r=[])})),e&&Object.keys(n).length>0&&(r=Object.values(n)[0].animStatesList),r.length?new Sa({rootNode:this.node,animStatesList:r,validAnimationIds:a,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};var n=e.nodes;this.parseSkins(),n.forEach((function(e){return t.parseNode(e,t.node)})),this.resetSkinInfo(this.node);var r={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),r.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,r,{isGlobal:!0,methodName:"parseOnEnd"}),r},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null},parseSkins:function(){var t=this;this.skins=[];var e=this.json.skins;e&&e.length&&(this.skins=e.map((function(e){for(var n=new Yr,r=e.joints.length,i=t.getArrayByAccessor(e.inverseBindMatrices,!0),a=0;a ",t)}return null}))}});ia.addLoader("hdr",Ka);var Za=Ka,Qa=a.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var r=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===r[0]&&75===r[1]&&84===r[2]&&88===r[3]&&32===r[4]&&49===r[5]&&49===r[6]&&187===r[7]&&13===r[8]&&10===r[9]&&26===r[10]&&10===r[11]){var i=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.arrayBuffer,this.baseOffset+12,13*i),s=a.getUint32(0,!0),o=67305985===s;this.glType=a.getUint32(1*i,o),this.glTypeSize=a.getUint32(2*i,o),this.glFormat=a.getUint32(3*i,o),this.glInternalFormat=a.getUint32(4*i,o),this.glBaseInternalFormat=a.getUint32(5*i,o),this.pixelWidth=a.getUint32(6*i,o),this.pixelHeight=a.getUint32(7*i,o),this.pixelDepth=a.getUint32(8*i,o),this.numberOfArrayElements=a.getUint32(9*i,o),this.numberOfFaces=a.getUint32(10*i,o),this.numberOfMipmapLevels=a.getUint32(11*i,o),this.bytesOfKeyValueData=a.getUint32(12*i,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=Qa.COMPRESSED_2D:this.loadType=Qa.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=Qa.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,i=this.pixelHeight,a=t?this.numberOfMipmapLevels:1,s=0;s2&&void 0!==arguments[2]?arguments[2]:0,r=new Qa(e,1,n),i={compressed:0===r.glType,type:r.glType,width:r.pixelWidth,height:r.pixelHeight,internalFormat:r.glInternalFormat,format:r.glFormat,isCubemap:6===r.numberOfFaces};return r.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(i.width,i.height))+1)?(i.mipmaps=r.mipmaps(!0),i.image=i.mipmaps[0].data):(i.mipmaps=null,i.image=r.mipmaps(!1)[0].data),new _e(i)}});ia.addLoader("ktx",Ja);var $a=Ja,ts=a.a.create({Mixes:s.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),ia.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.renderer.pixelRatio,a=[],s=this.framebuffer.readPixels(t*i,e*i,n*i,r*i),o=0;o=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var r=n.slice(0),i=0,a=r.length;i=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(r){e.removeTick(n),t(r)}};return e.addTick(n),n},timeout:function(t,e){var n=this,r=(new Date).getTime()+e,i={tick:function(){(new Date).getTime()-r>=0&&(n.removeTick(i),t())}};return n.addTick(i),i},interval:function(t,e){var n=(new Date).getTime()+e,r={tick:function(){var r=(new Date).getTime(),i=r-n;i>=0&&(i0;){if(d(c)128){if(0==(u=(255&h[0])-128)||u>o-s)throw new Error("Bad scanline data");for(;u-- >0;)f[s++]=h[1]}else{if(0==(u=255&h[0])||u>o-s)throw new Error("Bad scanline data");if(f[s++]=h[1],--u>0){if(m(f,s,u)=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(103),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(35))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,s,o,u=1,c={},f=!1,h=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){m(t.data)},r=function(t){a.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(m,0,t)}:(s="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&m(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),r=function(e){t.postMessage(s+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\n\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define attribute in\n#define varying out\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n#define gl_FragColor hilo_FragData0\n#define gl_FragDepthEXT gl_FragDepth\nlayout(location = 0) out highp vec4 hilo_FragData0;"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return i})),n.d(e,"GLTFExtensions",(function(){return r})),n.d(e,"Class",(function(){return a.a})),n.d(e,"EventMixin",(function(){return o})),n.d(e,"Fog",(function(){return zr})),n.d(e,"Mesh",(function(){return jn})),n.d(e,"Node",(function(){return E})),n.d(e,"SkinedMesh",(function(){return Qr})),n.d(e,"Skeleton",(function(){return $r})),n.d(e,"Stage",(function(){return Ri})),n.d(e,"Tween",(function(){return Yi})),n.d(e,"version",(function(){return ti})),n.d(e,"BoxGeometry",(function(){return qi})),n.d(e,"Geometry",(function(){return Q})),n.d(e,"GeometryData",(function(){return w})),n.d(e,"MorphGeometry",(function(){return br})),n.d(e,"PlaneGeometry",(function(){return $i})),n.d(e,"SphereGeometry",(function(){return ea})),n.d(e,"Camera",(function(){return L})),n.d(e,"PerspectiveCamera",(function(){return $})),n.d(e,"OrthographicCamera",(function(){return Un})),n.d(e,"Buffer",(function(){return Wt})),n.d(e,"UniformBuffer",(function(){return na})),n.d(e,"capabilities",(function(){return mt})),n.d(e,"extensions",(function(){return dt})),n.d(e,"Framebuffer",(function(){return He})),n.d(e,"glType",(function(){return Pt})),n.d(e,"logGLResource",(function(){return ia})),n.d(e,"Program",(function(){return Gt})),n.d(e,"RenderInfo",(function(){return ei})),n.d(e,"RenderList",(function(){return ai})),n.d(e,"VertexArrayObject",(function(){return $t})),n.d(e,"WebGLRenderer",(function(){return Ai})),n.d(e,"WebGLResourceManager",(function(){return oi})),n.d(e,"WebGLState",(function(){return si})),n.d(e,"BasicLoader",(function(){return ca})),n.d(e,"CubeTextureLoader",(function(){return da})),n.d(e,"GLTFLoader",(function(){return Za})),n.d(e,"GLTFParser",(function(){return za})),n.d(e,"AliAMCExtension",(function(){return Hr})),n.d(e,"HDRLoader",(function(){return rs})),n.d(e,"KTXLoader",(function(){return ss})),n.d(e,"LoadCache",(function(){return sa})),n.d(e,"LoadQueue",(function(){return os})),n.d(e,"ShaderMaterialLoader",(function(){return cs})),n.d(e,"TextureLoader",(function(){return hs})),n.d(e,"Loader",(function(){return ha})),n.d(e,"Texture",(function(){return ge})),n.d(e,"LazyTexture",(function(){return Ea})),n.d(e,"CubeTexture",(function(){return je})),n.d(e,"DataTexture",(function(){return Ke})),n.d(e,"Shader",(function(){return Lt})),n.d(e,"BasicMaterial",(function(){return Nn})),n.d(e,"GeometryMaterial",(function(){return Hn})),n.d(e,"Material",(function(){return Sn})),n.d(e,"PBRMaterial",(function(){return _a})),n.d(e,"semantic",(function(){return dn})),n.d(e,"ShaderMaterial",(function(){return yr})),n.d(e,"AxisHelper",(function(){return _s})),n.d(e,"AxisNetHelper",(function(){return Es})),n.d(e,"CameraHelper",(function(){return qn})),n.d(e,"AmbientLight",(function(){return Ts})),n.d(e,"AreaLight",(function(){return Ms})),n.d(e,"DirectionalLight",(function(){return Mr})),n.d(e,"CubeLightShadow",(function(){return pr})),n.d(e,"Light",(function(){return M})),n.d(e,"LightManager",(function(){return hi})),n.d(e,"LightShadow",(function(){return er})),n.d(e,"PointLight",(function(){return Er})),n.d(e,"SpotLight",(function(){return Lr})),n.d(e,"Animation",(function(){return wa})),n.d(e,"AnimationStates",(function(){return ba})),n.d(e,"MeshPicker",(function(){return Ls})),n.d(e,"Ticker",(function(){return Ss})),n.d(e,"log",(function(){return _.a})),n.d(e,"Cache",(function(){return tt})),n.d(e,"browser",(function(){return Mi})),n.d(e,"WebGLSupport",(function(){return ys})),n.d(e,"constants",(function(){return D.a})),n.d(e,"Color",(function(){return Ns.Color})),n.d(e,"Euler",(function(){return Ns.Euler})),n.d(e,"EulerNotifier",(function(){return Ns.EulerNotifier})),n.d(e,"Frustum",(function(){return Ns.Frustum})),n.d(e,"math",(function(){return Ns.math})),n.d(e,"Matrix3",(function(){return Ns.Matrix3})),n.d(e,"Matrix4",(function(){return Ns.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Ns.Matrix4Notifier})),n.d(e,"Plane",(function(){return Ns.Plane})),n.d(e,"QuaternionNotifier",(function(){return Ns.QuaternionNotifier})),n.d(e,"Quaternion",(function(){return Ns.Quaternion})),n.d(e,"Ray",(function(){return Ns.Ray})),n.d(e,"Sphere",(function(){return Ns.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Ns.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Ns.Vector2})),n.d(e,"Vector3",(function(){return Ns.Vector3})),n.d(e,"Vector3Notifier",(function(){return Ns.Vector3Notifier})),n.d(e,"Vector4",(function(){return Ns.Vector4}));var r={};n.r(r),n.d(r,"ALI_amc_mesh_compression",(function(){return Hr})),n.d(r,"WEB3D_quantized_attributes",(function(){return Ur})),n.d(r,"HILO_animation_clips",(function(){return Gr})),n.d(r,"ALI_animation_clips",(function(){return Br})),n.d(r,"ALI_bounding_box",(function(){return Vr})),n.d(r,"KHR_materials_pbrSpecularGlossiness",(function(){return Xr})),n.d(r,"KHR_materials_clearcoat",(function(){return jr})),n.d(r,"KHR_lights_punctual",(function(){return kr})),n.d(r,"KHR_techniques_webgl",(function(){return Wr}));var i=n(4),a=n(1),s=a.a.create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n},type:null,target:null,detail:null,stopImmediatePropagation:function(){this._stopped=!0}}),o={_listeners:null,on:function(t,e,n){for(var r=this._listeners=this._listeners||{},i=r[t]=r[t]||[],a=0,s=i.length;a0){if(1===arguments.length)return delete this._listeners[t],this;for(var r=0,i=n.length;r0){var o=a.slice(0);if((n=n||new s(r,this,e))._stopped)return!1;for(var u=0;u-1&&a.splice(f,1)}}return!0}return!1}},u=n(7),c=n(20),f=n(5),h=n(16),l=n(21),d=n(22),m=n(6),_=n(3),p=new f.a(0,1,0),g=new u.a,E=a.a.create({Statics:{TRAVERSE_STOP_NONE:0,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:2},Mixes:o,isNode:!0,className:"Node",name:"",anim:null,animationId:"",jointName:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,userData:null,onUpdate:null,__forceUseParentWorldMatrix:!1,onlySyncQuaternion:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),this.up=p.clone(),this.children=[],this.worldMatrix=new u.a,this._matrix=new c.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new l.a,this._quaternion=new d.a,this._matrix.onUpdate=this._onMatrixUpdate.bind(this),this._position.onUpdate=this._onPositionUpdate.bind(this),this._scale.onUpdate=this._onScaleUpdate.bind(this),this._pivot.onUpdate=this._onPivotUpdate.bind(this),this._rotation.onUpdate=this._onRotationUpdate.bind(this),this._quaternion.onUpdate=this._onQuaternionUpdate.bind(this),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.skeleton&&(e.skeleton.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix),e.worldMatrixVersion++),e.autoUpdateChildWorldMatrix||t?0:1})),this},getConcatenatedMatrix:function(t){for(var e=new u.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(2===n||1===n)return n}for(var r=this.children,i=0,a=r.length;i1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=r?this.children:[this];n.length;){e=n,n=[];for(var i=0,a=e.length;i1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?g.targetTo(this,t,this.up):g.targetTo(t,this,this.up),this._quaternion.fromMat4(g),this},raycast:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(e){if(n&&!e.pointerEnabled)return 1;if(e.isMesh){var i=e.raycast(t,!1);i&&(r=r.concat(i.map((function(t){return{mesh:e,point:t}}))))}return n&&!e.pointerChildren?1:0})),r.length?(e&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){_.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){_.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){_.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){_.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){_.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){_.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,worldMatrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this.onlySyncQuaternion||this._rotation.fromQuat(this._quaternion),this._quatDirty=!1,this._matrixDirty=!0}}),v=n(8),T=new v.a,A=a.a.create({Extends:E,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},shadow:null,isDirty:!1,constructor:function(t){this.color=new v.a(1,1,1),A.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return T.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=A,I=n(23),R=new u.a,O=a.a.create({Extends:E,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new u.a,this.projectionMatrix=new u.a,this.viewProjectionMatrix=new u.a,this._frustum=new I.a,O.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new u.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new u.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var r=t.clone();return r.transformMat4(this.viewProjectionMatrix),e&&n&&(r.x=(r.x+1)/2*e,r.y=n-(r.y+1)/2*n),r},unprojectVector:function(t,e,n){var r=t.clone();return e&&n&&(r.x=r.x/e*2-1,r.y=1-r.y/n*2),R.invert(this.viewProjectionMatrix),r.transformMat4(R),r},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),L=O,S=n(13),y=n(11),N=n(10),x=n(9),C=n(19),b={2:new S.a,3:new f.a,4:new y.a,16:new u.a},P=a.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=m.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||_.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(i.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new P(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?b[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,r=this._data;n>1?e.toArray(r,t):r[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Z.fromTranslation(V.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(Z.fromScaling(V.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Z.fromQuat(K.fromEuler({x:t*m.a.DEG2RAD,y:e*m.a.DEG2RAD,z:n*m.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,r,i){e.setByOffset(i,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,r){n.setByOffset(r,t.transformMat3(q).normalize())}))}if(this._tangents){var r=this.tangents;r.traverse((function(t,e,n){r.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var r=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,r,i){n.setByOffset(i,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+r})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,r){var i=this[t];if(!i||n>i.length){var a=new r(n);i?(a.set(i.data),i.data=a):this[t]=new w(a,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var r=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;r[n]=e[0],r[n+1]=e[1],r[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var r=this.indices.data;e.forEach((function(e){r[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var r=this.addPoints(t,e,n);this.addIndices(r,r+1,r+2)},addRect:function(t,e,n,r){var i=this.addPoints(t,e,n,r);this.addIndices(i,i+1,i+2,i,i+2,i+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,r=0;r0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new C.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new C.a({center:new f.a(e.x,e.y,e.z)}),r=this.vertices;r?n.fromGeometryData(r):(_.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===H)if(this.indices){for(var e=this.indices.data,n=e.length,r=new Float32Array(n*t),a=this.uvs?new Float32Array(2*n):null,s=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,f=0;f2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&r&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(i.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){_.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),J=a.a.create({Extends:L,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){J.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,r=this.aspect,i=this.fov,a=1/Math.tan(.5*m.a.degToRad(i));if(t[0]=a/r,t[5]=a,t[11]=-1,t[15]=0,n){var s=1/(e-n);t[10]=(e+n)*s,t[14]=2*n*e*s}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Q,n=Math.tan(this.fov/2*Math.PI/180),r=this.near,i=this.far,a=r*n,s=i*n,o=this.aspect*a,u=this.aspect*s,c=[-o,-a,-r],f=[o,-a,-r],h=[o,a,-r],l=[-o,a,-r],d=[-u,-s,-i],m=[u,-s,-i],_=[u,s,-i],p=[-u,s,-i];e.addRect(d,m,_,p),e.addRect(m,f,h,_),e.addRect(f,c,l,h),e.addRect(c,d,p,l),e.addRect(p,_,h,l),e.addRect(c,f,m,d),this._geometry=e}return this._geometry}}),$=J,tt=a.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}});function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:t;this._usedExtensions[t]=e,this.gl&&this.get(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;if(this.isWebGL2&&ft[t])return ft[t];var n=ht[t];if(n){if(this.isWebGL2)return new n.WebGL2(e);var r=this._getOriginExtension(t);return r?new n.WebGL1(r):null}return this._getOriginExtension(t)},_getOriginExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};lt.use("ANGLE_instanced_arrays","instanced"),lt.use("OES_vertex_array_object","vao"),lt.use("OES_texture_float","texFloat"),lt.use("OES_element_index_uint","uintIndices"),lt.use("EXT_shader_texture_lod","shaderTextureLod"),lt.use("EXT_frag_depth","fragDepth"),lt.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic"),lt.use("WEBGL_lose_context","loseContext"),lt.use("EXT_color_buffer_float","colorBufferFloat"),lt.use("EXT_sRGB","sRGB"),lt.use("WEBGL_draw_buffers","drawBuffers");var dt=lt,mt={isWebGL2:!1,MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,MAX_RENDERBUFFER_SIZE:void 0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:void 0,MAX_CUBE_MAP_TEXTURE_SIZE:void 0,MAX_FRAGMENT_UNIFORM_VECTORS:void 0,MAX_TEXTURE_IMAGE_UNITS:void 0,MAX_TEXTURE_SIZE:void 0,MAX_VARYING_VECTORS:void 0,MAX_VERTEX_ATTRIBS:void 0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:void 0,MAX_VERTEX_UNIFORM_VECTORS:void 0,init:function(t){var e=this;this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t);["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!dt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!dt.texFloat,this.FRAG_DEPTH=!!dt.fragDepth,this.SHADER_TEXTURE_LOD=!!dt.shaderTextureLod,this.DRAW_BUFFERS=!!dt.drawBuffers,dt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(dt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var r=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],i=0;i0){n=a.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},_t=n(51),pt=n.n(_t),gt=n(52),Et=n.n(gt),vt=n(53),Tt=n.n(vt),At=n(54),Mt=n.n(At),It=new tt,Rt=new tt,Ot=a.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(17),"chunk/color.frag":n(36),"chunk/color.vert":n(75),"chunk/color_main.vert":n(77),"chunk/diffuse.frag":n(57),"chunk/diffuse_main.frag":n(66),"chunk/extensions.frag":n(24),"chunk/extensions.vert":n(48),"chunk/fog.frag":n(43),"chunk/fog_main.frag":n(68),"chunk/frag_color.frag":n(47),"chunk/joint.vert":n(70),"chunk/joint_main.vert":n(80),"chunk/light.frag":n(40),"chunk/lightFog.frag":n(39),"chunk/lightFog.vert":n(73),"chunk/lightFog_main.frag":n(45),"chunk/lightFog_main.vert":n(83),"chunk/logDepth.frag":n(28),"chunk/logDepth_main.frag":n(29),"chunk/logDepth.vert":n(76),"chunk/logDepth_main.vert":n(84),"chunk/morph.vert":n(74),"chunk/morph_main.vert":n(79),"chunk/normal.frag":n(38),"chunk/normal.vert":n(72),"chunk/normal_main.frag":n(44),"chunk/normal_main.vert":n(82),"chunk/pbr.frag":n(85),"chunk/pbr_main.frag":n(87),"chunk/phong.frag":n(64),"chunk/phong_main.frag":n(67),"chunk/precision.frag":n(25),"chunk/precision.vert":n(49),"chunk/transparency.frag":n(42),"chunk/transparency_main.frag":n(46),"chunk/unQuantize.vert":n(69),"chunk/unQuantize_main.vert":n(78),"chunk/uv.frag":n(37),"chunk/uv.vert":n(71),"chunk/uv_main.vert":n(81),"method/encoding.glsl":n(86),"method/getDiffuse.glsl":n(59),"method/getLightAttenuation.glsl":n(61),"method/getShadow.glsl":n(63),"method/getSpecular.glsl":n(60),"method/packFloat.glsl":n(50),"method/textureEnvMap.glsl":n(41),"method/transpose.glsl":n(58),"method/unpackFloat.glsl":n(62),"basic.frag":n(51),"basic.vert":n(52),"geometry.frag":n(53),"pbr.frag":n(54),"screen.frag":n(55),"screen.vert":n(56)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return It}},headerCache:{get:function(){return Rt}},reset:function(t){It.removeAll()},getHeaderKey:function(t,e,n,r,i){var a="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(a+="_joint"+t.skeleton.jointCount),r&&(a+="_fog_"+r.mode),a+="_"+t.geometry.getShaderKey(),i&&(a+="_fogDepth"),a},getHeader:function(t,e,n,r,i){var a=this.getHeaderKey(t,e,n,r),s=Rt.get(a);if(!s||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),r&&(o.HAS_FOG=1,r.getRenderOption(o)),i&&(o.USE_LOG_DEPTH=1,mt.FRAG_DEPTH&&(o.USE_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),s="#define SHADER_NAME ".concat(e.shaderName||e.className,"\n"),s+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",Rt.add(a,s)}return s},_getCommonHeader:function(t){var e=mt.getMaxPrecision(mt.MAX_VERTEX_PRECISION,t.vertexPrecision),n=mt.getMaxPrecision(mt.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),r=mt.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(r,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,r,i,a){var s=this.getHeader(t,e,r,i,a);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,s):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,s,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var r="";e&&(r=(r=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var i=t.className+":"+r;t.onBeforeCompile&&(i+=":"+(t.shaderCacheId||t.id));var a=It.get(i);if(!a){var s="",o=Et.a;if(t.isBasicMaterial?t.isGeometryMaterial?s+=Tt.a:s+=pt.a:t.isPBRMaterial&&(s+=Mt.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,s);s=u.fs,o=u.vs}if(r){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(r,");"),"gm");o=o.replace(c,"attribute $1 $2;")}a=this.getCustomShader(o,s,n,i,!0)}if(a){var f=this._getNumId(a);null!==f&&(t._shaderNumId=f)}return a},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,r,i){var a,s=this.commonHeader;return r&&(i&&(r+=":"+n),a=It.get(r)),a||(a=new Ot({vs:s+n+t,fs:s+n+e}),r&&It.add(r,a)),a}},alwaysUse:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(It.removeObject(this),this._isDestroyed=!0),this}}),Lt=Ot,St=n(56),yt=n.n(St),Nt=n(55),xt=n.n(Nt),Ct=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],bt={},Pt={dict:bt,init:function(t){Ct.forEach((function(e){var n,r,i=e.name,a=e.uniformFuncName,s=a+"v";"Matrix"===e.type?n=r=function(e,n){void 0!==n&&t[a](e,!1,n)}:(n=function(e,n){void 0!==n&&t[a](e,n)},r=function(e,n){t[s](e,n)}),bt[t[i]]=Object.assign(e,{glValue:t[i],uniform:n,uniformArray:r})}))},get:function(t){return bt[t]}},wt=n(106),Dt=n(107),Ht=D.a.VERTEX_SHADER,Ft=new tt,Ut=a.a.create({Statics:{cache:{get:function(){return Ft}},reset:function(t){Ft.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.id,i=Ft.get(r);return i||(i=new Ut({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Ft.add(r,i)),i},getBlankProgram:function(t){var e=Lt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,uniformBlocks:null,program:null,gl:null,state:null,alwaysUse:!1,isWebGL2:!1,constructor:function(t){return this.id=m.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.uniformBlocks={},this.gl=this.state.gl,this.isWebGL2=this.state.isWebGL2,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:Ut.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),r=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&r){if(t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),t.deleteShader(n),t.deleteShader(r),!t.getProgramParameter(e,t.LINK_STATUS)){var i=t.getProgramInfoLog(e);return _.a.error("compileProgramError: "+i,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){this.isWebGL2&&(e=this._convertToGLSL300(t,e));var n=this.gl,r=n.createShader(t);if(n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){var i=n.getShaderInfoLog(r);return _.a.error("compileShaderError: "+i,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return r},_convertToGLSL300:function(t,e){return t===Ht?wt+e:(Dt+e).replace(/gl_FragData\[(\d)\]/g,"hilo_FragData$1")},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),i=dt.instanced,a=function(){var r=e.getActiveAttrib(n,s),a=r.name,o=r.type,u=r.size,c=e.getAttribLocation(n,a),f=Pt.get(o),h=function(t){var n=t.type,r=void 0===n?e.FLOAT:n,i=t.normalized,a=void 0!==i&&i,s=t.stride,o=void 0===s?0:s,u=t.offset,h=void 0===u?0:u,l=t.size,d=void 0===l?f.size:l;e.vertexAttribPointer(c,d,r,a,o,h)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(i&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;i.vertexAttribDivisor(c,t)}),"Matrix"===f.type){var _=f.byteSize,p=f.size,g=Math.sqrt(p),E=4*g,v=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;v((function(e){i.vertexAttribDivisor(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:f,pointer:h,enable:l,divisor:d,addTo:m}},s=0;s1||o>1?function(t){h(c,t)}:function(t){e._dict[s]!==t&&(e._dict[s]=t,d(c,t))}})},m=0;m2&&void 0!==arguments[2]?arguments[2]:Xt;return this.createBuffer(t,Bt,e,n)},createBuffer:function(t,e,n,r){var i=n.bufferViewId,a=jt.get(i);return a||(n.isDirty=!1,a=new kt(t,e,n.data,r),jt.add(i,a),a)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xt;return this.createBuffer(t,Vt,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Xt;this.id=m.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=r,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,r=this.usage;return this.bind(),e.bufferData(n,t,r),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.gl,i=this.target;return n||this.bind(),r.bufferSubData(i,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstanced(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstanced(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,r=this.indexBuffer;return this.indexType=t.type,r?t.isDirty&&(r.uploadGeometryData(t),this.vertexCount=t.length):((r=Wt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=r,this.vertexCount=t.length),r},addAttribute:function(t,e,n,r){this.bind();var i=this.gl,a=e.name,s=this[a];if(!s){var o=Wt.createVertexBuffer(i,t,n);o.bind(),e.enable(),e.pointer(t),s={attribute:e,buffer:o,geometryData:t},this.attributes.push(s),this[a]=s,e.addTo(this.activeStates,s),r&&r(s)}if(t.isDirty){var u=s.buffer;u.bind(),e.enable(),e.pointer(t),u.uploadGeometryData(t)}return s},addInstancedAttribute:function(t,e,n){this.bind();var r=this.gl,i=t.name,a=t.glTypeInfo,s=zt.getTypedArray(Float32Array,e.length*a.size);e.forEach((function(t,e){void 0!==n(t)?zt.fillArrayData(s,n(t),e*a.size):_.a.warn("no attributeData:"+i+"-"+t.name)}));var o,u=this[i];return u?(o=u.geometryData).data=s:o=new w(s,1),this.addAttribute(o,t,r.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},getResources:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.attributes&&this.attributes.forEach((function(e){t.push(e.buffer)})),this.indexBuffer&&t.push(this.indexBuffer),t},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.instancedExtension=null,this.useVao&&(this.vaoExtension.deleteVertexArray(this.vao),this.vao=null,this.vaoExtension=null),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){var n=e.attribute||{};t[n.name]=null})),this.attributes=null,this.activeStates=null,Qt.removeObject(this),this._isDestroyed=!0),this}}),$t=Jt,te=D.a.TEXTURE_2D,ee=D.a.FLOAT,ne=D.a.RGB,re=D.a.RGBA,ie=D.a.RGB32F,ae=D.a.RGBA32F,se=D.a.LINEAR,oe=D.a.NEAREST,ue=D.a.REPEAT,ce=D.a.CLAMP_TO_EDGE,fe=D.a.UNSIGNED_BYTE,he=D.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le=D.a.UNPACK_FLIP_Y_WEBGL,de=D.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,me=D.a.BROWSER_DEFAULT_WEBGL,_e=D.a.NONE,pe=new tt,ge=a.a.create({Statics:{cache:{get:function(){return pe}},reset:function(t){pe.each((function(e,n){t.deleteTexture(e),pe.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&_.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:te,internalFormat:re,format:re,type:fe,width:0,height:0,border:0,magFilter:se,minFilter:se,wrapS:ue,wrapT:ue,name:"",premultiplyAlpha:!1,flipY:!1,colorSpaceConversion:!0,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==se&&this.minFilter!==oe},set:function(){_.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==ce||this.wrapT!==ce},set:function(){_.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){_.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return m.a.isPowerOfTwo(t.width)&&m.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,r=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=m.a.nextPowerOfTwo(n),r=m.a.nextPowerOfTwo(r));var i=mt.MAX_TEXTURE_SIZE;return i&&(n>i&&(n=i),r>i&&(r=i)),{width:n,height:r}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var r=this._canvasImage;return r?(r.width=e,r.height=n,this._canvasCtx=r.getContext("2d")):((r=document.createElement("canvas")).width=e,r.height=n,this._canvasImage=r,this._canvasCtx=r.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),_.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(r.width,"x").concat(r.height),t.src),this._originImage=t,r},_glUploadTexture:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,s=t.gl,o=this.type,u=this.format,c=this.internalFormat;return this.compressed?s.compressedTexImage2D(e,r,c,i,a,this.border,n):(c=this._fixInternalFormat(t,o,u,c),n&&void 0!==n.width?s.texImage2D(e,r,c,u,this.type,n):s.texImage2D(e,r,c,i,a,this.border,u,this.type,n)),this},_fixInternalFormat:function(t,e,n,r){return t.isWebGL2?e===ee&&(n===re?r=ae:n===ne&&(r=ie)):n!==r&&(r=this.format),r},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,r){e._glUploadTexture(t,e.target,n.data,r,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},_updatePixelStorei:function(){var t=this.state;t.pixelStorei(he,this.premultiplyAlpha),t.pixelStorei(le,!!this.flipY),t.pixelStorei(de,this.colorSpaceConversion?me:_e)},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var r=this.useMipmap,i=this.useRepeat;if(this.image&&!this.image.length){if(!t.isWebGL2){var a=i||r,s=this.getSupportSize(this.image,a);this.image=this.resizeImg(this.image,s.width,s.height)}this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+mt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._uploadTexture(t),r&&(this.compressed?this.mipmaps||(_.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=se):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT);var o=dt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,mt.MAX_TEXTURE_MAX_ANISOTROPY)),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var r=t.gl;t.activeTexture(r.TEXTURE0+mt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._subTextureList.forEach((function(t){var e=t[0],i=t[1],a=t[2];r.texSubImage2D(n.target,0,e,i,n.format,n.type,a)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var r=pe.get(n);return r||(r=e.createTexture(),pe.add(n,r),this.needUpdate=!0),this.updateTexture(t,r),this.isImageCanRelease&&this._releaseImage(),r},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),pe.add(this.id,t),this},destroy:function(){var t=this.id,e=pe.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),pe.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Ee=D.a.FRAMEBUFFER,ve=D.a.TEXTURE_2D,Te=D.a.RGBA,Ae=D.a.UNSIGNED_BYTE,Me=D.a.COLOR_ATTACHMENT0,Ie=D.a.DEPTH_STENCIL_ATTACHMENT,Re=D.a.DEPTH_STENCIL,Oe=D.a.DEPTH_TEST,Le=D.a.CULL_FACE,Se=D.a.TRIANGLE_STRIP,ye=D.a.NEAREST,Ne=D.a.CLAMP_TO_EDGE,xe=D.a.COLOR_BUFFER_BIT,Ce=D.a.READ_FRAMEBUFFER,be=D.a.DRAW_FRAMEBUFFER,Pe=new tt,we={framebufferTarget:Ee,attachment:Me,target:ve,format:Te,internalFormat:Te,type:Ae,minFilter:ye,magFilter:ye,wrapS:Ne,wrapT:Ne},De=a.a.create({Statics:{ATTACHMENT_TYPE_TEXTURE:"TEXTURE",ATTACHMENT_TYPE_RENDERBUFFER:"RENDERBUFFER",cache:{get:function(){return Pe}},reset:function(t){Pe.each((function(t){t.reset()}))},destroy:function(t){Pe.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Re,framebufferTarget:we.framebufferTarget,target:we.target,format:we.format,internalFormat:we.internalFormat,type:we.type,minFilter:we.minFilter,magFilter:we.magFilter,wrapS:we.wrapS,wrapT:we.wrapT,data:null,attachment:we.attachment,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,colorAttachmentInfos:void 0,depthStencilAttachmentInfo:void 0,constructor:function(t,e){this.id=m.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),void 0===this.colorAttachmentInfos&&(this.colorAttachmentInfos=[{attachmentType:De.ATTACHMENT_TYPE_TEXTURE,framebufferTarget:this.framebufferTarget,target:this.target,format:this.format,internalFormat:this.internalFormat,type:this.type,minFilter:this.minFilter,magFilter:this.magFilter,wrapS:this.wrapS,wrapT:this.wrapT,data:this.data}]),void 0===this.depthStencilAttachmentInfo&&this.needRenderbuffer&&(this.depthStencilAttachmentInfo={attachmentType:De.ATTACHMENT_TYPE_RENDERBUFFER,framebufferTarget:this.framebufferTarget,attachment:Ie,internalFormat:Re}),Pe.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this._createAttachments(),this.isComplete()||_.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},_createAttachments:function(){var t=this,e=this.colorAttachmentInfos,n=this.depthStencilAttachmentInfo,r=[];if(e&&e.forEach((function(e,n){var i=Me+n;switch(e.attachmentType){case De.ATTACHMENT_TYPE_RENDERBUFFER:t._createRenderbufferAttachment(e,i);break;case De.ATTACHMENT_TYPE_TEXTURE:default:t._createTextureAttachment(e,i)}r.push(i)})),n){var i=n.attachment;switch(n.attachmentType){case De.ATTACHMENT_TYPE_RENDERBUFFER:this._createRenderbufferAttachment(n,i);break;case De.ATTACHMENT_TYPE_TEXTURE:default:this._createTextureAttachment(n,i)}}r.length>1&&mt.DRAW_BUFFERS&&dt.drawBuffers.drawBuffers(r)},_createTextureAttachment:function(t,e){var n=this.state,r=n.gl,i=Object.assign({},we,t),a=new ge({minFilter:i.minFilter,magFilter:i.magFilter,internalFormat:i.internalFormat,format:i.format,type:i.type,width:this.width,height:this.height,image:i.data,wrapS:i.wrapS,wrapT:i.wrapT}),s=a.getGLTexture(n);return r.framebufferTexture2D(i.framebufferTarget,e,i.target,s,0),t.texture=a,e===Me&&(this.texture=a),a},_createRenderbufferAttachment:function(t,e){var n=this.gl,r=this.width,i=this.height,a=n.createRenderbuffer();return n.bindRenderbuffer(n.RENDERBUFFER,a),t.samples>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,t.samples,t.internalFormat,r,i):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,r,i),n.framebufferRenderbuffer(t.framebufferTarget||we.framebufferTarget,e,n.RENDERBUFFER,a),t.renderbuffer=a,a},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&(this._preFramebuffer=this.state.currentFramebuffer,this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer))},unbind:function(){(this.init(),this._isInit)&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this._preFramebuffer)},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if(this._isInit){var s=this.gl,o=this.state,u=this.colorAttachmentInfos;if(!a){if(!u[0])return;a=u[0].texture}o.disable(Oe),o.disable(Le),i&&this.clear(i);var c=Lt.getCustomShader(yt.a,xt.a,"","FramebufferTextureShader"),f=Gt.getProgram(c,o);f.useProgram();var h="".concat(t,"_").concat(e,"_").concat(n,"_").concat(r,"_").concat(f.id),l=$t.getVao(s,h,{useVao:this.useVao,useInstanced:!1,mode:Se});if(l.isDirty){l.isDirty=!1;var d=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(r*=2),t+n,e-r];l.addAttribute(new w(new Float32Array(d),2),f.attributes.a_position),l.addAttribute(new w(new Float32Array([0,1,1,1,0,0,1,0]),2),f.attributes.a_texcoord0)}o.activeTexture(s.TEXTURE0),o.bindTexture(s.TEXTURE_2D,a.getGLTexture(o)),l.draw()}},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=Object(i.getTypedArrayClass)(this.type),s=new a(n*r*4);if(this._isInit){var o=this.gl;e=this.height-e-r,this.bind(),o.readPixels(t,e,n,r,this.format,this.type,s),this.unbind()}return s},copyFramebuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.init(),this._isInit){var n=this.gl,r=e.mask,i=e.filter,a=e.srcSize,s=e.dstSize;r||(r=xe),i||(i=ye),a||(a=[0,0,t.width,t.height]),s||(s=[0,0,this.width,this.height]),n.bindFramebuffer(Ce,t.framebuffer),n.bindFramebuffer(be,this.framebuffer),n.blitFramebuffer(a[0],a[1],a[2],a[3],s[0],s[1],s[2],s[3],r,i),n.bindFramebuffer(Ce,null),n.bindFramebuffer(be,null)}},destroy:function(){return this._isDestroyed||(this.destroyResource(),this.gl=null,Pe.removeObject(this),this._isDestroyed=!0),this},destroyResource:function(){var t=this.gl;if(t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.colorAttachmentInfos&&this.colorAttachmentInfos.forEach((function(e){var n=e.texture,r=e.renderbuffer;e.texture=null,e.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)})),this.depthStencilAttachmentInfo)){var e=this.depthStencilAttachmentInfo,n=e.texture,r=e.renderbuffer;this.depthStencilAttachmentInfo.texture=null,this.depthStencilAttachmentInfo.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)}}}),He=De,Fe=D.a.TEXTURE_CUBE_MAP,Ue=D.a.RGB,Ge=D.a.LINEAR,Be=D.a.CLAMP_TO_EDGE,Ve=D.a.TEXTURE_CUBE_MAP_POSITIVE_X,Xe=a.a.create({Extends:ge,isCubeTexture:!0,className:"CubeTexture",target:Fe,internalFormat:Ue,format:Ue,magFilter:Ge,minFilter:Ge,wrapS:Be,wrapT:Be,constructor:function(t){Xe.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,r){e._glUploadTexture(t,Ve+r,n,0)}))):_.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),je=Xe,ke=D.a.TEXTURE_2D,We=D.a.RGBA,Ye=D.a.NEAREST,ze=D.a.CLAMP_TO_EDGE,qe=D.a.FLOAT,Ze=a.a.create({Extends:ge,isDataTexture:!0,className:"DataTexture",target:ke,internalFormat:We,format:We,type:qe,magFilter:Ye,minFilter:Ye,wrapS:ze,wrapT:ze,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=m.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),r=Math.floor(n/2),a=n-r;this.width=Math.pow(2,r),this.height=Math.pow(2,a),this.DataClass=Object(i.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){Ze.superclass.constructor.call(this,t)}}),Ke=Ze;function Qe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Je(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1),mt.SHADER_TEXTURE_LOD&&this.enableTextureLod&&(e.USE_SHADER_TEXTURE_LOD=1),mt.DRAW_BUFFERS&&this.enableDrawBuffers&&(e.USE_DRAW_BUFFERS=1);var r=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,r.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),r.add(this.parallaxMap,"PARALLAX_MAP"),r.add(this.emission,"EMISSION_MAP"),r.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),r.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var r=this.uvTypes,i=this.option,a=t.uv||0;r[a]=1,i[e]=a,t.isCubeTexture&&(i["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var r in e)-1!==t.indexOf(Number(r))?n["HAS_TEXCOORD".concat(r)]=1:(_.a.warnOnce("Material._textureOption.update(".concat(r,")"),"uv_".concat(r," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var r=this.getUniformInfo(n);r.isDependMesh&&!r.notSupportInstanced&&t.push({name:n,info:r})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=dn[n]),n&&n.get||(_.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=Ln),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])},getShadowMaterial:function(t){return t.side!==this.side&&(t.side=this.side,t.isDirty=!0),t.frontFace!==this.frontFace&&(t.frontFace=this.frontFace,t.isDirty=!0),t}}),yn=a.a.create({Extends:Sn,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),yn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yn.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var r=this.diffuse;return r&&r.isTexture&&(r.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),Nn=yn,xn=D.a.POSITION,Cn=D.a.NORMAL,bn=D.a.DEPTH,Pn=D.a.DISTANCE,wn=D.a.NONE,Dn=a.a.create({Extends:Nn,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:xn,lightType:wn,writeOriginData:!1,constructor:function(t){Dn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Dn.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case xn:t.HAS_FRAG_POS=1;break;case Cn:t.HAS_NORMAL=1;break;case bn:break;case Pn:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),Hn=Dn,Fn=a.a.create({Extends:L,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){Fn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Q,n=[this.left,this.bottom,-this.near],r=[this.right,this.bottom,-this.near],i=[this.right,this.top,-this.near],a=[this.left,this.top,-this.near],s=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(s,o,u,c),e.addRect(o,r,i,u),e.addRect(r,n,a,i),e.addRect(n,s,c,a),e.addRect(c,u,i,a),e.addRect(n,r,o,s),this._geometry=e}return this._geometry}}),Un=Fn,Gn=n(15),Bn=new Gn.a,Vn=new u.a,Xn=a.a.create({Extends:E,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){Xn.superclass.constructor.call(this,t)},clone:function(t){var e=E.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,r=this.material,i=this.worldMatrix;if(n&&r){Vn.invert(i),Bn.copy(t),Bn.transformMat4(Vn);var a=n.raycast(Bn,r.side,e);if(a)return a.forEach((function(t){t.transformMat4(i)})),a}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},isDestroyed:{get:function(){return this._isDestroyed}},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager;return n.destroyMesh(this),this.material&&e&&this.material.destroyTextures(),this.off(),this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),jn=Xn,kn=D.a.LINES,Wn=new f.a,Yn=new u.a,zn=a.a.create({Extends:jn,isCameraHelper:!0,className:"CameraHelper",camera:null,color:null,constructor:function(t){zn.superclass.constructor.call(this,t),this.color||(this.color=new v.a(.3,.9,.6)),this.material=new Nn({lightType:"NONE",diffuse:this.color||new v.a(.5,.5,.5,1),castShadows:!1}),this.geometry=new Q({mode:kn,isStatic:!1,vertices:new w(new Float32Array(27),3),indices:new w(new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7,8,4,8,5,8,6,8,7]),1)})},onUpdate:function(){this.camera&&(this.camera.updateViewProjectionMatrix(),this._buildGeometry())},_buildGeometry:function(){var t=this.camera,e=this.geometry;Yn.multiply(t.viewProjectionMatrix,this.worldMatrix),Yn.invert(),e.vertices.set(0,Wn.set(-1,-1,1).transformMat4(Yn)),e.vertices.set(1,Wn.set(-1,1,1).transformMat4(Yn)),e.vertices.set(2,Wn.set(1,1,1).transformMat4(Yn)),e.vertices.set(3,Wn.set(1,-1,1).transformMat4(Yn)),e.vertices.set(4,Wn.set(-1,-1,-1).transformMat4(Yn)),e.vertices.set(5,Wn.set(-1,1,-1).transformMat4(Yn)),e.vertices.set(6,Wn.set(1,1,-1).transformMat4(Yn)),e.vertices.set(7,Wn.set(1,-1,-1).transformMat4(Yn)),e.vertices.set(8,Wn.set(0,0,-1).transformMat4(Yn))}}),qn=zn,Zn=D.a.DEPTH,Kn=D.a.BACK,Qn=null,Jn=new v.a(1,1,1),$n=new u.a,tr=function(t){return t.material.castShadows},er=a.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new He(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustomCamera(this.cameraInfo,t);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),$n.multiply(this.camera.viewMatrix,t.worldMatrix);var r=n.getBounds($n);this.camera.near=-r.zMax,this.camera.far=-r.zMin,this.camera.left=r.xMin,this.camera.right=r.xMax,this.camera.bottom=r.yMin,this.camera.top=r.yMax}}this.camera.updateViewMatrix()},updateCustomCamera:function(t,e){for(var n in t)this.camera[n]=t[n];t.far||(this.camera.far=e.far),t.near||(this.camera.near=e.near)},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustomCamera(this.cameraInfo,t):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new Un:this.light.isSpotLight&&(this.camera=new $),this.camera.addTo(this.light),this._createCameraHelper()),(this.light.isDirty||this._cameraMatrixVersion!==t.matrixVersion)&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion,this.light.isDirty=!1)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Qn||(Qn=new Hn({vertexType:Zn,side:Kn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(Jn),r.updateViewProjectionMatrix(),dn.setCamera(r),this.renderShadowScene(e,Qn),n.unbind(),dn.setCamera(t),e.viewport()},renderShadowScene:function(t,e){var n=t.forceMaterial;t.renderList.traverse((function(n){tr(n)&&(t.forceMaterial=n.material.getShadowMaterial(e),t.renderMesh(n))}),(function(n){n.length&&(t.forceMaterial=n[0].material.getShadowMaterial(e),t.renderInstancedMeshes(n.filter((function(t){return tr(t)}))))})),t.forceMaterial=n},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))},_createCameraHelper:function(){if(this.debug){var t=this.light,e=this.camera;this._cameraHelper||(this._cameraHelper=new qn({camera:e,color:new v.a(0,1,0)}),t.addChild(this._cameraHelper))}}}),nr=D.a.DISTANCE,rr=D.a.BACK,ir=D.a.TEXTURE_CUBE_MAP,ar=D.a.TEXTURE0,sr=D.a.TEXTURE_CUBE_MAP_POSITIVE_X,or=D.a.NEAREST,ur=D.a.FRAMEBUFFER,cr=D.a.FRAMEBUFFER_COMPLETE,fr=null,hr=new v.a(0,0,0,0),lr=new f.a,dr=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],mr=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},_r=a.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:er,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){_r.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new He(this.renderer,{target:ir,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new je({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:or,minFilter:or,width:1024,height:1024});return t.checkFramebufferStatus(ur)!==cr&&_.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(ur)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,r=this.texture.getGLTexture(e);e.activeTexture(ar+mt.MAX_TEXTURE_INDEX),e.bindTexture(this.target,r),n.framebufferTexture2D(ur,this.attachment,sr+t,r,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new $,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;fr||(fr=new Hn({vertexType:nr,side:rr,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(r.position);for(var i=0;i<6;i++)n.bindTexture(i),lr.fromArray(dr[0],3*i).add(r.position),r.up.fromArray(dr[1],3*i),r.lookAt(lr),r.updateViewProjectionMatrix(),e.clear(hr),dn.setCamera(r),e.forceMaterial=fr,this.renderShadowScene(e);r.matrix.identity(),r.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),dn.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){mr(e,n)&&t.renderMesh(e)}),(function(e){var r=e.filter((function(t){return mr(t,n)}));t.renderInstancedMeshes(r)}))}}),pr=_r,gr=a.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){gr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new pr({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),Er=gr,vr=new u.a,Tr=new f.a,Ar=a.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",lightShadow:null,constructor:function(t){this.direction=new f.a(0,0,1),Ar.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new er({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Tr.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Tr},getViewDirection:function(t){var e=t.getModelViewMatrix(this,vr);return Tr.copy(this.direction).transformDirection(e).normalize(),Tr}}),Mr=Ar,Ir=new u.a,Rr=new f.a,Or=a.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(m.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(m.a.degToRad(t))}},constructor:function(t){this.direction=new f.a(0,0,1),Or.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new er({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Rr.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Rr},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Ir);return Rr.copy(this.direction).transformDirection(e).normalize(),Rr}}),Lr=Or,Sr=a.a.create({Extends:Sn,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){Sr.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Sr.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),yr=Sr,Nr=n(14),xr=n.n(Nr),Cr=a.a.create({Extends:Q,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Cr.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Q.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cr.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(i.each)(this.targets,(function(n,r){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===r?e.MORPH_HAS_POSITION=1:"normals"===r?e.MORPH_HAS_NORMAL=1:"tangents"===r&&(e.MORPH_HAS_TANGENT=1)}))),e}}),br=Cr,Pr={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},wr={Geometry:Q,GeometryData:w};var Dr={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Dr.useAuto?xr.a.initWASM(Dr.wasmURL,Dr.memPages):Dr.useWebWorker?xr.a.initWorker(Dr.workerURL):Dr.useWASM?xr.a.initWASM(Dr.wasmURL,Dr.memPages):Promise.resolve()},parse:function(t,e,n,r){var i=Date.now(),a=e.bufferViews[t.bufferView],s=Dr.wasmURL,o=Dr.workerURL,u=Dr.useAuto,c=Dr.useWASM,f=Dr.useWebWorker,h=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);function l(e){Dr._decodeTotalTime+=Date.now()-i;var n=e.toHilo3dGeometry(wr,r.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var r=new br;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&"id"!==i&&(r[i]=n[i]);r.targets={},n=r}for(var a=n.targets,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),qr=new u.a,Zr=new u.a,Kr=a.a.create({Extends:jn,isSkinedMesh:!0,className:"SkinedMesh",useInstanced:!1,jointMatTexture:null,frustumTest:!1,skeleton:null,constructor:function(t){Kr.superclass.constructor.call(this,t)},getJointMat:function(){var t=this;if(this.skeleton&&!(this.skeleton.jointCount<=0)){var e=this.skeleton.jointNodeList,n=this.skeleton.inverseBindMatrices,r=16*this.skeleton.jointCount;return this.jointMat&&this.jointMat.length===r||(this.jointMat=new Float32Array(r)),this.clonedFrom?Zr.invert(this.clonedFrom.worldMatrix):Zr.invert(this.worldMatrix),e.forEach((function(e,r){qr.copy(Zr),qr.multiply(e.worldMatrix),qr.multiply(n[r]),qr.toArray(t.jointMat,16*r)})),this.jointMat}},resetJointNamesByNodeName:function(t){this.skeleton.resetJointNamesByNodeName(t)},resetSkinIndices:function(t){var e=this.skeleton;if(e){var n=this.geometry,r=n.skinIndices;if(r){this.material.isDirty=!0,n.isDirty=!0,r.isDirty=!0;var i=new y.a;r.traverse((function(n,a,s){n.elements.forEach((function(n,r){var a=e.jointNames[n],s=t.jointNames.indexOf(a);s>=0?i.elements[r]=s:_.a.warnOnce("SkinedMesh.resetSkinIndices","SkinedMesh.resetSkinIndices: no jointName found!",a)})),r.setByOffset(s,i)}))}}},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new Ke({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=jn.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,skeleton:this.skeleton.clone()}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kr.superclass.getRenderOption.call(this,t);var e=this.skeleton.jointCount;if(e&&(t.JOINT_COUNT=e,mt.VERTEX_TEXTURE_FLOAT)){var n=(mt.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),Qr=Kr,Jr=a.a.create({isSkeleton:!0,className:"Skeleton",userData:null,constructor:function(t){this.id=m.a.generateUUID(this.className),this.jointNodeList=[],this.jointNames=[],this.inverseBindMatrices=[],Object.assign(this,t)},jointCount:{get:function(){return this.jointNodeList.length}},_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,t&&this._initJointNodeList()}},_initJointNodeList:function(){var t={};this.rootNode.traverse((function(e){t[e.jointName]=e})),this.jointNodeList=this.jointNames.map((function(e){return t[e]}))},resetJointNamesByNodeName:function(t){var e=this.jointNames;this.jointNodeList.forEach((function(n,r){var i=t.rootNode.getChildByName(n.name);i&&(e[r]=i.jointName)}))},clone:function(t){var e=new Jr;return e.copy(this,t),e},copy:function(t,e){return this.inverseBindMatrices=t.inverseBindMatrices,this.jointNames=t.jointNames.slice(),void 0===e&&(e=t.rootNode),this.rootNode=e,this}}),$r=Jr,ti="1.19.0",ei=a.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),ni=new f.a,ri=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;if(n!==r)return n-r;var i=t.material._shaderNumId||0,a=e.material._shaderNumId||0;return i!==a?i-a:t._sortRenderZ-e._sortRenderZ},ii=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;return n!==r?n-r:e._sortRenderZ-t._sortRenderZ},ai=a.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var r in n){var i=n[r];i.length>2&&e?e(i):i.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(ii),this.opaqueList.sort(ri)},addMesh:function(t,e){var n=t.material,r=t.geometry;if(n&&r){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var i=this.instancedDict,a=n.id+"_"+r.id,s=i[a];i[a]||(s=i[a]=[]),s.push(t)}else t.worldMatrix.getTranslation(ni),ni.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=ni.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else _.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),si=a.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,isWebGL2:!1,constructor:function(t){this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t),this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,r){this.set4("colorMask",t,e,n,r)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,r){this.set4("blendFuncSeparate",t,e,n,r)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,r){this.set4("viewport",t,e,n,r)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n||(r[0]=e,r[1]=n,this.gl[t](e,n))},set3:function(t,e,n,r){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n&&i[2]===r||(i[0]=e,i[1]=n,i[2]=r,this.gl[t](e,n,r))},set4:function(t,e,n,r,i){var a=this._dict[t];a||(a=this._dict[t]=[]),a[0]===e&&a[1]===n&&a[2]===r&&a[3]===i||(a[0]=e,a[1]=n,a[2]=r,a[3]=i,this.gl[t](e,n,r,i))},get:function(t){return this._dict[t]}}),oi=a.a.create({Mixes:o,className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){this._needDestroyResources=[],this._meshDict={},Object.assign(this,t)},destroyMesh:function(t){var e=this;this.getMeshResources(t).forEach((function(t){e.destroyIfNoRef(t)})),delete this._meshDict[t.id]},getMeshResources:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._meshDict[t.id];return n&&n.forEach((function(t){e.push(t),t.getResources&&t.getResources(e)})),e},addMeshResources:function(t,e){var n=t.id,r=this._meshDict;r[n]||(r[n]=[]);var i=r[n];e.forEach((function(t){-1===i.indexOf(t)&&i.push(t)}))},destroyIfNoRef:function(t){var e=this._needDestroyResources;return t&&e.indexOf(t)<0&&e.push(t),this},getUsedResources:function(t){var e=this,n=[];return t&&t.traverse((function(t){t.isMesh&&!t.isDestroyed&&e.getMeshResources(t,n)})),n},destroyUnsuedResource:function(t){var e=this,n=this._needDestroyResources;if(0===n.length)return this;var r=this.getUsedResources(t);return n.forEach((function(t){r.indexOf(t)<0&&t&&t.destroy&&!t.alwaysUse&&(e.fire("destroyResource",t.id),t.destroy())})),this.reset(),this},reset:function(){return this._needDestroyResources.length=0,this}}),ui=new u.a,ci=new f.a,fi=new Float32Array([0,0,0]),hi=a.a.create({isLightManager:!0,className:"LightManager",shadowEnabled:!0,constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.each)(this.lightInfo,(function(n,r){if("uid"!==r&&n){e[r]=n;var i=t.getShadowMapCount(r);i&&(e[r+"_SMC"]=i)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:_.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(r.push(o.lightShadow.framebuffer.texture),i.push(o.lightShadow.width),i.push(o.lightShadow.height),s.push(o.lightShadow.minBias,o.lightShadow.maxBias),ui.copy(t.worldMatrix),ui.premultiply(o.lightShadow.camera.viewProjectionMatrix),ui.toArray(a,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return r.length&&(o.shadowMap=r,o.shadowMapSize=new Float32Array(i),o.shadowBias=new Float32Array(s),o.lightSpaceMatrix=new Float32Array(a)),o},getSpotInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[],c=[],f=[];this.spotLights.forEach((function(h,l){var d=3*l;h.getRealColor().toRGBArray(e,d),h.toInfoArray(n,d),h.getViewDirection(t).toArray(i,d),f.push(h.range),a.push(h._cutoffCos,h._outerCutoffCos),t.getModelViewMatrix(h,ui),ui.getTranslation(ci),ci.toArray(r,d),h.shadow&&h.lightShadow&&(s.push(h.lightShadow.framebuffer.texture),o.push(h.lightShadow.width),o.push(h.lightShadow.height),c.push(h.lightShadow.minBias,h.lightShadow.maxBias),ui.multiply(h.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),ui.toArray(u,16*l))}));var h={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),dirs:new Float32Array(i),cutoffs:new Float32Array(a),ranges:new Float32Array(f)};return s.length&&(h.shadowMap=s,h.shadowMapSize=new Float32Array(o),h.shadowBias=new Float32Array(c),h.lightSpaceMatrix=new Float32Array(u)),h},getPointInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[];this.pointLights.forEach((function(c,f){var h=3*f;c.getRealColor().toRGBArray(e,h),c.toInfoArray(n,h),u.push(c.range),t.getModelViewMatrix(c,ui),ui.getTranslation(ci),ci.toArray(r,h),c.shadow&&c.lightShadow&&(i.push(c.lightShadow.framebuffer.texture),s.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(a,16*f),o[2*f]=c.lightShadow.camera.near,o[2*f+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),ranges:new Float32Array(u)};return i.length&&(c.shadowMap=i,c.shadowBias=new Float32Array(s),c.lightSpaceMatrix=new Float32Array(a),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,r=[],i=[],a=[],s=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(r,c),t.getModelViewMatrix(o,ui),ui.getTranslation(ci),ci.toArray(i,c);var f=ui.getRotation();ui.fromQuat(f),ci.set(.5*o.width,0,0),ci.transformMat4(ui),ci.toArray(a,c),ci.set(0,.5*o.height,0),ci.transformMat4(ui),ci.toArray(s,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(r),poses:new Float32Array(i),width:new Float32Array(a),height:new Float32Array(s),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return fi[0]=fi[1]=fi[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();fi[0]+=e.r,fi[1]+=e.g,fi[2]+=e.b})),fi[0]=Math.min(1,fi[0]),fi[1]=Math.min(1,fi[1]),fi[2]=Math.min(1,fi[2]),fi},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,r=this.directionalLights,i=this.pointLights,a=this.spotLights,s=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=i.length,e.DIRECTIONAL_LIGHTS=r.length,e.SPOT_LIGHTS=a.length,e.AREA_LIGHTS=s.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=i.filter(o).length,e.SHADOW_SPOT_LIGHTS=a.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=r.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo(),this.updateCustomInfo&&this.updateCustomInfo(this,t)},updateCustomInfo:null,getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){if(!this.shadowEnabled)return 0;var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},update:function(t,e,n){var r=this;n.forEach((function(t){r.addLight(t)})),this.createShadowMap(t,e),this.updateInfo(e)},createShadowMap:function(t,e){this.shadowEnabled&&(this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)})))}}),li=D.a.DEPTH_TEST,di=D.a.STENCIL_TEST,mi=D.a.SAMPLE_ALPHA_TO_COVERAGE,_i=D.a.CULL_FACE,pi=D.a.FRONT_AND_BACK,gi=D.a.BLEND,Ei=D.a.LINES,vi=D.a.STATIC_DRAW,Ti=D.a.DYNAMIC_DRAW,Ai=a.a.create({Mixes:o,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,forceMaterial:null,isInitFailed:!1,_isInit:!1,_isContextLost:!1,isWebGL2:!1,preferWebGL2:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new ei,this.renderList=new ai,this.lightManager=new hi,this.resourceManager=new oi},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var r=this.domElement;this.width=t,this.height=e,r.width=t,r.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,r){var i=this.state,a=this.gl;i&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=a.drawingBufferWidth),void 0===r&&(r=a.drawingBufferHeight),i.viewport(t,e,n,r))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};if(!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0),this.preferWebGL2)try{this.gl=this.domElement.getContext("webgl2",e),this.isWebGL2=!0}catch(t){this.isWebGL2=!1,this.gl=null}this.gl||(this.gl=this.domElement.getContext("webgl",e),this.isWebGL2=!1);var n=this.gl;n.viewport(0,0,this.width,this.height),Pt.init(n),dt.init(n),mt.init(n),Lt.init(this),this.state=new si(n),dt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,this.useFramebuffer&&(this.framebuffer=new He(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){var e=this.gl;this._isContextLost=!0,t.preventDefault(),Gt.reset(e),Lt.reset(e),ge.reset(e),Wt.reset(e),$t.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null,this.fire("webglContextLost")},_onContextRestore:function(t){var e=this.gl;this._isContextLost=!1,dt.reset(e),He.reset(e),this.fire("webglContextRestored")},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(li),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(li)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(mi):e.disable(mi)},setupCullFace:function(t){var e=this.state;e.frontFace(t.frontFace),t.cullFace&&t.cullFaceType!==pi?(e.enable(_i),e.cullFace(t.cullFaceType)):e.disable(_i)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(gi),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(gi)},setupStencil:function(t){if(this.stencil){var e=this.state;t.stencilTest?(e.enable(di),e.stencilMask(t.stencilMask),e.stencilFunc(t.stencilFunc,t.stencilFuncRef,t.stencilFuncMask),e.stencilOp(t.stencilOpFail,t.stencilOpZFail,t.stencilOpZPass)):e.disable(di)}},setupUniforms:function(t,e,n,r){var i=this.forceMaterial||e.material;if(this.isWebGL2){var a=i.uniformBlocks;for(var s in t.uniformBlocks){var o=a[s];o&&(t[s]=o)}}for(var u in t.uniforms){var c=i.getUniformInfo(u),f=t.uniforms[u];if(!c.isBlankInfo&&(r||c.isDependMesh&&!n)){var h=c.get(e,i,f);null!=h&&(t[u]=h)}}},setupVao:function(t,e,n){var r=n.geometry,i=r.isStatic;if(t.isDirty||!i||r.isDirty){t.isDirty=!1;var a=this.forceMaterial||n.material,s=a.attributes,o=i?vi:Ti;for(var u in s){var c=e.attributes[u];if(c){var f=a.getAttributeData(u,n,c);null!=f&&t.addAttribute(f,c,o)}}r.indices&&t.addIndexBuffer(r.indices,o),r.isDirty=!1}r.vertexCount&&(t.vertexCount=r.vertexCount)},setupMaterial:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.forceMaterial||e.material;(i.isDirty||this._lastMaterial!==i)&&(this.setupDepthTest(i),this.setupSampleAlphaToCoverage(i),this.setupCullFace(i),this.setupBlend(i),this.setupStencil(i),r=!0),this.setupUniforms(t,e,n,r),i.isDirty=!1,this._lastMaterial=i},setupMesh:function(t,e){var n=this.gl,r=this.state,i=this.lightManager,a=this.resourceManager,s=t.geometry,o=this.forceMaterial||t.material,u=Lt.getShader(t,o,e,i,this.fog,this.useLogDepth),c=Gt.getProgram(u,r);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&s.mode!==Ei&&s.convertToLinesMode();var f=s.id+c.id,h=$t.getVao(n,f,{useInstanced:e,useVao:this.useVao,mode:s.mode});return this.setupVao(h,c,t),a.addMeshResources(t,[h,u,c]),{vao:h,program:c,geometry:s}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var r=this.renderList,i=this.renderInfo,a=this.lightManager,s=this.resourceManager,o=this.state;this.fog=t.fog,a.reset(),i.reset(),r.reset(),dn.init(this,o,e,a,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix();var u=[];t.traverse((function(t){return t.visible?(t.isMesh?r.addMesh(t,e):t.isLight&&u.push(t),E.TRAVERSE_STOP_NONE):E.TRAVERSE_STOP_CHILDREN})),r.sort(),a.update(this,e,u),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),s.destroyUnsuedResource(t)}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),n.depthMask(!0);var r=e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT;this.stencil&&(n.stencilMask(!0),r|=e.STENCIL_BUFFER_BIT),e.clear(r)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},clearStencil:function(){var t=this.gl;this.state.stencilMask(!0),t.clear(t.STENCIL_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,r=this.setupMesh(e,!0),i=r.vao,a=r.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,r=e.info,s=a.attributes[n];s&&i.addInstancedAttribute(s,t,(function(t){return r.get(t)}))})),i.drawInstance(t.length),this.addRenderInfo(i.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(Gt.reset(t),Lt.reset(t),Wt.reset(t),$t.reset(t),this.state.reset(t),ge.reset(t),He.destroy(t))}}),Mi=function(){var t,e=navigator.userAgent,n=document,r=window,i=n.documentElement,a={iphone:/iphone/i.test(e),ipad:/ipad/i.test(e),ipod:/ipod/i.test(e),ios:/iphone|ipad|ipod/i.test(e),android:/android/i.test(e),webkit:/webkit/i.test(e),chrome:/chrome/i.test(e),safari:/safari/i.test(e),firefox:/firefox/i.test(e),ie:/msie/i.test(e),opera:/opera/i.test(e),supportTouch:"ontouchstart"in r,supportCanvas:!!n.createElement("canvas").getContext,supportStorage:void 0,supportOrientation:"orientation"in r||"orientation"in r.screen,supportDeviceMotion:"ondevicemotion"in r};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),a.supportStorage=!0}catch(t){a.supportStorage=!1,_.a.warn("LocalStorage disabled")}t=a.webkit||a.firefox?"webkit":a.opera?"o":a.ie?"ms":"",a.jsVendor=t;var s=a.cssVendor="-"+t+"-";try{var o=n.createElement("div"),u=o.style,c=void 0!==u[t+"Transform"],f=void 0!==u[t+"Perspective"];f&&(o.id="test3d",(u=n.createElement("style")).textContent="@media ("+s+"transform-3d){#test3d{height:3px}}",n.head.appendChild(u),i.appendChild(o),f=3===o.offsetHeight,n.head.removeChild(u),i.removeChild(o)),a.supportTransform=c,a.supportTransform3D=f}catch(t){a.supportTransform=!1,a.supportTransform3D=!1}var h=a.supportTouch,l=h?"touchstart":"mousedown",d=h?"touchmove":"mousemove",m=h?"touchend":"mouseup";return a.POINTER_START=l,a.POINTER_MOVE=d,a.POINTER_END=m,a}(),Ii=a.a.create({Extends:E,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,width:0,height:0,canvas:null,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}Ii.superclass.constructor.call(this,t),this.initRenderer(t),_.a.log("Hilo3d version: ".concat(ti))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new Ai(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,r){if(void 0===n&&(n=this.pixelRatio),r||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var i=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,r),i.style.width=this.width+"px",i.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,r){return this.resize(n,r,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.canvas,i=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?r.addEventListener(t,i,!1):r.removeEventListener(t,i)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,r=t.type,i=0===r.indexOf("touch"),a=t;if(i){var s=t.touches,o=t.changedTouches;s&&s.length?a=s[0]:o&&o.length&&(a=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(a.pageX||a.clientX)-u.left,f=(a.pageY||a.clientY)-u.top;t.stageX=c,t.stageY=f,t.stopPropagation=function(){this._stopPropagationed=!0};var h=this.getMeshResultAtPoint(c,f,!0),l=h.mesh;t.hitPoint=h.point;var d="mouseout"===r;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===r?m="touchout":"mousemove"!==r&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==r&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!i){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}Mi.android&&"touchmove"===r&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(i.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.camera,i=this._ray;i||(i=this._ray=new Gn.a),i.fromCamera(r,t,e,this.width,this.height);var a=this.raycast(i,!0,n);if(a)return a[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new f.a});var s=this._stageResultAtPoint.point;return s.copy(r.unprojectVector(s.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return Ii.superclass.destroy.call(this,this.renderer),this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),Ri=Ii;function Oi(){return+new Date}var Li=a.a.create({constructor:function(t,e,n,r){var i=this;for(var a in i.target=t,i._startTime=0,i._seekTime=0,i._pausedTime=0,i._pausedStartTime=0,i._reverseFlag=1,i._repeatCount=0,3===arguments.length&&(r=n,n=e,e=null),r)i[a]=r[a];i._fromProps=e,i._toProps=n,!r.duration&&r.time&&(i.duration=r.time||0,i.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,r=t||e,i=this._fromProps={},a=this._toProps={};for(var s in t=t||n,e=e||n,r)a[s]=e[s]||0,n[s]=i[s]=t[s]||0;return this},start:function(){var t=this;return t._startTime=Oi()+t.delay,t._seekTime=0,t._pausedTime=0,t._reverseFlag=1,t._repeatCount=0,t.paused=!1,t.isStart=!1,t.isComplete=!1,Li.add(t),t},stop:function(){return Li.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=Oi(),this},resume:function(){var t=this;return t.paused=!1,t._pausedStartTime&&(t._pausedTime+=Oi()-t._pausedStartTime),t._pausedStartTime=0,t},seek:function(t,e){var n=this,r=Oi();return n._startTime=r,n._seekTime=t,n._pausedTime=0,void 0!==e&&(n.paused=e),n._update(r,!0),Li.add(n),n},link:function(t){var e,n,r=t.delay,i=this._startTime;return"string"==typeof r&&(e=0===r.indexOf("+"),n=0===r.indexOf("-"),r=e||n?Number(r.substr(1))*(e?1:-1):Number(r)),t.delay=r,t._startTime=e||n?i+this.duration+r:i+r,this._next=t,Li.remove(t),t},_render:function(t){var e=this.target,n=this._fromProps;for(var r in n)e[r]=n[r]+(this._toProps[r]-n[r])*t},_update:function(t,e){var n=this;if(n.paused&&!e)return!1;if(n.isComplete)return!0;var r=t-n._startTime-n._pausedTime+n._seekTime;if(r<0)return!1;var i,a=r/n.duration;a<=0?a=0:a>=1&&(a=1);var s=n.ease?n.ease(a):a;n.reverse&&n.isStart&&(n._reverseFlag<0&&(a=1-a,s=1-s),a<1e-7&&(n.repeat>0&&n._repeatCount++>=n.repeat||0===n.repeat&&!n.loop?n.isComplete=!0:(n._startTime=Oi(),n._pausedTime=0,n._reverseFlag*=-1))),n.isStart||(n.setProps(n._fromProps,n._toProps),n.isStart=!0,n.onStart&&n.onStart.call(n,n)),n.time=r,n._render(s),(i=n.onUpdate)&&i.call(n,s,n),a>=1&&(n.reverse?(n._startTime=Oi(),n._pausedTime=0,n._reverseFlag*=-1):n.loop||n.repeat>0&&n._repeatCount++0&&u<=t?(o._render(a),o.time=r,Li.add(o)):n.isComplete&&(u<0||u>t)&&o.start()}return!!n.isComplete&&((i=n.onComplete)&&i.call(n,n),!0)},Statics:{_tweens:[],tick:function(){var t,e,n=Li._tweens,r=n.length;for(e=0;e-1&&r.splice(e,1);else for(e=0;e1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return _.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return zi.superclass._raycast.call(this,t,e)}}),qi=zi,Zi=D.a.FRONT,Ki=D.a.BACK,Qi=[0,0,1],Ji=a.a.create({Extends:Q,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){Ji.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),r=this.width/t,i=this.height/e,a=new Float32Array(3*n),s=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,f=0;f<=e;f++)for(var h=0;h<=t;h++){var l=f*(t+1)+h;if(a[3*l]=h*r-this.width/2,a[3*l+1]=this.height/2-f*i,s[3*l]=0,s[3*l+1]=0,s[3*l+2]=1,o[2*l]=h/t,o[2*l+1]=1-f/e,f0||n<0))return null;if(e===Ki&&(r<0||n>0))return null;var i=t.intersectsPlane(Qi,0);if(i){var a=i.x,s=i.y,o=.5*this.width,u=.5*this.height;if(a>=-o&&a<=o&&s>=-u&&s<=u)return[i]}return null}}),$i=Ji,ta=a.a.create({Extends:Q,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){ta.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,r=(n+1)*(e+1),i=n*e,a=new Float32Array(3*r),s=new Float32Array(4*r),o=new Float32Array(2*r),u=new Uint16Array(6*i),c=0,f=0,h=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,E=_*g,v=Math.cos(E)*t,T=Math.sin(E)*t,A=0;A<=n;A++){var M=A/n,I=m*M,R=Math.cos(I),O=Math.sin(I),L=R*T,S=O*T,y=O,N=-R;if(s[h++]=y,s[h++]=0,s[h++]=N,s[h++]=1,a[f++]=L,a[f++]=v,a[f++]=S,o[l++]=M,o[l++]=g,p>0&&A>0){var x=d,C=x-1,b=C-n-1,P=x-n-1;u[c++]=b,u[c++]=P,u[c++]=x,u[c++]=b,u[c++]=x,u[c++]=C}d++}this.vertices=new w(a,3),this.indices=new w(u,1),this.uvs=new w(o,2),this.tangents=new w(s,4),this.normals=new w(new Float32Array(a),3)},_raycast:function(t,e){return ta.superclass._raycast.call(this,t,e)}}),ea=ta,na=a.a.create({className:"UniformBuffer",isUniformBuffer:!0,isDirty:!1,data:{get:function(){return this._data},set:function(t){this._data=t,this.isDirty=!0}},_data:null,_buffer:null,constructor:function(t){this.data=t},getBuffer:function(t){return this._buffer||(this._buffer=new Wt(t,t.UNIFORM_BUFFER,null,t.DYNAMIC_DRAW)),this.isDirty&&(this._buffer.bufferData(this.data),this.isDirty=!1),this._buffer},destroy:function(){this._buffer&&(this._buffer.destroy(),this._buffer=null),this.isDirty=!0}}),ra=[Lt,Gt,Wt,$t,ge,He],ia=function(){var t="";return ra.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),_.a.log(t),t},aa=a.a.create({Mixes:o,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var r={key:t,state:e,data:n};this._files[t]=r,this.fire("update",r),this.fire("update:".concat(r.key),r)}},get:function(t){return this.enabled?this._files[t]:null},getLoaded:function(t){var e=this.get(t);return e&&e.state===aa.LOADED?e.data:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===aa.LOADED?Promise.resolve(t.data):t.state===aa.FAILED?Promise.reject():new Promise((function(n,r){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===aa.LOADED?n(e.data):e.state===aa.FAILED&&r(e.data)}),!0)})):Promise.reject()}}),sa=aa,oa=new sa,ua=a.a.create({Mixes:o,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:oa,enalbeCache:function(){oa.enabled=!0},disableCache:function(){oa.enabled=!1},deleteCache:function(t){oa.remove(t)},clearCache:function(){oa.clear()},cache:{get:function(){return oa},set:function(){_.a.warn("BasicLoader.cache is readonly!")}},TYPE_IMAGE:"img",TYPE_JSON:"json",TYPE_BUFFER:"buffer",TYPE_TEXT:"text"},load:function(t){var e=t.src,n=t.type;if(!n){var r=Object(i.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(r)&&(n="img"),n||(n=t.defaultType)}return n===ua.TYPE_IMAGE?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,r=new Uint8Array(n),i=0;i=300)r(new TypeError("Network request failed for ".concat(a.status)));else{var e="response"in a?a.response:a.responseText;if(t.type===ua.TYPE_JSON)try{e=JSON.parse(e)}catch(t){return void r(new TypeError("JSON.parse error"+t))}n(e)}},a.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request timed out"))},a.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(a.withCredentials=!0),t.type===ua.TYPE_BUFFER&&(a.responseType="arraybuffer"),Object(i.each)(t.headers,(function(t,e){a.setRequestHeader(e,t)})),a.send(t.body||null)}))}}),ca=ua,fa=a.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){fa._loaderClassMap[t]=e},getLoader:function(t){if(!fa._loaders[t]){var e=fa._loaderClassMap[t]?fa._loaderClassMap[t]:ca;fa._loaders[t]=new e}return fa._loaders[t]}},preHandlerUrl:null,load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(i.getExtension)(t.src),r=fa.getLoader(n),a=t;return this.preHandlerUrl&&((a=Object.assign({},t)).src=this.preHandlerUrl(t.src)),r.load(a)}}),ha=fa,la=a.a.create({Extends:ca,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){la.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new je(n)})).catch((function(t){throw _.a.error("load CubeTexture failed",t.message,t.stack),t}))}});ha.addLoader("CubeTexture",la);var da=la,ma=a.a.create({Extends:Sn,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnvMap:null,isSpecularEnvMapIncludeMipmaps:!1,emission:null,emissionFactor:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,clearcoatFactor:0,clearcoatMap:null,clearcoatRoughnessFactor:0,clearcoatRoughnessMap:null,clearcoatNormalMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),this.emissionFactor=new v.a(0,0,0),ma.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_emissionFactor:"EMISSIONFACTOR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3",u_clearcoatFactor:"CLEARCOATFACTOR",u_clearcoatRoughnessFactor:"CLEARCOATROUGHNESSFACTOR"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP",u_clearcoatMap:"CLEARCOATMAP",u_clearcoatRoughnessMap:"CLEARCOATROUGHNESSMAP",u_clearcoatNormalMap:"CLEARCOATNORMALMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ma.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),mt.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),this.specularEnvMap&&this.isSpecularEnvMapIncludeMipmaps&&(t.IS_SPECULAR_ENV_MAP_INCLUDE_MIPMAPS=1),this.clearcoatFactor>0&&(t.HAS_CLEARCOAT=1,t.HAS_NORMAL=1,this.clearcoatMap&&e.add(this.clearcoatMap,"CLEARCOAT_MAP"),this.clearcoatNormalMap&&e.add(this.clearcoatNormalMap,"CLEARCOAT_NORMAL_MAP"),this.clearcoatRoughnessMap&&e.add(this.clearcoatRoughnessMap,"CLEARCOAT_ROUGHNESS_MAP")),e.update(),t}}),_a=ma,pa=new Image;pa.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ga=a.a.create({Extends:ge,Mixes:o,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ga.superclass.constructor.call(this,t),this.image=this.placeHolder||pa},load:function(t){var e=this;return ga.loader=ga.loader||new ha,ga.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));_.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ga.superclass._releaseImage.call(this)}}),Ea=ga,va=n(12);function Ta(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Aa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;r--)Na[r]=t[r]+n*(e[r]-t[r]);return Na}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,r){var a=t.length/3;if(void 0===e)return 1===a?t[1]:t.slice(a,-a);var s=t[1],o=t[2],u=e[1],c=e[0];return a>1&&(s=t.slice(a,-a),o=t.slice(-a),u=e.slice(a,-a),c=e.slice(0,a)),s.hermite?s.hermite(s,o.scale(r),u,c.scale(r),n):s.isQuaternion?(s.fromArray(this._cubicSpline(s.elements,o.elements,u.elements,c.elements,r,n),0),s.normalize()):(Object(i.isArrayLike)(s)||(s=[s],o=[o],u=[u],c=[c]),s=this._cubicSpline(s,o,u,c,r,n)),s},_cubicSpline:function(t,e,n,r,i,a){var s=a*a,o=s*a,u=2*o-3*s+1,c=o-2*s+a,f=-2*o+3*s,h=o-s;Na.length=0;for(var l=t.length-1;l>=0;l--)Na[l]=t[l]*u+c*e[l]*i+n[l]*f+h*r[l]*i;return Na}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ca.StateType[t]||Ca._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ca._extraStateHandlers.type[String(t).toUpperCase()]=t,Ca._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=m.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){var e=Object(i.getIndexFromSortedArray)(this.keyTime,t,xa);return e[0]<0&&(e[0]=0),e[1]>=this.keyTime.length&&(e[1]=this.keyTime.length-1),e},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=Ta(this.findIndexByTime(t),2),n=e[0],r=e[1],a=this.keyTime[n],s=this.keyTime[r],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===r){var u=this.interpolation(o);return this.type===Ca.StateType.ROTATION&&(u=Ma.fromEuler(ya.fromArray(u))),u.elements||u}var c=this.getStateByIndex(r),f=s-a,h=(t-a)/f;this.type===Ca.StateType.ROTATION?Object(i.isArrayLike)(o[0])?(o[0]=Ma.fromEuler(ya.fromArray(o[0])),o[1]=Ia.fromEuler(ya.fromArray(o[1])),o[2]=Ra.fromEuler(ya.fromArray(o[2])),c[0]=Oa.fromEuler(ya.fromArray(c[0])),c[1]=La.fromEuler(ya.fromArray(c[1])),c[2]=Sa.fromEuler(ya.fromArray(c[2]))):(o=Ma.fromEuler(ya.fromArray(o)),c=Ia.fromEuler(ya.fromArray(c))):this.type===Ca.StateType.QUATERNION&&(Object(i.isArrayLike)(o[0])?(o[0]=Ma.fromArray(o[0]),o[1]=Ia.fromArray(o[1]),o[2]=Ra.fromArray(o[2]),c[0]=Oa.fromArray(c[0]),c[1]=La.fromArray(c[1]),c[2]=Sa.fromArray(c[2])):(o=Ma.fromArray(o),c=Ia.fromArray(c)));var l=this.interpolation(o,c,h,f);return l.elements||l},interpolation:function(t,e,n,r){return Ca.interpolation[this.interpolationType](t,e,n,r)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],r=e.length;e=e.slice();for(var i=0;ie[a]){var o=e[a];e[a]=e[s],e[s]=o,o=n[a],n[a]=n[s],n[s]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ca.StateType.ROTATION&&(n=Ca.StateType.QUATERNION);var r=this.getState(t);if(r){var i="updateNode"+n;this[i]?this[i](e,r):Ca._extraStateHandlers.handler[n]?Ca._extraStateHandlers.handler[n].call(this,e,r):_.a.warnOnce(i,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),ba=Ca,Pa=a.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:o,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this._initNodeNameMap()}},_animStatesList:null,animStatesList:{get:function(){return this._animStatesList},set:function(t){this._animStatesList=t,this._initClipTime()}},validAnimationIds:null,constructor:function(t){this.id=m.a.generateUUID(this.className),this.clips={},this._animStatesList=[],Object.assign(this,t)},addClip:function(t,e,n,r){this.clips[t]={start:e,end:n,animStatesList:r}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},_initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=0,this.clipEndTime=t.endTime},_initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var r=this.clips[t];r?(n=r.start,e=r.end,r.animStatesList&&(this.animStatesList=r.animStatesList,this._initClipTime())):_.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Pa._anims.push(this)},stop:function(){this.paused=!0;var t=Pa._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),wa=Pa;function Da(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ha(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ha(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ha(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},i.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Ya.extensionHandlers[t]},parseExtension:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t[e],a=this.getExtensionHandler(e);return a&&a.parse?a.parse(i,this,n,r):n},parseExtensions:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.each(t,(function(t,i){if(!r.ignoreExtensions||!r.ignoreExtensions[i]){var a=n.getExtensionHandler(i),s=r.methodName||"parse";a&&a[s]&&(e=a[s](t,n,e,r))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),r=n.getUint32(4,!0),a=n.getUint32(8,!0),s=12;if(r<2){var o=n.getUint32(s,!0);e=new Uint8Array(t,20,o),e=i.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==r)throw new Error("Dont support glTF version ".concat(r));for(;sa*i.BYTES_PER_ELEMENT)s.array=new i(s.buffer,s.byteOffset,s.byteLength/i.BYTES_PER_ELEMENT),r=new w(s.array,a,{offset:n.byteOffset||0,stride:s.byteStride,bufferViewId:s.id});else{var u,c=(n.byteOffset||0)+s.byteOffset;if(c%i.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new i(s.buffer.slice(c,c+o*i.BYTES_PER_ELEMENT));else u=new i(s.buffer,c,o);r=new w(u,a)}return n.sparse&&(r||(r=new w(new i(o),a)),r=this.sparseAccessorHandler(r,n.sparse)),r=this.parseExtensions(n.extensions,r,{isDecode:e,isAccessor:!0}),n.data=r,n.normalized&&(r.normalized=!0),r},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var r=this.getAccessorData(t,e);if(!r.stride&&!r.offset&&1===r.size)return r.data;var i=[];return r.traverse((function(t){i.push(t.toArray?t.toArray():t)})),n.array=i,i},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case Fa:e.blend=!0;break;case Ua:e.depthTest=!0;break;case Ga:e.cullFace=!0}})),i.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Ba?Va:Ba:e.side=Xa)},createMorphGeometry:function(t,e){var n=this,r=new br,a=r.targets={};return i.each(t.targets,(function(t){i.each(t,(function(t,e){var r=Wa[e].name;a[r]||(a[r]=[]);var i=n.getAccessorData(t,!0);a[r].push(i)}))})),r.weights=e||new Float32Array(t.targets.length),r},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var r=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(r)return r.mode=n,r}t||(t=new Q({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var i=e.attributes;for(var a in i){var s=Wa[a];if(s){var o=!(this.isUnQuantizeInShader&&s.decodeMatName);t[s.name]=this.getAccessorData(i[a],o),o||(t[s.decodeMatName]=t[s.name].decodeMat,delete t[s.name].decodeMat)}else _.a.warn("Unknow attribute named ".concat(a,"!"))}return t},handlerSkinedMesh:function(t,e){e&&(t.skeleton=e,this.useInstanced&&(t.useInstanced=!0))},fixProgressiveGeometry:function(t,e){t._geometry=e,this.isProgressive&&t._meshes&&t._meshes.forEach((function(t){t.visible=!0,t.geometry=e}))},parseGeometries:function(){var t=this,e=i.serialRun(this.json.meshes,(function(e){return i.serialRun(e.primitives,(function(n){var r;n.targets&&n.targets.length&&(r=t.createMorphGeometry(n,e.weights)),n._geometry=r;var i=t.handlerGeometry(r,n);return i&&i.then?i.then((function(e){t.fixProgressiveGeometry(n,e)}),(function(t){_.a.error("geometry parse error",t)})):(t.fixProgressiveGeometry(n,i),i)}))}));return this.isProgressive?null:e},parseMesh:function(t,e,n){var r=this,i=this.json.meshes[t];i.primitives.forEach((function(a){var s,o=r.skins&&r.skins[n.skin];if(a.meshNode)s=a.meshNode.clone();else{var u=r.materials[a.material]||new Nn;s=new(o?Qr:jn)({geometry:a._geometry,material:u,name:"mesh-"+(i.name||t)}),a.meshNode=s}r.handlerSkinedMesh(s,o),r.isProgressive&&!s.geometry&&(s.visible=!1,a._meshes=a._meshes||[],a._meshes.push(s)),e.addChild(s),r.meshes.push(s)}))},parseCameras:function(){var t=this;this.cameras={};var e=window.innerWidth/window.innerHeight;i.each(this.json.cameras,(function(n,r){var i;"perspective"===n.type&&n.perspective?((i=new $).fov=m.a.radToDeg(n.perspective.yfov),i.near=n.perspective.znear,i.far=n.perspective.zfar,n.aspectRatio?i.aspect=n.aspectRatio:i.aspect=e):"orthographic"===n.type&&n.orthographic&&((i=new Un).near=n.orthographic.znear,i.far=n.orthographic.zfar,i.right=n.orthographic.xmag,i.left=-1*i.right,i.top=n.orthographic.ymag,i.bottom=-1*i.top),(i=t.parseExtensions(n.extensions,i,{isCamera:!0}))&&(i.name=n.name||r,t.cameras[r]=i)}))},handlerNodeTransform:function(t,e){e.matrix?t.matrix.fromArray(e.matrix):(e.rotation&&t.quaternion.fromArray(e.rotation),e.scale&&t.setScale(e.scale[0],e.scale[1],e.scale[2]),e.translation&&(t.x=e.translation[0],t.y=e.translation[1],t.z=e.translation[2]))},parseNode:function(t,e){var n,r=this,i=this.json.nodes[t];i||_.a.warn("GLTFParser.parseNode: nodes[".concat(t,"] has nothing.")),n=new E({name:i.name,animationId:t}),n=this.parseExtensions(i.extensions,n,{isNode:!0}),"camera"in i&&this.cameras[i.camera]&&n.addChild(this.cameras[i.camera]),this.handlerNodeTransform(n,i),i.jointName?(n.jointName=i.jointName,this.jointMap[n.jointName]=n):this.isGLTF2&&(n.jointName=t,this.jointMap[t]=n),i.meshes?i.meshes.forEach((function(t){return r.parseMesh(t,n,i)})):"mesh"in i&&this.parseMesh(i.mesh,n,i),i.children&&i.children.forEach((function(t){return r.parseNode(t,n)})),e.addChild(n)},parseAnimations:function(){var t=this;if(!this.json.animations)return null;var e=this.isMultiAnim,n={},r=[],a={};return i.each(this.json.animations,(function(i){i.channels.forEach((function(e){var n=e.target.path,s=e.target.id;t.isGLTF2&&(s=e.target.node);var o=i.samplers[e.sampler],u=t.isGLTF2?o.input:i.parameters[o.input],c=t.isGLTF2?o.output:i.parameters[n],f=t.getArrayByAccessor(u,!0),h=t.getArrayByAccessor(c,!0);"rotation"===n&&(n="quaternion");var l=new ba({interpolationType:o.interpolation||"LINEAR",nodeName:s,keyTime:f,states:h,type:ba.getType(n)});r.push(l),a[s]=!0})),e&&r.length&&(n[i.name]={animStatesList:r},r=[])})),e&&Object.keys(n).length>0&&(r=Object.values(n)[0].animStatesList),r.length?new wa({rootNode:this.node,animStatesList:r,validAnimationIds:a,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new E({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return _.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};var n=e.nodes;this.parseSkins(),n.forEach((function(e){return t.parseNode(e,t.node)})),this.resetSkinInfo(this.node);var r={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),r.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,r,{isGlobal:!0,methodName:"parseOnEnd"}),r},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null},parseSkins:function(){var t=this;this.skins=[];var e=this.json.skins;e&&e.length&&(this.skins=e.map((function(e){for(var n=new $r,r=e.joints.length,i=t.getArrayByAccessor(e.inverseBindMatrices,!0),a=0;a ",t)}return null}))}});ha.addLoader("hdr",ns);var rs=ns,is=a.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var r=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===r[0]&&75===r[1]&&84===r[2]&&88===r[3]&&32===r[4]&&49===r[5]&&49===r[6]&&187===r[7]&&13===r[8]&&10===r[9]&&26===r[10]&&10===r[11]){var i=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.arrayBuffer,this.baseOffset+12,13*i),s=a.getUint32(0,!0),o=67305985===s;this.glType=a.getUint32(1*i,o),this.glTypeSize=a.getUint32(2*i,o),this.glFormat=a.getUint32(3*i,o),this.glInternalFormat=a.getUint32(4*i,o),this.glBaseInternalFormat=a.getUint32(5*i,o),this.pixelWidth=a.getUint32(6*i,o),this.pixelHeight=a.getUint32(7*i,o),this.pixelDepth=a.getUint32(8*i,o),this.numberOfArrayElements=a.getUint32(9*i,o),this.numberOfFaces=a.getUint32(10*i,o),this.numberOfMipmapLevels=a.getUint32(11*i,o),this.bytesOfKeyValueData=a.getUint32(12*i,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=is.COMPRESSED_2D:this.loadType=is.TEX_2D:_.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):_.a.warn("texture arrays not currently supported"):_.a.warn("only 2D textures currently supported")}else _.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=is.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,i=this.pixelHeight,a=t?this.numberOfMipmapLevels:1,s=0;s2&&void 0!==arguments[2]?arguments[2]:0,r=new is(e,1,n),i={compressed:0===r.glType,type:r.glType,width:r.pixelWidth,height:r.pixelHeight,internalFormat:r.glInternalFormat,format:r.glFormat,isCubemap:6===r.numberOfFaces};return r.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(i.width,i.height))+1)?(i.mipmaps=r.mipmaps(!0),i.image=i.mipmaps[0].data):(i.mipmaps=null,i.image=r.mipmaps(!1)[0].data),new ge(i)}});ha.addLoader("ktx",as);var ss=as,os=a.a.create({Mixes:o,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){_.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),ha.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.renderer.pixelRatio,a=[],s=this.framebuffer.readPixels(t*i,e*i,n*i,r*i),o=0;o=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var r=n.slice(0),i=0,a=r.length;i=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(r){e.removeTick(n),t(r)}};return e.addTick(n),n},timeout:function(t,e){var n=this,r=(new Date).getTime()+e,i={tick:function(){(new Date).getTime()-r>=0&&(n.removeTick(i),t())}};return n.addTick(i),i},interval:function(t,e){var n=(new Date).getTime()+e,r={tick:function(){var r=(new Date).getTime(),i=r-n;i>=0&&(i0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=a*s),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=s+r*(n[2]-s),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,a,s,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(a=2*r.RANDOM()-1)*a+(s=2*r.RANDOM()-1)*s}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*a*c,t[3]=e*s*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*s,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2],c=n[3],f=c*r+o*a-u*i,h=c*i+u*r-s*a,l=c*a+s*i-o*r,d=-s*r-o*i-u*a;return t[0]=f*c+d*-s+h*-u-l*-o,t[1]=h*c+d*-o+l*-s-f*-u,t[2]=l*c+d*-u+f*-o-h*-s,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+a*a)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function f(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.len=f,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],u=e[2];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-u)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function a(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function s(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function l(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=f,e.sqrDist=h,e.len=a,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=f,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=a*u-i*o,t[3]=s*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-a*o,t[1]=i*u+s*o,t[2]=a*u+r*o,t[3]=s*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=a*u+s*o,t[3]=s*u-a*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=h,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),a=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=a*Math.sin(2*Math.PI*n),t[1]=a*Math.cos(2*Math.PI*n),t[2]=s*Math.sin(2*Math.PI*i),t[3]=s*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*n+r*r+i*i+a*a,o=s?1/s:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=a*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=a*u*f-s*o*c,t[1]=s*o*f+a*u*c,t[2]=s*u*c-a*o*f,t[3]=s*u*f+a*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),a=o(n(2)),s=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function f(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*f+s*o+i*c-a*u,t[1]=i*f+s*u+a*o-r*c,t[2]=a*f+s*c+r*u-i*o,t[3]=s*f-r*o-i*u-a*c,t}function h(t,e,n,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=n[0],f=n[1],h=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=a*c+s*f+o*h+u*l)<0&&(m=-m,c=-c,f=-f,h=-h,l=-l),1-m>r.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-i)*d)/_,g=Math.sin(i*d)/_):(p=1-i,g=i),t[0]=p*a+g*c,t[1]=p*s+g*f,t[2]=p*o+g*h,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+s]-e[3*s+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}e.clone=s.clone,e.fromValues=s.fromValues,e.copy=s.copy,e.set=s.set,e.add=s.add,e.mul=f,e.scale=s.scale,e.dot=s.dot,e.lerp=s.lerp;var d=e.length=s.length,m=(e.len=d,e.squaredLength=s.squaredLength),_=(e.sqrLen=m,e.normalize=s.normalize);e.exactEquals=s.exactEquals,e.equals=s.equals,e.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,i,s){var o=a.dot(i,s);return o<-.999999?(a.cross(t,e,i),a.len(t)<1e-6&&a.cross(t,n,i),a.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,s),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,_(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,a,s,o){return h(t,r,s,o),h(e,i,a,o),h(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,a,s,o,u,c,f,h,l,d,m,_,p){var g=new r.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=i,g[4]=a,g[5]=s,g[6]=o,g[7]=u,g[8]=c,g[9]=f,g[10]=h,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,r,i,a,s,o,u,c,f,h,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,R=i*c-a*u,I=f*_-h*m,L=f*p-l*m,O=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*O-M*L+R*I;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(i*y-r*N-a*S)*x,t[2]=(_*R-p*M+g*A)*x,t[3]=(l*M-h*R-d*A)*x,t[4]=(u*O-s*N-c*L)*x,t[5]=(n*N-i*O+a*L)*x,t[6]=(p*T-m*R-g*v)*x,t[7]=(f*R-l*T+d*v)*x,t[8]=(s*y-o*O+c*I)*x,t[9]=(r*O-n*y-a*I)*x,t[10]=(m*M-_*T+g*E)*x,t[11]=(h*T-f*M-d*E)*x,t[12]=(o*L-s*S-u*I)*x,t[13]=(n*S-r*L+i*I)*x,t[14]=(_*v-m*A-p*E)*x,t[15]=(f*A-h*v+l*E)*x,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-h*(u*g-c*p)+_*(u*d-c*l),t[1]=-(r*(l*g-d*p)-h*(i*g-a*p)+_*(i*d-a*l)),t[2]=r*(u*g-c*p)-o*(i*g-a*p)+_*(i*c-a*u),t[3]=-(r*(u*d-c*l)-o*(i*d-a*l)+h*(i*c-a*u)),t[4]=-(s*(l*g-d*p)-f*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-f*(i*g-a*p)+m*(i*d-a*l),t[6]=-(n*(u*g-c*p)-s*(i*g-a*p)+m*(i*c-a*u)),t[7]=n*(u*d-c*l)-s*(i*d-a*l)+f*(i*c-a*u),t[8]=s*(h*g-d*_)-f*(o*g-c*_)+m*(o*d-c*h),t[9]=-(n*(h*g-d*_)-f*(r*g-a*_)+m*(r*d-a*h)),t[10]=n*(o*g-c*_)-s*(r*g-a*_)+m*(r*c-a*o),t[11]=-(n*(o*d-c*h)-s*(r*d-a*h)+f*(r*c-a*o)),t[12]=-(s*(h*p-l*_)-f*(o*p-u*_)+m*(o*l-u*h)),t[13]=n*(h*p-l*_)-f*(r*p-i*_)+m*(r*l-i*h),t[14]=-(n*(o*p-u*_)-s*(r*p-i*_)+m*(r*u-i*o)),t[15]=n*(o*l-u*h)-s*(r*l-i*h)+f*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8],f=t[9],h=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*s-n*a)*(h*p-l*_)-(e*o-r*a)*(f*p-l*m)+(e*u-i*a)*(f*_-h*m)+(n*o-r*s)*(c*p-l*d)-(n*u-i*s)*(c*_-h*d)+(r*u-i*o)*(c*m-f*d)},e.multiply=a,e.translate=function(t,e,n){var r=n[0],i=n[1],a=n[2],s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*a+e[12],t[13]=e[1]*r+e[5]*i+e[9]*a+e[13],t[14]=e[2]*r+e[6]*i+e[10]*a+e[14],t[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(s=e[0],o=e[1],u=e[2],c=e[3],f=e[4],h=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=f,t[5]=h,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=s*r+f*i+m*a+e[12],t[13]=o*r+h*i+_*a+e[13],t[14]=u*r+l*i+p*a+e[14],t[15]=c*r+d*i+g*a+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var a,s,o,u,c,f,h,l,d,m,_,p,g,E,v,T,A,M,R,I,L,O,S,y,N=i[0],x=i[1],C=i[2],b=Math.sqrt(N*N+x*x+C*C);return b0?(n[0]=2*(c*u+l*i+f*o-h*a)/d,n[1]=2*(f*u+l*a+h*i-c*o)/d,n[2]=2*(h*u+l*o+c*a-f*i)/d):(n[0]=2*(c*u+l*i+f*o-h*a),n[1]=2*(f*u+l*a+h*i-c*o),n[2]=2*(h*u+l*o+c*a-f*i)),s(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],s=e[5],o=e[6],u=e[8],c=e[9],f=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+s*s+o*o),t[2]=Math.sqrt(u*u+c*c+f*f),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3],u=i+i,c=a+a,f=s+s,h=i*u,l=i*c,d=i*f,m=a*c,_=a*f,p=s*f,g=o*u,E=o*c,v=o*f,T=r[0],A=r[1],M=r[2];return t[0]=(1-(m+p))*T,t[1]=(l+v)*T,t[2]=(d-E)*T,t[3]=0,t[4]=(l-v)*A,t[5]=(1-(h+p))*A,t[6]=(_+g)*A,t[7]=0,t[8]=(d+E)*M,t[9]=(_-g)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=a+a,f=s+s,h=o+o,l=a*c,d=a*f,m=a*h,_=s*f,p=s*h,g=o*h,E=u*c,v=u*f,T=u*h,A=r[0],M=r[1],R=r[2],I=i[0],L=i[1],O=i[2],S=(1-(_+g))*A,y=(d+T)*A,N=(m-v)*A,x=(d-T)*M,C=(1-(l+g))*M,b=(p+E)*M,P=(m+v)*R,w=(p-E)*R,H=(1-(l+_))*R;return t[0]=S,t[1]=y,t[2]=N,t[3]=0,t[4]=x,t[5]=C,t[6]=b,t[7]=0,t[8]=P,t[9]=w,t[10]=H,t[11]=0,t[12]=n[0]+I-(S*I+x*L+P*O),t[13]=n[1]+L-(y*I+C*L+w*O),t[14]=n[2]+O-(N*I+b*L+H*O),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[1]=f+g,t[2]=l-p,t[3]=0,t[4]=f-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,a,s){var o=1/(n-e),u=1/(i-r),c=1/(a-s);return t[0]=2*a*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(s+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*a*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var a=1/Math.tan(e/2),s=void 0;return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(r-i),t[10]=(i+r)*s,t[14]=2*i*r*s):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(s+o),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(s-o)*u*.5,t[9]=(i-a)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,a,s){var o=1/(e-n),u=1/(r-i),c=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(s+a)*c,t[15]=1,t},e.lookAt=function(t,e,n,a){var s=void 0,o=void 0,u=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],E=e[2],v=a[0],T=a[1],A=a[2],M=n[0],R=n[1],I=n[2];return Math.abs(p-M)0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var m=u*l-c*h,_=c*f-o*l,p=o*h-u*f;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=h*p-l*_,t[5]=l*m-f*p,t[6]=f*_-h*m,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=i,t[13]=a,t[14]=s,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],E=t[15],v=e[0],T=e[1],A=e[2],M=e[3],R=e[4],I=e[5],L=e[6],O=e[7],S=e[8],y=e[9],N=e[10],x=e[11],C=e[12],b=e[13],P=e[14],w=e[15];return Math.abs(n-v)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(s-M)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-R)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(R))&&Math.abs(u-I)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-L)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(f-O)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(h-S)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-N)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(m-x)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(_-C)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(C))&&Math.abs(p-b)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(b))&&Math.abs(g-P)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(E-w)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(w))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function a(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],E=e[15],v=n[0],T=n[1],A=n[2],M=n[3];return t[0]=v*r+T*o+A*h+M*_,t[1]=v*i+T*u+A*l+M*p,t[2]=v*a+T*c+A*d+M*g,t[3]=v*s+T*f+A*m+M*E,v=n[4],T=n[5],A=n[6],M=n[7],t[4]=v*r+T*o+A*h+M*_,t[5]=v*i+T*u+A*l+M*p,t[6]=v*a+T*c+A*d+M*g,t[7]=v*s+T*f+A*m+M*E,v=n[8],T=n[9],A=n[10],M=n[11],t[8]=v*r+T*o+A*h+M*_,t[9]=v*i+T*u+A*l+M*p,t[10]=v*a+T*c+A*d+M*g,t[11]=v*s+T*f+A*m+M*E,v=n[12],T=n[13],A=n[14],M=n[15],t[12]=v*r+T*o+A*h+M*_,t[13]=v*i+T*u+A*l+M*p,t[14]=v*a+T*c+A*d+M*g,t[15]=v*s+T*f+A*m+M*E,t}function s(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=r+r,u=i+i,c=a+a,f=r*o,h=r*u,l=r*c,d=i*u,m=i*c,_=a*c,p=s*o,g=s*u,E=s*c;return t[0]=1-(d+_),t[1]=h+E,t[2]=l-g,t[3]=0,t[4]=h-E,t[5]=1-(f+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=a,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,a,s,o,u,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=i,f[4]=a,f[5]=s,f[6]=o,f[7]=u,f[8]=c,f},e.set=function(t,e,n,r,i,a,s,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=f*s-o*c,l=-f*a+o*u,d=c*a-s*u,m=n*h+r*l+i*d;return m?(m=1/m,t[0]=h*m,t[1]=(-f*r+i*c)*m,t[2]=(o*r-i*s)*m,t[3]=l*m,t[4]=(f*n-i*u)*m,t[5]=(-o*n+i*a)*m,t[6]=d*m,t[7]=(-c*n+r*u)*m,t[8]=(s*n-r*a)*m,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8];return t[0]=s*f-o*c,t[1]=i*c-r*f,t[2]=r*o-i*s,t[3]=o*u-a*f,t[4]=n*f-i*u,t[5]=i*a-n*o,t[6]=a*c-s*u,t[7]=r*u-n*c,t[8]=n*s-r*a,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8];return e*(c*a-s*u)+n*(-c*i+s*o)+r*(u*i-a*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=u,t[6]=l*r+d*s+c,t[7]=l*i+d*o+f,t[8]=l*a+d*u+h,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*r+l*s,t[1]=d*i+l*o,t[2]=d*a+l*u,t[3]=d*s-l*r,t[4]=d*o-l*i,t[5]=d*u-l*a,t[6]=c,t[7]=f,t[8]=h,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,f=r*s,h=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-h-m,t[3]=f-g,t[6]=l+p,t[1]=f+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-h,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],f=e[8],h=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,R=i*c-a*u,I=f*_-h*m,L=f*p-l*m,O=f*g-d*m,S=h*p-l*_,y=h*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*O-M*L+R*I;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(u*O-s*N-c*L)*x,t[2]=(s*y-o*O+c*I)*x,t[3]=(i*y-r*N-a*S)*x,t[4]=(n*N-i*O+a*L)*x,t[5]=(r*O-n*y-a*I)*x,t[6]=(_*R-p*M+g*A)*x,t[7]=(p*T-m*R-g*v)*x,t[8]=(m*M-_*T+g*E)*x,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],E=e[6],v=e[7],T=e[8];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-E)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(f-v)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(v))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],f=e[7],h=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],E=n[6],v=n[7],T=n[8];return t[0]=l*r+d*s+m*c,t[1]=l*i+d*o+m*f,t[2]=l*a+d*u+m*h,t[3]=_*r+p*s+g*c,t[4]=_*i+p*o+g*f,t[5]=_*a+p*u+g*h,t[6]=E*r+v*s+T*c,t[7]=E*i+v*o+T*f,t[8]=E*a+v*u+T*h,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=a,e.multiply=s,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=f,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],s=Math.sin(r),o=Math.cos(r);return t[0]=i*o-a*s+n[0],t[1]=i*s+a*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));var o=i*i+a*a;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*a)*s*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],a=e[0],s=e[1];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function f(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){var e=t[0],n=t[1];return e*e+n*n}e.len=f,e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=h,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,a=e[2]/n,s=e[3]/n,o=e[4],u=e[5],c=e[6],f=e[7],h=r*o+i*u+a*c+s*f;t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=(o-r*h)/n,t[5]=(u-i*h)/n,t[6]=(c-a*h)/n,t[7]=(f-s*h)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],f=t[7],h=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],E=e[7];return Math.abs(n-h)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-_)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(f-E)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))};var r=s(n(0)),i=s(n(3)),a=s(n(4));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],a=.5*n[2],s=e[0],o=e[1],u=e[2],c=e[3];return t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-a*o,t[5]=i*c+a*s-r*u,t[6]=a*c+r*o-i*s,t[7]=-r*s-i*o-a*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[4],u=n[5],c=n[6],f=n[7],h=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],E=n[3];return t[0]=r*E+s*_+i*g-a*p,t[1]=i*E+s*p+a*_-r*g,t[2]=a*E+s*g+r*p-i*_,t[3]=s*E-r*_-i*p-a*g,t[4]=r*f+s*o+i*c-a*u+h*E+m*_+l*g-d*p,t[5]=i*f+s*u+a*o-r*c+l*E+m*p+d*_-h*g,t[6]=a*f+s*c+r*u-i*o+d*E+m*g+h*p-l*_,t[7]=s*f-r*o-i*u-a*c+m*E-h*_-l*p-d*g,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var f=e.dot=i.dot,h=e.length=i.length,l=(e.len=h,e.squaredLength=i.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,a,s){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=a,o[5]=s,o},e.set=function(t,e,n,r,i,a,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=n*a-r*i;return u?(u=1/u,t[0]=a*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-a*s)*u,t[5]=(r*s-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=Math.sin(n),f=Math.cos(n);return t[0]=r*f+a*c,t[1]=i*f+s*c,t[2]=r*-c+a*f,t[3]=i*-c+s*f,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r*c,t[1]=i*c,t[2]=a*f,t[3]=s*f,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=r*c+a*f+o,t[5]=i*c+s*f+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=e[0],f=e[1],h=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],f=n[1],h=n[2],l=n[3],d=n[4],m=n[5];return t[0]=r*c+a*f,t[1]=i*c+s*f,t[2]=r*h+a*l,t[3]=i*h+s*l,t[4]=r*d+a*m+o,t[5]=i*d+s*m+u,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*a-i*r;return s?(s=1/s,t[0]=a*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=r*-o+a*u,t[3]=i*-o+s*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=a*u,t[3]=s*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*o+a*u,t[1]=i*o+s*u,t[2]=r*c+a*f,t[3]=i*c+s*f,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=d(n(0)),i=d(n(9)),a=d(n(8)),s=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),f=d(n(6)),h=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=a,e.mat3=s,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=f,e.vec3=h,e.vec4=l}])},function(t,e,n){"use strict";var r=function(){var t,e;try{t=Object.defineProperty,e=Object.defineProperties,t({},"$",{value:0})}catch(n){"__defineGetter__"in Object&&(t=function(t,e,n){return"value"in n&&(t[e]=n.value),"get"in n&&t.__defineGetter__(e,n.get),"set"in n&&t.__defineSetter__(e,n.set),t},e=function(e,n){for(var r in n)n.hasOwnProperty(r)&&t(e,r,n[r]);return e})}var n=function(t){for(var n=1,r=arguments.length;n>1,s=n(t[a],e);if(0===s)return[a,a];s<0?r=a+1:i=a-1}return r>i?[i,r]:[r,i]}function E(t,e,n){var r=g(t,e,n);t.splice(r[1],0,e)}function v(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?f:t instanceof Uint32Array?h:l}var A,M,R=(a(A={},o,Int8Array),a(A,u,Uint8Array),a(A,c,Int16Array),a(A,f,Uint16Array),a(A,h,Uint32Array),a(A,l,Float32Array),M=A,function(t){return M[t]||Float32Array});function I(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function P(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),a=n(1),s=n(5),o=n(10),u=new s.a,c=new s.a,f=a.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],f=n[1],h=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=f*m-h*d,g=h*l-o*m,E=o*d-f*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=f*m-h*d)*p+(g=h*l-(o+=1e-7)*m)*g+(E=o*d-f*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new f),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});f.prototype.sub=f.prototype.subtract,f.prototype.mul=f.prototype.multiply,e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(12),a=n(4),s=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;s.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(a.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(a.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=s},function(t,e,n){"use strict";var r=n(1).a.create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),i={_listeners:null,on:function(t,e,n){for(var r=this._listeners=this._listeners||{},i=r[t]=r[t]||[],a=0,s=i.length;a0){if(1===arguments.length)return delete this._listeners[t],this;for(var r=0,i=n.length;r0){var o=s.slice(0);if((n=n||new r(i,this,e))._stopped)return!1;for(var u=0;u-1&&s.splice(f,1)}}return!0}return!1}};e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(11),a=n(1),s=n(9),o=new i.a,u=a.a.create({Mixes:s.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t,e){return r.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=this.elements;return r[0]=t[e],r[1]=t[e+1],r[2]=t[e+2],r[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,i,a){return r.quat.set(this.elements,t,e,n,i),a||this.fire("update"),this},identity:function(t){return r.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return r.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,i){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),i||this.fire("update"),this},setAxisAngle:function(t,e,n){return r.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return r.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return r.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return r.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return r.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return r.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return r.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return r.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return r.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return r.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return r.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,i,a,s){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),s||this.fire("update"),this},invert:function(t){return r.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return r.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(t){return r.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return r.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,a=t.order||"ZYX",s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),f=Math.sin(i),h=Math.cos(i),l=this.elements;return"XYZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"YXZ"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"ZXY"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h-s*u*f):"ZYX"===a?(l[0]=s*c*h-o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h+s*u*f):"YZX"===a?(l[0]=s*c*h+o*u*f,l[1]=o*u*h+s*c*f,l[2]=o*c*f-s*u*h,l[3]=o*c*h-s*u*f):"XZY"===a&&(l[0]=s*c*h-o*u*f,l[1]=o*u*h-s*c*f,l[2]=o*c*f+s*u*h,l[3]=o*c*h+s*u*f),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,a,s,o,u,c){return r.mat3.set(this.elements,t,e,n,i,a,s,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var a=Math.cos(t),s=Math.sin(t);return this.set(r*a,-i*s,0,r*s,i*a,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(7),s=n(3),o=new a.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,f=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],a=n[1],o=n[2],u=n[4],c=n[5],f=n[6],h=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(f,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(h,d),this.elements[2]=Math.atan2(a,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(a,r))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(f,d),this.elements[2]=Math.atan2(a,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(h,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(f,c),this.elements[1]=Math.atan2(h,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):s.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=f},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return i(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,r){return r-e-n+t}},{key:"depp",value:function(t,e,n,r){return e+n-t+r}},{key:"ATTR",get:function(){return s}},{key:"ATTR_NAME_ID",get:function(){return u}}]),i(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){s[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=h[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a=0;c--)o[u+c]=n.apply(null,i.map((function(t){return s[t*r.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=a.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=a.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var r=c[e.name];r&&(e.data.BYTES_PER_ELEMENT?n[r]=new t.GeometryData(e.data,e.itemCount):n[r]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),r=e.attributes,i=0;for(var a in r.POSITION&&(i=r.POSITION.length/3),r)if(s[a]){var o=h[s[a]];i&&(o=r[a].length/i),n.addAttr(s[a],r[a],o)}else console.warn("Dont support attribute",a);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var r in f)e[r]&&n.addAttr(f[r],e[r].data,e[r].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function r(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,i){var a=r(i),s=n-e;return Math.round((t-e)/s*a)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,i=r(e),a=1/0,s=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,s=t.length,o=r(a),u=i-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=t.length,s=r(e),o=i-n,u=new Float32Array(a),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var r=c[n[3]].read(t,e+4);return r.geometry.type=n[3],r.geometry}(t,e))}var h,l=null,d=null;function m(t,e){return!l&&o()?(l=new s({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return f(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),f(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===h||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var r=new XMLHttpRequest;r.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)h=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));h=new Worker(t)}h.onerror=function(t){console.log("web worker error",t),h=!1,n(t)},e(h)})),r.addEventListener("error",(function(t){return n(t)})),r.open("get",t,!0),r.send()})):new Promise((function(e,n){(h=new Worker(t)).onerror=function(t){console.log("web worker init error",t),h=!1,n(t)},e(h)})))}var E=0;function v(t,e,n,i){return e=e&&o(),t=new Uint8Array(t),g(i).then((function(i){return new Promise((function(a,s){var o=E++,u=function(e){if(e.data.id===o)if(i.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=r,n.__proto__=r.prototype,a(n)}else a(f(t))};i.addEventListener("message",u),i.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(r){return e?_(t,n):f(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var r=o();return!r||t.byteLength>1048576?v(t,r,e,n):r?Promise.resolve(_(t,e)):Promise.resolve(f(t))},decompressWithJS:f,decompressWithWASM:_,decompressWithWorker:v,destory:function(){h&&(h.terminate(),h=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex,i=this.currentVertex-n+1,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r,r=i,e[this.prevCorner(t[a])]=i++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex-n+1,i=r,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r++,e[this.prevCorner(t[a])]=a?r:i;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,r=this.clers,i=r.length,a=-1,s=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,r=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&r.cal(r,t,a.plus,this.lastReadVertexIndex,t):r.cal(r,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,r=this.currentVertex--;e[n]=r;var i=t.pop();return e[this.nextCorner(i)]=r,e[this.prevCorner(i)]=-this.nextCorner(t[t.length-1]),i=t.shift(),e[this.prevCorner(i)]=r,e[this.nextCorner(i)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=this.handlesMap[this.currentFace],s=e.splice(0,t);return e.shift(),n.push(s),r[this.nextCorner(a)]=-(i+1),r[this.prevCorner(a)]=-this.nextCorner(s[s.length-1]),r[i]=-this.prevCorner(s[0]),e.push(i),e}},{key:"onHandleStart",value:function(t,e){for(var n,i=this.indices,a=3*this.currentFace,s=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(s);if(u>=0){var c,f=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,r(f));break}}return i[this.nextCorner(s)]=-(a+1),i[this.prevCorner(s)]=-this.nextCorner(n[n.length-1]),i[a]=-this.prevCorner(t[0]),(t=n.concat(t)).push(a),t}},{key:"onFaceS",value:function(t,e,n){var r=this.handlesMap,i=this.indices,a=3*this.currentFace;if(r[this.currentFace]){this.markCorner(t.pop(),t);var s=t.indexOf(r[this.currentFace]);t=s>=0?this.onHandleEnd(s,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),i[a]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(a)}return t}},{key:"onFaceM",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(a);var s=r[this.prevCorner(a[0])];r[i]=s;var o=t.pop();return r[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),r[this.nextCorner(o)]=s,o=t.shift(),r[this.prevCorner(o)]=s,r[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(i),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,r=this.clers,i=[],a=[];this.currentFace>=0;){var s="onFace"+u[r[this.currentFace]];this[s]?n=this[s](n,i,a):console.warn("has no ".concat(s)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&i(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},r=[];for(var i in n)r[n[i]]=i;n.map=r,t.exports=n},function(t,e,n){var r=n(0);function i(t,e,n,r){return new t(e.slice(n,n+r*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),a=new r,s=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=s.headerBytes,a.mode="CLERS",e=function(t,e,n,r){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),r={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,r){return n.fill(e,t,t+r),t},_printf:function(t,e){for(var r=t;n[r];)r++;var i=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new i(d);return f.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),r=n[0],i=n[1],a=n[2],s=new Float32Array(e.buffer.slice(a,a+u*i*4));m.addAttr(m.attrIdToName(r),s,i)})),m}}])&&r(e.prototype,n),t}();t.exports=a},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var r=n(34),i=n.n(r),a=n(1),s=n(5),o=a.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new s.a(0,0,0),this.direction=t.direction||new s.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new s.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),a=n(9),s=n(5),o=i.a.create({Mixes:a.a,Extends:s.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return r.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.fire("update"),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.fire("update"),this},random:function(t){return r.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this.fire("update"),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e,n){"use strict";var r=n(1),i=n(5),a=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=a},function(t,e,n){"use strict";var r=n(1),i=n(5),a=new i.a,s=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.fire("update"),this},set:function(t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,f,h,l,d,m,_,p),this.fire("update"),this},identity:function(){return i.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,a){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),a||this.fire("update"),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this.fire("update"),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=f.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=f.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],u=n[1],c=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,E=o*d-u*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(E=o*d-u*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this.fire("update"),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new u.a),this.determinant()<0&&(n.x*=-1),r.copy(this),f.inverse(n),r.scale(f),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var r=n(1),i=n(9),a=n(6),s=n(13),o=a.a.DEG2RAD,u=a.a.RAD2DEG,c=r.a.create({Mixes:i.a,Extends:s.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(19),a=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5],c=n[6],f=n[7],h=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],E=n[15];return e[0].set(s-r,f-o,m-h,E-_).normalize(),e[1].set(s+r,f+o,m+h,E+_).normalize(),e[2].set(s+i,f+u,m+l,E+p).normalize(),e[3].set(s-i,f-u,m-l,E-p).normalize(),e[4].set(s-a,f-c,m-d,E-g).normalize(),e[5].set(s+a,f+c,m+d,E+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)l)return null;r(f,u,s);var m=i(n,f);if(m<0||d+m>l)return null;var _=i(o,f)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2];return t[0]=i*u-a*o,t[1]=a*s-r*u,t[2]=r*o-i*s,t}},function(t,e,n){var r=n(26),i=n(31),a=n(32),s=n(33);t.exports=function(t,e,n,u,c){var f=r(n,u);if(0!==f){var h=-(r(e,u)+c)/f;return h<0?null:(a(o,n,h),i(t,e,o))}return r(u,e)+c===0?s(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(92),i=n(26),a=n(30),s=n(93),o=n(32),u=n(31),c=[0,0,0];t.exports=function(t,e,n,f,h){a(c,f,e);var l=i(n,c);if(l<0)return null;s(c,e,n,l);var d=r(f,c),m=h*h;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,a=1/0,s=0;su){var c=o;o=u,u=c}if(ua)return 1/0;o>i&&(i=o),ua?1/0:i}t.exports=function(t,e,r,i){var a=n(e,r,i);if(a===1/0)t=null;else{t=t||[];for(var s=0;s0;){if(d(c)128){if(0==(u=(255&h[0])-128)||u>o-s)throw new Error("Bad scanline data");for(;u-- >0;)f[s++]=h[1]}else{if(0==(u=255&h[0])||u>o-s)throw new Error("Bad scanline data");if(f[s++]=h[1],--u>0){if(m(f,s,u) 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\n\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define attribute in\n#define varying out\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n#define gl_FragColor hilo_FragData0\n#define gl_FragDepthEXT gl_FragDepth\nlayout(location = 0) out highp vec4 hilo_FragData0;"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return i})),n.d(e,"GLTFExtensions",(function(){return r})),n.d(e,"Class",(function(){return a.a})),n.d(e,"EventMixin",(function(){return s.a})),n.d(e,"Fog",(function(){return Hr})),n.d(e,"Mesh",(function(){return Br})),n.d(e,"Node",(function(){return g})),n.d(e,"SkinedMesh",(function(){return jr})),n.d(e,"Skeleton",(function(){return Yr})),n.d(e,"Stage",(function(){return gi})),n.d(e,"Tween",(function(){return Gi})),n.d(e,"version",(function(){return zr})),n.d(e,"BoxGeometry",(function(){return Vi})),n.d(e,"Geometry",(function(){return K})),n.d(e,"GeometryData",(function(){return b})),n.d(e,"MorphGeometry",(function(){return Tr})),n.d(e,"PlaneGeometry",(function(){return Yi})),n.d(e,"SphereGeometry",(function(){return qi})),n.d(e,"Camera",(function(){return L})),n.d(e,"PerspectiveCamera",(function(){return Q})),n.d(e,"OrthographicCamera",(function(){return Dn})),n.d(e,"Buffer",(function(){return kt})),n.d(e,"UniformBuffer",(function(){return Ki})),n.d(e,"capabilities",(function(){return lt})),n.d(e,"extensions",(function(){return ht})),n.d(e,"Framebuffer",(function(){return we})),n.d(e,"glType",(function(){return Ct})),n.d(e,"logGLResource",(function(){return Qi})),n.d(e,"Program",(function(){return Ft})),n.d(e,"RenderInfo",(function(){return qr})),n.d(e,"RenderList",(function(){return Jr})),n.d(e,"VertexArrayObject",(function(){return Qt})),n.d(e,"WebGLRenderer",(function(){return mi})),n.d(e,"WebGLResourceManager",(function(){return ti})),n.d(e,"WebGLState",(function(){return $r})),n.d(e,"BasicLoader",(function(){return na})),n.d(e,"CubeTextureLoader",(function(){return sa})),n.d(e,"GLTFLoader",(function(){return Xa})),n.d(e,"GLTFParser",(function(){return Ba})),n.d(e,"AliAMCExtension",(function(){return Ir})),n.d(e,"HDRLoader",(function(){return Za})),n.d(e,"KTXLoader",(function(){return $a})),n.d(e,"LoadCache",(function(){return $i})),n.d(e,"LoadQueue",(function(){return ts})),n.d(e,"ShaderMaterialLoader",(function(){return ns})),n.d(e,"TextureLoader",(function(){return is})),n.d(e,"Loader",(function(){return ia})),n.d(e,"Texture",(function(){return _e})),n.d(e,"LazyTexture",(function(){return ha})),n.d(e,"CubeTexture",(function(){return Ve})),n.d(e,"DataTexture",(function(){return qe})),n.d(e,"Shader",(function(){return It})),n.d(e,"BasicMaterial",(function(){return Sn})),n.d(e,"GeometryMaterial",(function(){return wn})),n.d(e,"Material",(function(){return Ln})),n.d(e,"PBRMaterial",(function(){return ua})),n.d(e,"semantic",(function(){return hn})),n.d(e,"ShaderMaterial",(function(){return pr})),n.d(e,"AxisHelper",(function(){return us})),n.d(e,"AxisNetHelper",(function(){return hs})),n.d(e,"CameraHelper",(function(){return _s})),n.d(e,"AmbientLight",(function(){return gs})),n.d(e,"AreaLight",(function(){return vs})),n.d(e,"DirectionalLight",(function(){return fr})),n.d(e,"CubeLightShadow",(function(){return ir})),n.d(e,"Light",(function(){return A})),n.d(e,"LightManager",(function(){return ii})),n.d(e,"LightShadow",(function(){return kn})),n.d(e,"PointLight",(function(){return sr})),n.d(e,"SpotLight",(function(){return mr})),n.d(e,"Animation",(function(){return Sa})),n.d(e,"AnimationStates",(function(){return La})),n.d(e,"MeshPicker",(function(){return Rs})),n.d(e,"Ticker",(function(){return Is})),n.d(e,"log",(function(){return m.a})),n.d(e,"Cache",(function(){return J})),n.d(e,"browser",(function(){return _i})),n.d(e,"WebGLSupport",(function(){return Ls})),n.d(e,"constants",(function(){return P.a})),n.d(e,"Color",(function(){return Os.Color})),n.d(e,"Euler",(function(){return Os.Euler})),n.d(e,"EulerNotifier",(function(){return Os.EulerNotifier})),n.d(e,"Frustum",(function(){return Os.Frustum})),n.d(e,"math",(function(){return Os.math})),n.d(e,"Matrix3",(function(){return Os.Matrix3})),n.d(e,"Matrix4",(function(){return Os.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Os.Matrix4Notifier})),n.d(e,"Plane",(function(){return Os.Plane})),n.d(e,"Quaternion",(function(){return Os.Quaternion})),n.d(e,"Ray",(function(){return Os.Ray})),n.d(e,"Sphere",(function(){return Os.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Os.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Os.Vector2})),n.d(e,"Vector3",(function(){return Os.Vector3})),n.d(e,"Vector3Notifier",(function(){return Os.Vector3Notifier})),n.d(e,"Vector4",(function(){return Os.Vector4}));var r={};n.r(r),n.d(r,"ALI_amc_mesh_compression",(function(){return Ir})),n.d(r,"WEB3D_quantized_attributes",(function(){return Or})),n.d(r,"HILO_animation_clips",(function(){return Sr})),n.d(r,"ALI_animation_clips",(function(){return yr})),n.d(r,"ALI_bounding_box",(function(){return Nr})),n.d(r,"KHR_materials_pbrSpecularGlossiness",(function(){return xr})),n.d(r,"KHR_materials_clearcoat",(function(){return Cr})),n.d(r,"KHR_lights_punctual",(function(){return br})),n.d(r,"KHR_techniques_webgl",(function(){return Pr}));var i=n(4),a=n(1),s=n(9),o=n(7),u=n(21),c=n(5),f=n(17),h=n(22),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=a.a.create({Statics:{TRAVERSE_STOP_NONE:0,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:2},Mixes:s.a,isNode:!0,className:"Node",name:"",anim:null,animationId:"",jointName:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,userData:null,onUpdate:null,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new f.a(0,0,0),this._scale=new f.a(1,1,1),this._pivot=new f.a(0,0,0),this._rotation=new h.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.skeleton&&(e.skeleton.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),e.autoUpdateChildWorldMatrix||t?0:1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(2===n||1===n)return n}for(var r=this.children,i=0,a=r.length;i1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=r?this.children:[this];n.length;){e=n,n=[];for(var i=0,a=e.length;i1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(e){if(n&&!e.pointerEnabled)return 1;if(e.isMesh){var i=e.raycast(t,!1);i&&(r=r.concat(i.map((function(t){return{mesh:e,point:t}}))))}return n&&!e.pointerChildren?1:0})),r.length?(e&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),E=n(8),v=new E.a,T=a.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},shadow:null,isDirty:!1,constructor:function(t){this.color=new E.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return v.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),A=T,M=n(23),R=new o.a,I=a.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new M.a,I.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var r=t.clone();return r.transformMat4(this.viewProjectionMatrix),e&&n&&(r.x=(r.x+1)/2*e,r.y=n-(r.y+1)/2*n),r},unprojectVector:function(t,e,n){var r=t.clone();return e&&n&&(r.x=r.x/e*2-1,r.y=1-r.y/n*2),R.invert(this.viewProjectionMatrix),r.transformMat4(R),r},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),L=I,O=n(14),S=n(12),y=n(11),N=n(20),x={2:new O.a,3:new c.a,4:new S.a,16:new o.a},C=a.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(i.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new C(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?x[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,r=this._data;n>1?e.toArray(r,t):r[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(z.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(z.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(z.fromQuat(q.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,r,i){e.setByOffset(i,n.transformMat4(t))})),Y.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,r){n.setByOffset(r,t.transformMat3(Y).normalize())}))}if(this._tangents){var r=this.tangents;r.traverse((function(t,e,n){r.setByOffset(n,t.transformMat3(Y).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var r=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,r,i){n.setByOffset(i,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+r})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,r){var i=this[t];if(!i||n>i.length){var a=new r(n);i?(a.set(i.data),i.data=a):this[t]=new b(a,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var r=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;r[n]=e[0],r[n+1]=e[1],r[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var r=this.indices.data;e.forEach((function(e){r[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var r=this.addPoints(t,e,n);this.addIndices(r,r+1,r+2)},addRect:function(t,e,n,r){var i=this.addPoints(t,e,n,r);this.addIndices(i,i+1,i+2,i,i+2,i+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,r=0;r0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new N.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new N.a({center:new c.a(e.x,e.y,e.z)}),r=this.vertices;r?n.fromGeometryData(r):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===w)if(this.indices){for(var e=this.indices.data,n=e.length,r=new Float32Array(n*t),a=this.uvs?new Float32Array(2*n):null,s=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,f=0;f2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&r&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(i.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),Z=a.a.create({Extends:L,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){Z.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,r=this.aspect,i=this.fov,a=1/Math.tan(.5*d.a.degToRad(i));if(t[0]=a/r,t[5]=a,t[11]=-1,t[15]=0,n){var s=1/(e-n);t[10]=(e+n)*s,t[14]=2*n*e*s}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new K,n=Math.tan(this.fov/2*Math.PI/180),r=this.near,i=this.far,a=r*n,s=i*n,o=this.aspect*a,u=this.aspect*s,c=[-o,-a,-r],f=[o,-a,-r],h=[o,a,-r],l=[-o,a,-r],d=[-u,-s,-i],m=[u,-s,-i],_=[u,s,-i],p=[-u,s,-i];e.addRect(d,m,_,p),e.addRect(m,f,h,_),e.addRect(f,c,l,h),e.addRect(c,d,p,l),e.addRect(p,_,h,l),e.addRect(c,f,m,d),this._geometry=e}return this._geometry}}),Q=Z,J=a.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}});function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:t;this._usedExtensions[t]=e,this.gl&&this.get(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;if(this.isWebGL2&&ut[t])return ut[t];var n=ct[t];if(n){if(this.isWebGL2)return new n.WebGL2(e);var r=this._getOriginExtension(t);return r?new n.WebGL1(r):null}return this._getOriginExtension(t)},_getOriginExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};ft.use("ANGLE_instanced_arrays","instanced"),ft.use("OES_vertex_array_object","vao"),ft.use("OES_texture_float","texFloat"),ft.use("OES_element_index_uint","uintIndices"),ft.use("EXT_shader_texture_lod","shaderTextureLod"),ft.use("EXT_frag_depth","fragDepth"),ft.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic"),ft.use("WEBGL_lose_context","loseContext"),ft.use("EXT_color_buffer_float","colorBufferFloat"),ft.use("EXT_sRGB","sRGB"),ft.use("WEBGL_draw_buffers","drawBuffers");var ht=ft,lt={isWebGL2:!1,MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,MAX_RENDERBUFFER_SIZE:void 0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:void 0,MAX_CUBE_MAP_TEXTURE_SIZE:void 0,MAX_FRAGMENT_UNIFORM_VECTORS:void 0,MAX_TEXTURE_IMAGE_UNITS:void 0,MAX_TEXTURE_SIZE:void 0,MAX_VARYING_VECTORS:void 0,MAX_VERTEX_ATTRIBS:void 0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:void 0,MAX_VERTEX_UNIFORM_VECTORS:void 0,init:function(t){var e=this;this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t);["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!ht.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!ht.texFloat,this.FRAG_DEPTH=!!ht.fragDepth,this.SHADER_TEXTURE_LOD=!!ht.shaderTextureLod,this.DRAW_BUFFERS=!!ht.drawBuffers,ht.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(ht.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var r=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],i=0;i0){n=a.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},dt=n(50),mt=n.n(dt),_t=n(51),pt=n.n(_t),gt=n(52),Et=n.n(gt),vt=n(53),Tt=n.n(vt),At=new J,Mt=new J,Rt=a.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(36),"chunk/color.vert":n(74),"chunk/color_main.vert":n(76),"chunk/diffuse.frag":n(56),"chunk/diffuse_main.frag":n(65),"chunk/extensions.frag":n(24),"chunk/extensions.vert":n(48),"chunk/fog.frag":n(43),"chunk/fog_main.frag":n(67),"chunk/frag_color.frag":n(47),"chunk/joint.vert":n(69),"chunk/joint_main.vert":n(79),"chunk/light.frag":n(40),"chunk/lightFog.frag":n(39),"chunk/lightFog.vert":n(72),"chunk/lightFog_main.frag":n(45),"chunk/lightFog_main.vert":n(82),"chunk/logDepth.frag":n(28),"chunk/logDepth_main.frag":n(29),"chunk/logDepth.vert":n(75),"chunk/logDepth_main.vert":n(83),"chunk/morph.vert":n(73),"chunk/morph_main.vert":n(78),"chunk/normal.frag":n(38),"chunk/normal.vert":n(71),"chunk/normal_main.frag":n(44),"chunk/normal_main.vert":n(81),"chunk/pbr.frag":n(85),"chunk/pbr_main.frag":n(87),"chunk/phong.frag":n(63),"chunk/phong_main.frag":n(66),"chunk/precision.frag":n(25),"chunk/precision.vert":n(49),"chunk/transparency.frag":n(42),"chunk/transparency_main.frag":n(46),"chunk/unQuantize.vert":n(68),"chunk/unQuantize_main.vert":n(77),"chunk/uv.frag":n(37),"chunk/uv.vert":n(70),"chunk/uv_main.vert":n(80),"method/encoding.glsl":n(86),"method/getDiffuse.glsl":n(58),"method/getLightAttenuation.glsl":n(60),"method/getShadow.glsl":n(62),"method/getSpecular.glsl":n(59),"method/packFloat.glsl":n(84),"method/textureEnvMap.glsl":n(41),"method/transpose.glsl":n(57),"method/unpackFloat.glsl":n(61),"basic.frag":n(50),"basic.vert":n(51),"geometry.frag":n(52),"pbr.frag":n(53),"screen.frag":n(54),"screen.vert":n(55)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return At}},headerCache:{get:function(){return Mt}},reset:function(t){At.removeAll()},getHeaderKey:function(t,e,n,r,i){var a="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(a+="_joint"+t.skeleton.jointCount),r&&(a+="_fog_"+r.mode),a+="_"+t.geometry.getShaderKey(),i&&(a+="_fogDepth"),a},getHeader:function(t,e,n,r,i){var a=this.getHeaderKey(t,e,n,r),s=Mt.get(a);if(!s||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),r&&(o.HAS_FOG=1,r.getRenderOption(o)),i&&(o.USE_LOG_DEPTH=1,lt.FRAG_DEPTH&&(o.USE_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),s="#define SHADER_NAME ".concat(e.shaderName||e.className,"\n"),s+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",Mt.add(a,s)}return s},_getCommonHeader:function(t){var e=lt.getMaxPrecision(lt.MAX_VERTEX_PRECISION,t.vertexPrecision),n=lt.getMaxPrecision(lt.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),r=lt.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(r,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,r,i,a){var s=this.getHeader(t,e,r,i,a);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,s):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,s,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var r="";e&&(r=(r=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var i=t.className+":"+r;t.onBeforeCompile&&(i+=":"+(t.shaderCacheId||t.id));var a=At.get(i);if(!a){var s="",o=pt.a;if(t.isBasicMaterial?t.isGeometryMaterial?s+=Et.a:s+=mt.a:t.isPBRMaterial&&(s+=Tt.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,s);s=u.fs,o=u.vs}if(r){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(r,");"),"gm");o=o.replace(c,"attribute $1 $2;")}a=this.getCustomShader(o,s,n,i,!0)}if(a){var f=this._getNumId(a);null!==f&&(t._shaderNumId=f)}return a},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,r,i){var a,s=this.commonHeader;return r&&(i&&(r+=":"+n),a=At.get(r)),a||(a=new Rt({vs:s+n+t,fs:s+n+e}),r&&At.add(r,a)),a}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(At.removeObject(this),this._isDestroyed=!0),this}}),It=Rt,Lt=n(55),Ot=n.n(Lt),St=n(54),yt=n.n(St),Nt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],xt={},Ct={dict:xt,init:function(t){Nt.forEach((function(e){var n,r,i=e.name,a=e.uniformFuncName,s=a+"v";"Matrix"===e.type?n=r=function(e,n){void 0!==n&&t[a](e,!1,n)}:(n=function(e,n){void 0!==n&&t[a](e,n)},r=function(e,n){t[s](e,n)}),xt[t[i]]=Object.assign(e,{glValue:t[i],uniform:n,uniformArray:r})}))},get:function(t){return xt[t]}},bt=n(106),Pt=n(107),wt=P.a.VERTEX_SHADER,Ht=new J,Dt=a.a.create({Statics:{cache:{get:function(){return Ht}},reset:function(t){Ht.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.id,i=Ht.get(r);return i||(i=new Dt({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Ht.add(r,i)),i},getBlankProgram:function(t){var e=It.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,uniformBlocks:null,program:null,gl:null,state:null,alwaysUse:!1,isWebGL2:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.uniformBlocks={},this.gl=this.state.gl,this.isWebGL2=this.state.isWebGL2,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:Dt.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),r=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&r){if(t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),t.deleteShader(n),t.deleteShader(r),!t.getProgramParameter(e,t.LINK_STATUS)){var i=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+i,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){this.isWebGL2&&(e=this._convertToGLSL300(t,e));var n=this.gl,r=n.createShader(t);if(n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){var i=n.getShaderInfoLog(r);return m.a.error("compileShaderError: "+i,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return r},_convertToGLSL300:function(t,e){return t===wt?bt+e:(Pt+e).replace(/gl_FragData\[(\d)\]/g,"hilo_FragData$1")},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),i=ht.instanced,a=function(){var r=e.getActiveAttrib(n,s),a=r.name,o=r.type,u=r.size,c=e.getAttribLocation(n,a),f=Ct.get(o),h=function(t){var n=t.type,r=void 0===n?e.FLOAT:n,i=t.normalized,a=void 0!==i&&i,s=t.stride,o=void 0===s?0:s,u=t.offset,h=void 0===u?0:u,l=t.size,d=void 0===l?f.size:l;e.vertexAttribPointer(c,d,r,a,o,h)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(i&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;i.vertexAttribDivisor(c,t)}),"Matrix"===f.type){var _=f.byteSize,p=f.size,g=Math.sqrt(p),E=4*g,v=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;v((function(e){i.vertexAttribDivisor(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:f,pointer:h,enable:l,divisor:d,addTo:m}},s=0;s1||o>1?function(t){h(c,t)}:function(t){e._dict[s]!==t&&(e._dict[s]=t,d(c,t))}})},m=0;m2&&void 0!==arguments[2]?arguments[2]:Bt;return this.createBuffer(t,Ut,e,n)},createBuffer:function(t,e,n,r){var i=n.bufferViewId,a=Vt.get(i);return a||(n.isDirty=!1,a=new Xt(t,e,n.data,r),Vt.add(i,a),a)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt;return this.createBuffer(t,Gt,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ut,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=r,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,r=this.usage;return this.bind(),e.bufferData(n,t,r),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.gl,i=this.target;return n||this.bind(),r.bufferSubData(i,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstanced(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstanced(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,r=this.indexBuffer;return this.indexType=t.type,r?t.isDirty&&(r.uploadGeometryData(t),this.vertexCount=t.length):((r=kt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=r,this.vertexCount=t.length),r},addAttribute:function(t,e,n,r){this.bind();var i=this.gl,a=e.name,s=this[a];if(!s){var o=kt.createVertexBuffer(i,t,n);o.bind(),e.enable(),e.pointer(t),s={attribute:e,buffer:o,geometryData:t},this.attributes.push(s),this[a]=s,e.addTo(this.activeStates,s),r&&r(s)}if(t.isDirty){var u=s.buffer;u.bind(),e.enable(),e.pointer(t),u.uploadGeometryData(t)}return s},addInstancedAttribute:function(t,e,n){this.bind();var r=this.gl,i=t.name,a=t.glTypeInfo,s=Wt.getTypedArray(Float32Array,e.length*a.size);e.forEach((function(t,e){void 0!==n(t)?Wt.fillArrayData(s,n(t),e*a.size):m.a.warn("no attributeData:"+i+"-"+t.name)}));var o,u=this[i];return u?(o=u.geometryData).data=s:o=new b(s,1),this.addAttribute(o,t,r.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},getResources:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.attributes&&this.attributes.forEach((function(e){t.push(e.buffer)})),this.indexBuffer&&t.push(this.indexBuffer),t},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.instancedExtension=null,this.useVao&&(this.vaoExtension.deleteVertexArray(this.vao),this.vao=null,this.vaoExtension=null),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){var n=e.attribute||{};t[n.name]=null})),this.attributes=null,this.activeStates=null,Kt.removeObject(this),this._isDestroyed=!0),this}}),Qt=Zt,Jt=P.a.TEXTURE_2D,$t=P.a.FLOAT,te=P.a.RGB,ee=P.a.RGBA,ne=P.a.RGB32F,re=P.a.RGBA32F,ie=P.a.LINEAR,ae=P.a.NEAREST,se=P.a.REPEAT,oe=P.a.CLAMP_TO_EDGE,ue=P.a.UNSIGNED_BYTE,ce=P.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,fe=P.a.UNPACK_FLIP_Y_WEBGL,he=P.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,le=P.a.BROWSER_DEFAULT_WEBGL,de=P.a.NONE,me=new J,_e=a.a.create({Statics:{cache:{get:function(){return me}},reset:function(t){me.each((function(e,n){t.deleteTexture(e),me.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Jt,internalFormat:ee,format:ee,type:ue,width:0,height:0,border:0,magFilter:ie,minFilter:ie,wrapS:se,wrapT:se,name:"",premultiplyAlpha:!1,flipY:!1,colorSpaceConversion:!0,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==ie&&this.minFilter!==ae},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==oe||this.wrapT!==oe},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,r=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),r=d.a.nextPowerOfTwo(r));var i=lt.MAX_TEXTURE_SIZE;return i&&(n>i&&(n=i),r>i&&(r=i)),{width:n,height:r}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var r=this._canvasImage;return r?(r.width=e,r.height=n,this._canvasCtx=r.getContext("2d")):((r=document.createElement("canvas")).width=e,r.height=n,this._canvasImage=r,this._canvasCtx=r.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(r.width,"x").concat(r.height),t.src),this._originImage=t,r},_glUploadTexture:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,s=t.gl,o=this.type,u=this.format,c=this.internalFormat;return this.compressed?s.compressedTexImage2D(e,r,c,i,a,this.border,n):(c=this._fixInternalFormat(t,o,u,c),n&&void 0!==n.width?s.texImage2D(e,r,c,u,this.type,n):s.texImage2D(e,r,c,i,a,this.border,u,this.type,n)),this},_fixInternalFormat:function(t,e,n,r){return t.isWebGL2?e===$t&&(n===ee?r=re:n===te&&(r=ne)):n!==r&&(r=this.format),r},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,r){e._glUploadTexture(t,e.target,n.data,r,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},_updatePixelStorei:function(){var t=this.state;t.pixelStorei(ce,this.premultiplyAlpha),t.pixelStorei(fe,!!this.flipY),t.pixelStorei(he,this.colorSpaceConversion?le:de)},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var r=this.useMipmap,i=this.useRepeat;if(this.image&&!this.image.length){if(!t.isWebGL2){var a=i||r,s=this.getSupportSize(this.image,a);this.image=this.resizeImg(this.image,s.width,s.height)}this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+lt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._uploadTexture(t),r&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=ie):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT);var o=ht.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,lt.MAX_TEXTURE_MAX_ANISOTROPY)),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var r=t.gl;t.activeTexture(r.TEXTURE0+lt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._subTextureList.forEach((function(t){var e=t[0],i=t[1],a=t[2];r.texSubImage2D(n.target,0,e,i,n.format,n.type,a)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var r=me.get(n);return r||(r=e.createTexture(),me.add(n,r),this.needUpdate=!0),this.updateTexture(t,r),this.isImageCanRelease&&this._releaseImage(),r},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),me.add(this.id,t),this},destroy:function(){var t=this.id,e=me.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),me.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),pe=P.a.FRAMEBUFFER,ge=P.a.TEXTURE_2D,Ee=P.a.RGBA,ve=P.a.UNSIGNED_BYTE,Te=P.a.COLOR_ATTACHMENT0,Ae=P.a.DEPTH_STENCIL_ATTACHMENT,Me=P.a.DEPTH_STENCIL,Re=P.a.DEPTH_TEST,Ie=P.a.CULL_FACE,Le=P.a.TRIANGLE_STRIP,Oe=P.a.NEAREST,Se=P.a.CLAMP_TO_EDGE,ye=P.a.COLOR_BUFFER_BIT,Ne=P.a.READ_FRAMEBUFFER,xe=P.a.DRAW_FRAMEBUFFER,Ce=new J,be={framebufferTarget:pe,attachment:Te,target:ge,format:Ee,internalFormat:Ee,type:ve,minFilter:Oe,magFilter:Oe,wrapS:Se,wrapT:Se},Pe=a.a.create({Statics:{ATTACHMENT_TYPE_TEXTURE:"TEXTURE",ATTACHMENT_TYPE_RENDERBUFFER:"RENDERBUFFER",cache:{get:function(){return Ce}},reset:function(t){Ce.each((function(t){t.reset()}))},destroy:function(t){Ce.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Me,framebufferTarget:be.framebufferTarget,target:be.target,format:be.format,internalFormat:be.internalFormat,type:be.type,minFilter:be.minFilter,magFilter:be.magFilter,wrapS:be.wrapS,wrapT:be.wrapT,data:null,attachment:be.attachment,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,colorAttachmentInfos:void 0,depthStencilAttachmentInfo:void 0,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),void 0===this.colorAttachmentInfos&&(this.colorAttachmentInfos=[{attachmentType:Pe.ATTACHMENT_TYPE_TEXTURE,framebufferTarget:this.framebufferTarget,target:this.target,format:this.format,internalFormat:this.internalFormat,type:this.type,minFilter:this.minFilter,magFilter:this.magFilter,wrapS:this.wrapS,wrapT:this.wrapT,data:this.data}]),void 0===this.depthStencilAttachmentInfo&&this.needRenderbuffer&&(this.depthStencilAttachmentInfo={attachmentType:Pe.ATTACHMENT_TYPE_RENDERBUFFER,framebufferTarget:this.framebufferTarget,attachment:Ae,internalFormat:Me}),Ce.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this._createAttachments(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},_createAttachments:function(){var t=this,e=this.colorAttachmentInfos,n=this.depthStencilAttachmentInfo,r=[];if(e&&e.forEach((function(e,n){var i=Te+n;switch(e.attachmentType){case Pe.ATTACHMENT_TYPE_RENDERBUFFER:t._createRenderbufferAttachment(e,i);break;case Pe.ATTACHMENT_TYPE_TEXTURE:default:t._createTextureAttachment(e,i)}r.push(i)})),n){var i=n.attachment;switch(n.attachmentType){case Pe.ATTACHMENT_TYPE_RENDERBUFFER:this._createRenderbufferAttachment(n,i);break;case Pe.ATTACHMENT_TYPE_TEXTURE:default:this._createTextureAttachment(n,i)}}r.length>1&<.DRAW_BUFFERS&&ht.drawBuffers.drawBuffers(r)},_createTextureAttachment:function(t,e){var n=this.state,r=n.gl,i=Object.assign({},be,t),a=new _e({minFilter:i.minFilter,magFilter:i.magFilter,internalFormat:i.internalFormat,format:i.format,type:i.type,width:this.width,height:this.height,image:i.data,wrapS:i.wrapS,wrapT:i.wrapT}),s=a.getGLTexture(n);return r.framebufferTexture2D(i.framebufferTarget,e,i.target,s,0),t.texture=a,e===Te&&(this.texture=a),a},_createRenderbufferAttachment:function(t,e){var n=this.gl,r=this.width,i=this.height,a=n.createRenderbuffer();return n.bindRenderbuffer(n.RENDERBUFFER,a),t.samples>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,t.samples,t.internalFormat,r,i):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,r,i),n.framebufferRenderbuffer(t.framebufferTarget||be.framebufferTarget,e,n.RENDERBUFFER,a),t.renderbuffer=a,a},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new E.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if(this._isInit){var s=this.gl,o=this.state,u=this.colorAttachmentInfos;if(!a){if(!u[0])return;a=u[0].texture}o.disable(Re),o.disable(Ie),i&&this.clear(i);var c=It.getCustomShader(Ot.a,yt.a,"","FramebufferTextureShader"),f=Ft.getProgram(c,o);f.useProgram();var h="".concat(t,"_").concat(e,"_").concat(n,"_").concat(r,"_").concat(f.id),l=Qt.getVao(s,h,{useVao:this.useVao,useInstanced:!1,mode:Le});if(l.isDirty){l.isDirty=!1;var d=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(r*=2),t+n,e-r];l.addAttribute(new b(new Float32Array(d),2),f.attributes.a_position),l.addAttribute(new b(new Float32Array([0,1,1,1,0,0,1,0]),2),f.attributes.a_texcoord0)}o.activeTexture(s.TEXTURE0),o.bindTexture(s.TEXTURE_2D,a.getGLTexture(o)),l.draw()}},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=Object(i.getTypedArrayClass)(this.type),s=new a(n*r*4);if(this._isInit){var o=this.gl;e=this.height-e-r,this.bind(),o.readPixels(t,e,n,r,this.format,this.type,s),this.unbind()}return s},copyFramebuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.init(),this._isInit){var n=this.gl,r=e.mask,i=e.filter,a=e.srcSize,s=e.dstSize;r||(r=ye),i||(i=Oe),a||(a=[0,0,t.width,t.height]),s||(s=[0,0,this.width,this.height]),n.bindFramebuffer(Ne,t.framebuffer),n.bindFramebuffer(xe,this.framebuffer),n.blitFramebuffer(a[0],a[1],a[2],a[3],s[0],s[1],s[2],s[3],r,i),n.bindFramebuffer(Ne,null),n.bindFramebuffer(xe,null)}},destroy:function(){return this._isDestroyed||(this.destroyResource(),this.gl=null,Ce.removeObject(this),this._isDestroyed=!0),this},destroyResource:function(){var t=this.gl;if(t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.colorAttachmentInfos&&this.colorAttachmentInfos.forEach((function(e){var n=e.texture,r=e.renderbuffer;e.texture=null,e.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)})),this.depthStencilAttachmentInfo)){var e=this.depthStencilAttachmentInfo,n=e.texture,r=e.renderbuffer;this.depthStencilAttachmentInfo.texture=null,this.depthStencilAttachmentInfo.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)}}}),we=Pe,He=P.a.TEXTURE_CUBE_MAP,De=P.a.RGB,Fe=P.a.LINEAR,Ue=P.a.CLAMP_TO_EDGE,Ge=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,Be=a.a.create({Extends:_e,isCubeTexture:!0,className:"CubeTexture",target:He,internalFormat:De,format:De,magFilter:Fe,minFilter:Fe,wrapS:Ue,wrapT:Ue,constructor:function(t){Be.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,r){e._glUploadTexture(t,Ge+r,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),Ve=Be,Xe=P.a.TEXTURE_2D,ke=P.a.RGBA,je=P.a.NEAREST,We=P.a.CLAMP_TO_EDGE,Ye=P.a.FLOAT,ze=a.a.create({Extends:_e,isDataTexture:!0,className:"DataTexture",target:Xe,internalFormat:ke,format:ke,type:Ye,magFilter:je,minFilter:je,wrapS:We,wrapT:We,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),r=Math.floor(n/2),a=n-r;this.width=Math.pow(2,r),this.height=Math.pow(2,a),this.DataClass=Object(i.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ze.superclass.constructor.call(this,t)}}),qe=ze;function Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1),lt.SHADER_TEXTURE_LOD&&this.enableTextureLod&&(e.USE_SHADER_TEXTURE_LOD=1),lt.DRAW_BUFFERS&&this.enableDrawBuffers&&(e.USE_DRAW_BUFFERS=1);var r=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,r.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),r.add(this.parallaxMap,"PARALLAX_MAP"),r.add(this.emission,"EMISSION_MAP"),r.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),r.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var r=this.uvTypes,i=this.option,a=t.uv||0;r[a]=1,i[e]=a,t.isCubeTexture&&(i["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var r in e)-1!==t.indexOf(Number(r))?n["HAS_TEXCOORD".concat(r)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(r,")"),"uv_".concat(r," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var r=this.getUniformInfo(n);r.isDependMesh&&!r.notSupportInstanced&&t.push({name:n,info:r})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=hn[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=In),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),On=a.a.create({Extends:Ln,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new E.a(.5,.5,.5),this.specular=new E.a(1,1,1),this.emission=new E.a(0,0,0),On.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};On.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var r=this.diffuse;return r&&r.isTexture&&(r.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),Sn=On,yn=P.a.POSITION,Nn=P.a.NORMAL,xn=P.a.DEPTH,Cn=P.a.DISTANCE,bn=P.a.NONE,Pn=a.a.create({Extends:Sn,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:yn,lightType:bn,writeOriginData:!1,constructor:function(t){Pn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Pn.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case yn:t.HAS_FRAG_POS=1;break;case Nn:t.HAS_NORMAL=1;break;case xn:break;case Cn:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),wn=Pn,Hn=a.a.create({Extends:L,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){Hn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new K,n=[this.left,this.bottom,-this.near],r=[this.right,this.bottom,-this.near],i=[this.right,this.top,-this.near],a=[this.left,this.top,-this.near],s=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(s,o,u,c),e.addRect(o,r,i,u),e.addRect(r,n,a,i),e.addRect(n,s,c,a),e.addRect(c,u,i,a),e.addRect(n,r,o,s),this._geometry=e}return this._geometry}}),Dn=Hn,Fn=P.a.DEPTH,Un=P.a.BACK,Gn=null,Bn=new E.a(1,1,1),Vn=new o.a,Xn=function(t){return t.material.castShadows},kn=a.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new we(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),Vn.multiply(this.camera.viewMatrix,t.worldMatrix);var r=n.getBounds(Vn);this.camera.near=-r.zMax,this.camera.far=-r.zMin,this.camera.left=r.xMin,this.camera.right=r.xMax,this.camera.bottom=r.yMin,this.camera.top=r.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new Dn:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),(this.light.isDirty||this._cameraMatrixVersion!==t.matrixVersion)&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion,this.light.isDirty=!1)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Gn||(Gn=new wn({vertexType:Fn,side:Un,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(Bn),r.updateViewProjectionMatrix(),hn.setCamera(r),e.forceMaterial=Gn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),hn.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){Xn(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return Xn(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),jn=P.a.DISTANCE,Wn=P.a.BACK,Yn=P.a.TEXTURE_CUBE_MAP,zn=P.a.TEXTURE0,qn=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,Kn=P.a.NEAREST,Zn=P.a.FRAMEBUFFER,Qn=P.a.FRAMEBUFFER_COMPLETE,Jn=null,$n=new E.a(0,0,0,0),tr=new c.a,er=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],nr=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},rr=a.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:kn,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){rr.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new we(this.renderer,{target:Yn,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new Ve({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:Kn,minFilter:Kn,width:1024,height:1024});return t.checkFramebufferStatus(Zn)!==Qn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(Zn)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,r=this.texture.getGLTexture(e);e.activeTexture(zn+lt.MAX_TEXTURE_INDEX),e.bindTexture(this.target,r),n.framebufferTexture2D(Zn,this.attachment,qn+t,r,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Jn||(Jn=new wn({vertexType:jn,side:Wn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(r.position);for(var i=0;i<6;i++)n.bindTexture(i),tr.fromArray(er[0],3*i).add(r.position),r.up.fromArray(er[1],3*i),r.lookAt(tr),r.updateViewProjectionMatrix(),e.clear($n),hn.setCamera(r),e.forceMaterial=Jn,this.renderShadowScene(e);r.matrix.identity(),r.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),hn.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){nr(e,n)&&t.renderMesh(e)}),(function(e){var r=e.filter((function(t){return nr(t,n)}));t.renderInstancedMeshes(r)}))}}),ir=rr,ar=a.a.create({Extends:A,isPointLight:!0,className:"PointLight",constructor:function(t){ar.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new ir({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),sr=ar,or=new o.a,ur=new c.a,cr=a.a.create({Extends:A,isDirectionalLight:!0,className:"DirectionalLight",constructor:function(t){this.direction=new c.a(0,0,1),cr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new kn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return ur.copy(this.direction).transformDirection(this.worldMatrix).normalize(),ur},getViewDirection:function(t){var e=t.getModelViewMatrix(this,or);return ur.copy(this.direction).transformDirection(e).normalize(),ur}}),fr=cr,hr=new o.a,lr=new c.a,dr=a.a.create({Extends:A,isSpotLight:!0,className:"SpotLight",_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),dr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new kn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return lr.copy(this.direction).transformDirection(this.worldMatrix).normalize(),lr},getViewDirection:function(t){var e=t.getModelViewMatrix(this,hr);return lr.copy(this.direction).transformDirection(e).normalize(),lr}}),mr=dr,_r=a.a.create({Extends:Ln,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){_r.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(_r.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),pr=_r,gr=n(15),Er=n.n(gr),vr=a.a.create({Extends:K,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){vr.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return K.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vr.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(i.each)(this.targets,(function(n,r){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===r?e.MORPH_HAS_POSITION=1:"normals"===r?e.MORPH_HAS_NORMAL=1:"tangents"===r&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Tr=vr,Ar={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Mr={Geometry:K,GeometryData:b};var Rr={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Rr.useAuto?Er.a.initWASM(Rr.wasmURL,Rr.memPages):Rr.useWebWorker?Er.a.initWorker(Rr.workerURL):Rr.useWASM?Er.a.initWASM(Rr.wasmURL,Rr.memPages):Promise.resolve()},parse:function(t,e,n,r){var i=Date.now(),a=e.bufferViews[t.bufferView],s=Rr.wasmURL,o=Rr.workerURL,u=Rr.useAuto,c=Rr.useWASM,f=Rr.useWebWorker,h=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);function l(e){Rr._decodeTotalTime+=Date.now()-i;var n=e.toHilo3dGeometry(Mr,r.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var r=new Tr;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&"id"!==i&&(r[i]=n[i]);r.targets={},n=r}for(var a=n.targets,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),Dr=n(16),Fr=new Dr.a,Ur=new o.a,Gr=a.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){Gr.superclass.constructor.call(this,t)},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,r=this.material,i=this.worldMatrix;if(n&&r){Ur.invert(i),Fr.copy(t),Fr.transformMat4(Ur);var a=n.raycast(Fr,r.side,e);if(a)return a.forEach((function(t){t.transformMat4(i)})),a}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},isDestroyed:{get:function(){return this._isDestroyed}},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager;return n.destroyMesh(this),this.material&&e&&this.material.destroyTextures(),this.off(),this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),Br=Gr,Vr=new o.a,Xr=new o.a,kr=a.a.create({Extends:Br,isSkinedMesh:!0,className:"SkinedMesh",useInstanced:!1,jointMatTexture:null,frustumTest:!1,skeleton:null,constructor:function(t){kr.superclass.constructor.call(this,t)},getJointMat:function(){var t=this;if(this.skeleton&&!(this.skeleton.jointCount<=0)){var e=this.skeleton.jointNodeList,n=this.skeleton.inverseBindMatrices,r=16*this.skeleton.jointCount;return this.jointMat&&this.jointMat.length===r||(this.jointMat=new Float32Array(r)),this.clonedFrom?Xr.invert(this.clonedFrom.worldMatrix):Xr.invert(this.worldMatrix),e.forEach((function(e,r){Vr.copy(Xr),Vr.multiply(e.worldMatrix),Vr.multiply(n[r]),Vr.toArray(t.jointMat,16*r)})),this.jointMat}},resetJointNamesByNodeName:function(t){this.skeleton.resetJointNamesByNodeName(t)},resetSkinIndices:function(t){var e=this.skeleton;if(e){var n=this.geometry,r=n.skinIndices;if(r){this.material.isDirty=!0,n.isDirty=!0,r.isDirty=!0;var i=new S.a;r.traverse((function(n,a,s){n.elements.forEach((function(n,r){var a=e.jointNames[n],s=t.jointNames.indexOf(a);s>=0?i.elements[r]=s:m.a.warnOnce("SkinedMesh.resetSkinIndices","SkinedMesh.resetSkinIndices: no jointName found!",a)})),r.setByOffset(s,i)}))}}},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new qe({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=Br.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,skeleton:this.skeleton.clone()}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};kr.superclass.getRenderOption.call(this,t);var e=this.skeleton.jointCount;if(e&&(t.JOINT_COUNT=e,lt.VERTEX_TEXTURE_FLOAT)){var n=(lt.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),jr=kr,Wr=a.a.create({isSkeleton:!0,className:"Skeleton",userData:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.jointNodeList=[],this.jointNames=[],this.inverseBindMatrices=[],Object.assign(this,t)},jointCount:{get:function(){return this.jointNodeList.length}},_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,t&&this._initJointNodeList()}},_initJointNodeList:function(){var t={};this.rootNode.traverse((function(e){t[e.jointName]=e})),this.jointNodeList=this.jointNames.map((function(e){return t[e]}))},resetJointNamesByNodeName:function(t){var e=this.jointNames;this.jointNodeList.forEach((function(n,r){var i=t.rootNode.getChildByName(n.name);i&&(e[r]=i.jointName)}))},clone:function(t){var e=new Wr;return e.copy(this,t),e},copy:function(t,e){return this.inverseBindMatrices=t.inverseBindMatrices,this.jointNames=t.jointNames.slice(),void 0===e&&(e=t.rootNode),this.rootNode=e,this}}),Yr=Wr,zr="1.18.0",qr=a.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),Kr=new c.a,Zr=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;if(n!==r)return n-r;var i=t.material._shaderNumId||0,a=e.material._shaderNumId||0;return i!==a?i-a:t._sortRenderZ-e._sortRenderZ},Qr=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;return n!==r?n-r:e._sortRenderZ-t._sortRenderZ},Jr=a.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var r in n){var i=n[r];i.length>2&&e?e(i):i.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(Qr),this.opaqueList.sort(Zr)},addMesh:function(t,e){var n=t.material,r=t.geometry;if(n&&r){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var i=this.instancedDict,a=n.id+"_"+r.id,s=i[a];i[a]||(s=i[a]=[]),s.push(t)}else t.worldMatrix.getTranslation(Kr),Kr.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=Kr.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),$r=a.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,isWebGL2:!1,constructor:function(t){this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t),this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,r){this.set4("colorMask",t,e,n,r)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,r){this.set4("blendFuncSeparate",t,e,n,r)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,r){this.set4("viewport",t,e,n,r)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n||(r[0]=e,r[1]=n,this.gl[t](e,n))},set3:function(t,e,n,r){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n&&i[2]===r||(i[0]=e,i[1]=n,i[2]=r,this.gl[t](e,n,r))},set4:function(t,e,n,r,i){var a=this._dict[t];a||(a=this._dict[t]=[]),a[0]===e&&a[1]===n&&a[2]===r&&a[3]===i||(a[0]=e,a[1]=n,a[2]=r,a[3]=i,this.gl[t](e,n,r,i))},get:function(t){return this._dict[t]}}),ti=a.a.create({Mixes:s.a,className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){this._needDestroyResources=[],this._meshDict={},Object.assign(this,t)},destroyMesh:function(t){var e=this;this.getMeshResources(t).forEach((function(t){e.destroyIfNoRef(t)})),delete this._meshDict[t.id]},getMeshResources:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._meshDict[t.id];return n&&n.forEach((function(t){e.push(t),t.getResources&&t.getResources(e)})),e},addMeshResources:function(t,e){var n=t.id,r=this._meshDict;r[n]||(r[n]=[]);var i=r[n];e.forEach((function(t){-1===i.indexOf(t)&&i.push(t)}))},destroyIfNoRef:function(t){var e=this._needDestroyResources;return t&&e.indexOf(t)<0&&e.push(t),this},getUsedResources:function(t){var e=this,n=[];return t&&t.traverse((function(t){t.isMesh&&!t.isDestroyed&&e.getMeshResources(t,n)})),n},destroyUnsuedResource:function(t){var e=this,n=this._needDestroyResources;if(0===n.length)return this;var r=this.getUsedResources(t);return n.forEach((function(t){r.indexOf(t)<0&&t&&t.destroy&&!t.alwaysUse&&(e.fire("destroyResource",t.id),t.destroy())})),this.reset(),this},reset:function(){return this._needDestroyResources.length=0,this}}),ei=new o.a,ni=new c.a,ri=new Float32Array([0,0,0]),ii=a.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.each)(this.lightInfo,(function(n,r){if("uid"!==r&&n){e[r]=n;var i=t.getShadowMapCount(r);i&&(e[r+"_SMC"]=i)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(r.push(o.lightShadow.framebuffer.texture),i.push(o.lightShadow.width),i.push(o.lightShadow.height),s.push(o.lightShadow.minBias,o.lightShadow.maxBias),ei.copy(t.worldMatrix),ei.premultiply(o.lightShadow.camera.viewProjectionMatrix),ei.toArray(a,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return r.length&&(o.shadowMap=r,o.shadowMapSize=new Float32Array(i),o.shadowBias=new Float32Array(s),o.lightSpaceMatrix=new Float32Array(a)),o},getSpotInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[],c=[],f=[];this.spotLights.forEach((function(h,l){var d=3*l;h.getRealColor().toRGBArray(e,d),h.toInfoArray(n,d),h.getViewDirection(t).toArray(i,d),f.push(h.range),a.push(h._cutoffCos,h._outerCutoffCos),t.getModelViewMatrix(h,ei),ei.getTranslation(ni),ni.toArray(r,d),h.shadow&&h.lightShadow&&(s.push(h.lightShadow.framebuffer.texture),o.push(h.lightShadow.width),o.push(h.lightShadow.height),c.push(h.lightShadow.minBias,h.lightShadow.maxBias),ei.multiply(h.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),ei.toArray(u,16*l))}));var h={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),dirs:new Float32Array(i),cutoffs:new Float32Array(a),ranges:new Float32Array(f)};return s.length&&(h.shadowMap=s,h.shadowMapSize=new Float32Array(o),h.shadowBias=new Float32Array(c),h.lightSpaceMatrix=new Float32Array(u)),h},getPointInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[];this.pointLights.forEach((function(c,f){var h=3*f;c.getRealColor().toRGBArray(e,h),c.toInfoArray(n,h),u.push(c.range),t.getModelViewMatrix(c,ei),ei.getTranslation(ni),ni.toArray(r,h),c.shadow&&c.lightShadow&&(i.push(c.lightShadow.framebuffer.texture),s.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(a,16*f),o[2*f]=c.lightShadow.camera.near,o[2*f+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),ranges:new Float32Array(u)};return i.length&&(c.shadowMap=i,c.shadowBias=new Float32Array(s),c.lightSpaceMatrix=new Float32Array(a),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,r=[],i=[],a=[],s=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(r,c),t.getModelViewMatrix(o,ei),ei.getTranslation(ni),ni.toArray(i,c);var f=ei.getRotation();ei.fromQuat(f),ni.set(.5*o.width,0,0),ni.transformMat4(ei),ni.toArray(a,c),ni.set(0,.5*o.height,0),ni.transformMat4(ei),ni.toArray(s,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(r),poses:new Float32Array(i),width:new Float32Array(a),height:new Float32Array(s),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return ri[0]=ri[1]=ri[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();ri[0]+=e.r,ri[1]+=e.g,ri[2]+=e.b})),ri[0]=Math.min(1,ri[0]),ri[1]=Math.min(1,ri[1]),ri[2]=Math.min(1,ri[2]),ri},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,r=this.directionalLights,i=this.pointLights,a=this.spotLights,s=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=i.length,e.DIRECTIONAL_LIGHTS=r.length,e.SPOT_LIGHTS=a.length,e.AREA_LIGHTS=s.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=i.filter(o).length,e.SHADOW_SPOT_LIGHTS=a.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=r.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo(),this.updateCustomInfo&&this.updateCustomInfo(this,t)},updateCustomInfo:null,getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),ai=P.a.DEPTH_TEST,si=P.a.STENCIL_TEST,oi=P.a.SAMPLE_ALPHA_TO_COVERAGE,ui=P.a.CULL_FACE,ci=P.a.FRONT_AND_BACK,fi=P.a.BLEND,hi=P.a.LINES,li=P.a.STATIC_DRAW,di=P.a.DYNAMIC_DRAW,mi=a.a.create({Mixes:s.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,forceMaterial:null,isInitFailed:!1,_isInit:!1,_isContextLost:!1,isWebGL2:!1,preferWebGL2:!1,constructor:function(t){this.clearColor=new E.a(1,1,1),Object.assign(this,t),this.renderInfo=new qr,this.renderList=new Jr,this.lightManager=new ii,this.resourceManager=new ti},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var r=this.domElement;this.width=t,this.height=e,r.width=t,r.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,r){var i=this.state,a=this.gl;i&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=a.drawingBufferWidth),void 0===r&&(r=a.drawingBufferHeight),i.viewport(t,e,n,r))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};if(!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0),this.preferWebGL2)try{this.gl=this.domElement.getContext("webgl2",e),this.isWebGL2=!0}catch(t){this.isWebGL2=!1,this.gl=null}this.gl||(this.gl=this.domElement.getContext("webgl",e),this.isWebGL2=!1);var n=this.gl;n.viewport(0,0,this.width,this.height),Ct.init(n),ht.init(n),lt.init(n),It.init(this),this.state=new $r(n),ht.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,this.useFramebuffer&&(this.framebuffer=new we(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){var e=this.gl;this._isContextLost=!0,t.preventDefault(),Ft.reset(e),It.reset(e),_e.reset(e),kt.reset(e),Qt.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null,this.fire("webglContextLost")},_onContextRestore:function(t){var e=this.gl;this._isContextLost=!1,ht.reset(e),we.reset(e),this.fire("webglContextRestored")},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(ai),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(ai)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(oi):e.disable(oi)},setupCullFace:function(t){var e=this.state;e.frontFace(t.frontFace),t.cullFace&&t.cullFaceType!==ci?(e.enable(ui),e.cullFace(t.cullFaceType)):e.disable(ui)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(fi),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(fi)},setupStencil:function(t){if(this.stencil){var e=this.state;t.stencilTest?(e.enable(si),e.stencilMask(t.stencilMask),e.stencilFunc(t.stencilFunc,t.stencilFuncRef,t.stencilFuncMask),e.stencilOp(t.stencilOpFail,t.stencilOpZFail,t.stencilOpZPass)):e.disable(si)}},setupUniforms:function(t,e,n,r){var i=this.forceMaterial||e.material;if(this.isWebGL2){var a=i.uniformBlocks;for(var s in t.uniformBlocks){var o=a[s];o&&(t[s]=o)}}for(var u in t.uniforms){var c=i.getUniformInfo(u),f=t.uniforms[u];if(!c.isBlankInfo&&(r||c.isDependMesh&&!n)){var h=c.get(e,i,f);null!=h&&(t[u]=h)}}},setupVao:function(t,e,n){var r=n.geometry,i=r.isStatic;if(t.isDirty||!i||r.isDirty){t.isDirty=!1;var a=this.forceMaterial||n.material,s=a.attributes,o=i?li:di;for(var u in s){var c=e.attributes[u];if(c){var f=a.getAttributeData(u,n,c);null!=f&&t.addAttribute(f,c,o)}}r.indices&&t.addIndexBuffer(r.indices,o),r.isDirty=!1}r.vertexCount&&(t.vertexCount=r.vertexCount)},setupMaterial:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.forceMaterial||e.material;(i.isDirty||this._lastMaterial!==i)&&(this.setupDepthTest(i),this.setupSampleAlphaToCoverage(i),this.setupCullFace(i),this.setupBlend(i),this.setupStencil(i),r=!0),this.setupUniforms(t,e,n,r),i.isDirty=!1,this._lastMaterial=i},setupMesh:function(t,e){var n=this.gl,r=this.state,i=this.lightManager,a=this.resourceManager,s=t.geometry,o=this.forceMaterial||t.material,u=It.getShader(t,o,e,i,this.fog,this.useLogDepth),c=Ft.getProgram(u,r);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&s.mode!==hi&&s.convertToLinesMode();var f=s.id+c.id,h=Qt.getVao(n,f,{useInstanced:e,useVao:this.useVao,mode:s.mode});return this.setupVao(h,c,t),a.addMeshResources(t,[h,u,c]),{vao:h,program:c,geometry:s}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var r=this.renderList,i=this.renderInfo,a=this.lightManager,s=this.resourceManager,o=this.state;this.fog=t.fog,a.reset(),i.reset(),r.reset(),hn.init(this,o,e,a,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?r.addMesh(t,e):t.isLight&&a.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),r.sort(),a.createShadowMap(this,e),a.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),s.destroyUnsuedResource(t)}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),n.depthMask(!0);var r=e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT;this.stencil&&(n.stencilMask(!0),r|=e.STENCIL_BUFFER_BIT),e.clear(r)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},clearStencil:function(){var t=this.gl;this.state.stencilMask(!0),t.clear(t.STENCIL_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,r=this.setupMesh(e,!0),i=r.vao,a=r.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,r=e.info,s=a.attributes[n];s&&i.addInstancedAttribute(s,t,(function(t){return r.get(t)}))})),i.drawInstance(t.length),this.addRenderInfo(i.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(Ft.reset(t),It.reset(t),kt.reset(t),Qt.reset(t),this.state.reset(t),_e.reset(t),we.destroy(t))}}),_i=function(){var t,e=navigator.userAgent,n=document,r=window,i=n.documentElement,a={iphone:/iphone/i.test(e),ipad:/ipad/i.test(e),ipod:/ipod/i.test(e),ios:/iphone|ipad|ipod/i.test(e),android:/android/i.test(e),webkit:/webkit/i.test(e),chrome:/chrome/i.test(e),safari:/safari/i.test(e),firefox:/firefox/i.test(e),ie:/msie/i.test(e),opera:/opera/i.test(e),supportTouch:"ontouchstart"in r,supportCanvas:!!n.createElement("canvas").getContext,supportStorage:void 0,supportOrientation:"orientation"in r||"orientation"in r.screen,supportDeviceMotion:"ondevicemotion"in r};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),a.supportStorage=!0}catch(t){a.supportStorage=!1,m.a.warn("LocalStorage disabled")}t=a.webkit||a.firefox?"webkit":a.opera?"o":a.ie?"ms":"",a.jsVendor=t;var s=a.cssVendor="-"+t+"-";try{var o=n.createElement("div"),u=o.style,c=void 0!==u[t+"Transform"],f=void 0!==u[t+"Perspective"];f&&(o.id="test3d",(u=n.createElement("style")).textContent="@media ("+s+"transform-3d){#test3d{height:3px}}",n.head.appendChild(u),i.appendChild(o),f=3===o.offsetHeight,n.head.removeChild(u),i.removeChild(o)),a.supportTransform=c,a.supportTransform3D=f}catch(t){a.supportTransform=!1,a.supportTransform3D=!1}var h=a.supportTouch,l=h?"touchstart":"mousedown",d=h?"touchmove":"mousemove",_=h?"touchend":"mouseup";return a.POINTER_START=l,a.POINTER_MOVE=d,a.POINTER_END=_,a}(),pi=a.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,width:0,height:0,canvas:null,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}pi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat(zr))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new mi(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,r){if(void 0===n&&(n=this.pixelRatio),r||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var i=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,r),i.style.width=this.width+"px",i.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,r){return this.resize(n,r,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.canvas,i=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?r.addEventListener(t,i,!1):r.removeEventListener(t,i)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,r=t.type,i=0===r.indexOf("touch"),a=t;if(i){var s=t.touches,o=t.changedTouches;s&&s.length?a=s[0]:o&&o.length&&(a=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(a.pageX||a.clientX)-u.left,f=(a.pageY||a.clientY)-u.top;t.stageX=c,t.stageY=f,t.stopPropagation=function(){this._stopPropagationed=!0};var h=this.getMeshResultAtPoint(c,f,!0),l=h.mesh;t.hitPoint=h.point;var d="mouseout"===r;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===r?m="touchout":"mousemove"!==r&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==r&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!i){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}_i.android&&"touchmove"===r&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(i.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.camera,i=this._ray;i||(i=this._ray=new Dr.a),i.fromCamera(r,t,e,this.width,this.height);var a=this.raycast(i,!0,n);if(a)return a[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var s=this._stageResultAtPoint.point;return s.copy(r.unprojectVector(s.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return pi.superclass.destroy.call(this,this.renderer),this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),gi=pi;function Ei(){return+new Date}var vi=a.a.create({constructor:function(t,e,n,r){var i=this;for(var a in i.target=t,i._startTime=0,i._seekTime=0,i._pausedTime=0,i._pausedStartTime=0,i._reverseFlag=1,i._repeatCount=0,3===arguments.length&&(r=n,n=e,e=null),r)i[a]=r[a];i._fromProps=e,i._toProps=n,!r.duration&&r.time&&(i.duration=r.time||0,i.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,r=t||e,i=this._fromProps={},a=this._toProps={};for(var s in t=t||n,e=e||n,r)a[s]=e[s]||0,n[s]=i[s]=t[s]||0;return this},start:function(){var t=this;return t._startTime=Ei()+t.delay,t._seekTime=0,t._pausedTime=0,t._reverseFlag=1,t._repeatCount=0,t.paused=!1,t.isStart=!1,t.isComplete=!1,vi.add(t),t},stop:function(){return vi.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=Ei(),this},resume:function(){var t=this;return t.paused=!1,t._pausedStartTime&&(t._pausedTime+=Ei()-t._pausedStartTime),t._pausedStartTime=0,t},seek:function(t,e){var n=this,r=Ei();return n._startTime=r,n._seekTime=t,n._pausedTime=0,void 0!==e&&(n.paused=e),n._update(r,!0),vi.add(n),n},link:function(t){var e,n,r=t.delay,i=this._startTime;return"string"==typeof r&&(e=0===r.indexOf("+"),n=0===r.indexOf("-"),r=e||n?Number(r.substr(1))*(e?1:-1):Number(r)),t.delay=r,t._startTime=e||n?i+this.duration+r:i+r,this._next=t,vi.remove(t),t},_render:function(t){var e=this.target,n=this._fromProps;for(var r in n)e[r]=n[r]+(this._toProps[r]-n[r])*t},_update:function(t,e){var n=this;if(n.paused&&!e)return!1;if(n.isComplete)return!0;var r=t-n._startTime-n._pausedTime+n._seekTime;if(r<0)return!1;var i,a=r/n.duration;a<=0?a=0:a>=1&&(a=1);var s=n.ease?n.ease(a):a;n.reverse&&n.isStart&&(n._reverseFlag<0&&(a=1-a,s=1-s),a<1e-7&&(n.repeat>0&&n._repeatCount++>=n.repeat||0===n.repeat&&!n.loop?n.isComplete=!0:(n._startTime=Ei(),n._pausedTime=0,n._reverseFlag*=-1))),n.isStart||(n.setProps(n._fromProps,n._toProps),n.isStart=!0,n.onStart&&n.onStart.call(n,n)),n.time=r,n._render(s),(i=n.onUpdate)&&i.call(n,s,n),a>=1&&(n.reverse?(n._startTime=Ei(),n._pausedTime=0,n._reverseFlag*=-1):n.loop||n.repeat>0&&n._repeatCount++0&&u<=t?(o._render(a),o.time=r,vi.add(o)):n.isComplete&&(u<0||u>t)&&o.start()}return!!n.isComplete&&((i=n.onComplete)&&i.call(n,n),!0)},Statics:{_tweens:[],tick:function(){var t,e,n=vi._tweens,r=n.length;for(e=0;e-1&&r.splice(e,1);else for(e=0;e1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Bi.superclass._raycast.call(this,t,e)}}),Vi=Bi,Xi=P.a.FRONT,ki=P.a.BACK,ji=[0,0,1],Wi=a.a.create({Extends:K,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){Wi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),r=this.width/t,i=this.height/e,a=new Float32Array(3*n),s=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,f=0;f<=e;f++)for(var h=0;h<=t;h++){var l=f*(t+1)+h;if(a[3*l]=h*r-this.width/2,a[3*l+1]=this.height/2-f*i,s[3*l]=0,s[3*l+1]=0,s[3*l+2]=1,o[2*l]=h/t,o[2*l+1]=1-f/e,f0||n<0))return null;if(e===ki&&(r<0||n>0))return null;var i=t.intersectsPlane(ji,0);if(i){var a=i.x,s=i.y,o=.5*this.width,u=.5*this.height;if(a>=-o&&a<=o&&s>=-u&&s<=u)return[i]}return null}}),Yi=Wi,zi=a.a.create({Extends:K,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){zi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,r=(n+1)*(e+1),i=n*e,a=new Float32Array(3*r),s=new Float32Array(4*r),o=new Float32Array(2*r),u=new Uint16Array(6*i),c=0,f=0,h=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,E=_*g,v=Math.cos(E)*t,T=Math.sin(E)*t,A=0;A<=n;A++){var M=A/n,R=m*M,I=Math.cos(R),L=Math.sin(R),O=I*T,S=L*T,y=L,N=-I;if(s[h++]=y,s[h++]=0,s[h++]=N,s[h++]=1,a[f++]=O,a[f++]=v,a[f++]=S,o[l++]=M,o[l++]=g,p>0&&A>0){var x=d,C=x-1,P=C-n-1,w=x-n-1;u[c++]=P,u[c++]=w,u[c++]=x,u[c++]=P,u[c++]=x,u[c++]=C}d++}this.vertices=new b(a,3),this.indices=new b(u,1),this.uvs=new b(o,2),this.tangents=new b(s,4),this.normals=new b(new Float32Array(a),3)},_raycast:function(t,e){return zi.superclass._raycast.call(this,t,e)}}),qi=zi,Ki=a.a.create({className:"UniformBuffer",isUniformBuffer:!0,isDirty:!1,data:{get:function(){return this._data},set:function(t){this._data=t,this.isDirty=!0}},_data:null,_buffer:null,constructor:function(t){this.data=t},getBuffer:function(t){return this._buffer||(this._buffer=new kt(t,t.UNIFORM_BUFFER,null,t.DYNAMIC_DRAW)),this.isDirty&&(this._buffer.bufferData(this.data),this.isDirty=!1),this._buffer},destroy:function(){this._buffer&&(this._buffer.destroy(),this._buffer=null),this.isDirty=!0}}),Zi=[It,Ft,kt,Qt,_e,we],Qi=function(){var t="";return Zi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t),t},Ji=a.a.create({Mixes:s.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var r={key:t,state:e,data:n};this._files[t]=r,this.fire("update",r),this.fire("update:".concat(r.key),r)}},get:function(t){return this.enabled?this._files[t]:null},getLoaded:function(t){var e=this.get(t);return e&&e.state===Ji.LOADED?e.data:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Ji.LOADED?Promise.resolve(t.data):t.state===Ji.FAILED?Promise.reject():new Promise((function(n,r){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Ji.LOADED?n(e.data):e.state===Ji.FAILED&&r(e.data)}),!0)})):Promise.reject()}}),$i=Ji,ta=new $i,ea=a.a.create({Mixes:s.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:ta,enalbeCache:function(){ta.enabled=!0},disableCache:function(){ta.enabled=!1},deleteCache:function(t){ta.remove(t)},clearCache:function(){ta.clear()},cache:{get:function(){return ta},set:function(){m.a.warn("BasicLoader.cache is readonly!")}},TYPE_IMAGE:"img",TYPE_JSON:"json",TYPE_BUFFER:"buffer",TYPE_TEXT:"text"},load:function(t){var e=t.src,n=t.type;if(!n){var r=Object(i.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(r)&&(n="img"),n||(n=t.defaultType)}return n===ea.TYPE_IMAGE?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,r=new Uint8Array(n),i=0;i=300)r(new TypeError("Network request failed for ".concat(a.status)));else{var e="response"in a?a.response:a.responseText;if(t.type===ea.TYPE_JSON)try{e=JSON.parse(e)}catch(t){return void r(new TypeError("JSON.parse error"+t))}n(e)}},a.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request timed out"))},a.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(a.withCredentials=!0),t.type===ea.TYPE_BUFFER&&(a.responseType="arraybuffer"),Object(i.each)(t.headers,(function(t,e){a.setRequestHeader(e,t)})),a.send(t.body||null)}))}}),na=ea,ra=a.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){ra._loaderClassMap[t]=e},getLoader:function(t){if(!ra._loaders[t]){var e=ra._loaderClassMap[t]?ra._loaderClassMap[t]:na;ra._loaders[t]=new e}return ra._loaders[t]}},preHandlerUrl:null,load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(i.getExtension)(t.src),r=ra.getLoader(n),a=t;return this.preHandlerUrl&&((a=Object.assign({},t)).src=this.preHandlerUrl(t.src)),r.load(a)}}),ia=ra,aa=a.a.create({Extends:na,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){aa.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new Ve(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});ia.addLoader("CubeTexture",aa);var sa=aa,oa=a.a.create({Extends:Ln,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnvMap:null,isSpecularEnvMapIncludeMipmaps:!1,emission:null,emissionFactor:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,clearcoatFactor:0,clearcoatMap:null,clearcoatRoughnessFactor:0,clearcoatRoughnessMap:null,clearcoatNormalMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new E.a(1,1,1),this.specular=new E.a(1,1,1),this.emissionFactor=new E.a(0,0,0),oa.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_emissionFactor:"EMISSIONFACTOR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3",u_clearcoatFactor:"CLEARCOATFACTOR",u_clearcoatRoughnessFactor:"CLEARCOATROUGHNESSFACTOR"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP",u_clearcoatMap:"CLEARCOATMAP",u_clearcoatRoughnessMap:"CLEARCOATROUGHNESSMAP",u_clearcoatNormalMap:"CLEARCOATNORMALMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oa.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),lt.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),this.specularEnvMap&&this.isSpecularEnvMapIncludeMipmaps&&(t.IS_SPECULAR_ENV_MAP_INCLUDE_MIPMAPS=1),this.clearcoatFactor>0&&(t.HAS_CLEARCOAT=1,t.HAS_NORMAL=1,this.clearcoatMap&&e.add(this.clearcoatMap,"CLEARCOAT_MAP"),this.clearcoatNormalMap&&e.add(this.clearcoatNormalMap,"CLEARCOAT_NORMAL_MAP"),this.clearcoatRoughnessMap&&e.add(this.clearcoatRoughnessMap,"CLEARCOAT_ROUGHNESS_MAP")),e.update(),t}}),ua=oa,ca=new Image;ca.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var fa=a.a.create({Extends:_e,Mixes:s.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),fa.superclass.constructor.call(this,t),this.image=this.placeHolder||ca},load:function(t){var e=this;return fa.loader=fa.loader||new ia,fa.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),fa.superclass._releaseImage.call(this)}}),ha=fa,la=n(13);function da(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ma(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;r--)Ma[r]=t[r]+n*(e[r]-t[r]);return Ma}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,r){var a=t.length/3;if(void 0===e)return 1===a?t[1]:t.slice(a,-a);var s=t[1],o=t[2],u=e[1],c=e[0];return a>1&&(s=t.slice(a,-a),o=t.slice(-a),u=e.slice(a,-a),c=e.slice(0,a)),s.hermite?s.hermite(s,o.scale(r),u,c.scale(r),n):s.isQuaternion?(s.fromArray(this._cubicSpline(s.elements,o.elements,u.elements,c.elements,r,n),0,!0),s.normalize(!0)):(Object(i.isArrayLike)(s)||(s=[s],o=[o],u=[u],c=[c]),s=this._cubicSpline(s,o,u,c,r,n)),s},_cubicSpline:function(t,e,n,r,i,a){var s=a*a,o=s*a,u=2*o-3*s+1,c=o-2*s+a,f=-2*o+3*s,h=o-s;Ma.length=0;for(var l=t.length-1;l>=0;l--)Ma[l]=t[l]*u+c*e[l]*i+n[l]*f+h*r[l]*i;return Ma}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ia.StateType[t]||Ia._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ia._extraStateHandlers.type[String(t).toUpperCase()]=t,Ia._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){var e=Object(i.getIndexFromSortedArray)(this.keyTime,t,Ra);return e[0]<0&&(e[0]=0),e[1]>=this.keyTime.length&&(e[1]=this.keyTime.length-1),e},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=da(this.findIndexByTime(t),2),n=e[0],r=e[1],a=this.keyTime[n],s=this.keyTime[r],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===r){var u=this.interpolation(o);return this.type===Ia.StateType.ROTATION&&(u=_a.fromEuler(Aa.fromArray(u))),u.elements||u}var c=this.getStateByIndex(r),f=s-a,h=(t-a)/f;this.type===Ia.StateType.ROTATION?Object(i.isArrayLike)(o[0])?(o[0]=_a.fromEuler(Aa.fromArray(o[0])),o[1]=pa.fromEuler(Aa.fromArray(o[1])),o[2]=ga.fromEuler(Aa.fromArray(o[2])),c[0]=Ea.fromEuler(Aa.fromArray(c[0])),c[1]=va.fromEuler(Aa.fromArray(c[1])),c[2]=Ta.fromEuler(Aa.fromArray(c[2]))):(o=_a.fromEuler(Aa.fromArray(o)),c=pa.fromEuler(Aa.fromArray(c))):this.type===Ia.StateType.QUATERNION&&(Object(i.isArrayLike)(o[0])?(o[0]=_a.fromArray(o[0]),o[1]=pa.fromArray(o[1]),o[2]=ga.fromArray(o[2]),c[0]=Ea.fromArray(c[0]),c[1]=va.fromArray(c[1]),c[2]=Ta.fromArray(c[2])):(o=_a.fromArray(o),c=pa.fromArray(c)));var l=this.interpolation(o,c,h,f);return l.elements||l},interpolation:function(t,e,n,r){return Ia.interpolation[this.interpolationType](t,e,n,r)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],r=e.length;e=e.slice();for(var i=0;ie[a]){var o=e[a];e[a]=e[s],e[s]=o,o=n[a],n[a]=n[s],n[s]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ia.StateType.ROTATION&&(n=Ia.StateType.QUATERNION);var r=this.getState(t);if(r){var i="updateNode"+n;this[i]?this[i](e,r):Ia._extraStateHandlers.handler[n]?Ia._extraStateHandlers.handler[n].call(this,e,r):m.a.warnOnce(i,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),La=Ia,Oa=a.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:s.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this._initNodeNameMap()}},_animStatesList:null,animStatesList:{get:function(){return this._animStatesList},set:function(t){this._animStatesList=t,this._initClipTime()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.clips={},this._animStatesList=[],Object.assign(this,t)},addClip:function(t,e,n,r){this.clips[t]={start:e,end:n,animStatesList:r}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},_initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=0,this.clipEndTime=t.endTime},_initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var r=this.clips[t];r?(n=r.start,e=r.end,r.animStatesList&&(this.animStatesList=r.animStatesList,this._initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Oa._anims.push(this)},stop:function(){this.paused=!0;var t=Oa._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Sa=Oa;function ya(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Na(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Na(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},i.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Ga.extensionHandlers[t]},parseExtension:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t[e],a=this.getExtensionHandler(e);return a&&a.parse?a.parse(i,this,n,r):n},parseExtensions:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.each(t,(function(t,i){if(!r.ignoreExtensions||!r.ignoreExtensions[i]){var a=n.getExtensionHandler(i),s=r.methodName||"parse";a&&a[s]&&(e=a[s](t,n,e,r))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),r=n.getUint32(4,!0),a=n.getUint32(8,!0),s=12;if(r<2){var o=n.getUint32(s,!0);e=new Uint8Array(t,20,o),e=i.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==r)throw new Error("Dont support glTF version ".concat(r));for(;sa*i.BYTES_PER_ELEMENT)s.array=new i(s.buffer,s.byteOffset,s.byteLength/i.BYTES_PER_ELEMENT),r=new b(s.array,a,{offset:n.byteOffset||0,stride:s.byteStride,bufferViewId:s.id});else{var u,c=(n.byteOffset||0)+s.byteOffset;if(c%i.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new i(s.buffer.slice(c,c+o*i.BYTES_PER_ELEMENT));else u=new i(s.buffer,c,o);r=new b(u,a)}return n.sparse&&(r||(r=new b(new i(o),a)),r=this.sparseAccessorHandler(r,n.sparse)),r=this.parseExtensions(n.extensions,r,{isDecode:e,isAccessor:!0}),n.data=r,n.normalized&&(r.normalized=!0),r},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var r=this.getAccessorData(t,e);if(!r.stride&&!r.offset&&1===r.size)return r.data;var i=[];return r.traverse((function(t){i.push(t.toArray?t.toArray():t)})),n.array=i,i},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case xa:e.blend=!0;break;case Ca:e.depthTest=!0;break;case ba:e.cullFace=!0}})),i.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Pa?wa:Pa:e.side=Ha)},createMorphGeometry:function(t,e){var n=this,r=new Tr,a=r.targets={};return i.each(t.targets,(function(t){i.each(t,(function(t,e){var r=Ua[e].name;a[r]||(a[r]=[]);var i=n.getAccessorData(t,!0);a[r].push(i)}))})),r.weights=e||new Float32Array(t.targets.length),r},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var r=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(r)return r.mode=n,r}t||(t=new K({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var i=e.attributes;for(var a in i){var s=Ua[a];if(s){var o=!(this.isUnQuantizeInShader&&s.decodeMatName);t[s.name]=this.getAccessorData(i[a],o),o||(t[s.decodeMatName]=t[s.name].decodeMat,delete t[s.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(a,"!"))}return t},handlerSkinedMesh:function(t,e){e&&(t.skeleton=e,this.useInstanced&&(t.useInstanced=!0))},fixProgressiveGeometry:function(t,e){t._geometry=e,this.isProgressive&&t._meshes&&t._meshes.forEach((function(t){t.visible=!0,t.geometry=e}))},parseGeometries:function(){var t=this,e=i.serialRun(this.json.meshes,(function(e){return i.serialRun(e.primitives,(function(n){var r;n.targets&&n.targets.length&&(r=t.createMorphGeometry(n,e.weights)),n._geometry=r;var i=t.handlerGeometry(r,n);return i&&i.then?i.then((function(e){t.fixProgressiveGeometry(n,e)}),(function(t){m.a.error("geometry parse error",t)})):(t.fixProgressiveGeometry(n,i),i)}))}));return this.isProgressive?null:e},parseMesh:function(t,e,n){var r=this,i=this.json.meshes[t];i.primitives.forEach((function(a){var s,o=r.skins&&r.skins[n.skin];if(a.meshNode)s=a.meshNode.clone();else{var u=r.materials[a.material]||new Sn;s=new(o?jr:Br)({geometry:a._geometry,material:u,name:"mesh-"+(i.name||t)}),a.meshNode=s}r.handlerSkinedMesh(s,o),r.isProgressive&&!s.geometry&&(s.visible=!1,a._meshes=a._meshes||[],a._meshes.push(s)),e.addChild(s),r.meshes.push(s)}))},parseCameras:function(){var t=this;this.cameras={};var e=window.innerWidth/window.innerHeight;i.each(this.json.cameras,(function(n,r){var i;"perspective"===n.type&&n.perspective?((i=new Q).fov=d.a.radToDeg(n.perspective.yfov),i.near=n.perspective.znear,i.far=n.perspective.zfar,n.aspectRatio?i.aspect=n.aspectRatio:i.aspect=e):"orthographic"===n.type&&n.orthographic&&((i=new Dn).near=n.orthographic.znear,i.far=n.orthographic.zfar,i.right=n.orthographic.xmag,i.left=-1*i.right,i.top=n.orthographic.ymag,i.bottom=-1*i.top),(i=t.parseExtensions(n.extensions,i,{isCamera:!0}))&&(i.name=n.name||r,t.cameras[r]=i)}))},handlerNodeTransform:function(t,e){e.matrix?t.matrix.fromArray(e.matrix):(e.rotation&&t.quaternion.fromArray(e.rotation),e.scale&&t.setScale(e.scale[0],e.scale[1],e.scale[2]),e.translation&&(t.x=e.translation[0],t.y=e.translation[1],t.z=e.translation[2]))},parseNode:function(t,e){var n,r=this,i=this.json.nodes[t];i||m.a.warn("GLTFParser.parseNode: nodes[".concat(t,"] has nothing.")),n=new g({name:i.name,animationId:t}),n=this.parseExtensions(i.extensions,n,{isNode:!0}),"camera"in i&&this.cameras[i.camera]&&n.addChild(this.cameras[i.camera]),this.handlerNodeTransform(n,i),i.jointName?(n.jointName=i.jointName,this.jointMap[n.jointName]=n):this.isGLTF2&&(n.jointName=t,this.jointMap[t]=n),i.meshes?i.meshes.forEach((function(t){return r.parseMesh(t,n,i)})):"mesh"in i&&this.parseMesh(i.mesh,n,i),i.children&&i.children.forEach((function(t){return r.parseNode(t,n)})),e.addChild(n)},parseAnimations:function(){var t=this;if(!this.json.animations)return null;var e=this.isMultiAnim,n={},r=[],a={};return i.each(this.json.animations,(function(i){i.channels.forEach((function(e){var n=e.target.path,s=e.target.id;t.isGLTF2&&(s=e.target.node);var o=i.samplers[e.sampler],u=t.isGLTF2?o.input:i.parameters[o.input],c=t.isGLTF2?o.output:i.parameters[n],f=t.getArrayByAccessor(u,!0),h=t.getArrayByAccessor(c,!0);"rotation"===n&&(n="quaternion");var l=new La({interpolationType:o.interpolation||"LINEAR",nodeName:s,keyTime:f,states:h,type:La.getType(n)});r.push(l),a[s]=!0})),e&&r.length&&(n[i.name]={animStatesList:r},r=[])})),e&&Object.keys(n).length>0&&(r=Object.values(n)[0].animStatesList),r.length?new Sa({rootNode:this.node,animStatesList:r,validAnimationIds:a,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};var n=e.nodes;this.parseSkins(),n.forEach((function(e){return t.parseNode(e,t.node)})),this.resetSkinInfo(this.node);var r={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),r.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,r,{isGlobal:!0,methodName:"parseOnEnd"}),r},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null},parseSkins:function(){var t=this;this.skins=[];var e=this.json.skins;e&&e.length&&(this.skins=e.map((function(e){for(var n=new Yr,r=e.joints.length,i=t.getArrayByAccessor(e.inverseBindMatrices,!0),a=0;a ",t)}return null}))}});ia.addLoader("hdr",Ka);var Za=Ka,Qa=a.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var r=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===r[0]&&75===r[1]&&84===r[2]&&88===r[3]&&32===r[4]&&49===r[5]&&49===r[6]&&187===r[7]&&13===r[8]&&10===r[9]&&26===r[10]&&10===r[11]){var i=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.arrayBuffer,this.baseOffset+12,13*i),s=a.getUint32(0,!0),o=67305985===s;this.glType=a.getUint32(1*i,o),this.glTypeSize=a.getUint32(2*i,o),this.glFormat=a.getUint32(3*i,o),this.glInternalFormat=a.getUint32(4*i,o),this.glBaseInternalFormat=a.getUint32(5*i,o),this.pixelWidth=a.getUint32(6*i,o),this.pixelHeight=a.getUint32(7*i,o),this.pixelDepth=a.getUint32(8*i,o),this.numberOfArrayElements=a.getUint32(9*i,o),this.numberOfFaces=a.getUint32(10*i,o),this.numberOfMipmapLevels=a.getUint32(11*i,o),this.bytesOfKeyValueData=a.getUint32(12*i,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=Qa.COMPRESSED_2D:this.loadType=Qa.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=Qa.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,i=this.pixelHeight,a=t?this.numberOfMipmapLevels:1,s=0;s2&&void 0!==arguments[2]?arguments[2]:0,r=new Qa(e,1,n),i={compressed:0===r.glType,type:r.glType,width:r.pixelWidth,height:r.pixelHeight,internalFormat:r.glInternalFormat,format:r.glFormat,isCubemap:6===r.numberOfFaces};return r.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(i.width,i.height))+1)?(i.mipmaps=r.mipmaps(!0),i.image=i.mipmaps[0].data):(i.mipmaps=null,i.image=r.mipmaps(!1)[0].data),new _e(i)}});ia.addLoader("ktx",Ja);var $a=Ja,ts=a.a.create({Mixes:s.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),ia.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.renderer.pixelRatio,a=[],s=this.framebuffer.readPixels(t*i,e*i,n*i,r*i),o=0;o=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var r=n.slice(0),i=0,a=r.length;i=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(r){e.removeTick(n),t(r)}};return e.addTick(n),n},timeout:function(t,e){var n=this,r=(new Date).getTime()+e,i={tick:function(){(new Date).getTime()-r>=0&&(n.removeTick(i),t())}};return n.addTick(i),i},interval:function(t,e){var n=(new Date).getTime()+e,r={tick:function(){var r=(new Date).getTime(),i=r-n;i>=0&&(i0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=a*s),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=s+r*(n[2]-s),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,a,s,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(a=2*r.RANDOM()-1)*a+(s=2*r.RANDOM()-1)*s}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*a*c,t[3]=e*s*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*s,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2],c=n[3],h=c*r+o*a-u*i,f=c*i+u*r-s*a,l=c*a+s*i-o*r,d=-s*r-o*i-u*a;return t[0]=h*c+d*-s+f*-u-l*-o,t[1]=f*c+d*-o+l*-s-h*-u,t[2]=l*c+d*-u+h*-o-f*-s,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-h)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+a*a)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function f(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],u=e[2];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-u)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function a(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function s(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function l(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=a,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=a*u-i*o,t[3]=s*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-a*o,t[1]=i*u+s*o,t[2]=a*u+r*o,t[3]=s*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=a*u+s*o,t[3]=s*u-a*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=f,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),a=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=a*Math.sin(2*Math.PI*n),t[1]=a*Math.cos(2*Math.PI*n),t[2]=s*Math.sin(2*Math.PI*i),t[3]=s*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*n+r*r+i*i+a*a,o=s?1/s:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=a*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),h=Math.cos(r);return t[0]=a*u*h-s*o*c,t[1]=s*o*h+a*u*c,t[2]=s*u*c-a*o*h,t[3]=s*u*h+a*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),a=o(n(2)),s=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*h+s*o+i*c-a*u,t[1]=i*h+s*u+a*o-r*c,t[2]=a*h+s*c+r*u-i*o,t[3]=s*h-r*o-i*u-a*c,t}function f(t,e,n,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=a*c+s*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>r.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-i)*d)/_,g=Math.sin(i*d)/_):(p=1-i,g=i),t[0]=p*a+g*c,t[1]=p*s+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+s]-e[3*s+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}e.clone=s.clone,e.fromValues=s.fromValues,e.copy=s.copy,e.set=s.set,e.add=s.add,e.mul=h,e.scale=s.scale,e.dot=s.dot,e.lerp=s.lerp;var d=e.length=s.length,m=(e.len=d,e.squaredLength=s.squaredLength),_=(e.sqrLen=m,e.normalize=s.normalize);e.exactEquals=s.exactEquals,e.equals=s.equals,e.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,i,s){var o=a.dot(i,s);return o<-.999999?(a.cross(t,e,i),a.len(t)<1e-6&&a.cross(t,n,i),a.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,s),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,_(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,a,s,o){return f(t,r,s,o),f(e,i,a,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,a,s,o,u,c,h,f,l,d,m,_,p){var g=new r.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=i,g[4]=a,g[5]=s,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,r,i,a,s,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,R=i*c-a*u,I=h*_-f*m,L=h*p-l*m,O=h*g-d*m,S=f*p-l*_,y=f*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*O-M*L+R*I;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(i*y-r*N-a*S)*x,t[2]=(_*R-p*M+g*A)*x,t[3]=(l*M-f*R-d*A)*x,t[4]=(u*O-s*N-c*L)*x,t[5]=(n*N-i*O+a*L)*x,t[6]=(p*T-m*R-g*v)*x,t[7]=(h*R-l*T+d*v)*x,t[8]=(s*y-o*O+c*I)*x,t[9]=(r*O-n*y-a*I)*x,t[10]=(m*M-_*T+g*E)*x,t[11]=(f*T-h*M-d*E)*x,t[12]=(o*L-s*S-u*I)*x,t[13]=(n*S-r*L+i*I)*x,t[14]=(_*v-m*A-p*E)*x,t[15]=(h*A-f*v+l*E)*x,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(r*(l*g-d*p)-f*(i*g-a*p)+_*(i*d-a*l)),t[2]=r*(u*g-c*p)-o*(i*g-a*p)+_*(i*c-a*u),t[3]=-(r*(u*d-c*l)-o*(i*d-a*l)+f*(i*c-a*u)),t[4]=-(s*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(i*g-a*p)+m*(i*d-a*l),t[6]=-(n*(u*g-c*p)-s*(i*g-a*p)+m*(i*c-a*u)),t[7]=n*(u*d-c*l)-s*(i*d-a*l)+h*(i*c-a*u),t[8]=s*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(r*g-a*_)+m*(r*d-a*f)),t[10]=n*(o*g-c*_)-s*(r*g-a*_)+m*(r*c-a*o),t[11]=-(n*(o*d-c*f)-s*(r*d-a*f)+h*(r*c-a*o)),t[12]=-(s*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(r*p-i*_)+m*(r*l-i*f),t[14]=-(n*(o*p-u*_)-s*(r*p-i*_)+m*(r*u-i*o)),t[15]=n*(o*l-u*f)-s*(r*l-i*f)+h*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*s-n*a)*(f*p-l*_)-(e*o-r*a)*(h*p-l*m)+(e*u-i*a)*(h*_-f*m)+(n*o-r*s)*(c*p-l*d)-(n*u-i*s)*(c*_-f*d)+(r*u-i*o)*(c*m-h*d)},e.multiply=a,e.translate=function(t,e,n){var r=n[0],i=n[1],a=n[2],s=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*a+e[12],t[13]=e[1]*r+e[5]*i+e[9]*a+e[13],t[14]=e[2]*r+e[6]*i+e[10]*a+e[14],t[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(s=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=s*r+h*i+m*a+e[12],t[13]=o*r+f*i+_*a+e[13],t[14]=u*r+l*i+p*a+e[14],t[15]=c*r+d*i+g*a+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var a,s,o,u,c,h,f,l,d,m,_,p,g,E,v,T,A,M,R,I,L,O,S,y,N=i[0],x=i[1],C=i[2],b=Math.sqrt(N*N+x*x+C*C);return b0?(n[0]=2*(c*u+l*i+h*o-f*a)/d,n[1]=2*(h*u+l*a+f*i-c*o)/d,n[2]=2*(f*u+l*o+c*a-h*i)/d):(n[0]=2*(c*u+l*i+h*o-f*a),n[1]=2*(h*u+l*a+f*i-c*o),n[2]=2*(f*u+l*o+c*a-h*i)),s(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],s=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+s*s+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],a=e[1],s=e[2],o=e[3],u=i+i,c=a+a,h=s+s,f=i*u,l=i*c,d=i*h,m=a*c,_=a*h,p=s*h,g=o*u,E=o*c,v=o*h,T=r[0],A=r[1],M=r[2];return t[0]=(1-(m+p))*T,t[1]=(l+v)*T,t[2]=(d-E)*T,t[3]=0,t[4]=(l-v)*A,t[5]=(1-(f+p))*A,t[6]=(_+g)*A,t[7]=0,t[8]=(d+E)*M,t[9]=(_-g)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var a=e[0],s=e[1],o=e[2],u=e[3],c=a+a,h=s+s,f=o+o,l=a*c,d=a*h,m=a*f,_=s*h,p=s*f,g=o*f,E=u*c,v=u*h,T=u*f,A=r[0],M=r[1],R=r[2],I=i[0],L=i[1],O=i[2],S=(1-(_+g))*A,y=(d+T)*A,N=(m-v)*A,x=(d-T)*M,C=(1-(l+g))*M,b=(p+E)*M,P=(m+v)*R,w=(p-E)*R,D=(1-(l+_))*R;return t[0]=S,t[1]=y,t[2]=N,t[3]=0,t[4]=x,t[5]=C,t[6]=b,t[7]=0,t[8]=P,t[9]=w,t[10]=D,t[11]=0,t[12]=n[0]+I-(S*I+x*L+P*O),t[13]=n[1]+L-(y*I+C*L+w*O),t[14]=n[2]+O-(N*I+b*L+D*O),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,h=r*s,f=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,a,s){var o=1/(n-e),u=1/(i-r),c=1/(a-s);return t[0]=2*a*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(s+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*a*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var a=1/Math.tan(e/2),s=void 0;return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(r-i),t[10]=(i+r)*s,t[14]=2*i*r*s):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(s+o),c=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(s-o)*u*.5,t[9]=(i-a)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,a,s){var o=1/(e-n),u=1/(r-i),c=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(s+a)*c,t[15]=1,t},e.lookAt=function(t,e,n,a){var s=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],E=e[2],v=a[0],T=a[1],A=a[2],M=n[0],R=n[1],I=n[2];return Math.abs(p-M)0&&(h*=d=1/Math.sqrt(d),f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=i,t[13]=a,t[14]=s,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],E=t[15],v=e[0],T=e[1],A=e[2],M=e[3],R=e[4],I=e[5],L=e[6],O=e[7],S=e[8],y=e[9],N=e[10],x=e[11],C=e[12],b=e[13],P=e[14],w=e[15];return Math.abs(n-v)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(s-M)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-R)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(R))&&Math.abs(u-I)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-L)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(h-O)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(f-S)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-N)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(m-x)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(_-C)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(C))&&Math.abs(p-b)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(b))&&Math.abs(g-P)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(E-w)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(w))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function a(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],E=e[15],v=n[0],T=n[1],A=n[2],M=n[3];return t[0]=v*r+T*o+A*f+M*_,t[1]=v*i+T*u+A*l+M*p,t[2]=v*a+T*c+A*d+M*g,t[3]=v*s+T*h+A*m+M*E,v=n[4],T=n[5],A=n[6],M=n[7],t[4]=v*r+T*o+A*f+M*_,t[5]=v*i+T*u+A*l+M*p,t[6]=v*a+T*c+A*d+M*g,t[7]=v*s+T*h+A*m+M*E,v=n[8],T=n[9],A=n[10],M=n[11],t[8]=v*r+T*o+A*f+M*_,t[9]=v*i+T*u+A*l+M*p,t[10]=v*a+T*c+A*d+M*g,t[11]=v*s+T*h+A*m+M*E,v=n[12],T=n[13],A=n[14],M=n[15],t[12]=v*r+T*o+A*f+M*_,t[13]=v*i+T*u+A*l+M*p,t[14]=v*a+T*c+A*d+M*g,t[15]=v*s+T*h+A*m+M*E,t}function s(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=r+r,u=i+i,c=a+a,h=r*o,f=r*u,l=r*c,d=i*u,m=i*c,_=a*c,p=s*o,g=s*u,E=s*c;return t[0]=1-(d+_),t[1]=f+E,t[2]=l-g,t[3]=0,t[4]=f-E,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=a,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,a,s,o,u,c){var h=new r.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=i,h[4]=a,h[5]=s,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,r,i,a,s,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*s-o*c,l=-h*a+o*u,d=c*a-s*u,m=n*f+r*l+i*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*r+i*c)*m,t[2]=(o*r-i*s)*m,t[3]=l*m,t[4]=(h*n-i*u)*m,t[5]=(-o*n+i*a)*m,t[6]=d*m,t[7]=(-c*n+r*u)*m,t[8]=(s*n-r*a)*m,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=s*h-o*c,t[1]=i*c-r*h,t[2]=r*o-i*s,t[3]=o*u-a*h,t[4]=n*h-i*u,t[5]=i*a-n*o,t[6]=a*c-s*u,t[7]=r*u-n*c,t[8]=n*s-r*a,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=t[6],u=t[7],c=t[8];return e*(c*a-s*u)+n*(-c*i+s*o)+r*(u*i-a*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=u,t[6]=l*r+d*s+c,t[7]=l*i+d*o+h,t[8]=l*a+d*u+f,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*r+l*s,t[1]=d*i+l*o,t[2]=d*a+l*u,t[3]=d*s-l*r,t[4]=d*o-l*i,t[5]=d*u-l*a,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n+n,o=r+r,u=i+i,c=n*s,h=r*s,f=r*o,l=i*s,d=i*o,m=i*u,_=a*s,p=a*o,g=a*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],E=n*o-r*s,v=n*u-i*s,T=n*c-a*s,A=r*u-i*o,M=r*c-a*o,R=i*c-a*u,I=h*_-f*m,L=h*p-l*m,O=h*g-d*m,S=f*p-l*_,y=f*g-d*_,N=l*g-d*p,x=E*N-v*y+T*S+A*O-M*L+R*I;return x?(x=1/x,t[0]=(o*N-u*y+c*S)*x,t[1]=(u*O-s*N-c*L)*x,t[2]=(s*y-o*O+c*I)*x,t[3]=(i*y-r*N-a*S)*x,t[4]=(n*N-i*O+a*L)*x,t[5]=(r*O-n*y-a*I)*x,t[6]=(_*R-p*M+g*A)*x,t[7]=(p*T-m*R-g*v)*x,t[8]=(m*M-_*T+g*E)*x,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],E=e[6],v=e[7],T=e[8];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-E)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(h-v)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(f-T)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],E=n[6],v=n[7],T=n[8];return t[0]=l*r+d*s+m*c,t[1]=l*i+d*o+m*h,t[2]=l*a+d*u+m*f,t[3]=_*r+p*s+g*c,t[4]=_*i+p*o+g*h,t[5]=_*a+p*u+g*f,t[6]=E*r+v*s+T*c,t[7]=E*i+v*o+T*h,t[8]=E*a+v*u+T*f,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=a,e.multiply=s,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],s=Math.sin(r),o=Math.cos(r);return t[0]=i*o-a*s+n[0],t[1]=i*s+a*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));var o=i*i+a*a;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*a)*s*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],a=e[0],s=e[1];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=a,e.mul=s,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=i();return function(e,n,r,i,a,s){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,a=e[2]/n,s=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=r*o+i*u+a*c+s*h;t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=(o-r*f)/n,t[5]=(u-i*f)/n,t[6]=(c-a*f)/n,t[7]=(h-s*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],E=e[7];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-_)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-E)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))};var r=s(n(0)),i=s(n(3)),a=s(n(4));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],a=.5*n[2],s=e[0],o=e[1],u=e[2],c=e[3];return t[0]=s,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-a*o,t[5]=i*c+a*s-r*u,t[6]=a*c+r*o-i*s,t[7]=-r*s-i*o-a*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],E=n[3];return t[0]=r*E+s*_+i*g-a*p,t[1]=i*E+s*p+a*_-r*g,t[2]=a*E+s*g+r*p-i*_,t[3]=s*E-r*_-i*p-a*g,t[4]=r*h+s*o+i*c-a*u+f*E+m*_+l*g-d*p,t[5]=i*h+s*u+a*o-r*c+l*E+m*p+d*_-f*g,t[6]=a*h+s*c+r*u-i*o+d*E+m*g+f*p-l*_,t[7]=s*h-r*o-i*u-a*c+m*E-f*_-l*p-d*g,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var h=e.dot=i.dot,f=e.length=i.length,l=(e.len=f,e.squaredLength=i.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,a,s){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=a,o[5]=s,o},e.set=function(t,e,n,r,i,a,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],u=n*a-r*i;return u?(u=1/u,t[0]=a*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-a*s)*u,t[5]=(r*s-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=r*h+a*c,t[1]=i*h+s*c,t[2]=r*-c+a*h,t[3]=i*-c+s*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r*c,t[1]=i*c,t[2]=a*h,t[3]=s*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=r*c+a*h+o,t[5]=i*c+s*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=a,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-f)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=r*c+a*h,t[1]=i*c+s*h,t[2]=r*f+a*l,t[3]=i*f+s*l,t[4]=r*d+a*m+o,t[5]=i*d+s*m+u,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],s=n*a-i*r;return s?(s=1/s,t[0]=a*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=r*-o+a*u,t[3]=i*-o+s*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=a*u,t[3]=s*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=a,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(s-h)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],a=e[2],s=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*o+a*u,t[1]=i*o+s*u,t[2]=r*c+a*h,t[3]=i*c+s*h,t}function a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=d(n(0)),i=d(n(9)),a=d(n(8)),s=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=a,e.mat3=s,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var r=function(){var t,e;try{t=Object.defineProperty,e=Object.defineProperties,t({},"$",{value:0})}catch(n){"__defineGetter__"in Object&&(t=function(t,e,n){return"value"in n&&(t[e]=n.value),"get"in n&&t.__defineGetter__(e,n.get),"set"in n&&t.__defineSetter__(e,n.set),t},e=function(e,n){for(var r in n)n.hasOwnProperty(r)&&t(e,r,n[r]);return e})}var n=function(t){for(var n=1,r=arguments.length;n>1,s=n(t[a],e);if(0===s)return[a,a];s<0?r=a+1:i=a-1}return r>i?[i,r]:[r,i]}function E(t,e,n){var r=g(t,e,n);t.splice(r[1],0,e)}function v(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var A,M,R=(a(A={},o,Int8Array),a(A,u,Uint8Array),a(A,c,Int16Array),a(A,h,Uint16Array),a(A,f,Uint32Array),a(A,l,Float32Array),M=A,function(t){return M[t]||Float32Array});function I(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function P(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),a=n(1),s=n(5),o=n(9),u=new s.a,c=new s.a,h=a.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,a,s,o,u,c,h,f,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],h=n[1],f=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,E=o*d-h*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(E=o*d-h*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new h),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var r=n(1),i=n(11),a=n(4),s=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;s.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(a.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(a.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=s},function(t,e,n){"use strict";var r=n(0),i=n(10),a=n(1),s=new i.a,o=a.a.create({className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t){return r.quat.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.quat.set(this.elements,t,e,n,i),this},identity:function(){return r.quat.identity(this.elements),this},rotationTo:function(t,e){return r.quat.rotationTo(this.elements,t.elements,e.elements),this},setAxes:function(t,e,n){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),this},setAxisAngle:function(t,e){return r.quat.setAxisAngle(this.elements,t.elements,e),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e){return r.quat.lerp(this.elements,this.elements,t.elements,e),this},slerp:function(t,e){return r.quat.slerp(this.elements,this.elements,t.elements,e),this},sqlerp:function(t,e,n,i,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),this},invert:function(){return r.quat.invert(this.elements,this.elements),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this},fromMat4:function(t){return s.fromMat4(t),this.fromMat3(s),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t){var e=.5*t.x,n=.5*t.y,r=.5*t.z,i=t.order||"ZYX",a=Math.sin(e),s=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),h=Math.cos(r),f=this.elements;return"XYZ"===i?(f[0]=a*u*h+s*o*c,f[1]=s*o*h-a*u*c,f[2]=s*u*c+a*o*h,f[3]=s*u*h-a*o*c):"YXZ"===i?(f[0]=a*u*h+s*o*c,f[1]=s*o*h-a*u*c,f[2]=s*u*c-a*o*h,f[3]=s*u*h+a*o*c):"ZXY"===i?(f[0]=a*u*h-s*o*c,f[1]=s*o*h+a*u*c,f[2]=s*u*c+a*o*h,f[3]=s*u*h-a*o*c):"ZYX"===i?(f[0]=a*u*h-s*o*c,f[1]=s*o*h+a*u*c,f[2]=s*u*c-a*o*h,f[3]=s*u*h+a*o*c):"YZX"===i?(f[0]=a*u*h+s*o*c,f[1]=s*o*h+a*u*c,f[2]=s*u*c-a*o*h,f[3]=s*u*h-a*o*c):"XZY"===i&&(f[0]=a*u*h-s*o*c,f[1]=s*o*h-a*u*c,f[2]=s*u*c+a*o*h,f[3]=s*u*h+a*o*c),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});o.prototype.mul=o.prototype.multiply,o.prototype.len=o.prototype.length,o.prototype.sqrLen=o.prototype.squaredLength,e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,a,s,o,u,c){return r.mat3.set(this.elements,t,e,n,i,a,s,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var a=Math.cos(t),s=Math.sin(t);return this.set(r*a,-i*s,0,r*s,i*a,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(7),s=n(3),o=new a.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,h=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],a=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(a,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(a,r))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(a,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):s.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return i(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,r){return r-e-n+t}},{key:"depp",value:function(t,e,n,r){return e+n-t+r}},{key:"ATTR",get:function(){return s}},{key:"ATTR_NAME_ID",get:function(){return u}}]),i(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){s[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a=0;c--)o[u+c]=n.apply(null,i.map((function(t){return s[t*r.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=a.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=a.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var r=c[e.name];r&&(e.data.BYTES_PER_ELEMENT?n[r]=new t.GeometryData(e.data,e.itemCount):n[r]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),r=e.attributes,i=0;for(var a in r.POSITION&&(i=r.POSITION.length/3),r)if(s[a]){var o=f[s[a]];i&&(o=r[a].length/i),n.addAttr(s[a],r[a],o)}else console.warn("Dont support attribute",a);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var r in h)e[r]&&n.addAttr(h[r],e[r].data,e[r].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function r(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,i){var a=r(i),s=n-e;return Math.round((t-e)/s*a)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,i=r(e),a=1/0,s=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,s=t.length,o=r(a),u=i-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=t.length,s=r(e),o=i-n,u=new Float32Array(a),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var r=c[n[3]].read(t,e+4);return r.geometry.type=n[3],r.geometry}(t,e))}var f,l=null,d=null;function m(t,e){return!l&&o()?(l=new s({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===f||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var r=new XMLHttpRequest;r.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)f=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));f=new Worker(t)}f.onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)})),r.addEventListener("error",(function(t){return n(t)})),r.open("get",t,!0),r.send()})):new Promise((function(e,n){(f=new Worker(t)).onerror=function(t){console.log("web worker init error",t),f=!1,n(t)},e(f)})))}var E=0;function v(t,e,n,i){return e=e&&o(),t=new Uint8Array(t),g(i).then((function(i){return new Promise((function(a,s){var o=E++,u=function(e){if(e.data.id===o)if(i.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=r,n.__proto__=r.prototype,a(n)}else a(h(t))};i.addEventListener("message",u),i.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(r){return e?_(t,n):h(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var r=o();return!r||t.byteLength>1048576?v(t,r,e,n):r?Promise.resolve(_(t,e)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:v,destory:function(){f&&(f.terminate(),f=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex,i=this.currentVertex-n+1,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r,r=i,e[this.prevCorner(t[a])]=i++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,r=this.currentVertex-n+1,i=r,a=n-1;a>=0;a--)e[this.nextCorner(t[a])]=r++,e[this.prevCorner(t[a])]=a?r:i;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,r=this.clers,i=r.length,a=-1,s=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,r=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&r.cal(r,t,a.plus,this.lastReadVertexIndex,t):r.cal(r,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,r=this.currentVertex--;e[n]=r;var i=t.pop();return e[this.nextCorner(i)]=r,e[this.prevCorner(i)]=-this.nextCorner(t[t.length-1]),i=t.shift(),e[this.prevCorner(i)]=r,e[this.nextCorner(i)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=this.handlesMap[this.currentFace],s=e.splice(0,t);return e.shift(),n.push(s),r[this.nextCorner(a)]=-(i+1),r[this.prevCorner(a)]=-this.nextCorner(s[s.length-1]),r[i]=-this.prevCorner(s[0]),e.push(i),e}},{key:"onHandleStart",value:function(t,e){for(var n,i=this.indices,a=3*this.currentFace,s=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(s);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,r(h));break}}return i[this.nextCorner(s)]=-(a+1),i[this.prevCorner(s)]=-this.nextCorner(n[n.length-1]),i[a]=-this.prevCorner(t[0]),(t=n.concat(t)).push(a),t}},{key:"onFaceS",value:function(t,e,n){var r=this.handlesMap,i=this.indices,a=3*this.currentFace;if(r[this.currentFace]){this.markCorner(t.pop(),t);var s=t.indexOf(r[this.currentFace]);t=s>=0?this.onHandleEnd(s,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),i[a]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(a)}return t}},{key:"onFaceM",value:function(t,e,n){var r=this.indices,i=3*this.currentFace,a=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(a);var s=r[this.prevCorner(a[0])];r[i]=s;var o=t.pop();return r[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),r[this.nextCorner(o)]=s,o=t.shift(),r[this.prevCorner(o)]=s,r[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(i),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,r=this.clers,i=[],a=[];this.currentFace>=0;){var s="onFace"+u[r[this.currentFace]];this[s]?n=this[s](n,i,a):console.warn("has no ".concat(s)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&i(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},r=[];for(var i in n)r[n[i]]=i;n.map=r,t.exports=n},function(t,e,n){var r=n(0);function i(t,e,n,r){return new t(e.slice(n,n+r*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),a=new r,s=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=s.headerBytes,a.mode="CLERS",e=function(t,e,n,r){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),r={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,r){return n.fill(e,t,t+r),t},_printf:function(t,e){for(var r=t;n[r];)r++;var i=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new i(d);return h.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),r=n[0],i=n[1],a=n[2],s=new Float32Array(e.buffer.slice(a,a+u*i*4));m.addAttr(m.attrIdToName(r),s,i)})),m}}])&&r(e.prototype,n),t}();t.exports=a},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var r=n(34),i=n.n(r),a=n(1),s=n(5),o=a.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new s.a(0,0,0),this.direction=t.direction||new s.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new s.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),a=n(5),s=i.a.create({Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},onUpdate:function(){},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.onUpdate(),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.onUpdate(),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.onUpdate(),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.onUpdate(),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.onUpdate(),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.onUpdate(),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.onUpdate(),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.onUpdate(),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.onUpdate(),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.onUpdate(),this},round:function(){return r.vec3.round(this.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.onUpdate(),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.onUpdate(),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.onUpdate(),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.onUpdate(),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.onUpdate(),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.onUpdate(),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},hermite:function(t,e,n,i,a){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},bezier:function(t,e,n,i,a){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},random:function(t){return r.vec3.random(this.elements,t),this.onUpdate(),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.onUpdate(),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.onUpdate(),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],a=e[2];return e[0]=r*n[0]+i*n[4]+a*n[8],e[1]=r*n[1]+i*n[5]+a*n[9],e[2]=r*n[2]+i*n[6]+a*n[10],this.onUpdate(),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.onUpdate(),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.onUpdate(),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.onUpdate(),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.onUpdate(),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}}});e.a=s},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e,n){"use strict";var r=n(1),i=n(5),a=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=a},function(t,e,n){"use strict";var r=n(1),i=n(5),a=new i.a,s=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.onUpdate(),this},set:function(t,e,n,r,a,s,o,u,c,h,f,l,d,m,_,p){return i.mat4.set(this.elements,t,e,n,r,a,s,o,u,c,h,f,l,d,m,_,p),this.onUpdate(),this},identity:function(){return i.mat4.identity(this.elements),this.onUpdate(),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.onUpdate(),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.onUpdate(),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.onUpdate(),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.onUpdate(),this},premultiply:function(t){return this.multiply(t,this),this.onUpdate(),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.onUpdate(),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.onUpdate(),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.onUpdate(),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.onUpdate(),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.onUpdate(),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.onUpdate(),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.onUpdate(),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.onUpdate(),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.onUpdate(),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.onUpdate(),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new u.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,a){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),a||this.onUpdate(),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.onUpdate(),this},frustum:function(t,e,n,r,a,s){return i.mat4.frustum(this.elements,t,e,n,r,a,s),this.onUpdate(),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.onUpdate(),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.onUpdate(),this},ortho:function(t,e,n,r,a,s){return i.mat4.ortho(this.elements,t,e,n,r,a,s),this.onUpdate(),this},lookAt:function(t,e,n){return t.isVector3||(t=c.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},targetTo:function(t,e,n){t.isVector3||(t=c.set(t.x,t.y,t.z)),e.isVector3||(e=h.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],a=t[1],s=t[2],o=n[0],u=n[1],f=n[2],l=i-e[0],d=a-e[1],m=s-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-f*d,g=f*l-o*m,E=o*d-u*l;return(_=p*p+g*g+E*E)>0?(p*=_=1/Math.sqrt(_),g*=_,E*=_):(_=(p=u*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(E=o*d-u*l)*E,p*=_=1/Math.sqrt(_),g*=_,E*=_),r[0]=p,r[1]=g,r[2]=E,r[3]=0,r[4]=d*E-m*g,r[5]=m*p-l*E,r[6]=l*g-d*p,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,this.onUpdate(),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.onUpdate(),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.onUpdate(),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new o.a),this.determinant()<0&&(n.x*=-1),r.copy(this),c.inverse(n),r.scale(c),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(6),a=n(12),s=i.a.DEG2RAD,o=i.a.RAD2DEG,u=r.a.create({Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},onUpdate:function(){},updateDegrees:function(){return u.superclass.updateDegrees.call(this),this.onUpdate(),this},updateRadians:function(){return u.superclass.updateRadians.call(this),this.onUpdate(),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*s,this.onUpdate()}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*s,this.onUpdate()}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*s,this.onUpdate()}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*o,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*o,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*o,this.onUpdate()}}});e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(10),a=n(1),s=new i.a,o=a.a.create({className:"QuaternionNotifier",isQuaternionNotifier:!0,isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},onUpdate:function(){},copy:function(t){return r.quat.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this.onUpdate(),this},set:function(t,e,n,i){return r.quat.set(this.elements,t,e,n,i),this.onUpdate(),this},identity:function(){return r.quat.identity(this.elements),this.onUpdate(),this},rotationTo:function(t,e){return r.quat.rotationTo(this.elements,t.elements,e.elements),this.onUpdate(),this},setAxes:function(t,e,n){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),this.onUpdate(),this},setAxisAngle:function(t,e){return r.quat.setAxisAngle(this.elements,t.elements,e),this.onUpdate(),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this.onUpdate(),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this.onUpdate(),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this.onUpdate(),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this.onUpdate(),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e){return r.quat.lerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},slerp:function(t,e){return r.quat.slerp(this.elements,this.elements,t.elements,e),this.onUpdate(),this},sqlerp:function(t,e,n,i,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,a),this.onUpdate(),this},invert:function(){return r.quat.invert(this.elements,this.elements),this.onUpdate(),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this.onUpdate(),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this.onUpdate(),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this.onUpdate(),this},fromMat4:function(t){return s.fromMat4(t),this.fromMat3(s),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,a=t.order||"ZYX",s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),h=Math.sin(i),f=Math.cos(i),l=this.elements;return"XYZ"===a?(l[0]=s*c*f+o*u*h,l[1]=o*u*f-s*c*h,l[2]=o*c*h+s*u*f,l[3]=o*c*f-s*u*h):"YXZ"===a?(l[0]=s*c*f+o*u*h,l[1]=o*u*f-s*c*h,l[2]=o*c*h-s*u*f,l[3]=o*c*f+s*u*h):"ZXY"===a?(l[0]=s*c*f-o*u*h,l[1]=o*u*f+s*c*h,l[2]=o*c*h+s*u*f,l[3]=o*c*f-s*u*h):"ZYX"===a?(l[0]=s*c*f-o*u*h,l[1]=o*u*f+s*c*h,l[2]=o*c*h-s*u*f,l[3]=o*c*f+s*u*h):"YZX"===a?(l[0]=s*c*f+o*u*h,l[1]=o*u*f+s*c*h,l[2]=o*c*h-s*u*f,l[3]=o*c*f-s*u*h):"XZY"===a&&(l[0]=s*c*f-o*u*h,l[1]=o*u*f-s*c*h,l[2]=o*c*h+s*u*f,l[3]=o*c*f+s*u*h),e||this.onUpdate(),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.onUpdate()}}});o.prototype.mul=o.prototype.multiply,o.prototype.len=o.prototype.length,o.prototype.sqrLen=o.prototype.squaredLength,e.a=o},function(t,e,n){"use strict";var r=n(1),i=n(18),a=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],E=n[15];return e[0].set(s-r,h-o,m-f,E-_).normalize(),e[1].set(s+r,h+o,m+f,E+_).normalize(),e[2].set(s+i,h+u,m+l,E+p).normalize(),e[3].set(s-i,h-u,m-l,E-p).normalize(),e[4].set(s-a,h-c,m-d,E-g).normalize(),e[5].set(s+a,h+c,m+d,E+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)l)return null;r(h,u,s);var m=i(n,h);if(m<0||d+m>l)return null;var _=i(o,h)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],a=e[2],s=n[0],o=n[1],u=n[2];return t[0]=i*u-a*o,t[1]=a*s-r*u,t[2]=r*o-i*s,t}},function(t,e,n){var r=n(26),i=n(31),a=n(32),s=n(33);t.exports=function(t,e,n,u,c){var h=r(n,u);if(0!==h){var f=-(r(e,u)+c)/h;return f<0?null:(a(o,n,f),i(t,e,o))}return r(u,e)+c===0?s(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(92),i=n(26),a=n(30),s=n(93),o=n(32),u=n(31),c=[0,0,0];t.exports=function(t,e,n,h,f){a(c,h,e);var l=i(n,c);if(l<0)return null;s(c,e,n,l);var d=r(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,a=1/0,s=0;su){var c=o;o=u,u=c}if(ua)return 1/0;o>i&&(i=o),ua?1/0:i}t.exports=function(t,e,r,i){var a=n(e,r,i);if(a===1/0)t=null;else{t=t||[];for(var s=0;s0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-s)throw new Error("Bad scanline data");for(;u-- >0;)h[s++]=f[1]}else{if(0==(u=255&f[0])||u>o-s)throw new Error("Bad scanline data");if(h[s++]=f[1],--u>0){if(m(h,s,u) 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\n\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define attribute in\n#define varying out\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod"},function(t,e){t.exports="#version 300 es\n#define GLSLIFY 1\n#define HILO_IS_WEBGL2\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n#define gl_FragColor hilo_FragData0\n#define gl_FragDepthEXT gl_FragDepth\nlayout(location = 0) out highp vec4 hilo_FragData0;"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return i})),n.d(e,"GLTFExtensions",(function(){return r})),n.d(e,"Class",(function(){return a.a})),n.d(e,"EventMixin",(function(){return o})),n.d(e,"Fog",(function(){return zr})),n.d(e,"Mesh",(function(){return jn})),n.d(e,"Node",(function(){return E})),n.d(e,"SkinedMesh",(function(){return Qr})),n.d(e,"Skeleton",(function(){return $r})),n.d(e,"Stage",(function(){return Ii})),n.d(e,"Tween",(function(){return Yi})),n.d(e,"version",(function(){return ti})),n.d(e,"BoxGeometry",(function(){return qi})),n.d(e,"Geometry",(function(){return Q})),n.d(e,"GeometryData",(function(){return w})),n.d(e,"MorphGeometry",(function(){return br})),n.d(e,"PlaneGeometry",(function(){return $i})),n.d(e,"SphereGeometry",(function(){return ea})),n.d(e,"Camera",(function(){return O})),n.d(e,"PerspectiveCamera",(function(){return $})),n.d(e,"OrthographicCamera",(function(){return Un})),n.d(e,"Buffer",(function(){return Wt})),n.d(e,"UniformBuffer",(function(){return na})),n.d(e,"capabilities",(function(){return mt})),n.d(e,"extensions",(function(){return dt})),n.d(e,"Framebuffer",(function(){return He})),n.d(e,"glType",(function(){return Pt})),n.d(e,"logGLResource",(function(){return ia})),n.d(e,"Program",(function(){return Gt})),n.d(e,"RenderInfo",(function(){return ei})),n.d(e,"RenderList",(function(){return ai})),n.d(e,"VertexArrayObject",(function(){return $t})),n.d(e,"WebGLRenderer",(function(){return Ai})),n.d(e,"WebGLResourceManager",(function(){return oi})),n.d(e,"WebGLState",(function(){return si})),n.d(e,"BasicLoader",(function(){return ca})),n.d(e,"CubeTextureLoader",(function(){return da})),n.d(e,"GLTFLoader",(function(){return Za})),n.d(e,"GLTFParser",(function(){return za})),n.d(e,"AliAMCExtension",(function(){return Hr})),n.d(e,"HDRLoader",(function(){return rs})),n.d(e,"KTXLoader",(function(){return ss})),n.d(e,"LoadCache",(function(){return sa})),n.d(e,"LoadQueue",(function(){return os})),n.d(e,"ShaderMaterialLoader",(function(){return cs})),n.d(e,"TextureLoader",(function(){return fs})),n.d(e,"Loader",(function(){return fa})),n.d(e,"Texture",(function(){return ge})),n.d(e,"LazyTexture",(function(){return Ea})),n.d(e,"CubeTexture",(function(){return je})),n.d(e,"DataTexture",(function(){return Ke})),n.d(e,"Shader",(function(){return Ot})),n.d(e,"BasicMaterial",(function(){return Nn})),n.d(e,"GeometryMaterial",(function(){return Hn})),n.d(e,"Material",(function(){return Sn})),n.d(e,"PBRMaterial",(function(){return _a})),n.d(e,"semantic",(function(){return dn})),n.d(e,"ShaderMaterial",(function(){return yr})),n.d(e,"AxisHelper",(function(){return _s})),n.d(e,"AxisNetHelper",(function(){return Es})),n.d(e,"CameraHelper",(function(){return qn})),n.d(e,"AmbientLight",(function(){return Ts})),n.d(e,"AreaLight",(function(){return Ms})),n.d(e,"DirectionalLight",(function(){return Mr})),n.d(e,"CubeLightShadow",(function(){return pr})),n.d(e,"Light",(function(){return M})),n.d(e,"LightManager",(function(){return fi})),n.d(e,"LightShadow",(function(){return er})),n.d(e,"PointLight",(function(){return Er})),n.d(e,"SpotLight",(function(){return Or})),n.d(e,"Animation",(function(){return wa})),n.d(e,"AnimationStates",(function(){return ba})),n.d(e,"MeshPicker",(function(){return Os})),n.d(e,"Ticker",(function(){return Ss})),n.d(e,"log",(function(){return _.a})),n.d(e,"Cache",(function(){return tt})),n.d(e,"browser",(function(){return Mi})),n.d(e,"WebGLSupport",(function(){return ys})),n.d(e,"constants",(function(){return D.a})),n.d(e,"Color",(function(){return Ns.Color})),n.d(e,"Euler",(function(){return Ns.Euler})),n.d(e,"EulerNotifier",(function(){return Ns.EulerNotifier})),n.d(e,"Frustum",(function(){return Ns.Frustum})),n.d(e,"math",(function(){return Ns.math})),n.d(e,"Matrix3",(function(){return Ns.Matrix3})),n.d(e,"Matrix4",(function(){return Ns.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Ns.Matrix4Notifier})),n.d(e,"Plane",(function(){return Ns.Plane})),n.d(e,"QuaternionNotifier",(function(){return Ns.QuaternionNotifier})),n.d(e,"Quaternion",(function(){return Ns.Quaternion})),n.d(e,"Ray",(function(){return Ns.Ray})),n.d(e,"Sphere",(function(){return Ns.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Ns.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Ns.Vector2})),n.d(e,"Vector3",(function(){return Ns.Vector3})),n.d(e,"Vector3Notifier",(function(){return Ns.Vector3Notifier})),n.d(e,"Vector4",(function(){return Ns.Vector4}));var r={};n.r(r),n.d(r,"ALI_amc_mesh_compression",(function(){return Hr})),n.d(r,"WEB3D_quantized_attributes",(function(){return Ur})),n.d(r,"HILO_animation_clips",(function(){return Gr})),n.d(r,"ALI_animation_clips",(function(){return Br})),n.d(r,"ALI_bounding_box",(function(){return Vr})),n.d(r,"KHR_materials_pbrSpecularGlossiness",(function(){return Xr})),n.d(r,"KHR_materials_clearcoat",(function(){return jr})),n.d(r,"KHR_lights_punctual",(function(){return kr})),n.d(r,"KHR_techniques_webgl",(function(){return Wr}));var i=n(4),a=n(1),s=a.a.create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n},type:null,target:null,detail:null,stopImmediatePropagation:function(){this._stopped=!0}}),o={_listeners:null,on:function(t,e,n){for(var r=this._listeners=this._listeners||{},i=r[t]=r[t]||[],a=0,s=i.length;a0){if(1===arguments.length)return delete this._listeners[t],this;for(var r=0,i=n.length;r0){var o=a.slice(0);if((n=n||new s(r,this,e))._stopped)return!1;for(var u=0;u-1&&a.splice(h,1)}}return!0}return!1}},u=n(7),c=n(20),h=n(5),f=n(16),l=n(21),d=n(22),m=n(6),_=n(3),p=new h.a(0,1,0),g=new u.a,E=a.a.create({Statics:{TRAVERSE_STOP_NONE:0,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:2},Mixes:o,isNode:!0,className:"Node",name:"",anim:null,animationId:"",jointName:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,userData:null,onUpdate:null,__forceUseParentWorldMatrix:!1,onlySyncQuaternion:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),this.up=p.clone(),this.children=[],this.worldMatrix=new u.a,this._matrix=new c.a,this._position=new f.a(0,0,0),this._scale=new f.a(1,1,1),this._pivot=new f.a(0,0,0),this._rotation=new l.a,this._quaternion=new d.a,this._matrix.onUpdate=this._onMatrixUpdate.bind(this),this._position.onUpdate=this._onPositionUpdate.bind(this),this._scale.onUpdate=this._onScaleUpdate.bind(this),this._pivot.onUpdate=this._onPivotUpdate.bind(this),this._rotation.onUpdate=this._onRotationUpdate.bind(this),this._quaternion.onUpdate=this._onQuaternionUpdate.bind(this),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.skeleton&&(e.skeleton.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix),e.worldMatrixVersion++),e.autoUpdateChildWorldMatrix||t?0:1})),this},getConcatenatedMatrix:function(t){for(var e=new u.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(2===n||1===n)return n}for(var r=this.children,i=0,a=r.length;i1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=r?this.children:[this];n.length;){e=n,n=[];for(var i=0,a=e.length;i1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?g.targetTo(this,t,this.up):g.targetTo(t,this,this.up),this._quaternion.fromMat4(g),this},raycast:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(e){if(n&&!e.pointerEnabled)return 1;if(e.isMesh){var i=e.raycast(t,!1);i&&(r=r.concat(i.map((function(t){return{mesh:e,point:t}}))))}return n&&!e.pointerChildren?1:0})),r.length?(e&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){_.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){_.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){_.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){_.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){_.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){_.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,worldMatrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this.onlySyncQuaternion||this._rotation.fromQuat(this._quaternion),this._quatDirty=!1,this._matrixDirty=!0}}),v=n(8),T=new v.a,A=a.a.create({Extends:E,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},shadow:null,isDirty:!1,constructor:function(t){this.color=new v.a(1,1,1),A.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return T.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=A,R=n(23),I=new u.a,L=a.a.create({Extends:E,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new u.a,this.projectionMatrix=new u.a,this.viewProjectionMatrix=new u.a,this._frustum=new R.a,L.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new u.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new u.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var r=t.clone();return r.transformMat4(this.viewProjectionMatrix),e&&n&&(r.x=(r.x+1)/2*e,r.y=n-(r.y+1)/2*n),r},unprojectVector:function(t,e,n){var r=t.clone();return e&&n&&(r.x=r.x/e*2-1,r.y=1-r.y/n*2),I.invert(this.viewProjectionMatrix),r.transformMat4(I),r},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=L,S=n(13),y=n(11),N=n(10),x=n(9),C=n(19),b={2:new S.a,3:new h.a,4:new y.a,16:new u.a},P=a.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=m.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||_.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(i.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new P(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?b[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,r=this._data;n>1?e.toArray(r,t):r[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Z.fromTranslation(V.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(Z.fromScaling(V.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Z.fromQuat(K.fromEuler({x:t*m.a.DEG2RAD,y:e*m.a.DEG2RAD,z:n*m.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,r,i){e.setByOffset(i,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,r){n.setByOffset(r,t.transformMat3(q).normalize())}))}if(this._tangents){var r=this.tangents;r.traverse((function(t,e,n){r.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var r=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,r,i){n.setByOffset(i,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+r})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,r){var i=this[t];if(!i||n>i.length){var a=new r(n);i?(a.set(i.data),i.data=a):this[t]=new w(a,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var r=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;r[n]=e[0],r[n+1]=e[1],r[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var r=this.indices.data;e.forEach((function(e){r[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var r=this.addPoints(t,e,n);this.addIndices(r,r+1,r+2)},addRect:function(t,e,n,r){var i=this.addPoints(t,e,n,r);this.addIndices(i,i+1,i+2,i,i+2,i+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,r=0;r0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new C.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new C.a({center:new h.a(e.x,e.y,e.z)}),r=this.vertices;r?n.fromGeometryData(r):(_.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===H)if(this.indices){for(var e=this.indices.data,n=e.length,r=new Float32Array(n*t),a=this.uvs?new Float32Array(2*n):null,s=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&r&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(i.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){_.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),J=a.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){J.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,r=this.aspect,i=this.fov,a=1/Math.tan(.5*m.a.degToRad(i));if(t[0]=a/r,t[5]=a,t[11]=-1,t[15]=0,n){var s=1/(e-n);t[10]=(e+n)*s,t[14]=2*n*e*s}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Q,n=Math.tan(this.fov/2*Math.PI/180),r=this.near,i=this.far,a=r*n,s=i*n,o=this.aspect*a,u=this.aspect*s,c=[-o,-a,-r],h=[o,-a,-r],f=[o,a,-r],l=[-o,a,-r],d=[-u,-s,-i],m=[u,-s,-i],_=[u,s,-i],p=[-u,s,-i];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),$=J,tt=a.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}});function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:t;this._usedExtensions[t]=e,this.gl&&this.get(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;if(this.isWebGL2&&ht[t])return ht[t];var n=ft[t];if(n){if(this.isWebGL2)return new n.WebGL2(e);var r=this._getOriginExtension(t);return r?new n.WebGL1(r):null}return this._getOriginExtension(t)},_getOriginExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};lt.use("ANGLE_instanced_arrays","instanced"),lt.use("OES_vertex_array_object","vao"),lt.use("OES_texture_float","texFloat"),lt.use("OES_element_index_uint","uintIndices"),lt.use("EXT_shader_texture_lod","shaderTextureLod"),lt.use("EXT_frag_depth","fragDepth"),lt.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic"),lt.use("WEBGL_lose_context","loseContext"),lt.use("EXT_color_buffer_float","colorBufferFloat"),lt.use("EXT_sRGB","sRGB"),lt.use("WEBGL_draw_buffers","drawBuffers");var dt=lt,mt={isWebGL2:!1,MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,MAX_RENDERBUFFER_SIZE:void 0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:void 0,MAX_CUBE_MAP_TEXTURE_SIZE:void 0,MAX_FRAGMENT_UNIFORM_VECTORS:void 0,MAX_TEXTURE_IMAGE_UNITS:void 0,MAX_TEXTURE_SIZE:void 0,MAX_VARYING_VECTORS:void 0,MAX_VERTEX_ATTRIBS:void 0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:void 0,MAX_VERTEX_UNIFORM_VECTORS:void 0,init:function(t){var e=this;this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t);["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!dt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!dt.texFloat,this.FRAG_DEPTH=!!dt.fragDepth,this.SHADER_TEXTURE_LOD=!!dt.shaderTextureLod,this.DRAW_BUFFERS=!!dt.drawBuffers,dt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(dt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var r=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],i=0;i0){n=a.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},_t=n(51),pt=n.n(_t),gt=n(52),Et=n.n(gt),vt=n(53),Tt=n.n(vt),At=n(54),Mt=n.n(At),Rt=new tt,It=new tt,Lt=a.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(17),"chunk/color.frag":n(36),"chunk/color.vert":n(75),"chunk/color_main.vert":n(77),"chunk/diffuse.frag":n(57),"chunk/diffuse_main.frag":n(66),"chunk/extensions.frag":n(24),"chunk/extensions.vert":n(48),"chunk/fog.frag":n(43),"chunk/fog_main.frag":n(68),"chunk/frag_color.frag":n(47),"chunk/joint.vert":n(70),"chunk/joint_main.vert":n(80),"chunk/light.frag":n(40),"chunk/lightFog.frag":n(39),"chunk/lightFog.vert":n(73),"chunk/lightFog_main.frag":n(45),"chunk/lightFog_main.vert":n(83),"chunk/logDepth.frag":n(28),"chunk/logDepth_main.frag":n(29),"chunk/logDepth.vert":n(76),"chunk/logDepth_main.vert":n(84),"chunk/morph.vert":n(74),"chunk/morph_main.vert":n(79),"chunk/normal.frag":n(38),"chunk/normal.vert":n(72),"chunk/normal_main.frag":n(44),"chunk/normal_main.vert":n(82),"chunk/pbr.frag":n(85),"chunk/pbr_main.frag":n(87),"chunk/phong.frag":n(64),"chunk/phong_main.frag":n(67),"chunk/precision.frag":n(25),"chunk/precision.vert":n(49),"chunk/transparency.frag":n(42),"chunk/transparency_main.frag":n(46),"chunk/unQuantize.vert":n(69),"chunk/unQuantize_main.vert":n(78),"chunk/uv.frag":n(37),"chunk/uv.vert":n(71),"chunk/uv_main.vert":n(81),"method/encoding.glsl":n(86),"method/getDiffuse.glsl":n(59),"method/getLightAttenuation.glsl":n(61),"method/getShadow.glsl":n(63),"method/getSpecular.glsl":n(60),"method/packFloat.glsl":n(50),"method/textureEnvMap.glsl":n(41),"method/transpose.glsl":n(58),"method/unpackFloat.glsl":n(62),"basic.frag":n(51),"basic.vert":n(52),"geometry.frag":n(53),"pbr.frag":n(54),"screen.frag":n(55),"screen.vert":n(56)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return Rt}},headerCache:{get:function(){return It}},reset:function(t){Rt.removeAll()},getHeaderKey:function(t,e,n,r,i){var a="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(a+="_joint"+t.skeleton.jointCount),r&&(a+="_fog_"+r.mode),a+="_"+t.geometry.getShaderKey(),i&&(a+="_fogDepth"),a},getHeader:function(t,e,n,r,i){var a=this.getHeaderKey(t,e,n,r),s=It.get(a);if(!s||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),r&&(o.HAS_FOG=1,r.getRenderOption(o)),i&&(o.USE_LOG_DEPTH=1,mt.FRAG_DEPTH&&(o.USE_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),s="#define SHADER_NAME ".concat(e.shaderName||e.className,"\n"),s+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",It.add(a,s)}return s},_getCommonHeader:function(t){var e=mt.getMaxPrecision(mt.MAX_VERTEX_PRECISION,t.vertexPrecision),n=mt.getMaxPrecision(mt.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),r=mt.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(r,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,r,i,a){var s=this.getHeader(t,e,r,i,a);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,s):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,s,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var r="";e&&(r=(r=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var i=t.className+":"+r;t.onBeforeCompile&&(i+=":"+(t.shaderCacheId||t.id));var a=Rt.get(i);if(!a){var s="",o=Et.a;if(t.isBasicMaterial?t.isGeometryMaterial?s+=Tt.a:s+=pt.a:t.isPBRMaterial&&(s+=Mt.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,s);s=u.fs,o=u.vs}if(r){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(r,");"),"gm");o=o.replace(c,"attribute $1 $2;")}a=this.getCustomShader(o,s,n,i,!0)}if(a){var h=this._getNumId(a);null!==h&&(t._shaderNumId=h)}return a},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,r,i){var a,s=this.commonHeader;return r&&(i&&(r+=":"+n),a=Rt.get(r)),a||(a=new Lt({vs:s+n+t,fs:s+n+e}),r&&Rt.add(r,a)),a}},alwaysUse:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(Rt.removeObject(this),this._isDestroyed=!0),this}}),Ot=Lt,St=n(56),yt=n.n(St),Nt=n(55),xt=n.n(Nt),Ct=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],bt={},Pt={dict:bt,init:function(t){Ct.forEach((function(e){var n,r,i=e.name,a=e.uniformFuncName,s=a+"v";"Matrix"===e.type?n=r=function(e,n){void 0!==n&&t[a](e,!1,n)}:(n=function(e,n){void 0!==n&&t[a](e,n)},r=function(e,n){t[s](e,n)}),bt[t[i]]=Object.assign(e,{glValue:t[i],uniform:n,uniformArray:r})}))},get:function(t){return bt[t]}},wt=n(106),Dt=n(107),Ht=D.a.VERTEX_SHADER,Ft=new tt,Ut=a.a.create({Statics:{cache:{get:function(){return Ft}},reset:function(t){Ft.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.id,i=Ft.get(r);return i||(i=new Ut({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Ft.add(r,i)),i},getBlankProgram:function(t){var e=Ot.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,uniformBlocks:null,program:null,gl:null,state:null,alwaysUse:!1,isWebGL2:!1,constructor:function(t){return this.id=m.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.uniformBlocks={},this.gl=this.state.gl,this.isWebGL2=this.state.isWebGL2,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:Ut.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),r=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&r){if(t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),t.deleteShader(n),t.deleteShader(r),!t.getProgramParameter(e,t.LINK_STATUS)){var i=t.getProgramInfoLog(e);return _.a.error("compileProgramError: "+i,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){this.isWebGL2&&(e=this._convertToGLSL300(t,e));var n=this.gl,r=n.createShader(t);if(n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){var i=n.getShaderInfoLog(r);return _.a.error("compileShaderError: "+i,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return r},_convertToGLSL300:function(t,e){return t===Ht?wt+e:(Dt+e).replace(/gl_FragData\[(\d)\]/g,"hilo_FragData$1")},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),i=dt.instanced,a=function(){var r=e.getActiveAttrib(n,s),a=r.name,o=r.type,u=r.size,c=e.getAttribLocation(n,a),h=Pt.get(o),f=function(t){var n=t.type,r=void 0===n?e.FLOAT:n,i=t.normalized,a=void 0!==i&&i,s=t.stride,o=void 0===s?0:s,u=t.offset,f=void 0===u?0:u,l=t.size,d=void 0===l?h.size:l;e.vertexAttribPointer(c,d,r,a,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(i&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;i.vertexAttribDivisor(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),E=4*g,v=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;v((function(e){i.vertexAttribDivisor(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},s=0;s1||o>1?function(t){f(c,t)}:function(t){e._dict[s]!==t&&(e._dict[s]=t,d(c,t))}})},m=0;m2&&void 0!==arguments[2]?arguments[2]:Xt;return this.createBuffer(t,Bt,e,n)},createBuffer:function(t,e,n,r){var i=n.bufferViewId,a=jt.get(i);return a||(n.isDirty=!1,a=new kt(t,e,n.data,r),jt.add(i,a),a)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xt;return this.createBuffer(t,Vt,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Xt;this.id=m.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=r,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,r=this.usage;return this.bind(),e.bufferData(n,t,r),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.gl,i=this.target;return n||this.bind(),r.bufferSubData(i,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstanced(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstanced(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,r=this.indexBuffer;return this.indexType=t.type,r?t.isDirty&&(r.uploadGeometryData(t),this.vertexCount=t.length):((r=Wt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=r,this.vertexCount=t.length),r},addAttribute:function(t,e,n,r){this.bind();var i=this.gl,a=e.name,s=this[a];if(!s){var o=Wt.createVertexBuffer(i,t,n);o.bind(),e.enable(),e.pointer(t),s={attribute:e,buffer:o,geometryData:t},this.attributes.push(s),this[a]=s,e.addTo(this.activeStates,s),r&&r(s)}if(t.isDirty){var u=s.buffer;u.bind(),e.enable(),e.pointer(t),u.uploadGeometryData(t)}return s},addInstancedAttribute:function(t,e,n){this.bind();var r=this.gl,i=t.name,a=t.glTypeInfo,s=zt.getTypedArray(Float32Array,e.length*a.size);e.forEach((function(t,e){void 0!==n(t)?zt.fillArrayData(s,n(t),e*a.size):_.a.warn("no attributeData:"+i+"-"+t.name)}));var o,u=this[i];return u?(o=u.geometryData).data=s:o=new w(s,1),this.addAttribute(o,t,r.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},getResources:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.attributes&&this.attributes.forEach((function(e){t.push(e.buffer)})),this.indexBuffer&&t.push(this.indexBuffer),t},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.instancedExtension=null,this.useVao&&(this.vaoExtension.deleteVertexArray(this.vao),this.vao=null,this.vaoExtension=null),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){var n=e.attribute||{};t[n.name]=null})),this.attributes=null,this.activeStates=null,Qt.removeObject(this),this._isDestroyed=!0),this}}),$t=Jt,te=D.a.TEXTURE_2D,ee=D.a.FLOAT,ne=D.a.RGB,re=D.a.RGBA,ie=D.a.RGB32F,ae=D.a.RGBA32F,se=D.a.LINEAR,oe=D.a.NEAREST,ue=D.a.REPEAT,ce=D.a.CLAMP_TO_EDGE,he=D.a.UNSIGNED_BYTE,fe=D.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le=D.a.UNPACK_FLIP_Y_WEBGL,de=D.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,me=D.a.BROWSER_DEFAULT_WEBGL,_e=D.a.NONE,pe=new tt,ge=a.a.create({Statics:{cache:{get:function(){return pe}},reset:function(t){pe.each((function(e,n){t.deleteTexture(e),pe.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&_.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:te,internalFormat:re,format:re,type:he,width:0,height:0,border:0,magFilter:se,minFilter:se,wrapS:ue,wrapT:ue,name:"",premultiplyAlpha:!1,flipY:!1,colorSpaceConversion:!0,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==se&&this.minFilter!==oe},set:function(){_.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==ce||this.wrapT!==ce},set:function(){_.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){_.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return m.a.isPowerOfTwo(t.width)&&m.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,r=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=m.a.nextPowerOfTwo(n),r=m.a.nextPowerOfTwo(r));var i=mt.MAX_TEXTURE_SIZE;return i&&(n>i&&(n=i),r>i&&(r=i)),{width:n,height:r}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var r=this._canvasImage;return r?(r.width=e,r.height=n,this._canvasCtx=r.getContext("2d")):((r=document.createElement("canvas")).width=e,r.height=n,this._canvasImage=r,this._canvasCtx=r.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),_.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(r.width,"x").concat(r.height),t.src),this._originImage=t,r},_glUploadTexture:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,s=t.gl,o=this.type,u=this.format,c=this.internalFormat;return this.compressed?s.compressedTexImage2D(e,r,c,i,a,this.border,n):(c=this._fixInternalFormat(t,o,u,c),n&&void 0!==n.width?s.texImage2D(e,r,c,u,this.type,n):s.texImage2D(e,r,c,i,a,this.border,u,this.type,n)),this},_fixInternalFormat:function(t,e,n,r){return t.isWebGL2?e===ee&&(n===re?r=ae:n===ne&&(r=ie)):n!==r&&(r=this.format),r},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,r){e._glUploadTexture(t,e.target,n.data,r,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},_updatePixelStorei:function(){var t=this.state;t.pixelStorei(fe,this.premultiplyAlpha),t.pixelStorei(le,!!this.flipY),t.pixelStorei(de,this.colorSpaceConversion?me:_e)},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var r=this.useMipmap,i=this.useRepeat;if(this.image&&!this.image.length){if(!t.isWebGL2){var a=i||r,s=this.getSupportSize(this.image,a);this.image=this.resizeImg(this.image,s.width,s.height)}this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+mt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._uploadTexture(t),r&&(this.compressed?this.mipmaps||(_.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=se):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT);var o=dt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,mt.MAX_TEXTURE_MAX_ANISOTROPY)),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var r=t.gl;t.activeTexture(r.TEXTURE0+mt.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),this._updatePixelStorei(),this._subTextureList.forEach((function(t){var e=t[0],i=t[1],a=t[2];r.texSubImage2D(n.target,0,e,i,n.format,n.type,a)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var r=pe.get(n);return r||(r=e.createTexture(),pe.add(n,r),this.needUpdate=!0),this.updateTexture(t,r),this.isImageCanRelease&&this._releaseImage(),r},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),pe.add(this.id,t),this},destroy:function(){var t=this.id,e=pe.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),pe.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Ee=D.a.FRAMEBUFFER,ve=D.a.TEXTURE_2D,Te=D.a.RGBA,Ae=D.a.UNSIGNED_BYTE,Me=D.a.COLOR_ATTACHMENT0,Re=D.a.DEPTH_STENCIL_ATTACHMENT,Ie=D.a.DEPTH_STENCIL,Le=D.a.DEPTH_TEST,Oe=D.a.CULL_FACE,Se=D.a.TRIANGLE_STRIP,ye=D.a.NEAREST,Ne=D.a.CLAMP_TO_EDGE,xe=D.a.COLOR_BUFFER_BIT,Ce=D.a.READ_FRAMEBUFFER,be=D.a.DRAW_FRAMEBUFFER,Pe=new tt,we={framebufferTarget:Ee,attachment:Me,target:ve,format:Te,internalFormat:Te,type:Ae,minFilter:ye,magFilter:ye,wrapS:Ne,wrapT:Ne},De=a.a.create({Statics:{ATTACHMENT_TYPE_TEXTURE:"TEXTURE",ATTACHMENT_TYPE_RENDERBUFFER:"RENDERBUFFER",cache:{get:function(){return Pe}},reset:function(t){Pe.each((function(t){t.reset()}))},destroy:function(t){Pe.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Ie,framebufferTarget:we.framebufferTarget,target:we.target,format:we.format,internalFormat:we.internalFormat,type:we.type,minFilter:we.minFilter,magFilter:we.magFilter,wrapS:we.wrapS,wrapT:we.wrapT,data:null,attachment:we.attachment,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,colorAttachmentInfos:void 0,depthStencilAttachmentInfo:void 0,constructor:function(t,e){this.id=m.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),void 0===this.colorAttachmentInfos&&(this.colorAttachmentInfos=[{attachmentType:De.ATTACHMENT_TYPE_TEXTURE,framebufferTarget:this.framebufferTarget,target:this.target,format:this.format,internalFormat:this.internalFormat,type:this.type,minFilter:this.minFilter,magFilter:this.magFilter,wrapS:this.wrapS,wrapT:this.wrapT,data:this.data}]),void 0===this.depthStencilAttachmentInfo&&this.needRenderbuffer&&(this.depthStencilAttachmentInfo={attachmentType:De.ATTACHMENT_TYPE_RENDERBUFFER,framebufferTarget:this.framebufferTarget,attachment:Re,internalFormat:Ie}),Pe.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this._createAttachments(),this.isComplete()||_.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},_createAttachments:function(){var t=this,e=this.colorAttachmentInfos,n=this.depthStencilAttachmentInfo,r=[];if(e&&e.forEach((function(e,n){var i=Me+n;switch(e.attachmentType){case De.ATTACHMENT_TYPE_RENDERBUFFER:t._createRenderbufferAttachment(e,i);break;case De.ATTACHMENT_TYPE_TEXTURE:default:t._createTextureAttachment(e,i)}r.push(i)})),n){var i=n.attachment;switch(n.attachmentType){case De.ATTACHMENT_TYPE_RENDERBUFFER:this._createRenderbufferAttachment(n,i);break;case De.ATTACHMENT_TYPE_TEXTURE:default:this._createTextureAttachment(n,i)}}r.length>1&&mt.DRAW_BUFFERS&&dt.drawBuffers.drawBuffers(r)},_createTextureAttachment:function(t,e){var n=this.state,r=n.gl,i=Object.assign({},we,t),a=new ge({minFilter:i.minFilter,magFilter:i.magFilter,internalFormat:i.internalFormat,format:i.format,type:i.type,width:this.width,height:this.height,image:i.data,wrapS:i.wrapS,wrapT:i.wrapT}),s=a.getGLTexture(n);return r.framebufferTexture2D(i.framebufferTarget,e,i.target,s,0),t.texture=a,e===Me&&(this.texture=a),a},_createRenderbufferAttachment:function(t,e){var n=this.gl,r=this.width,i=this.height,a=n.createRenderbuffer();return n.bindRenderbuffer(n.RENDERBUFFER,a),t.samples>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,t.samples,t.internalFormat,r,i):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,r,i),n.framebufferRenderbuffer(t.framebufferTarget||we.framebufferTarget,e,n.RENDERBUFFER,a),t.renderbuffer=a,a},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&(this._preFramebuffer=this.state.currentFramebuffer,this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer))},unbind:function(){(this.init(),this._isInit)&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this._preFramebuffer)},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if(this._isInit){var s=this.gl,o=this.state,u=this.colorAttachmentInfos;if(!a){if(!u[0])return;a=u[0].texture}o.disable(Le),o.disable(Oe),i&&this.clear(i);var c=Ot.getCustomShader(yt.a,xt.a,"","FramebufferTextureShader"),h=Gt.getProgram(c,o);h.useProgram();var f="".concat(t,"_").concat(e,"_").concat(n,"_").concat(r,"_").concat(h.id),l=$t.getVao(s,f,{useVao:this.useVao,useInstanced:!1,mode:Se});if(l.isDirty){l.isDirty=!1;var d=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(r*=2),t+n,e-r];l.addAttribute(new w(new Float32Array(d),2),h.attributes.a_position),l.addAttribute(new w(new Float32Array([0,1,1,1,0,0,1,0]),2),h.attributes.a_texcoord0)}o.activeTexture(s.TEXTURE0),o.bindTexture(s.TEXTURE_2D,a.getGLTexture(o)),l.draw()}},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=Object(i.getTypedArrayClass)(this.type),s=new a(n*r*4);if(this._isInit){var o=this.gl;e=this.height-e-r,this.bind(),o.readPixels(t,e,n,r,this.format,this.type,s),this.unbind()}return s},copyFramebuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.init(),this._isInit){var n=this.gl,r=e.mask,i=e.filter,a=e.srcSize,s=e.dstSize;r||(r=xe),i||(i=ye),a||(a=[0,0,t.width,t.height]),s||(s=[0,0,this.width,this.height]),n.bindFramebuffer(Ce,t.framebuffer),n.bindFramebuffer(be,this.framebuffer),n.blitFramebuffer(a[0],a[1],a[2],a[3],s[0],s[1],s[2],s[3],r,i),n.bindFramebuffer(Ce,null),n.bindFramebuffer(be,null)}},destroy:function(){return this._isDestroyed||(this.destroyResource(),this.gl=null,Pe.removeObject(this),this._isDestroyed=!0),this},destroyResource:function(){var t=this.gl;if(t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.colorAttachmentInfos&&this.colorAttachmentInfos.forEach((function(e){var n=e.texture,r=e.renderbuffer;e.texture=null,e.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)})),this.depthStencilAttachmentInfo)){var e=this.depthStencilAttachmentInfo,n=e.texture,r=e.renderbuffer;this.depthStencilAttachmentInfo.texture=null,this.depthStencilAttachmentInfo.renderbuffer=null,n?n.destroy():r&&t.deleteRenderbuffer(r)}}}),He=De,Fe=D.a.TEXTURE_CUBE_MAP,Ue=D.a.RGB,Ge=D.a.LINEAR,Be=D.a.CLAMP_TO_EDGE,Ve=D.a.TEXTURE_CUBE_MAP_POSITIVE_X,Xe=a.a.create({Extends:ge,isCubeTexture:!0,className:"CubeTexture",target:Fe,internalFormat:Ue,format:Ue,magFilter:Ge,minFilter:Ge,wrapS:Be,wrapT:Be,constructor:function(t){Xe.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,r){e._glUploadTexture(t,Ve+r,n,0)}))):_.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),je=Xe,ke=D.a.TEXTURE_2D,We=D.a.RGBA,Ye=D.a.NEAREST,ze=D.a.CLAMP_TO_EDGE,qe=D.a.FLOAT,Ze=a.a.create({Extends:ge,isDataTexture:!0,className:"DataTexture",target:ke,internalFormat:We,format:We,type:qe,magFilter:Ye,minFilter:Ye,wrapS:ze,wrapT:ze,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=m.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),r=Math.floor(n/2),a=n-r;this.width=Math.pow(2,r),this.height=Math.pow(2,a),this.DataClass=Object(i.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){Ze.superclass.constructor.call(this,t)}}),Ke=Ze;function Qe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Je(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1),mt.SHADER_TEXTURE_LOD&&this.enableTextureLod&&(e.USE_SHADER_TEXTURE_LOD=1),mt.DRAW_BUFFERS&&this.enableDrawBuffers&&(e.USE_DRAW_BUFFERS=1);var r=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,r.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),r.add(this.parallaxMap,"PARALLAX_MAP"),r.add(this.emission,"EMISSION_MAP"),r.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),r.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var r=this.uvTypes,i=this.option,a=t.uv||0;r[a]=1,i[e]=a,t.isCubeTexture&&(i["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var r in e)-1!==t.indexOf(Number(r))?n["HAS_TEXCOORD".concat(r)]=1:(_.a.warnOnce("Material._textureOption.update(".concat(r,")"),"uv_".concat(r," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var r=this.getUniformInfo(n);r.isDependMesh&&!r.notSupportInstanced&&t.push({name:n,info:r})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=dn[n]),n&&n.get||(_.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=On),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])},getShadowMaterial:function(t){return t.side!==this.side&&(t.side=this.side,t.isDirty=!0),t.frontFace!==this.frontFace&&(t.frontFace=this.frontFace,t.isDirty=!0),t}}),yn=a.a.create({Extends:Sn,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),yn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yn.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var r=this.diffuse;return r&&r.isTexture&&(r.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),Nn=yn,xn=D.a.POSITION,Cn=D.a.NORMAL,bn=D.a.DEPTH,Pn=D.a.DISTANCE,wn=D.a.NONE,Dn=a.a.create({Extends:Nn,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:xn,lightType:wn,writeOriginData:!1,constructor:function(t){Dn.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Dn.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case xn:t.HAS_FRAG_POS=1;break;case Cn:t.HAS_NORMAL=1;break;case bn:break;case Pn:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),Hn=Dn,Fn=a.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){Fn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Q,n=[this.left,this.bottom,-this.near],r=[this.right,this.bottom,-this.near],i=[this.right,this.top,-this.near],a=[this.left,this.top,-this.near],s=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(s,o,u,c),e.addRect(o,r,i,u),e.addRect(r,n,a,i),e.addRect(n,s,c,a),e.addRect(c,u,i,a),e.addRect(n,r,o,s),this._geometry=e}return this._geometry}}),Un=Fn,Gn=n(15),Bn=new Gn.a,Vn=new u.a,Xn=a.a.create({Extends:E,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){Xn.superclass.constructor.call(this,t)},clone:function(t){var e=E.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,r=this.material,i=this.worldMatrix;if(n&&r){Vn.invert(i),Bn.copy(t),Bn.transformMat4(Vn);var a=n.raycast(Bn,r.side,e);if(a)return a.forEach((function(t){t.transformMat4(i)})),a}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},isDestroyed:{get:function(){return this._isDestroyed}},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager;return n.destroyMesh(this),this.material&&e&&this.material.destroyTextures(),this.off(),this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),jn=Xn,kn=D.a.LINES,Wn=new h.a,Yn=new u.a,zn=a.a.create({Extends:jn,isCameraHelper:!0,className:"CameraHelper",camera:null,color:null,constructor:function(t){zn.superclass.constructor.call(this,t),this.color||(this.color=new v.a(.3,.9,.6)),this.material=new Nn({lightType:"NONE",diffuse:this.color||new v.a(.5,.5,.5,1),castShadows:!1}),this.geometry=new Q({mode:kn,isStatic:!1,vertices:new w(new Float32Array(27),3),indices:new w(new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7,8,4,8,5,8,6,8,7]),1)})},onUpdate:function(){this.camera&&(this.camera.updateViewProjectionMatrix(),this._buildGeometry())},_buildGeometry:function(){var t=this.camera,e=this.geometry;Yn.multiply(t.viewProjectionMatrix,this.worldMatrix),Yn.invert(),e.vertices.set(0,Wn.set(-1,-1,1).transformMat4(Yn)),e.vertices.set(1,Wn.set(-1,1,1).transformMat4(Yn)),e.vertices.set(2,Wn.set(1,1,1).transformMat4(Yn)),e.vertices.set(3,Wn.set(1,-1,1).transformMat4(Yn)),e.vertices.set(4,Wn.set(-1,-1,-1).transformMat4(Yn)),e.vertices.set(5,Wn.set(-1,1,-1).transformMat4(Yn)),e.vertices.set(6,Wn.set(1,1,-1).transformMat4(Yn)),e.vertices.set(7,Wn.set(1,-1,-1).transformMat4(Yn)),e.vertices.set(8,Wn.set(0,0,-1).transformMat4(Yn))}}),qn=zn,Zn=D.a.DEPTH,Kn=D.a.BACK,Qn=null,Jn=new v.a(1,1,1),$n=new u.a,tr=function(t){return t.material.castShadows},er=a.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=m.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new He(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustomCamera(this.cameraInfo,t);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),$n.multiply(this.camera.viewMatrix,t.worldMatrix);var r=n.getBounds($n);this.camera.near=-r.zMax,this.camera.far=-r.zMin,this.camera.left=r.xMin,this.camera.right=r.xMax,this.camera.bottom=r.yMin,this.camera.top=r.yMax}}this.camera.updateViewMatrix()},updateCustomCamera:function(t,e){for(var n in t)this.camera[n]=t[n];t.far||(this.camera.far=e.far),t.near||(this.camera.near=e.near)},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustomCamera(this.cameraInfo,t):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new Un:this.light.isSpotLight&&(this.camera=new $),this.camera.addTo(this.light),this._createCameraHelper()),(this.light.isDirty||this._cameraMatrixVersion!==t.matrixVersion)&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion,this.light.isDirty=!1)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;Qn||(Qn=new Hn({vertexType:Zn,side:Kn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(Jn),r.updateViewProjectionMatrix(),dn.setCamera(r),this.renderShadowScene(e,Qn),n.unbind(),dn.setCamera(t),e.viewport()},renderShadowScene:function(t,e){var n=t.forceMaterial;t.renderList.traverse((function(n){tr(n)&&(t.forceMaterial=n.material.getShadowMaterial(e),t.renderMesh(n))}),(function(n){n.length&&(t.forceMaterial=n[0].material.getShadowMaterial(e),t.renderInstancedMeshes(n.filter((function(t){return tr(t)}))))})),t.forceMaterial=n},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))},_createCameraHelper:function(){if(this.debug){var t=this.light,e=this.camera;this._cameraHelper||(this._cameraHelper=new qn({camera:e,color:new v.a(0,1,0)}),t.addChild(this._cameraHelper))}}}),nr=D.a.DISTANCE,rr=D.a.BACK,ir=D.a.TEXTURE_CUBE_MAP,ar=D.a.TEXTURE0,sr=D.a.TEXTURE_CUBE_MAP_POSITIVE_X,or=D.a.NEAREST,ur=D.a.FRAMEBUFFER,cr=D.a.FRAMEBUFFER_COMPLETE,hr=null,fr=new v.a(0,0,0,0),lr=new h.a,dr=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],mr=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},_r=a.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:er,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){_r.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new He(this.renderer,{target:ir,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new je({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:or,minFilter:or,width:1024,height:1024});return t.checkFramebufferStatus(ur)!==cr&&_.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(ur)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,r=this.texture.getGLTexture(e);e.activeTexture(ar+mt.MAX_TEXTURE_INDEX),e.bindTexture(this.target,r),n.framebufferTexture2D(ur,this.attachment,sr+t,r,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new $,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,r=this.camera;hr||(hr=new Hn({vertexType:nr,side:rr,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(r.position);for(var i=0;i<6;i++)n.bindTexture(i),lr.fromArray(dr[0],3*i).add(r.position),r.up.fromArray(dr[1],3*i),r.lookAt(lr),r.updateViewProjectionMatrix(),e.clear(fr),dn.setCamera(r),e.forceMaterial=hr,this.renderShadowScene(e);r.matrix.identity(),r.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),dn.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){mr(e,n)&&t.renderMesh(e)}),(function(e){var r=e.filter((function(t){return mr(t,n)}));t.renderInstancedMeshes(r)}))}}),pr=_r,gr=a.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){gr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new pr({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),Er=gr,vr=new u.a,Tr=new h.a,Ar=a.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",lightShadow:null,constructor:function(t){this.direction=new h.a(0,0,1),Ar.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new er({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Tr.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Tr},getViewDirection:function(t){var e=t.getModelViewMatrix(this,vr);return Tr.copy(this.direction).transformDirection(e).normalize(),Tr}}),Mr=Ar,Rr=new u.a,Ir=new h.a,Lr=a.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(m.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(m.a.degToRad(t))}},constructor:function(t){this.direction=new h.a(0,0,1),Lr.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new er({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Ir.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Ir},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Rr);return Ir.copy(this.direction).transformDirection(e).normalize(),Ir}}),Or=Lr,Sr=a.a.create({Extends:Sn,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){Sr.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Sr.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),yr=Sr,Nr=n(14),xr=n.n(Nr),Cr=a.a.create({Extends:Q,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Cr.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Q.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cr.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(i.each)(this.targets,(function(n,r){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===r?e.MORPH_HAS_POSITION=1:"normals"===r?e.MORPH_HAS_NORMAL=1:"tangents"===r&&(e.MORPH_HAS_TANGENT=1)}))),e}}),br=Cr,Pr={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},wr={Geometry:Q,GeometryData:w};var Dr={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Dr.useAuto?xr.a.initWASM(Dr.wasmURL,Dr.memPages):Dr.useWebWorker?xr.a.initWorker(Dr.workerURL):Dr.useWASM?xr.a.initWASM(Dr.wasmURL,Dr.memPages):Promise.resolve()},parse:function(t,e,n,r){var i=Date.now(),a=e.bufferViews[t.bufferView],s=Dr.wasmURL,o=Dr.workerURL,u=Dr.useAuto,c=Dr.useWASM,h=Dr.useWebWorker,f=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);function l(e){Dr._decodeTotalTime+=Date.now()-i;var n=e.toHilo3dGeometry(wr,r.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var r=new br;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&"id"!==i&&(r[i]=n[i]);r.targets={},n=r}for(var a=n.targets,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),qr=new u.a,Zr=new u.a,Kr=a.a.create({Extends:jn,isSkinedMesh:!0,className:"SkinedMesh",useInstanced:!1,jointMatTexture:null,frustumTest:!1,skeleton:null,constructor:function(t){Kr.superclass.constructor.call(this,t)},getJointMat:function(){var t=this;if(this.skeleton&&!(this.skeleton.jointCount<=0)){var e=this.skeleton.jointNodeList,n=this.skeleton.inverseBindMatrices,r=16*this.skeleton.jointCount;return this.jointMat&&this.jointMat.length===r||(this.jointMat=new Float32Array(r)),this.clonedFrom?Zr.invert(this.clonedFrom.worldMatrix):Zr.invert(this.worldMatrix),e.forEach((function(e,r){qr.copy(Zr),qr.multiply(e.worldMatrix),qr.multiply(n[r]),qr.toArray(t.jointMat,16*r)})),this.jointMat}},resetJointNamesByNodeName:function(t){this.skeleton.resetJointNamesByNodeName(t)},resetSkinIndices:function(t){var e=this.skeleton;if(e){var n=this.geometry,r=n.skinIndices;if(r){this.material.isDirty=!0,n.isDirty=!0,r.isDirty=!0;var i=new y.a;r.traverse((function(n,a,s){n.elements.forEach((function(n,r){var a=e.jointNames[n],s=t.jointNames.indexOf(a);s>=0?i.elements[r]=s:_.a.warnOnce("SkinedMesh.resetSkinIndices","SkinedMesh.resetSkinIndices: no jointName found!",a)})),r.setByOffset(s,i)}))}}},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new Ke({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=jn.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,skeleton:this.skeleton.clone()}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kr.superclass.getRenderOption.call(this,t);var e=this.skeleton.jointCount;if(e&&(t.JOINT_COUNT=e,mt.VERTEX_TEXTURE_FLOAT)){var n=(mt.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),Qr=Kr,Jr=a.a.create({isSkeleton:!0,className:"Skeleton",userData:null,constructor:function(t){this.id=m.a.generateUUID(this.className),this.jointNodeList=[],this.jointNames=[],this.inverseBindMatrices=[],Object.assign(this,t)},jointCount:{get:function(){return this.jointNodeList.length}},_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,t&&this._initJointNodeList()}},_initJointNodeList:function(){var t={};this.rootNode.traverse((function(e){t[e.jointName]=e})),this.jointNodeList=this.jointNames.map((function(e){return t[e]}))},resetJointNamesByNodeName:function(t){var e=this.jointNames;this.jointNodeList.forEach((function(n,r){var i=t.rootNode.getChildByName(n.name);i&&(e[r]=i.jointName)}))},clone:function(t){var e=new Jr;return e.copy(this,t),e},copy:function(t,e){return this.inverseBindMatrices=t.inverseBindMatrices,this.jointNames=t.jointNames.slice(),void 0===e&&(e=t.rootNode),this.rootNode=e,this}}),$r=Jr,ti="1.19.0",ei=a.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),ni=new h.a,ri=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;if(n!==r)return n-r;var i=t.material._shaderNumId||0,a=e.material._shaderNumId||0;return i!==a?i-a:t._sortRenderZ-e._sortRenderZ},ii=function(t,e){var n=t.material.renderOrder,r=e.material.renderOrder;return n!==r?n-r:e._sortRenderZ-t._sortRenderZ},ai=a.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var r in n){var i=n[r];i.length>2&&e?e(i):i.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(ii),this.opaqueList.sort(ri)},addMesh:function(t,e){var n=t.material,r=t.geometry;if(n&&r){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var i=this.instancedDict,a=n.id+"_"+r.id,s=i[a];i[a]||(s=i[a]=[]),s.push(t)}else t.worldMatrix.getTranslation(ni),ni.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=ni.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else _.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),si=a.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,isWebGL2:!1,constructor:function(t){this.gl=t,this.isWebGL2=Object(i.isWebGL2)(t),this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,r){this.set4("colorMask",t,e,n,r)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,r){this.set4("blendFuncSeparate",t,e,n,r)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,r){this.set4("viewport",t,e,n,r)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n||(r[0]=e,r[1]=n,this.gl[t](e,n))},set3:function(t,e,n,r){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n&&i[2]===r||(i[0]=e,i[1]=n,i[2]=r,this.gl[t](e,n,r))},set4:function(t,e,n,r,i){var a=this._dict[t];a||(a=this._dict[t]=[]),a[0]===e&&a[1]===n&&a[2]===r&&a[3]===i||(a[0]=e,a[1]=n,a[2]=r,a[3]=i,this.gl[t](e,n,r,i))},get:function(t){return this._dict[t]}}),oi=a.a.create({Mixes:o,className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){this._needDestroyResources=[],this._meshDict={},Object.assign(this,t)},destroyMesh:function(t){var e=this;this.getMeshResources(t).forEach((function(t){e.destroyIfNoRef(t)})),delete this._meshDict[t.id]},getMeshResources:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._meshDict[t.id];return n&&n.forEach((function(t){e.push(t),t.getResources&&t.getResources(e)})),e},addMeshResources:function(t,e){var n=t.id,r=this._meshDict;r[n]||(r[n]=[]);var i=r[n];e.forEach((function(t){-1===i.indexOf(t)&&i.push(t)}))},destroyIfNoRef:function(t){var e=this._needDestroyResources;return t&&e.indexOf(t)<0&&e.push(t),this},getUsedResources:function(t){var e=this,n=[];return t&&t.traverse((function(t){t.isMesh&&!t.isDestroyed&&e.getMeshResources(t,n)})),n},destroyUnsuedResource:function(t){var e=this,n=this._needDestroyResources;if(0===n.length)return this;var r=this.getUsedResources(t);return n.forEach((function(t){r.indexOf(t)<0&&t&&t.destroy&&!t.alwaysUse&&(e.fire("destroyResource",t.id),t.destroy())})),this.reset(),this},reset:function(){return this._needDestroyResources.length=0,this}}),ui=new u.a,ci=new h.a,hi=new Float32Array([0,0,0]),fi=a.a.create({isLightManager:!0,className:"LightManager",shadowEnabled:!0,constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.each)(this.lightInfo,(function(n,r){if("uid"!==r&&n){e[r]=n;var i=t.getShadowMapCount(r);i&&(e[r+"_SMC"]=i)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:_.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(r.push(o.lightShadow.framebuffer.texture),i.push(o.lightShadow.width),i.push(o.lightShadow.height),s.push(o.lightShadow.minBias,o.lightShadow.maxBias),ui.copy(t.worldMatrix),ui.premultiply(o.lightShadow.camera.viewProjectionMatrix),ui.toArray(a,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return r.length&&(o.shadowMap=r,o.shadowMapSize=new Float32Array(i),o.shadowBias=new Float32Array(s),o.lightSpaceMatrix=new Float32Array(a)),o},getSpotInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[],c=[],h=[];this.spotLights.forEach((function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(i,d),h.push(f.range),a.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,ui),ui.getTranslation(ci),ci.toArray(r,d),f.shadow&&f.lightShadow&&(s.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),ui.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),ui.toArray(u,16*l))}));var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),dirs:new Float32Array(i),cutoffs:new Float32Array(a),ranges:new Float32Array(h)};return s.length&&(f.shadowMap=s,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],r=[],i=[],a=[],s=[],o=[],u=[];this.pointLights.forEach((function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,ui),ui.getTranslation(ci),ci.toArray(r,f),c.shadow&&c.lightShadow&&(i.push(c.lightShadow.framebuffer.texture),s.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(a,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(r),ranges:new Float32Array(u)};return i.length&&(c.shadowMap=i,c.shadowBias=new Float32Array(s),c.lightSpaceMatrix=new Float32Array(a),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,r=[],i=[],a=[],s=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(r,c),t.getModelViewMatrix(o,ui),ui.getTranslation(ci),ci.toArray(i,c);var h=ui.getRotation();ui.fromQuat(h),ci.set(.5*o.width,0,0),ci.transformMat4(ui),ci.toArray(a,c),ci.set(0,.5*o.height,0),ci.transformMat4(ui),ci.toArray(s,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(r),poses:new Float32Array(i),width:new Float32Array(a),height:new Float32Array(s),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return hi[0]=hi[1]=hi[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();hi[0]+=e.r,hi[1]+=e.g,hi[2]+=e.b})),hi[0]=Math.min(1,hi[0]),hi[1]=Math.min(1,hi[1]),hi[2]=Math.min(1,hi[2]),hi},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,r=this.directionalLights,i=this.pointLights,a=this.spotLights,s=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=i.length,e.DIRECTIONAL_LIGHTS=r.length,e.SPOT_LIGHTS=a.length,e.AREA_LIGHTS=s.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=i.filter(o).length,e.SHADOW_SPOT_LIGHTS=a.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=r.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo(),this.updateCustomInfo&&this.updateCustomInfo(this,t)},updateCustomInfo:null,getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){if(!this.shadowEnabled)return 0;var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},update:function(t,e,n){var r=this;n.forEach((function(t){r.addLight(t)})),this.createShadowMap(t,e),this.updateInfo(e)},createShadowMap:function(t,e){this.shadowEnabled&&(this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)})))}}),li=D.a.DEPTH_TEST,di=D.a.STENCIL_TEST,mi=D.a.SAMPLE_ALPHA_TO_COVERAGE,_i=D.a.CULL_FACE,pi=D.a.FRONT_AND_BACK,gi=D.a.BLEND,Ei=D.a.LINES,vi=D.a.STATIC_DRAW,Ti=D.a.DYNAMIC_DRAW,Ai=a.a.create({Mixes:o,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,forceMaterial:null,isInitFailed:!1,_isInit:!1,_isContextLost:!1,isWebGL2:!1,preferWebGL2:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new ei,this.renderList=new ai,this.lightManager=new fi,this.resourceManager=new oi},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var r=this.domElement;this.width=t,this.height=e,r.width=t,r.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,r){var i=this.state,a=this.gl;i&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=a.drawingBufferWidth),void 0===r&&(r=a.drawingBufferHeight),i.viewport(t,e,n,r))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};if(!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0),this.preferWebGL2)try{this.gl=this.domElement.getContext("webgl2",e),this.isWebGL2=!0}catch(t){this.isWebGL2=!1,this.gl=null}this.gl||(this.gl=this.domElement.getContext("webgl",e),this.isWebGL2=!1);var n=this.gl;n.viewport(0,0,this.width,this.height),Pt.init(n),dt.init(n),mt.init(n),Ot.init(this),this.state=new si(n),dt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,this.useFramebuffer&&(this.framebuffer=new He(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){var e=this.gl;this._isContextLost=!0,t.preventDefault(),Gt.reset(e),Ot.reset(e),ge.reset(e),Wt.reset(e),$t.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null,this.fire("webglContextLost")},_onContextRestore:function(t){var e=this.gl;this._isContextLost=!1,dt.reset(e),He.reset(e),this.fire("webglContextRestored")},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(li),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(li)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(mi):e.disable(mi)},setupCullFace:function(t){var e=this.state;e.frontFace(t.frontFace),t.cullFace&&t.cullFaceType!==pi?(e.enable(_i),e.cullFace(t.cullFaceType)):e.disable(_i)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(gi),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(gi)},setupStencil:function(t){if(this.stencil){var e=this.state;t.stencilTest?(e.enable(di),e.stencilMask(t.stencilMask),e.stencilFunc(t.stencilFunc,t.stencilFuncRef,t.stencilFuncMask),e.stencilOp(t.stencilOpFail,t.stencilOpZFail,t.stencilOpZPass)):e.disable(di)}},setupUniforms:function(t,e,n,r){var i=this.forceMaterial||e.material;if(this.isWebGL2){var a=i.uniformBlocks;for(var s in t.uniformBlocks){var o=a[s];o&&(t[s]=o)}}for(var u in t.uniforms){var c=i.getUniformInfo(u),h=t.uniforms[u];if(!c.isBlankInfo&&(r||c.isDependMesh&&!n)){var f=c.get(e,i,h);null!=f&&(t[u]=f)}}},setupVao:function(t,e,n){var r=n.geometry,i=r.isStatic;if(t.isDirty||!i||r.isDirty){t.isDirty=!1;var a=this.forceMaterial||n.material,s=a.attributes,o=i?vi:Ti;for(var u in s){var c=e.attributes[u];if(c){var h=a.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}r.indices&&t.addIndexBuffer(r.indices,o),r.isDirty=!1}r.vertexCount&&(t.vertexCount=r.vertexCount)},setupMaterial:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.forceMaterial||e.material;(i.isDirty||this._lastMaterial!==i)&&(this.setupDepthTest(i),this.setupSampleAlphaToCoverage(i),this.setupCullFace(i),this.setupBlend(i),this.setupStencil(i),r=!0),this.setupUniforms(t,e,n,r),i.isDirty=!1,this._lastMaterial=i},setupMesh:function(t,e){var n=this.gl,r=this.state,i=this.lightManager,a=this.resourceManager,s=t.geometry,o=this.forceMaterial||t.material,u=Ot.getShader(t,o,e,i,this.fog,this.useLogDepth),c=Gt.getProgram(u,r);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&s.mode!==Ei&&s.convertToLinesMode();var h=s.id+c.id,f=$t.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:s.mode});return this.setupVao(f,c,t),a.addMeshResources(t,[f,u,c]),{vao:f,program:c,geometry:s}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var r=this.renderList,i=this.renderInfo,a=this.lightManager,s=this.resourceManager,o=this.state;this.fog=t.fog,a.reset(),i.reset(),r.reset(),dn.init(this,o,e,a,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix();var u=[];t.traverse((function(t){return t.visible?(t.isMesh?r.addMesh(t,e):t.isLight&&u.push(t),E.TRAVERSE_STOP_NONE):E.TRAVERSE_STOP_CHILDREN})),r.sort(),a.update(this,e,u),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),s.destroyUnsuedResource(t)}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),n.depthMask(!0);var r=e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT;this.stencil&&(n.stencilMask(!0),r|=e.STENCIL_BUFFER_BIT),e.clear(r)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},clearStencil:function(){var t=this.gl;this.state.stencilMask(!0),t.clear(t.STENCIL_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,r=this.setupMesh(e,!0),i=r.vao,a=r.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,r=e.info,s=a.attributes[n];s&&i.addInstancedAttribute(s,t,(function(t){return r.get(t)}))})),i.drawInstance(t.length),this.addRenderInfo(i.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(Gt.reset(t),Ot.reset(t),Wt.reset(t),$t.reset(t),this.state.reset(t),ge.reset(t),He.destroy(t))}}),Mi=function(){var t,e=navigator.userAgent,n=document,r=window,i=n.documentElement,a={iphone:/iphone/i.test(e),ipad:/ipad/i.test(e),ipod:/ipod/i.test(e),ios:/iphone|ipad|ipod/i.test(e),android:/android/i.test(e),webkit:/webkit/i.test(e),chrome:/chrome/i.test(e),safari:/safari/i.test(e),firefox:/firefox/i.test(e),ie:/msie/i.test(e),opera:/opera/i.test(e),supportTouch:"ontouchstart"in r,supportCanvas:!!n.createElement("canvas").getContext,supportStorage:void 0,supportOrientation:"orientation"in r||"orientation"in r.screen,supportDeviceMotion:"ondevicemotion"in r};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),a.supportStorage=!0}catch(t){a.supportStorage=!1,_.a.warn("LocalStorage disabled")}t=a.webkit||a.firefox?"webkit":a.opera?"o":a.ie?"ms":"",a.jsVendor=t;var s=a.cssVendor="-"+t+"-";try{var o=n.createElement("div"),u=o.style,c=void 0!==u[t+"Transform"],h=void 0!==u[t+"Perspective"];h&&(o.id="test3d",(u=n.createElement("style")).textContent="@media ("+s+"transform-3d){#test3d{height:3px}}",n.head.appendChild(u),i.appendChild(o),h=3===o.offsetHeight,n.head.removeChild(u),i.removeChild(o)),a.supportTransform=c,a.supportTransform3D=h}catch(t){a.supportTransform=!1,a.supportTransform3D=!1}var f=a.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return a.POINTER_START=l,a.POINTER_MOVE=d,a.POINTER_END=m,a}(),Ri=a.a.create({Extends:E,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,width:0,height:0,canvas:null,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}Ri.superclass.constructor.call(this,t),this.initRenderer(t),_.a.log("Hilo3d version: ".concat(ti))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new Ai(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,r){if(void 0===n&&(n=this.pixelRatio),r||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var i=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,r),i.style.width=this.width+"px",i.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,r){return this.resize(n,r,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.canvas,i=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?r.addEventListener(t,i,!1):r.removeEventListener(t,i)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,r=t.type,i=0===r.indexOf("touch"),a=t;if(i){var s=t.touches,o=t.changedTouches;s&&s.length?a=s[0]:o&&o.length&&(a=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(a.pageX||a.clientX)-u.left,h=(a.pageY||a.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===r;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===r?m="touchout":"mousemove"!==r&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==r&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!i){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}Mi.android&&"touchmove"===r&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(i.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.camera,i=this._ray;i||(i=this._ray=new Gn.a),i.fromCamera(r,t,e,this.width,this.height);var a=this.raycast(i,!0,n);if(a)return a[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new h.a});var s=this._stageResultAtPoint.point;return s.copy(r.unprojectVector(s.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return Ri.superclass.destroy.call(this,this.renderer),this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),Ii=Ri;function Li(){return+new Date}var Oi=a.a.create({constructor:function(t,e,n,r){var i=this;for(var a in i.target=t,i._startTime=0,i._seekTime=0,i._pausedTime=0,i._pausedStartTime=0,i._reverseFlag=1,i._repeatCount=0,3===arguments.length&&(r=n,n=e,e=null),r)i[a]=r[a];i._fromProps=e,i._toProps=n,!r.duration&&r.time&&(i.duration=r.time||0,i.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,r=t||e,i=this._fromProps={},a=this._toProps={};for(var s in t=t||n,e=e||n,r)a[s]=e[s]||0,n[s]=i[s]=t[s]||0;return this},start:function(){var t=this;return t._startTime=Li()+t.delay,t._seekTime=0,t._pausedTime=0,t._reverseFlag=1,t._repeatCount=0,t.paused=!1,t.isStart=!1,t.isComplete=!1,Oi.add(t),t},stop:function(){return Oi.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=Li(),this},resume:function(){var t=this;return t.paused=!1,t._pausedStartTime&&(t._pausedTime+=Li()-t._pausedStartTime),t._pausedStartTime=0,t},seek:function(t,e){var n=this,r=Li();return n._startTime=r,n._seekTime=t,n._pausedTime=0,void 0!==e&&(n.paused=e),n._update(r,!0),Oi.add(n),n},link:function(t){var e,n,r=t.delay,i=this._startTime;return"string"==typeof r&&(e=0===r.indexOf("+"),n=0===r.indexOf("-"),r=e||n?Number(r.substr(1))*(e?1:-1):Number(r)),t.delay=r,t._startTime=e||n?i+this.duration+r:i+r,this._next=t,Oi.remove(t),t},_render:function(t){var e=this.target,n=this._fromProps;for(var r in n)e[r]=n[r]+(this._toProps[r]-n[r])*t},_update:function(t,e){var n=this;if(n.paused&&!e)return!1;if(n.isComplete)return!0;var r=t-n._startTime-n._pausedTime+n._seekTime;if(r<0)return!1;var i,a=r/n.duration;a<=0?a=0:a>=1&&(a=1);var s=n.ease?n.ease(a):a;n.reverse&&n.isStart&&(n._reverseFlag<0&&(a=1-a,s=1-s),a<1e-7&&(n.repeat>0&&n._repeatCount++>=n.repeat||0===n.repeat&&!n.loop?n.isComplete=!0:(n._startTime=Li(),n._pausedTime=0,n._reverseFlag*=-1))),n.isStart||(n.setProps(n._fromProps,n._toProps),n.isStart=!0,n.onStart&&n.onStart.call(n,n)),n.time=r,n._render(s),(i=n.onUpdate)&&i.call(n,s,n),a>=1&&(n.reverse?(n._startTime=Li(),n._pausedTime=0,n._reverseFlag*=-1):n.loop||n.repeat>0&&n._repeatCount++0&&u<=t?(o._render(a),o.time=r,Oi.add(o)):n.isComplete&&(u<0||u>t)&&o.start()}return!!n.isComplete&&((i=n.onComplete)&&i.call(n,n),!0)},Statics:{_tweens:[],tick:function(){var t,e,n=Oi._tweens,r=n.length;for(e=0;e-1&&r.splice(e,1);else for(e=0;e1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?_.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return _.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return zi.superclass._raycast.call(this,t,e)}}),qi=zi,Zi=D.a.FRONT,Ki=D.a.BACK,Qi=[0,0,1],Ji=a.a.create({Extends:Q,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){Ji.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),r=this.width/t,i=this.height/e,a=new Float32Array(3*n),s=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(a[3*l]=f*r-this.width/2,a[3*l+1]=this.height/2-h*i,s[3*l]=0,s[3*l+1]=0,s[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===Ki&&(r<0||n>0))return null;var i=t.intersectsPlane(Qi,0);if(i){var a=i.x,s=i.y,o=.5*this.width,u=.5*this.height;if(a>=-o&&a<=o&&s>=-u&&s<=u)return[i]}return null}}),$i=Ji,ta=a.a.create({Extends:Q,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){ta.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,r=(n+1)*(e+1),i=n*e,a=new Float32Array(3*r),s=new Float32Array(4*r),o=new Float32Array(2*r),u=new Uint16Array(6*i),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,E=_*g,v=Math.cos(E)*t,T=Math.sin(E)*t,A=0;A<=n;A++){var M=A/n,R=m*M,I=Math.cos(R),L=Math.sin(R),O=I*T,S=L*T,y=L,N=-I;if(s[f++]=y,s[f++]=0,s[f++]=N,s[f++]=1,a[h++]=O,a[h++]=v,a[h++]=S,o[l++]=M,o[l++]=g,p>0&&A>0){var x=d,C=x-1,b=C-n-1,P=x-n-1;u[c++]=b,u[c++]=P,u[c++]=x,u[c++]=b,u[c++]=x,u[c++]=C}d++}this.vertices=new w(a,3),this.indices=new w(u,1),this.uvs=new w(o,2),this.tangents=new w(s,4),this.normals=new w(new Float32Array(a),3)},_raycast:function(t,e){return ta.superclass._raycast.call(this,t,e)}}),ea=ta,na=a.a.create({className:"UniformBuffer",isUniformBuffer:!0,isDirty:!1,data:{get:function(){return this._data},set:function(t){this._data=t,this.isDirty=!0}},_data:null,_buffer:null,constructor:function(t){this.data=t},getBuffer:function(t){return this._buffer||(this._buffer=new Wt(t,t.UNIFORM_BUFFER,null,t.DYNAMIC_DRAW)),this.isDirty&&(this._buffer.bufferData(this.data),this.isDirty=!1),this._buffer},destroy:function(){this._buffer&&(this._buffer.destroy(),this._buffer=null),this.isDirty=!0}}),ra=[Ot,Gt,Wt,$t,ge,He],ia=function(){var t="";return ra.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),_.a.log(t),t},aa=a.a.create({Mixes:o,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var r={key:t,state:e,data:n};this._files[t]=r,this.fire("update",r),this.fire("update:".concat(r.key),r)}},get:function(t){return this.enabled?this._files[t]:null},getLoaded:function(t){var e=this.get(t);return e&&e.state===aa.LOADED?e.data:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===aa.LOADED?Promise.resolve(t.data):t.state===aa.FAILED?Promise.reject():new Promise((function(n,r){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===aa.LOADED?n(e.data):e.state===aa.FAILED&&r(e.data)}),!0)})):Promise.reject()}}),sa=aa,oa=new sa,ua=a.a.create({Mixes:o,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:oa,enalbeCache:function(){oa.enabled=!0},disableCache:function(){oa.enabled=!1},deleteCache:function(t){oa.remove(t)},clearCache:function(){oa.clear()},cache:{get:function(){return oa},set:function(){_.a.warn("BasicLoader.cache is readonly!")}},TYPE_IMAGE:"img",TYPE_JSON:"json",TYPE_BUFFER:"buffer",TYPE_TEXT:"text"},load:function(t){var e=t.src,n=t.type;if(!n){var r=Object(i.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(r)&&(n="img"),n||(n=t.defaultType)}return n===ua.TYPE_IMAGE?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,r=new Uint8Array(n),i=0;i=300)r(new TypeError("Network request failed for ".concat(a.status)));else{var e="response"in a?a.response:a.responseText;if(t.type===ua.TYPE_JSON)try{e=JSON.parse(e)}catch(t){return void r(new TypeError("JSON.parse error"+t))}n(e)}},a.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request timed out"))},a.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(a.withCredentials=!0),t.type===ua.TYPE_BUFFER&&(a.responseType="arraybuffer"),Object(i.each)(t.headers,(function(t,e){a.setRequestHeader(e,t)})),a.send(t.body||null)}))}}),ca=ua,ha=a.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){ha._loaderClassMap[t]=e},getLoader:function(t){if(!ha._loaders[t]){var e=ha._loaderClassMap[t]?ha._loaderClassMap[t]:ca;ha._loaders[t]=new e}return ha._loaders[t]}},preHandlerUrl:null,load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(i.getExtension)(t.src),r=ha.getLoader(n),a=t;return this.preHandlerUrl&&((a=Object.assign({},t)).src=this.preHandlerUrl(t.src)),r.load(a)}}),fa=ha,la=a.a.create({Extends:ca,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){la.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new je(n)})).catch((function(t){throw _.a.error("load CubeTexture failed",t.message,t.stack),t}))}});fa.addLoader("CubeTexture",la);var da=la,ma=a.a.create({Extends:Sn,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnvMap:null,isSpecularEnvMapIncludeMipmaps:!1,emission:null,emissionFactor:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,clearcoatFactor:0,clearcoatMap:null,clearcoatRoughnessFactor:0,clearcoatRoughnessMap:null,clearcoatNormalMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),this.emissionFactor=new v.a(0,0,0),ma.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_emissionFactor:"EMISSIONFACTOR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3",u_clearcoatFactor:"CLEARCOATFACTOR",u_clearcoatRoughnessFactor:"CLEARCOATROUGHNESSFACTOR"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP",u_clearcoatMap:"CLEARCOATMAP",u_clearcoatRoughnessMap:"CLEARCOATROUGHNESSMAP",u_clearcoatNormalMap:"CLEARCOATNORMALMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ma.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),mt.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),this.specularEnvMap&&this.isSpecularEnvMapIncludeMipmaps&&(t.IS_SPECULAR_ENV_MAP_INCLUDE_MIPMAPS=1),this.clearcoatFactor>0&&(t.HAS_CLEARCOAT=1,t.HAS_NORMAL=1,this.clearcoatMap&&e.add(this.clearcoatMap,"CLEARCOAT_MAP"),this.clearcoatNormalMap&&e.add(this.clearcoatNormalMap,"CLEARCOAT_NORMAL_MAP"),this.clearcoatRoughnessMap&&e.add(this.clearcoatRoughnessMap,"CLEARCOAT_ROUGHNESS_MAP")),e.update(),t}}),_a=ma,pa=new Image;pa.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ga=a.a.create({Extends:ge,Mixes:o,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ga.superclass.constructor.call(this,t),this.image=this.placeHolder||pa},load:function(t){var e=this;return ga.loader=ga.loader||new fa,ga.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));_.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ga.superclass._releaseImage.call(this)}}),Ea=ga,va=n(12);function Ta(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Aa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;r--)Na[r]=t[r]+n*(e[r]-t[r]);return Na}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,r){var a=t.length/3;if(void 0===e)return 1===a?t[1]:t.slice(a,-a);var s=t[1],o=t[2],u=e[1],c=e[0];return a>1&&(s=t.slice(a,-a),o=t.slice(-a),u=e.slice(a,-a),c=e.slice(0,a)),s.hermite?s.hermite(s,o.scale(r),u,c.scale(r),n):s.isQuaternion?(s.fromArray(this._cubicSpline(s.elements,o.elements,u.elements,c.elements,r,n),0),s.normalize()):(Object(i.isArrayLike)(s)||(s=[s],o=[o],u=[u],c=[c]),s=this._cubicSpline(s,o,u,c,r,n)),s},_cubicSpline:function(t,e,n,r,i,a){var s=a*a,o=s*a,u=2*o-3*s+1,c=o-2*s+a,h=-2*o+3*s,f=o-s;Na.length=0;for(var l=t.length-1;l>=0;l--)Na[l]=t[l]*u+c*e[l]*i+n[l]*h+f*r[l]*i;return Na}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ca.StateType[t]||Ca._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ca._extraStateHandlers.type[String(t).toUpperCase()]=t,Ca._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=m.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){var e=Object(i.getIndexFromSortedArray)(this.keyTime,t,xa);return e[0]<0&&(e[0]=0),e[1]>=this.keyTime.length&&(e[1]=this.keyTime.length-1),e},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=Ta(this.findIndexByTime(t),2),n=e[0],r=e[1],a=this.keyTime[n],s=this.keyTime[r],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===r){var u=this.interpolation(o);return this.type===Ca.StateType.ROTATION&&(u=Ma.fromEuler(ya.fromArray(u))),u.elements||u}var c=this.getStateByIndex(r),h=s-a,f=(t-a)/h;this.type===Ca.StateType.ROTATION?Object(i.isArrayLike)(o[0])?(o[0]=Ma.fromEuler(ya.fromArray(o[0])),o[1]=Ra.fromEuler(ya.fromArray(o[1])),o[2]=Ia.fromEuler(ya.fromArray(o[2])),c[0]=La.fromEuler(ya.fromArray(c[0])),c[1]=Oa.fromEuler(ya.fromArray(c[1])),c[2]=Sa.fromEuler(ya.fromArray(c[2]))):(o=Ma.fromEuler(ya.fromArray(o)),c=Ra.fromEuler(ya.fromArray(c))):this.type===Ca.StateType.QUATERNION&&(Object(i.isArrayLike)(o[0])?(o[0]=Ma.fromArray(o[0]),o[1]=Ra.fromArray(o[1]),o[2]=Ia.fromArray(o[2]),c[0]=La.fromArray(c[0]),c[1]=Oa.fromArray(c[1]),c[2]=Sa.fromArray(c[2])):(o=Ma.fromArray(o),c=Ra.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,r){return Ca.interpolation[this.interpolationType](t,e,n,r)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],r=e.length;e=e.slice();for(var i=0;ie[a]){var o=e[a];e[a]=e[s],e[s]=o,o=n[a],n[a]=n[s],n[s]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ca.StateType.ROTATION&&(n=Ca.StateType.QUATERNION);var r=this.getState(t);if(r){var i="updateNode"+n;this[i]?this[i](e,r):Ca._extraStateHandlers.handler[n]?Ca._extraStateHandlers.handler[n].call(this,e,r):_.a.warnOnce(i,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),ba=Ca,Pa=a.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:o,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this._initNodeNameMap()}},_animStatesList:null,animStatesList:{get:function(){return this._animStatesList},set:function(t){this._animStatesList=t,this._initClipTime()}},validAnimationIds:null,constructor:function(t){this.id=m.a.generateUUID(this.className),this.clips={},this._animStatesList=[],Object.assign(this,t)},addClip:function(t,e,n,r){this.clips[t]={start:e,end:n,animStatesList:r}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},_initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=0,this.clipEndTime=t.endTime},_initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var r=this.clips[t];r?(n=r.start,e=r.end,r.animStatesList&&(this.animStatesList=r.animStatesList,this._initClipTime())):_.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Pa._anims.push(this)},stop:function(){this.paused=!0;var t=Pa._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),wa=Pa;function Da(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ha(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ha(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ha(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},i.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Ya.extensionHandlers[t]},parseExtension:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t[e],a=this.getExtensionHandler(e);return a&&a.parse?a.parse(i,this,n,r):n},parseExtensions:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.each(t,(function(t,i){if(!r.ignoreExtensions||!r.ignoreExtensions[i]){var a=n.getExtensionHandler(i),s=r.methodName||"parse";a&&a[s]&&(e=a[s](t,n,e,r))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),r=n.getUint32(4,!0),a=n.getUint32(8,!0),s=12;if(r<2){var o=n.getUint32(s,!0);e=new Uint8Array(t,20,o),e=i.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==r)throw new Error("Dont support glTF version ".concat(r));for(;sa*i.BYTES_PER_ELEMENT)s.array=new i(s.buffer,s.byteOffset,s.byteLength/i.BYTES_PER_ELEMENT),r=new w(s.array,a,{offset:n.byteOffset||0,stride:s.byteStride,bufferViewId:s.id});else{var u,c=(n.byteOffset||0)+s.byteOffset;if(c%i.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new i(s.buffer.slice(c,c+o*i.BYTES_PER_ELEMENT));else u=new i(s.buffer,c,o);r=new w(u,a)}return n.sparse&&(r||(r=new w(new i(o),a)),r=this.sparseAccessorHandler(r,n.sparse)),r=this.parseExtensions(n.extensions,r,{isDecode:e,isAccessor:!0}),n.data=r,n.normalized&&(r.normalized=!0),r},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var r=this.getAccessorData(t,e);if(!r.stride&&!r.offset&&1===r.size)return r.data;var i=[];return r.traverse((function(t){i.push(t.toArray?t.toArray():t)})),n.array=i,i},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case Fa:e.blend=!0;break;case Ua:e.depthTest=!0;break;case Ga:e.cullFace=!0}})),i.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Ba?Va:Ba:e.side=Xa)},createMorphGeometry:function(t,e){var n=this,r=new br,a=r.targets={};return i.each(t.targets,(function(t){i.each(t,(function(t,e){var r=Wa[e].name;a[r]||(a[r]=[]);var i=n.getAccessorData(t,!0);a[r].push(i)}))})),r.weights=e||new Float32Array(t.targets.length),r},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var r=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(r)return r.mode=n,r}t||(t=new Q({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var i=e.attributes;for(var a in i){var s=Wa[a];if(s){var o=!(this.isUnQuantizeInShader&&s.decodeMatName);t[s.name]=this.getAccessorData(i[a],o),o||(t[s.decodeMatName]=t[s.name].decodeMat,delete t[s.name].decodeMat)}else _.a.warn("Unknow attribute named ".concat(a,"!"))}return t},handlerSkinedMesh:function(t,e){e&&(t.skeleton=e,this.useInstanced&&(t.useInstanced=!0))},fixProgressiveGeometry:function(t,e){t._geometry=e,this.isProgressive&&t._meshes&&t._meshes.forEach((function(t){t.visible=!0,t.geometry=e}))},parseGeometries:function(){var t=this,e=i.serialRun(this.json.meshes,(function(e){return i.serialRun(e.primitives,(function(n){var r;n.targets&&n.targets.length&&(r=t.createMorphGeometry(n,e.weights)),n._geometry=r;var i=t.handlerGeometry(r,n);return i&&i.then?i.then((function(e){t.fixProgressiveGeometry(n,e)}),(function(t){_.a.error("geometry parse error",t)})):(t.fixProgressiveGeometry(n,i),i)}))}));return this.isProgressive?null:e},parseMesh:function(t,e,n){var r=this,i=this.json.meshes[t];i.primitives.forEach((function(a){var s,o=r.skins&&r.skins[n.skin];if(a.meshNode)s=a.meshNode.clone();else{var u=r.materials[a.material]||new Nn;s=new(o?Qr:jn)({geometry:a._geometry,material:u,name:"mesh-"+(i.name||t)}),a.meshNode=s}r.handlerSkinedMesh(s,o),r.isProgressive&&!s.geometry&&(s.visible=!1,a._meshes=a._meshes||[],a._meshes.push(s)),e.addChild(s),r.meshes.push(s)}))},parseCameras:function(){var t=this;this.cameras={};var e=window.innerWidth/window.innerHeight;i.each(this.json.cameras,(function(n,r){var i;"perspective"===n.type&&n.perspective?((i=new $).fov=m.a.radToDeg(n.perspective.yfov),i.near=n.perspective.znear,i.far=n.perspective.zfar,n.aspectRatio?i.aspect=n.aspectRatio:i.aspect=e):"orthographic"===n.type&&n.orthographic&&((i=new Un).near=n.orthographic.znear,i.far=n.orthographic.zfar,i.right=n.orthographic.xmag,i.left=-1*i.right,i.top=n.orthographic.ymag,i.bottom=-1*i.top),(i=t.parseExtensions(n.extensions,i,{isCamera:!0}))&&(i.name=n.name||r,t.cameras[r]=i)}))},handlerNodeTransform:function(t,e){e.matrix?t.matrix.fromArray(e.matrix):(e.rotation&&t.quaternion.fromArray(e.rotation),e.scale&&t.setScale(e.scale[0],e.scale[1],e.scale[2]),e.translation&&(t.x=e.translation[0],t.y=e.translation[1],t.z=e.translation[2]))},parseNode:function(t,e){var n,r=this,i=this.json.nodes[t];i||_.a.warn("GLTFParser.parseNode: nodes[".concat(t,"] has nothing.")),n=new E({name:i.name,animationId:t}),n=this.parseExtensions(i.extensions,n,{isNode:!0}),"camera"in i&&this.cameras[i.camera]&&n.addChild(this.cameras[i.camera]),this.handlerNodeTransform(n,i),i.jointName?(n.jointName=i.jointName,this.jointMap[n.jointName]=n):this.isGLTF2&&(n.jointName=t,this.jointMap[t]=n),i.meshes?i.meshes.forEach((function(t){return r.parseMesh(t,n,i)})):"mesh"in i&&this.parseMesh(i.mesh,n,i),i.children&&i.children.forEach((function(t){return r.parseNode(t,n)})),e.addChild(n)},parseAnimations:function(){var t=this;if(!this.json.animations)return null;var e=this.isMultiAnim,n={},r=[],a={};return i.each(this.json.animations,(function(i){i.channels.forEach((function(e){var n=e.target.path,s=e.target.id;t.isGLTF2&&(s=e.target.node);var o=i.samplers[e.sampler],u=t.isGLTF2?o.input:i.parameters[o.input],c=t.isGLTF2?o.output:i.parameters[n],h=t.getArrayByAccessor(u,!0),f=t.getArrayByAccessor(c,!0);"rotation"===n&&(n="quaternion");var l=new ba({interpolationType:o.interpolation||"LINEAR",nodeName:s,keyTime:h,states:f,type:ba.getType(n)});r.push(l),a[s]=!0})),e&&r.length&&(n[i.name]={animStatesList:r},r=[])})),e&&Object.keys(n).length>0&&(r=Object.values(n)[0].animStatesList),r.length?new wa({rootNode:this.node,animStatesList:r,validAnimationIds:a,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new E({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return _.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};var n=e.nodes;this.parseSkins(),n.forEach((function(e){return t.parseNode(e,t.node)})),this.resetSkinInfo(this.node);var r={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),r.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,r,{isGlobal:!0,methodName:"parseOnEnd"}),r},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null},parseSkins:function(){var t=this;this.skins=[];var e=this.json.skins;e&&e.length&&(this.skins=e.map((function(e){for(var n=new $r,r=e.joints.length,i=t.getArrayByAccessor(e.inverseBindMatrices,!0),a=0;a ",t)}return null}))}});fa.addLoader("hdr",ns);var rs=ns,is=a.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var r=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===r[0]&&75===r[1]&&84===r[2]&&88===r[3]&&32===r[4]&&49===r[5]&&49===r[6]&&187===r[7]&&13===r[8]&&10===r[9]&&26===r[10]&&10===r[11]){var i=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.arrayBuffer,this.baseOffset+12,13*i),s=a.getUint32(0,!0),o=67305985===s;this.glType=a.getUint32(1*i,o),this.glTypeSize=a.getUint32(2*i,o),this.glFormat=a.getUint32(3*i,o),this.glInternalFormat=a.getUint32(4*i,o),this.glBaseInternalFormat=a.getUint32(5*i,o),this.pixelWidth=a.getUint32(6*i,o),this.pixelHeight=a.getUint32(7*i,o),this.pixelDepth=a.getUint32(8*i,o),this.numberOfArrayElements=a.getUint32(9*i,o),this.numberOfFaces=a.getUint32(10*i,o),this.numberOfMipmapLevels=a.getUint32(11*i,o),this.bytesOfKeyValueData=a.getUint32(12*i,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=is.COMPRESSED_2D:this.loadType=is.TEX_2D:_.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):_.a.warn("texture arrays not currently supported"):_.a.warn("only 2D textures currently supported")}else _.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=is.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,i=this.pixelHeight,a=t?this.numberOfMipmapLevels:1,s=0;s2&&void 0!==arguments[2]?arguments[2]:0,r=new is(e,1,n),i={compressed:0===r.glType,type:r.glType,width:r.pixelWidth,height:r.pixelHeight,internalFormat:r.glInternalFormat,format:r.glFormat,isCubemap:6===r.numberOfFaces};return r.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(i.width,i.height))+1)?(i.mipmaps=r.mipmaps(!0),i.image=i.mipmaps[0].data):(i.mipmaps=null,i.image=r.mipmaps(!1)[0].data),new ge(i)}});fa.addLoader("ktx",as);var ss=as,os=a.a.create({Mixes:o,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){_.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),fa.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=this.renderer.pixelRatio,a=[],s=this.framebuffer.readPixels(t*i,e*i,n*i,r*i),o=0;o=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var r=n.slice(0),i=0,a=r.length;i=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(r){e.removeTick(n),t(r)}};return e.addTick(n),n},timeout:function(t,e){var n=this,r=(new Date).getTime()+e,i={tick:function(){(new Date).getTime()-r>=0&&(n.removeTick(i),t())}};return n.addTick(i),i},interval:function(t,e){var n=(new Date).getTime()+e,r={tick:function(){var r=(new Date).getTime(),i=r-n;i>=0&&(i0&&(o=1/Math.sqrt(o),t[0]=e*o,t[1]=r*o,t[2]=i*o,t[3]=u*o),t},n.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},n.lerp=function(t,n,e,r){var i=n[0],u=n[1],o=n[2],s=n[3];return t[0]=i+r*(e[0]-i),t[1]=u+r*(e[1]-u),t[2]=o+r*(e[2]-o),t[3]=s+r*(e[3]-s),t},n.random=function(t,n){var e,i,u,o,s,a;n=n||1;do{s=(e=2*r.RANDOM()-1)*e+(i=2*r.RANDOM()-1)*i}while(s>=1);do{a=(u=2*r.RANDOM()-1)*u+(o=2*r.RANDOM()-1)*o}while(a>=1);var c=Math.sqrt((1-s)/a);return t[0]=n*e,t[1]=n*i,t[2]=n*u*c,t[3]=n*o*c,t},n.transformMat4=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3];return t[0]=e[0]*r+e[4]*i+e[8]*u+e[12]*o,t[1]=e[1]*r+e[5]*i+e[9]*u+e[13]*o,t[2]=e[2]*r+e[6]*i+e[10]*u+e[14]*o,t[3]=e[3]*r+e[7]*i+e[11]*u+e[15]*o,t},n.transformQuat=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=e[0],s=e[1],a=e[2],c=e[3],f=c*r+s*u-a*i,h=c*i+a*r-o*u,l=c*u+o*i-s*r,d=-o*r-s*i-a*u;return t[0]=f*c+d*-o+h*-a-l*-s,t[1]=h*c+d*-s+l*-o-f*-a,t[2]=l*c+d*-a+f*-s-h*-o,t[3]=n[3],t},n.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=n[0],a=n[1],c=n[2],f=n[3];return Math.abs(e-s)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(u-c)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(o-f)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function o(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t[3]=n[3]*e[3],t}function s(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function a(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2],u=n[3]-t[3];return Math.sqrt(e*e+r*r+i*i+u*u)}function c(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2],u=n[3]-t[3];return e*e+r*r+i*i+u*u}function f(t){var n=t[0],e=t[1],r=t[2],i=t[3];return Math.sqrt(n*n+e*e+r*r+i*i)}function h(t){var n=t[0],e=t[1],r=t[2],i=t[3];return n*n+e*e+r*r+i*i}n.sub=u,n.mul=o,n.div=s,n.dist=a,n.sqrDist=c,n.len=f,n.sqrLen=h,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=4),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;a1?0:i<-1?Math.PI:Math.acos(i)},n.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=n[0],s=n[1],a=n[2];return Math.abs(e-o)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(u-a)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function u(t){var n=t[0],e=t[1],r=t[2];return Math.sqrt(n*n+e*e+r*r)}function o(t,n,e){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=n,i[2]=e,i}function s(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function a(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function c(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function f(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return Math.sqrt(e*e+r*r+i*i)}function h(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}function l(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function d(t,n){var e=n[0],r=n[1],i=n[2],u=e*e+r*r+i*i;return u>0&&(u=1/Math.sqrt(u),t[0]=n[0]*u,t[1]=n[1]*u,t[2]=n[2]*u),t}function E(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}n.sub=s,n.mul=a,n.div=c,n.dist=f,n.sqrDist=h,n.len=u,n.sqrLen=l,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=3),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;ar.EPSILON?(t[0]=n[0]/i,t[1]=n[1]/i,t[2]=n[2]/i):(t[0]=1,t[1]=0,t[2]=0),e},n.multiply=f,n.rotateX=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+o*s,t[1]=i*a+u*s,t[2]=u*a-i*s,t[3]=o*a-r*s,t},n.rotateY=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a-u*s,t[1]=i*a+o*s,t[2]=u*a+r*s,t[3]=o*a-i*s,t},n.rotateZ=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+i*s,t[1]=i*a-r*s,t[2]=u*a+o*s,t[3]=o*a-u*s,t},n.calculateW=function(t,n){var e=n[0],r=n[1],i=n[2];return t[0]=e,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-i*i)),t},n.slerp=h,n.random=function(t){var n=r.RANDOM(),e=r.RANDOM(),i=r.RANDOM(),u=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=u*Math.sin(2*Math.PI*e),t[1]=u*Math.cos(2*Math.PI*e),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e*e+r*r+i*i+u*u,s=o?1/o:0;return t[0]=-e*s,t[1]=-r*s,t[2]=-i*s,t[3]=u*s,t},n.conjugate=function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t},n.fromMat3=l,n.fromEuler=function(t,n,e,r){var i=.5*Math.PI/180;n*=i,e*=i,r*=i;var u=Math.sin(n),o=Math.cos(n),s=Math.sin(e),a=Math.cos(e),c=Math.sin(r),f=Math.cos(r);return t[0]=u*a*f-o*s*c,t[1]=o*s*f+u*a*c,t[2]=o*a*c-u*s*f,t[3]=o*a*f+u*s*c,t},n.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=s(e(0)),i=s(e(5)),u=s(e(2)),o=s(e(1));function s(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function a(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function f(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1],c=e[2],f=e[3];return t[0]=r*f+o*s+i*c-u*a,t[1]=i*f+o*a+u*s-r*c,t[2]=u*f+o*c+r*a-i*s,t[3]=o*f-r*s-i*a-u*c,t}function h(t,n,e,i){var u=n[0],o=n[1],s=n[2],a=n[3],c=e[0],f=e[1],h=e[2],l=e[3],d=void 0,E=void 0,m=void 0,_=void 0,R=void 0;return(E=u*c+o*f+s*h+a*l)<0&&(E=-E,c=-c,f=-f,h=-h,l=-l),1-E>r.EPSILON?(d=Math.acos(E),m=Math.sin(d),_=Math.sin((1-i)*d)/m,R=Math.sin(i*d)/m):(_=1-i,R=i),t[0]=_*u+R*c,t[1]=_*o+R*f,t[2]=_*s+R*h,t[3]=_*a+R*l,t}function l(t,n){var e=n[0]+n[4]+n[8],r=void 0;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{var i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var u=(i+1)%3,o=(i+2)%3;r=Math.sqrt(n[3*i+i]-n[3*u+u]-n[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(n[3*u+o]-n[3*o+u])*r,t[u]=(n[3*u+i]+n[3*i+u])*r,t[o]=(n[3*o+i]+n[3*i+o])*r}return t}n.clone=o.clone,n.fromValues=o.fromValues,n.copy=o.copy,n.set=o.set,n.add=o.add,n.mul=f,n.scale=o.scale,n.dot=o.dot,n.lerp=o.lerp;var d=n.length=o.length,E=(n.len=d,n.squaredLength=o.squaredLength),m=(n.sqrLen=E,n.normalize=o.normalize);n.exactEquals=o.exactEquals,n.equals=o.equals,n.rotationTo=function(){var t=u.create(),n=u.fromValues(1,0,0),e=u.fromValues(0,1,0);return function(r,i,o){var s=u.dot(i,o);return s<-.999999?(u.cross(t,n,i),u.len(t)<1e-6&&u.cross(t,e,i),u.normalize(t,t),c(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(u.cross(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,m(r,r))}}(),n.sqlerp=function(){var t=a(),n=a();return function(e,r,i,u,o,s){return h(t,r,o,s),h(n,i,u,s),h(e,t,n,2*s*(1-s)),e}}(),n.setAxes=function(){var t=i.create();return function(n,e,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-e[0],t[5]=-e[1],t[8]=-e[2],m(n,l(n,t))}}()},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},n.fromValues=function(t,n,e,i,u,o,s,a,c,f,h,l,d,E,m,_){var R=new r.ARRAY_TYPE(16);return R[0]=t,R[1]=n,R[2]=e,R[3]=i,R[4]=u,R[5]=o,R[6]=s,R[7]=a,R[8]=c,R[9]=f,R[10]=h,R[11]=l,R[12]=d,R[13]=E,R[14]=m,R[15]=_,R},n.set=function(t,n,e,r,i,u,o,s,a,c,f,h,l,d,E,m,_){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t[6]=s,t[7]=a,t[8]=c,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=E,t[14]=m,t[15]=_,t},n.identity=i,n.transpose=function(t,n){if(t===n){var e=n[1],r=n[2],i=n[3],u=n[6],o=n[7],s=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=u,t[11]=n[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],E=n[12],m=n[13],_=n[14],R=n[15],M=e*s-r*o,A=e*a-i*o,T=e*c-u*o,v=r*a-i*s,p=r*c-u*s,N=i*c-u*a,I=f*m-h*E,S=f*_-l*E,O=f*R-d*E,L=h*_-l*m,P=h*R-d*m,F=l*R-d*_,g=M*F-A*P+T*L+v*O-p*S+N*I;return g?(g=1/g,t[0]=(s*F-a*P+c*L)*g,t[1]=(i*P-r*F-u*L)*g,t[2]=(m*N-_*p+R*v)*g,t[3]=(l*p-h*N-d*v)*g,t[4]=(a*O-o*F-c*S)*g,t[5]=(e*F-i*O+u*S)*g,t[6]=(_*T-E*N-R*A)*g,t[7]=(f*N-l*T+d*A)*g,t[8]=(o*P-s*O+c*I)*g,t[9]=(r*O-e*P-u*I)*g,t[10]=(E*p-m*T+R*M)*g,t[11]=(h*T-f*p-d*M)*g,t[12]=(s*S-o*L-a*I)*g,t[13]=(e*L-r*S+i*I)*g,t[14]=(m*A-E*v-_*M)*g,t[15]=(f*v-h*A+l*M)*g,t):null},n.adjoint=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],E=n[12],m=n[13],_=n[14],R=n[15];return t[0]=s*(l*R-d*_)-h*(a*R-c*_)+m*(a*d-c*l),t[1]=-(r*(l*R-d*_)-h*(i*R-u*_)+m*(i*d-u*l)),t[2]=r*(a*R-c*_)-s*(i*R-u*_)+m*(i*c-u*a),t[3]=-(r*(a*d-c*l)-s*(i*d-u*l)+h*(i*c-u*a)),t[4]=-(o*(l*R-d*_)-f*(a*R-c*_)+E*(a*d-c*l)),t[5]=e*(l*R-d*_)-f*(i*R-u*_)+E*(i*d-u*l),t[6]=-(e*(a*R-c*_)-o*(i*R-u*_)+E*(i*c-u*a)),t[7]=e*(a*d-c*l)-o*(i*d-u*l)+f*(i*c-u*a),t[8]=o*(h*R-d*m)-f*(s*R-c*m)+E*(s*d-c*h),t[9]=-(e*(h*R-d*m)-f*(r*R-u*m)+E*(r*d-u*h)),t[10]=e*(s*R-c*m)-o*(r*R-u*m)+E*(r*c-u*s),t[11]=-(e*(s*d-c*h)-o*(r*d-u*h)+f*(r*c-u*s)),t[12]=-(o*(h*_-l*m)-f*(s*_-a*m)+E*(s*l-a*h)),t[13]=e*(h*_-l*m)-f*(r*_-i*m)+E*(r*l-i*h),t[14]=-(e*(s*_-a*m)-o*(r*_-i*m)+E*(r*a-i*s)),t[15]=e*(s*l-a*h)-o*(r*l-i*h)+f*(r*a-i*s),t},n.determinant=function(t){var n=t[0],e=t[1],r=t[2],i=t[3],u=t[4],o=t[5],s=t[6],a=t[7],c=t[8],f=t[9],h=t[10],l=t[11],d=t[12],E=t[13],m=t[14],_=t[15];return(n*o-e*u)*(h*_-l*m)-(n*s-r*u)*(f*_-l*E)+(n*a-i*u)*(f*m-h*E)+(e*s-r*o)*(c*_-l*d)-(e*a-i*o)*(c*m-h*d)+(r*a-i*s)*(c*E-f*d)},n.multiply=u,n.translate=function(t,n,e){var r=e[0],i=e[1],u=e[2],o=void 0,s=void 0,a=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,E=void 0,m=void 0,_=void 0,R=void 0;return n===t?(t[12]=n[0]*r+n[4]*i+n[8]*u+n[12],t[13]=n[1]*r+n[5]*i+n[9]*u+n[13],t[14]=n[2]*r+n[6]*i+n[10]*u+n[14],t[15]=n[3]*r+n[7]*i+n[11]*u+n[15]):(o=n[0],s=n[1],a=n[2],c=n[3],f=n[4],h=n[5],l=n[6],d=n[7],E=n[8],m=n[9],_=n[10],R=n[11],t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=f,t[5]=h,t[6]=l,t[7]=d,t[8]=E,t[9]=m,t[10]=_,t[11]=R,t[12]=o*r+f*i+E*u+n[12],t[13]=s*r+h*i+m*u+n[13],t[14]=a*r+l*i+_*u+n[14],t[15]=c*r+d*i+R*u+n[15]),t},n.scale=function(t,n,e){var r=e[0],i=e[1],u=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=n[7]*i,t[8]=n[8]*u,t[9]=n[9]*u,t[10]=n[10]*u,t[11]=n[11]*u,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},n.rotate=function(t,n,e,i){var u,o,s,a,c,f,h,l,d,E,m,_,R,M,A,T,v,p,N,I,S,O,L,P,F=i[0],g=i[1],C=i[2],D=Math.sqrt(F*F+g*g+C*C);return D0?(e[0]=2*(c*a+l*i+f*s-h*u)/d,e[1]=2*(f*a+l*u+h*i-c*s)/d,e[2]=2*(h*a+l*s+c*u-f*i)/d):(e[0]=2*(c*a+l*i+f*s-h*u),e[1]=2*(f*a+l*u+h*i-c*s),e[2]=2*(h*a+l*s+c*u-f*i)),o(t,n,e),t},n.getTranslation=function(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t},n.getScaling=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[4],o=n[5],s=n[6],a=n[8],c=n[9],f=n[10];return t[0]=Math.sqrt(e*e+r*r+i*i),t[1]=Math.sqrt(u*u+o*o+s*s),t[2]=Math.sqrt(a*a+c*c+f*f),t},n.getRotation=function(t,n){var e=n[0]+n[5]+n[10],r=0;return e>0?(r=2*Math.sqrt(e+1),t[3]=.25*r,t[0]=(n[6]-n[9])/r,t[1]=(n[8]-n[2])/r,t[2]=(n[1]-n[4])/r):n[0]>n[5]&&n[0]>n[10]?(r=2*Math.sqrt(1+n[0]-n[5]-n[10]),t[3]=(n[6]-n[9])/r,t[0]=.25*r,t[1]=(n[1]+n[4])/r,t[2]=(n[8]+n[2])/r):n[5]>n[10]?(r=2*Math.sqrt(1+n[5]-n[0]-n[10]),t[3]=(n[8]-n[2])/r,t[0]=(n[1]+n[4])/r,t[1]=.25*r,t[2]=(n[6]+n[9])/r):(r=2*Math.sqrt(1+n[10]-n[0]-n[5]),t[3]=(n[1]-n[4])/r,t[0]=(n[8]+n[2])/r,t[1]=(n[6]+n[9])/r,t[2]=.25*r),t},n.fromRotationTranslationScale=function(t,n,e,r){var i=n[0],u=n[1],o=n[2],s=n[3],a=i+i,c=u+u,f=o+o,h=i*a,l=i*c,d=i*f,E=u*c,m=u*f,_=o*f,R=s*a,M=s*c,A=s*f,T=r[0],v=r[1],p=r[2];return t[0]=(1-(E+_))*T,t[1]=(l+A)*T,t[2]=(d-M)*T,t[3]=0,t[4]=(l-A)*v,t[5]=(1-(h+_))*v,t[6]=(m+R)*v,t[7]=0,t[8]=(d+M)*p,t[9]=(m-R)*p,t[10]=(1-(h+E))*p,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},n.fromRotationTranslationScaleOrigin=function(t,n,e,r,i){var u=n[0],o=n[1],s=n[2],a=n[3],c=u+u,f=o+o,h=s+s,l=u*c,d=u*f,E=u*h,m=o*f,_=o*h,R=s*h,M=a*c,A=a*f,T=a*h,v=r[0],p=r[1],N=r[2],I=i[0],S=i[1],O=i[2],L=(1-(m+R))*v,P=(d+T)*v,F=(E-A)*v,g=(d-T)*p,C=(1-(l+R))*p,D=(_+M)*p,y=(E+A)*N,U=(_-M)*N,B=(1-(l+m))*N;return t[0]=L,t[1]=P,t[2]=F,t[3]=0,t[4]=g,t[5]=C,t[6]=D,t[7]=0,t[8]=y,t[9]=U,t[10]=B,t[11]=0,t[12]=e[0]+I-(L*I+g*S+y*O),t[13]=e[1]+S-(P*I+C*S+U*O),t[14]=e[2]+O-(F*I+D*S+B*O),t[15]=1,t},n.fromQuat=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e+e,s=r+r,a=i+i,c=e*o,f=r*o,h=r*s,l=i*o,d=i*s,E=i*a,m=u*o,_=u*s,R=u*a;return t[0]=1-h-E,t[1]=f+R,t[2]=l-_,t[3]=0,t[4]=f-R,t[5]=1-c-E,t[6]=d+m,t[7]=0,t[8]=l+_,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.frustum=function(t,n,e,r,i,u,o){var s=1/(e-n),a=1/(i-r),c=1/(u-o);return t[0]=2*u*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*u*a,t[6]=0,t[7]=0,t[8]=(e+n)*s,t[9]=(i+r)*a,t[10]=(o+u)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*u*2*c,t[15]=0,t},n.perspective=function(t,n,e,r,i){var u=1/Math.tan(n/2),o=void 0;return t[0]=u/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},n.perspectiveFromFieldOfView=function(t,n,e,r){var i=Math.tan(n.upDegrees*Math.PI/180),u=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),s=Math.tan(n.rightDegrees*Math.PI/180),a=2/(o+s),c=2/(i+u);return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*a*.5,t[9]=(i-u)*c*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t},n.ortho=function(t,n,e,r,i,u,o){var s=1/(n-e),a=1/(r-i),c=1/(u-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(n+e)*s,t[13]=(i+r)*a,t[14]=(o+u)*c,t[15]=1,t},n.lookAt=function(t,n,e,u){var o=void 0,s=void 0,a=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,E=void 0,m=void 0,_=n[0],R=n[1],M=n[2],A=u[0],T=u[1],v=u[2],p=e[0],N=e[1],I=e[2];return Math.abs(_-p)0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var E=a*l-c*h,m=c*f-s*l,_=s*h-a*f;return(d=E*E+m*m+_*_)>0&&(E*=d=1/Math.sqrt(d),m*=d,_*=d),t[0]=E,t[1]=m,t[2]=_,t[3]=0,t[4]=h*_-l*m,t[5]=l*E-f*_,t[6]=f*m-h*E,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=i,t[13]=u,t[14]=o,t[15]=1,t},n.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t},n.subtract=s,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=t[8],l=t[9],d=t[10],E=t[11],m=t[12],_=t[13],R=t[14],M=t[15],A=n[0],T=n[1],v=n[2],p=n[3],N=n[4],I=n[5],S=n[6],O=n[7],L=n[8],P=n[9],F=n[10],g=n[11],C=n[12],D=n[13],y=n[14],U=n[15];return Math.abs(e-A)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(A))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(u-v)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-N)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(N))&&Math.abs(a-I)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-S)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(f-O)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(h-L)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(l-P)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(d-F)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(E-g)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(g))&&Math.abs(m-C)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(_-D)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(D))&&Math.abs(R-y)<=r.EPSILON*Math.max(1,Math.abs(R),Math.abs(y))&&Math.abs(M-U)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(U))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function u(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=n[9],d=n[10],E=n[11],m=n[12],_=n[13],R=n[14],M=n[15],A=e[0],T=e[1],v=e[2],p=e[3];return t[0]=A*r+T*s+v*h+p*m,t[1]=A*i+T*a+v*l+p*_,t[2]=A*u+T*c+v*d+p*R,t[3]=A*o+T*f+v*E+p*M,A=e[4],T=e[5],v=e[6],p=e[7],t[4]=A*r+T*s+v*h+p*m,t[5]=A*i+T*a+v*l+p*_,t[6]=A*u+T*c+v*d+p*R,t[7]=A*o+T*f+v*E+p*M,A=e[8],T=e[9],v=e[10],p=e[11],t[8]=A*r+T*s+v*h+p*m,t[9]=A*i+T*a+v*l+p*_,t[10]=A*u+T*c+v*d+p*R,t[11]=A*o+T*f+v*E+p*M,A=e[12],T=e[13],v=e[14],p=e[15],t[12]=A*r+T*s+v*h+p*m,t[13]=A*i+T*a+v*l+p*_,t[14]=A*u+T*c+v*d+p*R,t[15]=A*o+T*f+v*E+p*M,t}function o(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=r+r,a=i+i,c=u+u,f=r*s,h=r*a,l=r*c,d=i*a,E=i*c,m=u*c,_=o*s,R=o*a,M=o*c;return t[0]=1-(d+m),t[1]=h+M,t[2]=l-R,t[3]=0,t[4]=h-M,t[5]=1-(f+m),t[6]=E+_,t[7]=0,t[8]=l+R,t[9]=E-_,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function s(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}n.mul=u,n.sub=s},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},n.fromMat4=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},n.clone=function(t){var n=new r.ARRAY_TYPE(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},n.fromValues=function(t,n,e,i,u,o,s,a,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=n,f[2]=e,f[3]=i,f[4]=u,f[5]=o,f[6]=s,f[7]=a,f[8]=c,f},n.set=function(t,n,e,r,i,u,o,s,a,c){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t[6]=s,t[7]=a,t[8]=c,t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.transpose=function(t,n){if(t===n){var e=n[1],r=n[2],i=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=i}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=f*o-s*c,l=-f*u+s*a,d=c*u-o*a,E=e*h+r*l+i*d;return E?(E=1/E,t[0]=h*E,t[1]=(-f*r+i*c)*E,t[2]=(s*r-i*o)*E,t[3]=l*E,t[4]=(f*e-i*a)*E,t[5]=(-s*e+i*u)*E,t[6]=d*E,t[7]=(-c*e+r*a)*E,t[8]=(o*e-r*u)*E,t):null},n.adjoint=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8];return t[0]=o*f-s*c,t[1]=i*c-r*f,t[2]=r*s-i*o,t[3]=s*a-u*f,t[4]=e*f-i*a,t[5]=i*u-e*s,t[6]=u*c-o*a,t[7]=r*a-e*c,t[8]=e*o-r*u,t},n.determinant=function(t){var n=t[0],e=t[1],r=t[2],i=t[3],u=t[4],o=t[5],s=t[6],a=t[7],c=t[8];return n*(c*u-o*a)+e*(-c*i+o*s)+r*(a*i-u*s)},n.multiply=i,n.translate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=s,t[5]=a,t[6]=l*r+d*o+c,t[7]=l*i+d*s+f,t[8]=l*u+d*a+h,t},n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*o,t[1]=d*i+l*s,t[2]=d*u+l*a,t[3]=d*o-l*r,t[4]=d*s-l*i,t[5]=d*a-l*u,t[6]=c,t[7]=f,t[8]=h,t},n.scale=function(t,n,e){var r=e[0],i=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=i*n[3],t[4]=i*n[4],t[5]=i*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},n.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromMat2d=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},n.fromQuat=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e+e,s=r+r,a=i+i,c=e*o,f=r*o,h=r*s,l=i*o,d=i*s,E=i*a,m=u*o,_=u*s,R=u*a;return t[0]=1-h-E,t[3]=f-R,t[6]=l+_,t[1]=f+R,t[4]=1-c-E,t[7]=d-m,t[2]=l-_,t[5]=d+m,t[8]=1-c-h,t},n.normalFromMat4=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],E=n[12],m=n[13],_=n[14],R=n[15],M=e*s-r*o,A=e*a-i*o,T=e*c-u*o,v=r*a-i*s,p=r*c-u*s,N=i*c-u*a,I=f*m-h*E,S=f*_-l*E,O=f*R-d*E,L=h*_-l*m,P=h*R-d*m,F=l*R-d*_,g=M*F-A*P+T*L+v*O-p*S+N*I;return g?(g=1/g,t[0]=(s*F-a*P+c*L)*g,t[1]=(a*O-o*F-c*S)*g,t[2]=(o*P-s*O+c*I)*g,t[3]=(i*P-r*F-u*L)*g,t[4]=(e*F-i*O+u*S)*g,t[5]=(r*O-e*P-u*I)*g,t[6]=(m*N-_*p+R*v)*g,t[7]=(_*T-E*N-R*A)*g,t[8]=(E*p-m*T+R*M)*g,t):null},n.projection=function(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},n.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t},n.subtract=u,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=t[8],l=n[0],d=n[1],E=n[2],m=n[3],_=n[4],R=n[5],M=n[6],A=n[7],T=n[8];return Math.abs(e-l)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(u-E)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(o-m)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(a-R)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(R))&&Math.abs(c-M)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(f-A)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=e[0],d=e[1],E=e[2],m=e[3],_=e[4],R=e[5],M=e[6],A=e[7],T=e[8];return t[0]=l*r+d*o+E*c,t[1]=l*i+d*s+E*f,t[2]=l*u+d*a+E*h,t[3]=m*r+_*o+R*c,t[4]=m*i+_*s+R*f,t[5]=m*u+_*a+R*h,t[6]=M*r+A*o+T*c,t[7]=M*i+A*s+T*f,t[8]=M*u+A*a+T*h,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.forEach=n.sqrLen=n.sqrDist=n.dist=n.div=n.mul=n.sub=n.len=void 0,n.create=i,n.clone=function(t){var n=new r.ARRAY_TYPE(2);return n[0]=t[0],n[1]=t[1],n},n.fromValues=function(t,n){var e=new r.ARRAY_TYPE(2);return e[0]=t,e[1]=n,e},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t},n.set=function(t,n,e){return t[0]=n,t[1]=e,t},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t},n.subtract=u,n.multiply=o,n.divide=s,n.ceil=function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t},n.floor=function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t},n.min=function(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t},n.max=function(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t},n.round=function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t},n.scale=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t},n.scaleAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t},n.distance=a,n.squaredDistance=c,n.length=f,n.squaredLength=h,n.negate=function(t,n){return t[0]=-n[0],t[1]=-n[1],t},n.inverse=function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t},n.normalize=function(t,n){var e=n[0],r=n[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=n[0]*i,t[1]=n[1]*i),t},n.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]},n.cross=function(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t},n.lerp=function(t,n,e,r){var i=n[0],u=n[1];return t[0]=i+r*(e[0]-i),t[1]=u+r*(e[1]-u),t},n.random=function(t,n){n=n||1;var e=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t},n.transformMat2=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i,t[1]=e[1]*r+e[3]*i,t},n.transformMat2d=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t},n.transformMat3=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[3]*i+e[6],t[1]=e[1]*r+e[4]*i+e[7],t},n.transformMat4=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[4]*i+e[12],t[1]=e[1]*r+e[5]*i+e[13],t},n.rotate=function(t,n,e,r){var i=n[0]-e[0],u=n[1]-e[1],o=Math.sin(r),s=Math.cos(r);return t[0]=i*s-u*o+e[0],t[1]=i*o+u*s+e[1],t},n.angle=function(t,n){var e=t[0],r=t[1],i=n[0],u=n[1],o=e*e+r*r;o>0&&(o=1/Math.sqrt(o));var s=i*i+u*u;s>0&&(s=1/Math.sqrt(s));var a=(e*i+r*u)*o*s;return a>1?0:a<-1?Math.PI:Math.acos(a)},n.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]},n.equals=function(t,n){var e=t[0],i=t[1],u=n[0],o=n[1];return Math.abs(e-u)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function o(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function s(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function a(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function c(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function f(t){var n=t[0],e=t[1];return Math.sqrt(n*n+e*e)}function h(t){var n=t[0],e=t[1];return n*n+e*e}n.len=f,n.sub=u,n.mul=o,n.div=s,n.dist=a,n.sqrDist=c,n.sqrLen=h,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=2),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;a0){e=Math.sqrt(e);var r=n[0]/e,i=n[1]/e,u=n[2]/e,o=n[3]/e,s=n[4],a=n[5],c=n[6],f=n[7],h=r*s+i*a+u*c+o*f;t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=(s-r*h)/e,t[5]=(a-i*h)/e,t[6]=(c-u*h)/e,t[7]=(f-o*h)/e}return t},n.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=n[0],l=n[1],d=n[2],E=n[3],m=n[4],_=n[5],R=n[6],M=n[7];return Math.abs(e-h)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(u-d)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(d))&&Math.abs(o-E)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(c-R)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-M)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(M))};var r=o(e(0)),i=o(e(3)),u=o(e(4));function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function s(t,n,e){var r=.5*e[0],i=.5*e[1],u=.5*e[2],o=n[0],s=n[1],a=n[2],c=n[3];return t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=r*c+i*a-u*s,t[5]=i*c+u*o-r*a,t[6]=u*c+r*s-i*o,t[7]=-r*o-i*s-u*a,t}function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t}function c(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[4],a=e[5],c=e[6],f=e[7],h=n[4],l=n[5],d=n[6],E=n[7],m=e[0],_=e[1],R=e[2],M=e[3];return t[0]=r*M+o*m+i*R-u*_,t[1]=i*M+o*_+u*m-r*R,t[2]=u*M+o*R+r*_-i*m,t[3]=o*M-r*m-i*_-u*R,t[4]=r*f+o*s+i*c-u*a+h*M+E*m+l*R-d*_,t[5]=i*f+o*a+u*s-r*c+l*M+E*_+d*m-h*R,t[6]=u*f+o*c+r*a-i*s+d*M+E*R+h*_-l*m,t[7]=o*f-r*s-i*a-u*c+E*M-h*m-l*_-d*R,t}n.getReal=i.copy,n.setReal=i.copy,n.mul=c;var f=n.dot=i.dot,h=n.length=i.length,l=(n.len=h,n.squaredLength=i.squaredLength);n.sqrLen=l},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},n.fromValues=function(t,n,e,i,u,o){var s=new r.ARRAY_TYPE(6);return s[0]=t,s[1]=n,s[2]=e,s[3]=i,s[4]=u,s[5]=o,s},n.set=function(t,n,e,r,i,u,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=e*u-r*i;return a?(a=1/a,t[0]=u*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t[4]=(i*s-u*o)*a,t[5]=(r*o-e*s)*a,t):null},n.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},n.multiply=i,n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=Math.sin(e),f=Math.cos(e);return t[0]=r*f+u*c,t[1]=i*f+o*c,t[2]=r*-c+u*f,t[3]=i*-c+o*f,t[4]=s,t[5]=a,t},n.scale=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1];return t[0]=r*c,t[1]=i*c,t[2]=u*f,t[3]=o*f,t[4]=s,t[5]=a,t},n.translate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1];return t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=r*c+u*f+s,t[5]=i*c+o*f+a,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t[4]=0,t[5]=0,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t},n.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},n.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t},n.subtract=u,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=n[0],f=n[1],h=n[2],l=n[3],d=n[4],E=n[5];return Math.abs(e-c)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(u-h)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(o-l)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(s-d)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-E)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(E))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1],h=e[2],l=e[3],d=e[4],E=e[5];return t[0]=r*c+u*f,t[1]=i*c+o*f,t[2]=r*h+u*l,t[3]=i*h+o*l,t[4]=r*d+u*E+s,t[5]=i*d+o*E+a,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},n.fromValues=function(t,n,e,i){var u=new r.ARRAY_TYPE(4);return u[0]=t,u[1]=n,u[2]=e,u[3]=i,u},n.set=function(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t},n.transpose=function(t,n){if(t===n){var e=n[1];t[1]=n[2],t[2]=e}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e*u-i*r;return o?(o=1/o,t[0]=u*o,t[1]=-r*o,t[2]=-i*o,t[3]=e*o,t):null},n.adjoint=function(t,n){var e=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=e,t},n.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},n.multiply=i,n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+u*s,t[1]=i*a+o*s,t[2]=r*-s+u*a,t[3]=i*-s+o*a,t},n.scale=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1];return t[0]=r*s,t[1]=i*s,t[2]=u*a,t[3]=o*a,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},n.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},n.LDU=function(t,n,e,r){return t[2]=r[2]/r[0],e[0]=r[0],e[1]=r[1],e[3]=r[3]-t[2]*e[1],[t,n,e]},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t},n.subtract=u,n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=n[0],a=n[1],c=n[2],f=n[3];return Math.abs(e-s)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(u-c)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(o-f)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))},n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1],c=e[2],f=e[3];return t[0]=r*s+u*a,t[1]=i*s+o*a,t[2]=r*c+u*f,t[3]=i*c+o*f,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.vec4=n.vec3=n.vec2=n.quat2=n.quat=n.mat4=n.mat3=n.mat2d=n.mat2=n.glMatrix=void 0;var r=d(e(0)),i=d(e(9)),u=d(e(8)),o=d(e(5)),s=d(e(4)),a=d(e(3)),c=d(e(7)),f=d(e(6)),h=d(e(2)),l=d(e(1));function d(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}n.glMatrix=r,n.mat2=i,n.mat2d=u,n.mat3=o,n.mat4=s,n.quat=a,n.quat2=c,n.vec2=f,n.vec3=h,n.vec4=l}])},function(t,n,e){"use strict";var r=function(){var t,n;try{t=Object.defineProperty,n=Object.defineProperties,t({},"$",{value:0})}catch(e){"__defineGetter__"in Object&&(t=function(t,n,e){return"value"in e&&(t[n]=e.value),"get"in e&&t.__defineGetter__(n,e.get),"set"in e&&t.__defineSetter__(n,e.set),t},n=function(n,e){for(var r in e)e.hasOwnProperty(r)&&t(n,r,e[r]);return n})}var e=function(t){for(var e=1,r=arguments.length;e>1,o=e(t[u],n);if(0===o)return[u,u];o<0?r=u+1:i=u-1}return r>i?[i,r]:[r,i]}function M(t,n,e){var r=R(t,n,e);t.splice(r[1],0,n)}function A(t,n,e){return n<=t.length?t:new Array(n-t.length+1).join(e||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?s:t instanceof Uint8Array?a:t instanceof Int16Array?c:t instanceof Uint16Array?f:t instanceof Uint32Array?h:l}var v,p,N=(u(v={},s,Int8Array),u(v,a,Uint8Array),u(v,c,Int16Array),u(v,f,Uint16Array),u(v,h,Uint32Array),u(v,l,Float32Array),p=v,function(t){return p[t]||Float32Array});function I(t,n,e,r,i){if(t&&n){n.isGeometryData&&(n=n.data);for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,e,r){return t.then((function(){return n(e,r)}))}),Promise.resolve())}function D(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function y(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,n,e)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],this},set:function(t,n,e){return r.vec3.set(this.elements,t,n,e),this},add:function(t,n){return n||(n=t,t=this),r.vec3.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec3.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec3.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec3.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec3.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec3.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec3.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec3.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec3.squaredDistance(t.elements,n.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec3.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec3.cross(this.elements,t.elements,n.elements),this},lerp:function(t,n){return r.vec3.lerp(this.elements,this.elements,t.elements,n),this},hermite:function(t,n,e,i,u){return r.vec3.hermite(this.elements,t.elements,n.elements,e.elements,i.elements,u),this},bezier:function(t,n,e,i,u){return r.vec3.bezier(this.elements,t.elements,n.elements,e.elements,i.elements,u),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var n=this.elements,e=t.elements,r=n[0],i=n[1],u=n[2];return n[0]=r*e[0]+i*e[4]+u*e[8],n[1]=r*e[1]+i*e[5]+u*e[9],n[2]=r*e[2]+i*e[6]+u*e[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,n){return r.vec3.rotateX(this.elements,this.elements,t.elements,n),this},rotateY:function(t,n){return r.vec3.rotateY(this.elements,this.elements,t.elements,n),this},rotateZ:function(t,n){return r.vec3.rotateZ(this.elements,this.elements,t.elements,n),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec3.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},function(t,n,e){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var n=++r;return t?n=t+"_"+n:n+="",n}),clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};n.a=i},function(t,n,e){"use strict";var r,i=e(0),u=e(1),o=e(5),s=e(10),a=new o.a,c=new o.a,f=u.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)t[n+r]=e[r];return t},fromArray:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)e[r]=t[n+r];return this},set:function(t,n,e,r,u,o,s,a,c,f,h,l,d,E,m,_){return i.mat4.set(this.elements,t,n,e,r,u,o,s,a,c,f,h,l,d,E,m,_),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),i.mat4.multiply(this.elements,t.elements,n.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,n){return i.mat4.rotate(this.elements,this.elements,t,n.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,n){return i.mat4.fromRotation(this.elements,t,n.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,n){return i.mat4.fromRotationTranslation(this.elements,t.elements,n.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,n,e){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,n.elements,e.elements),this},fromRotationTranslationScaleOrigin:function(t,n,e,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,n.elements,e.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,n,e,r,u,o){return i.mat4.frustum(this.elements,t,n,e,r,u,o),this},perspective:function(t,n,e,r){return i.mat4.perspective(this.elements,t,n,e,r),this},perspectiveFromFieldOfView:function(t,n,e){return i.mat4.perspectiveFromFieldOfView(this.elements,t,n,e),this},ortho:function(t,n,e,r,u,o){return i.mat4.ortho(this.elements,t,n,e,r,u,o),this},lookAt:function(t,n,e){return t.isVector3||(t=a.set(t.x,t.y,t.z)),n.isVector3||(n=c.set(n.x,n.y,n.z)),i.mat4.lookAt(this.elements,t.elements,n.elements,e.elements),this},targetTo:function(t,n,e){t.isVector3||(t=a.set(t.x,t.y,t.z)),n.isVector3||(n=c.set(n.x,n.y,n.z)),t=t.elements,n=n.elements,e=e.elements;var r=this.elements,i=t[0],u=t[1],o=t[2],s=e[0],f=e[1],h=e[2],l=i-n[0],d=u-n[1],E=o-n[2],m=l*l+d*d+E*E;m>0?(l*=m=1/Math.sqrt(m),d*=m,E*=m):E=1;var _=f*E-h*d,R=h*l-s*E,M=s*d-f*l;return(m=_*_+R*R+M*M)>0?(_*=m=1/Math.sqrt(m),R*=m,M*=m):(m=(_=f*E-h*d)*_+(R=h*l-(s+=1e-7)*E)*R+(M=s*d-f*l)*M,_*=m=1/Math.sqrt(m),R*=m,M*=m),r[0]=_,r[1]=R,r[2]=M,r[3]=0,r[4]=d*M-E*R,r[5]=E*_-l*M,r[6]=l*R-d*_,r[7]=0,r[8]=l,r[9]=d,r[10]=E,r[11]=0,r[12]=i,r[13]=u,r[14]=o,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),i.mat4.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),i.mat4.subtract(this.elements,t.elements,n.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),i.mat4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),i.mat4.equals(t.elements,n.elements)},compose:function(t,n,e,r){return r?this.fromRotationTranslationScaleOrigin(t,n,e,r):this.fromRotationTranslationScale(t,n,e),this},decompose:function(t,n,e,i){return this.getScaling(e),this.getTranslation(n),r||(r=new f),this.determinant()<0&&(e.x*=-1),r.copy(this),a.inverse(e),r.scale(a),t.fromMat4(r),i&&i.set(0,0,0),this}});f.prototype.sub=f.prototype.subtract,f.prototype.mul=f.prototype.multiply,n.a=f},function(t,n,e){"use strict";var r=e(1),i=e(12),u=e(4),o=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;o.superclass.constructor.call(this,t,n,e,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t},fromUintArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[n]/255,this.elements[1]=t[n+1]/255,this.elements[2]=t[n+2]/255,this.elements[3]=t[n+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(u.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",n=0;n<3;n++)t+=Object(u.padLeft)(Math.floor(255*this.elements[n]).toString(16),2);return t}});n.a=o},function(t,n,e){"use strict";var r=e(1).a.create({constructor:function(t,n,e){this.type=t,this.target=n,this.detail=e,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),i={_listeners:null,on:function(t,n,e){for(var r=this._listeners=this._listeners||{},i=r[t]=r[t]||[],u=0,o=i.length;u0){if(1===arguments.length)return delete this._listeners[t],this;for(var r=0,i=e.length;r0){var s=o.slice(0);if((e=e||new r(i,this,n))._stopped)return!1;for(var a=0;a-1&&o.splice(f,1)}}return!0}return!1}};n.a=i},function(t,n,e){"use strict";var r=e(0),i=e(11),u=e(1),o=e(9),s=new i.a,a=u.a.create({Mixes:o.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,n,e,i)},copy:function(t,n){return r.quat.copy(this.elements,t.elements),n||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0,r=this.elements;return r[0]=t[n],r[1]=t[n+1],r[2]=t[n+2],r[3]=t[n+3],e||this.fire("update"),this},set:function(t,n,e,i,u){return r.quat.set(this.elements,t,n,e,i),u||this.fire("update"),this},identity:function(t){return r.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,n,e){return r.quat.rotationTo(this.elements,t.elements,n.elements),e||this.fire("update"),this},setAxes:function(t,n,e,i){return r.quat.setAxes(this.elements,t.elements,n.elements,e.elements),i||this.fire("update"),this},setAxisAngle:function(t,n,e){return r.quat.setAxisAngle(this.elements,t.elements,n),e||this.fire("update"),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t,n){return r.quat.add(this.elements,this.elements,t.elements),n||this.fire("update"),this},multiply:function(t,n){return r.quat.multiply(this.elements,this.elements,t.elements),n||this.fire("update"),this},premultiply:function(t,n){return r.quat.multiply(this.elements,t.elements,this.elements),n||this.fire("update"),this},scale:function(t,n){return r.quat.scale(this.elements,this.elements,t),n||this.fire("update"),this},rotateX:function(t,n){return r.quat.rotateX(this.elements,this.elements,t),n||this.fire("update"),this},rotateY:function(t,n){return r.quat.rotateY(this.elements,this.elements,t),n||this.fire("update"),this},rotateZ:function(t,n){return r.quat.rotateZ(this.elements,this.elements,t),n||this.fire("update"),this},calculateW:function(t){return r.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,n,e){return r.quat.lerp(this.elements,this.elements,t.elements,n),e||this.fire("update"),this},slerp:function(t,n,e){return r.quat.slerp(this.elements,this.elements,t.elements,n),e||this.fire("update"),this},sqlerp:function(t,n,e,i,u,o){return r.quat.sqlerp(this.elements,t.elements,n.elements,e.elements,i.elements,u),o||this.fire("update"),this},invert:function(t){return r.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return r.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(t){return r.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,n){return r.quat.fromMat3(this.elements,t.elements),n||this.fire("update"),this},fromMat4:function(t,n){return s.fromMat4(t),this.fromMat3(s,n),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,n){var e=.5*t.x,r=.5*t.y,i=.5*t.z,u=t.order||"ZYX",o=Math.sin(e),s=Math.cos(e),a=Math.sin(r),c=Math.cos(r),f=Math.sin(i),h=Math.cos(i),l=this.elements;return"XYZ"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h-o*a*f):"YXZ"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h+o*a*f):"ZXY"===u?(l[0]=o*c*h-s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h-o*a*f):"ZYX"===u?(l[0]=o*c*h-s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h+o*a*f):"YZX"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h-o*a*f):"XZY"===u&&(l[0]=o*c*h-s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h+o*a*f),n||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});a.prototype.mul=a.prototype.multiply,a.prototype.len=a.prototype.length,a.prototype.sqrLen=a.prototype.squaredLength,n.a=a},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<9;r++)t[n+r]=e[r];return t},fromArray:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<9;r++)e[r]=t[n+r];return this},set:function(t,n,e,i,u,o,s,a,c){return r.mat3.set(this.elements,t,n,e,i,u,o,s,a,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),r.mat3.multiply(this.elements,t.elements,n.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),r.mat3.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.mat3.subtract(this.elements,t.elements,n.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.mat3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.mat3.equals(t.elements,n.elements)},fromRotationTranslationScale:function(t,n,e,r,i){var u=Math.cos(t),o=Math.sin(t);return this.set(r*u,-i*o,0,r*o,i*u,0,n,e,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,n.a=i},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,n,e,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t[3+n]=e[3],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],e[3]=t[n+3],this},set:function(t,n,e,i){return r.vec4.set(this.elements,t,n,e,i),this},add:function(t,n){return n||(n=t,t=this),r.vec4.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec4.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec4.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec4.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec4.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec4.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec4.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec4.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec4.squaredDistance(t.elements,n.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec4.dot(t.elements,n.elements)},lerp:function(t,n){return r.vec4.lerp(this.elements,this.elements,t.elements,n),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec4.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},function(t,n,e){"use strict";var r=e(1),i=e(6),u=e(7),o=e(3),s=new u.a,a=i.a.DEG2RAD,c=i.a.RAD2DEG,f=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,n,e]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,n,e){return this.elements[0]=t,this.elements[1]=n,this.elements[2]=e,this.updateDegrees(),this},setDegree:function(t,n,e){return this._degX=t,this._degY=n,this._degZ=e,this.updateRadians(),this},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[n],this.elements[1]=t[n+1],this.elements[2]=t[n+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[n]=this.elements[0],t[n+1]=this.elements[1],t[n+2]=this.elements[2],t},fromMat4:function(t,n){var e=t.elements,r=e[0],u=e[1],s=e[2],a=e[4],c=e[5],f=e[6],h=e[8],l=e[9],d=e[10];n=n||this.order,this.order=n;var E=i.a.clamp;return"XYZ"===n?(this.elements[1]=Math.asin(E(h,-1,1)),Math.abs(h)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-a,r)):(this.elements[0]=Math.atan2(f,c),this.elements[2]=0)):"YXZ"===n?(this.elements[0]=Math.asin(-E(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(h,d),this.elements[2]=Math.atan2(u,c)):(this.elements[1]=Math.atan2(-s,r),this.elements[2]=0)):"ZXY"===n?(this.elements[0]=Math.asin(E(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(-s,d),this.elements[2]=Math.atan2(-a,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(u,r))):"ZYX"===n?(this.elements[1]=Math.asin(-E(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(f,d),this.elements[2]=Math.atan2(u,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-a,c))):"YZX"===n?(this.elements[2]=Math.asin(E(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-s,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(h,d))):"XZY"===n?(this.elements[2]=Math.asin(-E(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(f,c),this.elements[1]=Math.atan2(h,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):o.a.warn("Euler fromMat4() unsupported order: "+n),this.updateDegrees(),this},fromQuat:function(t,n){return s.fromQuat(t),this.fromMat4(s,n)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*a,this.elements[1]=this._degY*a,this.elements[2]=this._degZ*a,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*a}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*a}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*a}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});n.a=f},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,n)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],this},set:function(t,n){return r.vec2.set(this.elements,t,n),this},add:function(t,n){return n||(n=t,t=this),r.vec2.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec2.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec2.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec2.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec2.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec2.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec2.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec2.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec2.squaredDistance(t.elements,n.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec2.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec2.cross(this.elements,t.elements,n.elements),this},lerp:function(t,n){return r.vec2.lerp(this.elements,this.elements,t.elements,n),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec2.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec2.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},,function(t,n,e){"use strict";var r=e(34),i=e.n(r),u=e(1),o=e(5),s=u.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new o.a(0,0,0),this.direction=t.direction||new o.a(0,0,-1)},set:function(t,n){return this.origin=t,this.direction=n,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,n,e,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(n,e,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(n,e,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,n){var e=this;n?t.sort((function(t,r){return e.squaredDistance(t[n])-e.squaredDistance(r[n])})):t.sort((function(t,n){return e.squaredDistance(t)-e.squaredDistance(n)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,n){var e=this._ray.intersectsSphere(t,n);return this._getRes(e)},intersectsPlane:function(t,n){var e=this._ray.intersectsPlane(t,n);return this._getRes(e)},intersectsTriangle:function(t){var n=this._ray.intersectsTriangle(t);return this._getRes(n)},intersectsBox:function(t){var n=this._ray.intersectsBox(t);return this._getRes(n)},intersectsTriangleCell:function(t,n){var e=this._ray.intersectsTriangleCell(t,n);return this._getRes(e)},_getRes:function(t){return t?new o.a(t[0],t[1],t[2]):null}});n.a=s},function(t,n,e){"use strict";var r=e(0),i=e(1),u=e(9),o=e(5),s=i.a.create({Mixes:u.a,Extends:o.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,n,e)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],this.fire("update"),this},set:function(t,n,e){return r.vec3.set(this.elements,t,n,e),this.fire("update"),this},add:function(t,n){return n||(n=t,t=this),r.vec3.add(this.elements,t.elements,n.elements),this.fire("update"),this},subtract:function(t,n){return n||(n=t,t=this),r.vec3.subtract(this.elements,t.elements,n.elements),this.fire("update"),this},multiply:function(t,n){return n||(n=t,t=this),r.vec3.multiply(this.elements,t.elements,n.elements),this.fire("update"),this},divide:function(t,n){return n||(n=t,t=this),r.vec3.divide(this.elements,t.elements,n.elements),this.fire("update"),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,n){return n||(n=t,t=this),r.vec3.min(this.elements,t.elements,n.elements),this.fire("update"),this},max:function(t,n){return n||(n=t,t=this),r.vec3.max(this.elements,t.elements,n.elements),this.fire("update"),this},round:function(){return r.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec3.scaleAndAdd(this.elements,n.elements,e.elements,t),this.fire("update"),this},distance:function(t,n){return n||(n=t,t=this),r.vec3.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec3.squaredDistance(t.elements,n.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,n){return n||(n=t,t=this),r.vec3.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec3.cross(this.elements,t.elements,n.elements),this.fire("update"),this},lerp:function(t,n){return r.vec3.lerp(this.elements,this.elements,t.elements,n),this.fire("update"),this},hermite:function(t,n,e,i,u){return r.vec3.hermite(this.elements,t.elements,n.elements,e.elements,i.elements,u),this.fire("update"),this},bezier:function(t,n,e,i,u){return r.vec3.bezier(this.elements,t.elements,n.elements,e.elements,i.elements,u),this.fire("update"),this},random:function(t){return r.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var n=this.elements,e=t.elements,r=n[0],i=n[1],u=n[2];return n[0]=r*e[0]+i*e[4]+u*e[8],n[1]=r*e[1]+i*e[5]+u*e[9],n[2]=r*e[2]+i*e[6]+u*e[10],this.fire("update"),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,n){return r.vec3.rotateX(this.elements,this.elements,t.elements,n),this.fire("update"),this},rotateY:function(t,n){return r.vec3.rotateY(this.elements,this.elements,t.elements,n),this.fire("update"),this},rotateZ:function(t,n){return r.vec3.rotateZ(this.elements,this.elements,t.elements,n),this.fire("update"),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec3.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});n.a=s},,function(t,n,e){"use strict";var r=e(1),i=e(5),u=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=n},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,n,e,r){return this.normal.set(t,n,e),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});n.a=u},function(t,n,e){"use strict";var r=e(1),i=e(5),u=new i.a,o=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var n=this.center,e=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)e[r]=t[n+r];return this.fire("update"),this},set:function(t,n,e,r,u,o,s,a,c,f,h,l,d,E,m,_){return i.mat4.set(this.elements,t,n,e,r,u,o,s,a,c,f,h,l,d,E,m,_),this.fire("update"),this},identity:function(){return i.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),i.mat4.multiply(this.elements,t.elements,n.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,n){return i.mat4.rotate(this.elements,this.elements,t,n.elements),this.fire("update"),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,n){return i.mat4.fromRotation(this.elements,t,n.elements),this.fire("update"),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,n){return i.mat4.fromRotationTranslation(this.elements,t.elements,n.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,n,e){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,n.elements,e.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,n,e,r,u){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,n.elements,e.elements,r.elements),u||this.fire("update"),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,n,e,r,u,o){return i.mat4.frustum(this.elements,t,n,e,r,u,o),this.fire("update"),this},perspective:function(t,n,e,r){return i.mat4.perspective(this.elements,t,n,e,r),this.fire("update"),this},perspectiveFromFieldOfView:function(t,n,e){return i.mat4.perspectiveFromFieldOfView(this.elements,t,n,e),this.fire("update"),this},ortho:function(t,n,e,r,u,o){return i.mat4.ortho(this.elements,t,n,e,r,u,o),this.fire("update"),this},lookAt:function(t,n,e){return t.isVector3||(t=f.set(t.x,t.y,t.z)),n.isVector3||(n=h.set(n.x,n.y,n.z)),i.mat4.lookAt(this.elements,t.elements,n.elements,e.elements),this.fire("update"),this},targetTo:function(t,n,e){t.isVector3||(t=f.set(t.x,t.y,t.z)),n.isVector3||(n=h.set(n.x,n.y,n.z)),t=t.elements,n=n.elements,e=e.elements;var r=this.elements,i=t[0],u=t[1],o=t[2],s=e[0],a=e[1],c=e[2],l=i-n[0],d=u-n[1],E=o-n[2],m=l*l+d*d+E*E;m>0?(l*=m=1/Math.sqrt(m),d*=m,E*=m):E=1;var _=a*E-c*d,R=c*l-s*E,M=s*d-a*l;return(m=_*_+R*R+M*M)>0?(_*=m=1/Math.sqrt(m),R*=m,M*=m):(m=(_=a*E-c*d)*_+(R=c*l-(s+=1e-7)*E)*R+(M=s*d-a*l)*M,_*=m=1/Math.sqrt(m),R*=m,M*=m),r[0]=_,r[1]=R,r[2]=M,r[3]=0,r[4]=d*M-E*R,r[5]=E*_-l*M,r[6]=l*R-d*_,r[7]=0,r[8]=l,r[9]=d,r[10]=E,r[11]=0,r[12]=i,r[13]=u,r[14]=o,r[15]=1,this.fire("update"),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),i.mat4.add(this.elements,t.elements,n.elements),this.fire("update"),this},subtract:function(t,n){return n||(n=t,t=this),i.mat4.subtract(this.elements,t.elements,n.elements),this.fire("update"),this},exactEquals:function(t,n){return n||(n=t,t=this),i.mat4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),i.mat4.equals(t.elements,n.elements)},compose:function(t,n,e,r){return r?this.fromRotationTranslationScaleOrigin(t,n,e,r):this.fromRotationTranslationScale(t,n,e),this},decompose:function(t,n,e,i){return this.getScaling(e),this.getTranslation(n),r||(r=new a.a),this.determinant()<0&&(e.x*=-1),r.copy(this),f.inverse(e),r.scale(f),t.fromMat4(r),i&&i.set(0,0,0),this}});n.a=l},function(t,n,e){"use strict";var r=e(1),i=e(9),u=e(6),o=e(13),s=u.a.DEG2RAD,a=u.a.RAD2DEG,c=r.a.create({Mixes:i.a,Extends:o.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;o.a.call(this,t,n,e)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*s,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*s,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*s,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*a,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*a,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*a,this.fire("update")}}});n.a=c},function(t,n,e){"use strict";var r=e(1),i=e(19),u=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var n=t.planes;return this.planes.forEach((function(t,e){t.copy(n[e])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var n=this.planes,e=t.elements,r=e[0],i=e[1],u=e[2],o=e[3],s=e[4],a=e[5],c=e[6],f=e[7],h=e[8],l=e[9],d=e[10],E=e[11],m=e[12],_=e[13],R=e[14],M=e[15];return n[0].set(o-r,f-s,E-h,M-m).normalize(),n[1].set(o+r,f+s,E+h,M+m).normalize(),n[2].set(o+i,f+a,E+l,M+_).normalize(),n[3].set(o-i,f-a,E-l,M-_).normalize(),n[4].set(o-u,f-c,E-d,M-R).normalize(),n[5].set(o+u,f+c,E+d,M+R).normalize(),this},intersectsSphere:function(t){for(var n=this.planes,e=t.center,r=-t.radius,i=0;i<6;i++){if(n[i].distanceToPoint(e)l)return null;r(f,a,o);var E=i(e,f);if(E<0||d+E>l)return null;var m=i(s,f)/l;return t[0]=n[0]+m*e[0],t[1]=n[1]+m*e[1],t[2]=n[2]+m*e[2],t}},function(t,n){t.exports=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=e[0],s=e[1],a=e[2];return t[0]=i*a-u*s,t[1]=u*o-r*a,t[2]=r*s-i*o,t}},function(t,n,e){var r=e(26),i=e(31),u=e(32),o=e(33);t.exports=function(t,n,e,a,c){var f=r(e,a);if(0!==f){var h=-(r(n,a)+c)/f;return h<0?null:(u(s,e,h),i(t,n,s))}return r(a,n)+c===0?o(t,n):null};var s=[0,0,0]},function(t,n,e){var r=e(92),i=e(26),u=e(30),o=e(93),s=e(32),a=e(31),c=[0,0,0];t.exports=function(t,n,e,f,h){u(c,f,n);var l=i(e,c);if(l<0)return null;o(c,n,e,l);var d=r(f,c),E=h*h;if(d>E)return null;return s(t,e,l-Math.sqrt(E-d)),a(t,t,n)}},function(t,n){t.exports=function(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}},function(t,n){t.exports=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}},function(t,n){function e(t,n,e){for(var r=t.length,i=-1/0,u=1/0,o=0;oa){var c=s;s=a,a=c}if(au)return 1/0;s>i&&(i=s),au?1/0:i}t.exports=function(t,n,r,i){var u=e(n,r,i);if(u===1/0)t=null;else{t=t||[];for(var o=0;o0&&(o=1/Math.sqrt(o),t[0]=e*o,t[1]=r*o,t[2]=i*o,t[3]=u*o),t},n.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},n.lerp=function(t,n,e,r){var i=n[0],u=n[1],o=n[2],s=n[3];return t[0]=i+r*(e[0]-i),t[1]=u+r*(e[1]-u),t[2]=o+r*(e[2]-o),t[3]=s+r*(e[3]-s),t},n.random=function(t,n){var e,i,u,o,s,a;n=n||1;do{s=(e=2*r.RANDOM()-1)*e+(i=2*r.RANDOM()-1)*i}while(s>=1);do{a=(u=2*r.RANDOM()-1)*u+(o=2*r.RANDOM()-1)*o}while(a>=1);var c=Math.sqrt((1-s)/a);return t[0]=n*e,t[1]=n*i,t[2]=n*u*c,t[3]=n*o*c,t},n.transformMat4=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3];return t[0]=e[0]*r+e[4]*i+e[8]*u+e[12]*o,t[1]=e[1]*r+e[5]*i+e[9]*u+e[13]*o,t[2]=e[2]*r+e[6]*i+e[10]*u+e[14]*o,t[3]=e[3]*r+e[7]*i+e[11]*u+e[15]*o,t},n.transformQuat=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=e[0],s=e[1],a=e[2],c=e[3],f=c*r+s*u-a*i,h=c*i+a*r-o*u,l=c*u+o*i-s*r,d=-o*r-s*i-a*u;return t[0]=f*c+d*-o+h*-a-l*-s,t[1]=h*c+d*-s+l*-o-f*-a,t[2]=l*c+d*-a+f*-s-h*-o,t[3]=n[3],t},n.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=n[0],a=n[1],c=n[2],f=n[3];return Math.abs(e-s)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(u-c)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(o-f)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function o(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t[3]=n[3]*e[3],t}function s(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function a(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2],u=n[3]-t[3];return Math.sqrt(e*e+r*r+i*i+u*u)}function c(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2],u=n[3]-t[3];return e*e+r*r+i*i+u*u}function f(t){var n=t[0],e=t[1],r=t[2],i=t[3];return Math.sqrt(n*n+e*e+r*r+i*i)}function h(t){var n=t[0],e=t[1],r=t[2],i=t[3];return n*n+e*e+r*r+i*i}n.sub=u,n.mul=o,n.div=s,n.dist=a,n.sqrDist=c,n.len=f,n.sqrLen=h,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=4),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;a1?0:i<-1?Math.PI:Math.acos(i)},n.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=n[0],s=n[1],a=n[2];return Math.abs(e-o)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(u-a)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function u(t){var n=t[0],e=t[1],r=t[2];return Math.sqrt(n*n+e*e+r*r)}function o(t,n,e){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=n,i[2]=e,i}function s(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function a(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function c(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function f(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return Math.sqrt(e*e+r*r+i*i)}function h(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}function l(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function d(t,n){var e=n[0],r=n[1],i=n[2],u=e*e+r*r+i*i;return u>0&&(u=1/Math.sqrt(u),t[0]=n[0]*u,t[1]=n[1]*u,t[2]=n[2]*u),t}function m(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}n.sub=s,n.mul=a,n.div=c,n.dist=f,n.sqrDist=h,n.len=u,n.sqrLen=l,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=3),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;ar.EPSILON?(t[0]=n[0]/i,t[1]=n[1]/i,t[2]=n[2]/i):(t[0]=1,t[1]=0,t[2]=0),e},n.multiply=f,n.rotateX=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+o*s,t[1]=i*a+u*s,t[2]=u*a-i*s,t[3]=o*a-r*s,t},n.rotateY=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a-u*s,t[1]=i*a+o*s,t[2]=u*a+r*s,t[3]=o*a-i*s,t},n.rotateZ=function(t,n,e){e*=.5;var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+i*s,t[1]=i*a-r*s,t[2]=u*a+o*s,t[3]=o*a-u*s,t},n.calculateW=function(t,n){var e=n[0],r=n[1],i=n[2];return t[0]=e,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-i*i)),t},n.slerp=h,n.random=function(t){var n=r.RANDOM(),e=r.RANDOM(),i=r.RANDOM(),u=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=u*Math.sin(2*Math.PI*e),t[1]=u*Math.cos(2*Math.PI*e),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e*e+r*r+i*i+u*u,s=o?1/o:0;return t[0]=-e*s,t[1]=-r*s,t[2]=-i*s,t[3]=u*s,t},n.conjugate=function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t},n.fromMat3=l,n.fromEuler=function(t,n,e,r){var i=.5*Math.PI/180;n*=i,e*=i,r*=i;var u=Math.sin(n),o=Math.cos(n),s=Math.sin(e),a=Math.cos(e),c=Math.sin(r),f=Math.cos(r);return t[0]=u*a*f-o*s*c,t[1]=o*s*f+u*a*c,t[2]=o*a*c-u*s*f,t[3]=o*a*f+u*s*c,t},n.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=s(e(0)),i=s(e(5)),u=s(e(2)),o=s(e(1));function s(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function a(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function f(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1],c=e[2],f=e[3];return t[0]=r*f+o*s+i*c-u*a,t[1]=i*f+o*a+u*s-r*c,t[2]=u*f+o*c+r*a-i*s,t[3]=o*f-r*s-i*a-u*c,t}function h(t,n,e,i){var u=n[0],o=n[1],s=n[2],a=n[3],c=e[0],f=e[1],h=e[2],l=e[3],d=void 0,m=void 0,E=void 0,_=void 0,R=void 0;return(m=u*c+o*f+s*h+a*l)<0&&(m=-m,c=-c,f=-f,h=-h,l=-l),1-m>r.EPSILON?(d=Math.acos(m),E=Math.sin(d),_=Math.sin((1-i)*d)/E,R=Math.sin(i*d)/E):(_=1-i,R=i),t[0]=_*u+R*c,t[1]=_*o+R*f,t[2]=_*s+R*h,t[3]=_*a+R*l,t}function l(t,n){var e=n[0]+n[4]+n[8],r=void 0;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{var i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var u=(i+1)%3,o=(i+2)%3;r=Math.sqrt(n[3*i+i]-n[3*u+u]-n[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(n[3*u+o]-n[3*o+u])*r,t[u]=(n[3*u+i]+n[3*i+u])*r,t[o]=(n[3*o+i]+n[3*i+o])*r}return t}n.clone=o.clone,n.fromValues=o.fromValues,n.copy=o.copy,n.set=o.set,n.add=o.add,n.mul=f,n.scale=o.scale,n.dot=o.dot,n.lerp=o.lerp;var d=n.length=o.length,m=(n.len=d,n.squaredLength=o.squaredLength),E=(n.sqrLen=m,n.normalize=o.normalize);n.exactEquals=o.exactEquals,n.equals=o.equals,n.rotationTo=function(){var t=u.create(),n=u.fromValues(1,0,0),e=u.fromValues(0,1,0);return function(r,i,o){var s=u.dot(i,o);return s<-.999999?(u.cross(t,n,i),u.len(t)<1e-6&&u.cross(t,e,i),u.normalize(t,t),c(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(u.cross(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,E(r,r))}}(),n.sqlerp=function(){var t=a(),n=a();return function(e,r,i,u,o,s){return h(t,r,o,s),h(n,i,u,s),h(e,t,n,2*s*(1-s)),e}}(),n.setAxes=function(){var t=i.create();return function(n,e,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-e[0],t[5]=-e[1],t[8]=-e[2],E(n,l(n,t))}}()},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},n.fromValues=function(t,n,e,i,u,o,s,a,c,f,h,l,d,m,E,_){var R=new r.ARRAY_TYPE(16);return R[0]=t,R[1]=n,R[2]=e,R[3]=i,R[4]=u,R[5]=o,R[6]=s,R[7]=a,R[8]=c,R[9]=f,R[10]=h,R[11]=l,R[12]=d,R[13]=m,R[14]=E,R[15]=_,R},n.set=function(t,n,e,r,i,u,o,s,a,c,f,h,l,d,m,E,_){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t[6]=s,t[7]=a,t[8]=c,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=m,t[14]=E,t[15]=_,t},n.identity=i,n.transpose=function(t,n){if(t===n){var e=n[1],r=n[2],i=n[3],u=n[6],o=n[7],s=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=u,t[11]=n[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],m=n[12],E=n[13],_=n[14],R=n[15],M=e*s-r*o,A=e*a-i*o,T=e*c-u*o,v=r*a-i*s,p=r*c-u*s,N=i*c-u*a,I=f*E-h*m,S=f*_-l*m,O=f*R-d*m,L=h*_-l*E,U=h*R-d*E,P=l*R-d*_,F=M*P-A*U+T*L+v*O-p*S+N*I;return F?(F=1/F,t[0]=(s*P-a*U+c*L)*F,t[1]=(i*U-r*P-u*L)*F,t[2]=(E*N-_*p+R*v)*F,t[3]=(l*p-h*N-d*v)*F,t[4]=(a*O-o*P-c*S)*F,t[5]=(e*P-i*O+u*S)*F,t[6]=(_*T-m*N-R*A)*F,t[7]=(f*N-l*T+d*A)*F,t[8]=(o*U-s*O+c*I)*F,t[9]=(r*O-e*U-u*I)*F,t[10]=(m*p-E*T+R*M)*F,t[11]=(h*T-f*p-d*M)*F,t[12]=(s*S-o*L-a*I)*F,t[13]=(e*L-r*S+i*I)*F,t[14]=(E*A-m*v-_*M)*F,t[15]=(f*v-h*A+l*M)*F,t):null},n.adjoint=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],m=n[12],E=n[13],_=n[14],R=n[15];return t[0]=s*(l*R-d*_)-h*(a*R-c*_)+E*(a*d-c*l),t[1]=-(r*(l*R-d*_)-h*(i*R-u*_)+E*(i*d-u*l)),t[2]=r*(a*R-c*_)-s*(i*R-u*_)+E*(i*c-u*a),t[3]=-(r*(a*d-c*l)-s*(i*d-u*l)+h*(i*c-u*a)),t[4]=-(o*(l*R-d*_)-f*(a*R-c*_)+m*(a*d-c*l)),t[5]=e*(l*R-d*_)-f*(i*R-u*_)+m*(i*d-u*l),t[6]=-(e*(a*R-c*_)-o*(i*R-u*_)+m*(i*c-u*a)),t[7]=e*(a*d-c*l)-o*(i*d-u*l)+f*(i*c-u*a),t[8]=o*(h*R-d*E)-f*(s*R-c*E)+m*(s*d-c*h),t[9]=-(e*(h*R-d*E)-f*(r*R-u*E)+m*(r*d-u*h)),t[10]=e*(s*R-c*E)-o*(r*R-u*E)+m*(r*c-u*s),t[11]=-(e*(s*d-c*h)-o*(r*d-u*h)+f*(r*c-u*s)),t[12]=-(o*(h*_-l*E)-f*(s*_-a*E)+m*(s*l-a*h)),t[13]=e*(h*_-l*E)-f*(r*_-i*E)+m*(r*l-i*h),t[14]=-(e*(s*_-a*E)-o*(r*_-i*E)+m*(r*a-i*s)),t[15]=e*(s*l-a*h)-o*(r*l-i*h)+f*(r*a-i*s),t},n.determinant=function(t){var n=t[0],e=t[1],r=t[2],i=t[3],u=t[4],o=t[5],s=t[6],a=t[7],c=t[8],f=t[9],h=t[10],l=t[11],d=t[12],m=t[13],E=t[14],_=t[15];return(n*o-e*u)*(h*_-l*E)-(n*s-r*u)*(f*_-l*m)+(n*a-i*u)*(f*E-h*m)+(e*s-r*o)*(c*_-l*d)-(e*a-i*o)*(c*E-h*d)+(r*a-i*s)*(c*m-f*d)},n.multiply=u,n.translate=function(t,n,e){var r=e[0],i=e[1],u=e[2],o=void 0,s=void 0,a=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,E=void 0,_=void 0,R=void 0;return n===t?(t[12]=n[0]*r+n[4]*i+n[8]*u+n[12],t[13]=n[1]*r+n[5]*i+n[9]*u+n[13],t[14]=n[2]*r+n[6]*i+n[10]*u+n[14],t[15]=n[3]*r+n[7]*i+n[11]*u+n[15]):(o=n[0],s=n[1],a=n[2],c=n[3],f=n[4],h=n[5],l=n[6],d=n[7],m=n[8],E=n[9],_=n[10],R=n[11],t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=f,t[5]=h,t[6]=l,t[7]=d,t[8]=m,t[9]=E,t[10]=_,t[11]=R,t[12]=o*r+f*i+m*u+n[12],t[13]=s*r+h*i+E*u+n[13],t[14]=a*r+l*i+_*u+n[14],t[15]=c*r+d*i+R*u+n[15]),t},n.scale=function(t,n,e){var r=e[0],i=e[1],u=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=n[7]*i,t[8]=n[8]*u,t[9]=n[9]*u,t[10]=n[10]*u,t[11]=n[11]*u,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},n.rotate=function(t,n,e,i){var u,o,s,a,c,f,h,l,d,m,E,_,R,M,A,T,v,p,N,I,S,O,L,U,P=i[0],F=i[1],g=i[2],y=Math.sqrt(P*P+F*F+g*g);return y0?(e[0]=2*(c*a+l*i+f*s-h*u)/d,e[1]=2*(f*a+l*u+h*i-c*s)/d,e[2]=2*(h*a+l*s+c*u-f*i)/d):(e[0]=2*(c*a+l*i+f*s-h*u),e[1]=2*(f*a+l*u+h*i-c*s),e[2]=2*(h*a+l*s+c*u-f*i)),o(t,n,e),t},n.getTranslation=function(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t},n.getScaling=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[4],o=n[5],s=n[6],a=n[8],c=n[9],f=n[10];return t[0]=Math.sqrt(e*e+r*r+i*i),t[1]=Math.sqrt(u*u+o*o+s*s),t[2]=Math.sqrt(a*a+c*c+f*f),t},n.getRotation=function(t,n){var e=n[0]+n[5]+n[10],r=0;return e>0?(r=2*Math.sqrt(e+1),t[3]=.25*r,t[0]=(n[6]-n[9])/r,t[1]=(n[8]-n[2])/r,t[2]=(n[1]-n[4])/r):n[0]>n[5]&&n[0]>n[10]?(r=2*Math.sqrt(1+n[0]-n[5]-n[10]),t[3]=(n[6]-n[9])/r,t[0]=.25*r,t[1]=(n[1]+n[4])/r,t[2]=(n[8]+n[2])/r):n[5]>n[10]?(r=2*Math.sqrt(1+n[5]-n[0]-n[10]),t[3]=(n[8]-n[2])/r,t[0]=(n[1]+n[4])/r,t[1]=.25*r,t[2]=(n[6]+n[9])/r):(r=2*Math.sqrt(1+n[10]-n[0]-n[5]),t[3]=(n[1]-n[4])/r,t[0]=(n[8]+n[2])/r,t[1]=(n[6]+n[9])/r,t[2]=.25*r),t},n.fromRotationTranslationScale=function(t,n,e,r){var i=n[0],u=n[1],o=n[2],s=n[3],a=i+i,c=u+u,f=o+o,h=i*a,l=i*c,d=i*f,m=u*c,E=u*f,_=o*f,R=s*a,M=s*c,A=s*f,T=r[0],v=r[1],p=r[2];return t[0]=(1-(m+_))*T,t[1]=(l+A)*T,t[2]=(d-M)*T,t[3]=0,t[4]=(l-A)*v,t[5]=(1-(h+_))*v,t[6]=(E+R)*v,t[7]=0,t[8]=(d+M)*p,t[9]=(E-R)*p,t[10]=(1-(h+m))*p,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},n.fromRotationTranslationScaleOrigin=function(t,n,e,r,i){var u=n[0],o=n[1],s=n[2],a=n[3],c=u+u,f=o+o,h=s+s,l=u*c,d=u*f,m=u*h,E=o*f,_=o*h,R=s*h,M=a*c,A=a*f,T=a*h,v=r[0],p=r[1],N=r[2],I=i[0],S=i[1],O=i[2],L=(1-(E+R))*v,U=(d+T)*v,P=(m-A)*v,F=(d-T)*p,g=(1-(l+R))*p,y=(_+M)*p,C=(m+A)*N,D=(_-M)*N,B=(1-(l+E))*N;return t[0]=L,t[1]=U,t[2]=P,t[3]=0,t[4]=F,t[5]=g,t[6]=y,t[7]=0,t[8]=C,t[9]=D,t[10]=B,t[11]=0,t[12]=e[0]+I-(L*I+F*S+C*O),t[13]=e[1]+S-(U*I+g*S+D*O),t[14]=e[2]+O-(P*I+y*S+B*O),t[15]=1,t},n.fromQuat=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e+e,s=r+r,a=i+i,c=e*o,f=r*o,h=r*s,l=i*o,d=i*s,m=i*a,E=u*o,_=u*s,R=u*a;return t[0]=1-h-m,t[1]=f+R,t[2]=l-_,t[3]=0,t[4]=f-R,t[5]=1-c-m,t[6]=d+E,t[7]=0,t[8]=l+_,t[9]=d-E,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.frustum=function(t,n,e,r,i,u,o){var s=1/(e-n),a=1/(i-r),c=1/(u-o);return t[0]=2*u*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*u*a,t[6]=0,t[7]=0,t[8]=(e+n)*s,t[9]=(i+r)*a,t[10]=(o+u)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*u*2*c,t[15]=0,t},n.perspective=function(t,n,e,r,i){var u=1/Math.tan(n/2),o=void 0;return t[0]=u/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},n.perspectiveFromFieldOfView=function(t,n,e,r){var i=Math.tan(n.upDegrees*Math.PI/180),u=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),s=Math.tan(n.rightDegrees*Math.PI/180),a=2/(o+s),c=2/(i+u);return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*a*.5,t[9]=(i-u)*c*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t},n.ortho=function(t,n,e,r,i,u,o){var s=1/(n-e),a=1/(r-i),c=1/(u-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(n+e)*s,t[13]=(i+r)*a,t[14]=(o+u)*c,t[15]=1,t},n.lookAt=function(t,n,e,u){var o=void 0,s=void 0,a=void 0,c=void 0,f=void 0,h=void 0,l=void 0,d=void 0,m=void 0,E=void 0,_=n[0],R=n[1],M=n[2],A=u[0],T=u[1],v=u[2],p=e[0],N=e[1],I=e[2];return Math.abs(_-p)0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var m=a*l-c*h,E=c*f-s*l,_=s*h-a*f;return(d=m*m+E*E+_*_)>0&&(m*=d=1/Math.sqrt(d),E*=d,_*=d),t[0]=m,t[1]=E,t[2]=_,t[3]=0,t[4]=h*_-l*E,t[5]=l*m-f*_,t[6]=f*E-h*m,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=i,t[13]=u,t[14]=o,t[15]=1,t},n.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t},n.subtract=s,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=t[8],l=t[9],d=t[10],m=t[11],E=t[12],_=t[13],R=t[14],M=t[15],A=n[0],T=n[1],v=n[2],p=n[3],N=n[4],I=n[5],S=n[6],O=n[7],L=n[8],U=n[9],P=n[10],F=n[11],g=n[12],y=n[13],C=n[14],D=n[15];return Math.abs(e-A)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(A))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(u-v)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-N)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(N))&&Math.abs(a-I)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-S)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(f-O)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(h-L)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(l-U)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(U))&&Math.abs(d-P)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(m-F)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(F))&&Math.abs(E-g)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(g))&&Math.abs(_-y)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(y))&&Math.abs(R-C)<=r.EPSILON*Math.max(1,Math.abs(R),Math.abs(C))&&Math.abs(M-D)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(D))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function u(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=n[9],d=n[10],m=n[11],E=n[12],_=n[13],R=n[14],M=n[15],A=e[0],T=e[1],v=e[2],p=e[3];return t[0]=A*r+T*s+v*h+p*E,t[1]=A*i+T*a+v*l+p*_,t[2]=A*u+T*c+v*d+p*R,t[3]=A*o+T*f+v*m+p*M,A=e[4],T=e[5],v=e[6],p=e[7],t[4]=A*r+T*s+v*h+p*E,t[5]=A*i+T*a+v*l+p*_,t[6]=A*u+T*c+v*d+p*R,t[7]=A*o+T*f+v*m+p*M,A=e[8],T=e[9],v=e[10],p=e[11],t[8]=A*r+T*s+v*h+p*E,t[9]=A*i+T*a+v*l+p*_,t[10]=A*u+T*c+v*d+p*R,t[11]=A*o+T*f+v*m+p*M,A=e[12],T=e[13],v=e[14],p=e[15],t[12]=A*r+T*s+v*h+p*E,t[13]=A*i+T*a+v*l+p*_,t[14]=A*u+T*c+v*d+p*R,t[15]=A*o+T*f+v*m+p*M,t}function o(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=r+r,a=i+i,c=u+u,f=r*s,h=r*a,l=r*c,d=i*a,m=i*c,E=u*c,_=o*s,R=o*a,M=o*c;return t[0]=1-(d+E),t[1]=h+M,t[2]=l-R,t[3]=0,t[4]=h-M,t[5]=1-(f+E),t[6]=m+_,t[7]=0,t[8]=l+R,t[9]=m-_,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function s(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}n.mul=u,n.sub=s},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},n.fromMat4=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},n.clone=function(t){var n=new r.ARRAY_TYPE(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},n.fromValues=function(t,n,e,i,u,o,s,a,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=n,f[2]=e,f[3]=i,f[4]=u,f[5]=o,f[6]=s,f[7]=a,f[8]=c,f},n.set=function(t,n,e,r,i,u,o,s,a,c){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t[6]=s,t[7]=a,t[8]=c,t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.transpose=function(t,n){if(t===n){var e=n[1],r=n[2],i=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=i}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=f*o-s*c,l=-f*u+s*a,d=c*u-o*a,m=e*h+r*l+i*d;return m?(m=1/m,t[0]=h*m,t[1]=(-f*r+i*c)*m,t[2]=(s*r-i*o)*m,t[3]=l*m,t[4]=(f*e-i*a)*m,t[5]=(-s*e+i*u)*m,t[6]=d*m,t[7]=(-c*e+r*a)*m,t[8]=(o*e-r*u)*m,t):null},n.adjoint=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8];return t[0]=o*f-s*c,t[1]=i*c-r*f,t[2]=r*s-i*o,t[3]=s*a-u*f,t[4]=e*f-i*a,t[5]=i*u-e*s,t[6]=u*c-o*a,t[7]=r*a-e*c,t[8]=e*o-r*u,t},n.determinant=function(t){var n=t[0],e=t[1],r=t[2],i=t[3],u=t[4],o=t[5],s=t[6],a=t[7],c=t[8];return n*(c*u-o*a)+e*(-c*i+o*s)+r*(a*i-u*s)},n.multiply=i,n.translate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=s,t[5]=a,t[6]=l*r+d*o+c,t[7]=l*i+d*s+f,t[8]=l*u+d*a+h,t},n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*o,t[1]=d*i+l*s,t[2]=d*u+l*a,t[3]=d*o-l*r,t[4]=d*s-l*i,t[5]=d*a-l*u,t[6]=c,t[7]=f,t[8]=h,t},n.scale=function(t,n,e){var r=e[0],i=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=i*n[3],t[4]=i*n[4],t[5]=i*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},n.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromMat2d=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},n.fromQuat=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e+e,s=r+r,a=i+i,c=e*o,f=r*o,h=r*s,l=i*o,d=i*s,m=i*a,E=u*o,_=u*s,R=u*a;return t[0]=1-h-m,t[3]=f-R,t[6]=l+_,t[1]=f+R,t[4]=1-c-m,t[7]=d-E,t[2]=l-_,t[5]=d+E,t[8]=1-c-h,t},n.normalFromMat4=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],d=n[11],m=n[12],E=n[13],_=n[14],R=n[15],M=e*s-r*o,A=e*a-i*o,T=e*c-u*o,v=r*a-i*s,p=r*c-u*s,N=i*c-u*a,I=f*E-h*m,S=f*_-l*m,O=f*R-d*m,L=h*_-l*E,U=h*R-d*E,P=l*R-d*_,F=M*P-A*U+T*L+v*O-p*S+N*I;return F?(F=1/F,t[0]=(s*P-a*U+c*L)*F,t[1]=(a*O-o*P-c*S)*F,t[2]=(o*U-s*O+c*I)*F,t[3]=(i*U-r*P-u*L)*F,t[4]=(e*P-i*O+u*S)*F,t[5]=(r*O-e*U-u*I)*F,t[6]=(E*N-_*p+R*v)*F,t[7]=(_*T-m*N-R*A)*F,t[8]=(m*p-E*T+R*M)*F,t):null},n.projection=function(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},n.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t},n.subtract=u,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=t[8],l=n[0],d=n[1],m=n[2],E=n[3],_=n[4],R=n[5],M=n[6],A=n[7],T=n[8];return Math.abs(e-l)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(o-E)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(a-R)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(R))&&Math.abs(c-M)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(f-A)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=n[6],f=n[7],h=n[8],l=e[0],d=e[1],m=e[2],E=e[3],_=e[4],R=e[5],M=e[6],A=e[7],T=e[8];return t[0]=l*r+d*o+m*c,t[1]=l*i+d*s+m*f,t[2]=l*u+d*a+m*h,t[3]=E*r+_*o+R*c,t[4]=E*i+_*s+R*f,t[5]=E*u+_*a+R*h,t[6]=M*r+A*o+T*c,t[7]=M*i+A*s+T*f,t[8]=M*u+A*a+T*h,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.forEach=n.sqrLen=n.sqrDist=n.dist=n.div=n.mul=n.sub=n.len=void 0,n.create=i,n.clone=function(t){var n=new r.ARRAY_TYPE(2);return n[0]=t[0],n[1]=t[1],n},n.fromValues=function(t,n){var e=new r.ARRAY_TYPE(2);return e[0]=t,e[1]=n,e},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t},n.set=function(t,n,e){return t[0]=n,t[1]=e,t},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t},n.subtract=u,n.multiply=o,n.divide=s,n.ceil=function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t},n.floor=function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t},n.min=function(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t},n.max=function(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t},n.round=function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t},n.scale=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t},n.scaleAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t},n.distance=a,n.squaredDistance=c,n.length=f,n.squaredLength=h,n.negate=function(t,n){return t[0]=-n[0],t[1]=-n[1],t},n.inverse=function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t},n.normalize=function(t,n){var e=n[0],r=n[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=n[0]*i,t[1]=n[1]*i),t},n.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]},n.cross=function(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t},n.lerp=function(t,n,e,r){var i=n[0],u=n[1];return t[0]=i+r*(e[0]-i),t[1]=u+r*(e[1]-u),t},n.random=function(t,n){n=n||1;var e=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t},n.transformMat2=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i,t[1]=e[1]*r+e[3]*i,t},n.transformMat2d=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t},n.transformMat3=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[3]*i+e[6],t[1]=e[1]*r+e[4]*i+e[7],t},n.transformMat4=function(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[4]*i+e[12],t[1]=e[1]*r+e[5]*i+e[13],t},n.rotate=function(t,n,e,r){var i=n[0]-e[0],u=n[1]-e[1],o=Math.sin(r),s=Math.cos(r);return t[0]=i*s-u*o+e[0],t[1]=i*o+u*s+e[1],t},n.angle=function(t,n){var e=t[0],r=t[1],i=n[0],u=n[1],o=e*e+r*r;o>0&&(o=1/Math.sqrt(o));var s=i*i+u*u;s>0&&(s=1/Math.sqrt(s));var a=(e*i+r*u)*o*s;return a>1?0:a<-1?Math.PI:Math.acos(a)},n.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]},n.equals=function(t,n){var e=t[0],i=t[1],u=n[0],o=n[1];return Math.abs(e-u)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function o(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function s(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function a(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function c(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function f(t){var n=t[0],e=t[1];return Math.sqrt(n*n+e*e)}function h(t){var n=t[0],e=t[1];return n*n+e*e}n.len=f,n.sub=u,n.mul=o,n.div=s,n.dist=a,n.sqrDist=c,n.sqrLen=h,n.forEach=function(){var t=i();return function(n,e,r,i,u,o){var s,a=void 0;for(e||(e=2),r||(r=0),s=i?Math.min(i*e+r,n.length):n.length,a=r;a0){e=Math.sqrt(e);var r=n[0]/e,i=n[1]/e,u=n[2]/e,o=n[3]/e,s=n[4],a=n[5],c=n[6],f=n[7],h=r*s+i*a+u*c+o*f;t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=(s-r*h)/e,t[5]=(a-i*h)/e,t[6]=(c-u*h)/e,t[7]=(f-o*h)/e}return t},n.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=t[6],f=t[7],h=n[0],l=n[1],d=n[2],m=n[3],E=n[4],_=n[5],R=n[6],M=n[7];return Math.abs(e-h)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(u-d)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(d))&&Math.abs(o-m)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-E)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(a-_)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(c-R)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-M)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(M))};var r=o(e(0)),i=o(e(3)),u=o(e(4));function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function s(t,n,e){var r=.5*e[0],i=.5*e[1],u=.5*e[2],o=n[0],s=n[1],a=n[2],c=n[3];return t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=r*c+i*a-u*s,t[5]=i*c+u*o-r*a,t[6]=u*c+r*s-i*o,t[7]=-r*o-i*s-u*a,t}function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t}function c(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[4],a=e[5],c=e[6],f=e[7],h=n[4],l=n[5],d=n[6],m=n[7],E=e[0],_=e[1],R=e[2],M=e[3];return t[0]=r*M+o*E+i*R-u*_,t[1]=i*M+o*_+u*E-r*R,t[2]=u*M+o*R+r*_-i*E,t[3]=o*M-r*E-i*_-u*R,t[4]=r*f+o*s+i*c-u*a+h*M+m*E+l*R-d*_,t[5]=i*f+o*a+u*s-r*c+l*M+m*_+d*E-h*R,t[6]=u*f+o*c+r*a-i*s+d*M+m*R+h*_-l*E,t[7]=o*f-r*s-i*a-u*c+m*M-h*E-l*_-d*R,t}n.getReal=i.copy,n.setReal=i.copy,n.mul=c;var f=n.dot=i.dot,h=n.length=i.length,l=(n.len=h,n.squaredLength=i.squaredLength);n.sqrLen=l},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},n.fromValues=function(t,n,e,i,u,o){var s=new r.ARRAY_TYPE(6);return s[0]=t,s[1]=n,s[2]=e,s[3]=i,s[4]=u,s[5]=o,s},n.set=function(t,n,e,r,i,u,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=u,t[5]=o,t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=n[4],s=n[5],a=e*u-r*i;return a?(a=1/a,t[0]=u*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t[4]=(i*s-u*o)*a,t[5]=(r*o-e*s)*a,t):null},n.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},n.multiply=i,n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=Math.sin(e),f=Math.cos(e);return t[0]=r*f+u*c,t[1]=i*f+o*c,t[2]=r*-c+u*f,t[3]=i*-c+o*f,t[4]=s,t[5]=a,t},n.scale=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1];return t[0]=r*c,t[1]=i*c,t[2]=u*f,t[3]=o*f,t[4]=s,t[5]=a,t},n.translate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1];return t[0]=r,t[1]=i,t[2]=u,t[3]=o,t[4]=r*c+u*f+s,t[5]=i*c+o*f+a,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t[4]=0,t[5]=0,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t},n.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},n.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t},n.subtract=u,n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t},n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=t[4],a=t[5],c=n[0],f=n[1],h=n[2],l=n[3],d=n[4],m=n[5];return Math.abs(e-c)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(u-h)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(o-l)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(s-d)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=n[4],a=n[5],c=e[0],f=e[1],h=e[2],l=e[3],d=e[4],m=e[5];return t[0]=r*c+u*f,t[1]=i*c+o*f,t[2]=r*h+u*l,t[3]=i*h+o*l,t[4]=r*d+u*m+s,t[5]=i*d+o*m+a,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sub=n.mul=void 0,n.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},n.clone=function(t){var n=new r.ARRAY_TYPE(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},n.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},n.fromValues=function(t,n,e,i){var u=new r.ARRAY_TYPE(4);return u[0]=t,u[1]=n,u[2]=e,u[3]=i,u},n.set=function(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t},n.transpose=function(t,n){if(t===n){var e=n[1];t[1]=n[2],t[2]=e}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},n.invert=function(t,n){var e=n[0],r=n[1],i=n[2],u=n[3],o=e*u-i*r;return o?(o=1/o,t[0]=u*o,t[1]=-r*o,t[2]=-i*o,t[3]=e*o,t):null},n.adjoint=function(t,n){var e=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=e,t},n.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},n.multiply=i,n.rotate=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=Math.sin(e),a=Math.cos(e);return t[0]=r*a+u*s,t[1]=i*a+o*s,t[2]=r*-s+u*a,t[3]=i*-s+o*a,t},n.scale=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1];return t[0]=r*s,t[1]=i*s,t[2]=u*a,t[3]=o*a,t},n.fromRotation=function(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t},n.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},n.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},n.LDU=function(t,n,e,r){return t[2]=r[2]/r[0],e[0]=r[0],e[1]=r[1],e[3]=r[3]-t[2]*e[1],[t,n,e]},n.add=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t},n.subtract=u,n.exactEquals=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},n.equals=function(t,n){var e=t[0],i=t[1],u=t[2],o=t[3],s=n[0],a=n[1],c=n[2],f=n[3];return Math.abs(e-s)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(u-c)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(o-f)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))},n.multiplyScalar=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t},n.multiplyScalarAndAdd=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(e(0));function i(t,n,e){var r=n[0],i=n[1],u=n[2],o=n[3],s=e[0],a=e[1],c=e[2],f=e[3];return t[0]=r*s+u*a,t[1]=i*s+o*a,t[2]=r*c+u*f,t[3]=i*c+o*f,t}function u(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}n.mul=i,n.sub=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.vec4=n.vec3=n.vec2=n.quat2=n.quat=n.mat4=n.mat3=n.mat2d=n.mat2=n.glMatrix=void 0;var r=d(e(0)),i=d(e(9)),u=d(e(8)),o=d(e(5)),s=d(e(4)),a=d(e(3)),c=d(e(7)),f=d(e(6)),h=d(e(2)),l=d(e(1));function d(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}n.glMatrix=r,n.mat2=i,n.mat2d=u,n.mat3=o,n.mat4=s,n.quat=a,n.quat2=c,n.vec2=f,n.vec3=h,n.vec4=l}])},function(t,n,e){"use strict";var r=function(){var t,n;try{t=Object.defineProperty,n=Object.defineProperties,t({},"$",{value:0})}catch(e){"__defineGetter__"in Object&&(t=function(t,n,e){return"value"in e&&(t[n]=e.value),"get"in e&&t.__defineGetter__(n,e.get),"set"in e&&t.__defineSetter__(n,e.set),t},n=function(n,e){for(var r in e)e.hasOwnProperty(r)&&t(n,r,e[r]);return n})}var e=function(t){for(var e=1,r=arguments.length;e>1,o=e(t[u],n);if(0===o)return[u,u];o<0?r=u+1:i=u-1}return r>i?[i,r]:[r,i]}function M(t,n,e){var r=R(t,n,e);t.splice(r[1],0,n)}function A(t,n,e){return n<=t.length?t:new Array(n-t.length+1).join(e||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?s:t instanceof Uint8Array?a:t instanceof Int16Array?c:t instanceof Uint16Array?f:t instanceof Uint32Array?h:l}var v,p,N=(u(v={},s,Int8Array),u(v,a,Uint8Array),u(v,c,Int16Array),u(v,f,Uint16Array),u(v,h,Uint32Array),u(v,l,Float32Array),p=v,function(t){return p[t]||Float32Array});function I(t,n,e,r,i){if(t&&n){n.isGeometryData&&(n=n.data);for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,e,r){return t.then((function(){return n(e,r)}))}),Promise.resolve())}function y(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function C(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,n,e)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],this},set:function(t,n,e){return r.vec3.set(this.elements,t,n,e),this},add:function(t,n){return n||(n=t,t=this),r.vec3.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec3.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec3.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec3.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec3.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec3.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec3.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec3.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec3.squaredDistance(t.elements,n.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec3.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec3.cross(this.elements,t.elements,n.elements),this},lerp:function(t,n){return r.vec3.lerp(this.elements,this.elements,t.elements,n),this},hermite:function(t,n,e,i,u){return r.vec3.hermite(this.elements,t.elements,n.elements,e.elements,i.elements,u),this},bezier:function(t,n,e,i,u){return r.vec3.bezier(this.elements,t.elements,n.elements,e.elements,i.elements,u),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var n=this.elements,e=t.elements,r=n[0],i=n[1],u=n[2];return n[0]=r*e[0]+i*e[4]+u*e[8],n[1]=r*e[1]+i*e[5]+u*e[9],n[2]=r*e[2]+i*e[6]+u*e[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,n){return r.vec3.rotateX(this.elements,this.elements,t.elements,n),this},rotateY:function(t,n){return r.vec3.rotateY(this.elements,this.elements,t.elements,n),this},rotateZ:function(t,n){return r.vec3.rotateZ(this.elements,this.elements,t.elements,n),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec3.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},function(t,n,e){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var n=++r;return t?n=t+"_"+n:n+="",n}),clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};n.a=i},function(t,n,e){"use strict";var r,i=e(0),u=e(1),o=e(5),s=e(9),a=new o.a,c=new o.a,f=u.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)t[n+r]=e[r];return t},fromArray:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)e[r]=t[n+r];return this},set:function(t,n,e,r,u,o,s,a,c,f,h,l,d,m,E,_){return i.mat4.set(this.elements,t,n,e,r,u,o,s,a,c,f,h,l,d,m,E,_),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),i.mat4.multiply(this.elements,t.elements,n.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,n){return i.mat4.rotate(this.elements,this.elements,t,n.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,n){return i.mat4.fromRotation(this.elements,t,n.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,n){return i.mat4.fromRotationTranslation(this.elements,t.elements,n.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,n,e){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,n.elements,e.elements),this},fromRotationTranslationScaleOrigin:function(t,n,e,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,n.elements,e.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,n,e,r,u,o){return i.mat4.frustum(this.elements,t,n,e,r,u,o),this},perspective:function(t,n,e,r){return i.mat4.perspective(this.elements,t,n,e,r),this},perspectiveFromFieldOfView:function(t,n,e){return i.mat4.perspectiveFromFieldOfView(this.elements,t,n,e),this},ortho:function(t,n,e,r,u,o){return i.mat4.ortho(this.elements,t,n,e,r,u,o),this},lookAt:function(t,n,e){return t.isVector3||(t=a.set(t.x,t.y,t.z)),n.isVector3||(n=c.set(n.x,n.y,n.z)),i.mat4.lookAt(this.elements,t.elements,n.elements,e.elements),this},targetTo:function(t,n,e){t.isVector3||(t=a.set(t.x,t.y,t.z)),n.isVector3||(n=c.set(n.x,n.y,n.z)),t=t.elements,n=n.elements,e=e.elements;var r=this.elements,i=t[0],u=t[1],o=t[2],s=e[0],f=e[1],h=e[2],l=i-n[0],d=u-n[1],m=o-n[2],E=l*l+d*d+m*m;E>0?(l*=E=1/Math.sqrt(E),d*=E,m*=E):m=1;var _=f*m-h*d,R=h*l-s*m,M=s*d-f*l;return(E=_*_+R*R+M*M)>0?(_*=E=1/Math.sqrt(E),R*=E,M*=E):(E=(_=f*m-h*d)*_+(R=h*l-(s+=1e-7)*m)*R+(M=s*d-f*l)*M,_*=E=1/Math.sqrt(E),R*=E,M*=E),r[0]=_,r[1]=R,r[2]=M,r[3]=0,r[4]=d*M-m*R,r[5]=m*_-l*M,r[6]=l*R-d*_,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=u,r[14]=o,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),i.mat4.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),i.mat4.subtract(this.elements,t.elements,n.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),i.mat4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),i.mat4.equals(t.elements,n.elements)},compose:function(t,n,e,r){return r?this.fromRotationTranslationScaleOrigin(t,n,e,r):this.fromRotationTranslationScale(t,n,e),this},decompose:function(t,n,e,i){return this.getScaling(e),this.getTranslation(n),r||(r=new f),this.determinant()<0&&(e.x*=-1),r.copy(this),a.inverse(e),r.scale(a),t.fromMat4(r),i&&i.set(0,0,0),this}});f.prototype.sub=f.prototype.subtract,f.prototype.mul=f.prototype.multiply,n.a=f},function(t,n,e){"use strict";var r=e(1),i=e(11),u=e(4),o=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;o.superclass.constructor.call(this,t,n,e,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t},fromUintArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[n]/255,this.elements[1]=t[n+1]/255,this.elements[2]=t[n+2]/255,this.elements[3]=t[n+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(u.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",n=0;n<3;n++)t+=Object(u.padLeft)(Math.floor(255*this.elements[n]).toString(16),2);return t}});n.a=o},function(t,n,e){"use strict";var r=e(0),i=e(10),u=e(1),o=new i.a,s=u.a.create({className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,n,e,i)},copy:function(t){return r.quat.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n],e[1]=t[n+1],e[2]=t[n+2],e[3]=t[n+3],this},set:function(t,n,e,i){return r.quat.set(this.elements,t,n,e,i),this},identity:function(){return r.quat.identity(this.elements),this},rotationTo:function(t,n){return r.quat.rotationTo(this.elements,t.elements,n.elements),this},setAxes:function(t,n,e){return r.quat.setAxes(this.elements,t.elements,n.elements,e.elements),this},setAxisAngle:function(t,n){return r.quat.setAxisAngle(this.elements,t.elements,n),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,n){return r.quat.lerp(this.elements,this.elements,t.elements,n),this},slerp:function(t,n){return r.quat.slerp(this.elements,this.elements,t.elements,n),this},sqlerp:function(t,n,e,i,u){return r.quat.sqlerp(this.elements,t.elements,n.elements,e.elements,i.elements,u),this},invert:function(){return r.quat.invert(this.elements,this.elements),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this},fromMat4:function(t){return o.fromMat4(t),this.fromMat3(o),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t){var n=.5*t.x,e=.5*t.y,r=.5*t.z,i=t.order||"ZYX",u=Math.sin(n),o=Math.cos(n),s=Math.sin(e),a=Math.cos(e),c=Math.sin(r),f=Math.cos(r),h=this.elements;return"XYZ"===i?(h[0]=u*a*f+o*s*c,h[1]=o*s*f-u*a*c,h[2]=o*a*c+u*s*f,h[3]=o*a*f-u*s*c):"YXZ"===i?(h[0]=u*a*f+o*s*c,h[1]=o*s*f-u*a*c,h[2]=o*a*c-u*s*f,h[3]=o*a*f+u*s*c):"ZXY"===i?(h[0]=u*a*f-o*s*c,h[1]=o*s*f+u*a*c,h[2]=o*a*c+u*s*f,h[3]=o*a*f-u*s*c):"ZYX"===i?(h[0]=u*a*f-o*s*c,h[1]=o*s*f+u*a*c,h[2]=o*a*c-u*s*f,h[3]=o*a*f+u*s*c):"YZX"===i?(h[0]=u*a*f+o*s*c,h[1]=o*s*f+u*a*c,h[2]=o*a*c-u*s*f,h[3]=o*a*f-u*s*c):"XZY"===i&&(h[0]=u*a*f-o*s*c,h[1]=o*s*f-u*a*c,h[2]=o*a*c+u*s*f,h[3]=o*a*f+u*s*c),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});s.prototype.mul=s.prototype.multiply,s.prototype.len=s.prototype.length,s.prototype.sqrLen=s.prototype.squaredLength,n.a=s},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<9;r++)t[n+r]=e[r];return t},fromArray:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<9;r++)e[r]=t[n+r];return this},set:function(t,n,e,i,u,o,s,a,c){return r.mat3.set(this.elements,t,n,e,i,u,o,s,a,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),r.mat3.multiply(this.elements,t.elements,n.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),r.mat3.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.mat3.subtract(this.elements,t.elements,n.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.mat3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.mat3.equals(t.elements,n.elements)},fromRotationTranslationScale:function(t,n,e,r,i){var u=Math.cos(t),o=Math.sin(t);return this.set(r*u,-i*o,0,r*o,i*u,0,n,e,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,n.a=i},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,n,e,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t[3+n]=e[3],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],e[3]=t[n+3],this},set:function(t,n,e,i){return r.vec4.set(this.elements,t,n,e,i),this},add:function(t,n){return n||(n=t,t=this),r.vec4.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec4.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec4.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec4.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec4.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec4.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec4.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec4.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec4.squaredDistance(t.elements,n.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec4.dot(t.elements,n.elements)},lerp:function(t,n){return r.vec4.lerp(this.elements,this.elements,t.elements,n),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec4.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},function(t,n,e){"use strict";var r=e(1),i=e(6),u=e(7),o=e(3),s=new u.a,a=i.a.DEG2RAD,c=i.a.RAD2DEG,f=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,n,e]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,n,e){return this.elements[0]=t,this.elements[1]=n,this.elements[2]=e,this.updateDegrees(),this},setDegree:function(t,n,e){return this._degX=t,this._degY=n,this._degZ=e,this.updateRadians(),this},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[n],this.elements[1]=t[n+1],this.elements[2]=t[n+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[n]=this.elements[0],t[n+1]=this.elements[1],t[n+2]=this.elements[2],t},fromMat4:function(t,n){var e=t.elements,r=e[0],u=e[1],s=e[2],a=e[4],c=e[5],f=e[6],h=e[8],l=e[9],d=e[10];n=n||this.order,this.order=n;var m=i.a.clamp;return"XYZ"===n?(this.elements[1]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-a,r)):(this.elements[0]=Math.atan2(f,c),this.elements[2]=0)):"YXZ"===n?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(h,d),this.elements[2]=Math.atan2(u,c)):(this.elements[1]=Math.atan2(-s,r),this.elements[2]=0)):"ZXY"===n?(this.elements[0]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(-s,d),this.elements[2]=Math.atan2(-a,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(u,r))):"ZYX"===n?(this.elements[1]=Math.asin(-m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(f,d),this.elements[2]=Math.atan2(u,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-a,c))):"YZX"===n?(this.elements[2]=Math.asin(m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-s,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(h,d))):"XZY"===n?(this.elements[2]=Math.asin(-m(a,-1,1)),Math.abs(a)<.99999?(this.elements[0]=Math.atan2(f,c),this.elements[1]=Math.atan2(h,r)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):o.a.warn("Euler fromMat4() unsupported order: "+n),this.updateDegrees(),this},fromQuat:function(t,n){return s.fromQuat(t),this.fromMat4(s,n)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*a,this.elements[1]=this._degY*a,this.elements[2]=this._degZ*a,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*a}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*a}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*a}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});n.a=f},function(t,n,e){"use strict";var r=e(0),i=e(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,n)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],this},set:function(t,n){return r.vec2.set(this.elements,t,n),this},add:function(t,n){return n||(n=t,t=this),r.vec2.add(this.elements,t.elements,n.elements),this},subtract:function(t,n){return n||(n=t,t=this),r.vec2.subtract(this.elements,t.elements,n.elements),this},multiply:function(t,n){return n||(n=t,t=this),r.vec2.multiply(this.elements,t.elements,n.elements),this},divide:function(t,n){return n||(n=t,t=this),r.vec2.divide(this.elements,t.elements,n.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,n){return n||(n=t,t=this),r.vec2.min(this.elements,t.elements,n.elements),this},max:function(t,n){return n||(n=t,t=this),r.vec2.max(this.elements,t.elements,n.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec2.scaleAndAdd(this.elements,n.elements,e.elements,t),this},distance:function(t,n){return n||(n=t,t=this),r.vec2.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec2.squaredDistance(t.elements,n.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,n){return n||(n=t,t=this),r.vec2.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec2.cross(this.elements,t.elements,n.elements),this},lerp:function(t,n){return r.vec2.lerp(this.elements,this.elements,t.elements,n),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec2.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec2.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,n.a=i},,function(t,n,e){"use strict";var r=e(34),i=e.n(r),u=e(1),o=e(5),s=u.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new o.a(0,0,0),this.direction=t.direction||new o.a(0,0,-1)},set:function(t,n){return this.origin=t,this.direction=n,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,n,e,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(n,e,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(n,e,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,n){var e=this;n?t.sort((function(t,r){return e.squaredDistance(t[n])-e.squaredDistance(r[n])})):t.sort((function(t,n){return e.squaredDistance(t)-e.squaredDistance(n)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,n){var e=this._ray.intersectsSphere(t,n);return this._getRes(e)},intersectsPlane:function(t,n){var e=this._ray.intersectsPlane(t,n);return this._getRes(e)},intersectsTriangle:function(t){var n=this._ray.intersectsTriangle(t);return this._getRes(n)},intersectsBox:function(t){var n=this._ray.intersectsBox(t);return this._getRes(n)},intersectsTriangleCell:function(t,n){var e=this._ray.intersectsTriangleCell(t,n);return this._getRes(e)},_getRes:function(t){return t?new o.a(t[0],t[1],t[2]):null}});n.a=s},function(t,n,e){"use strict";var r=e(0),i=e(1),u=e(5),o=i.a.create({Extends:u.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,n,e)},onUpdate:function(){},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[0+n]=e[0],t[1+n]=e[1],t[2+n]=e[2],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],this.onUpdate(),this},set:function(t,n,e){return r.vec3.set(this.elements,t,n,e),this.onUpdate(),this},add:function(t,n){return n||(n=t,t=this),r.vec3.add(this.elements,t.elements,n.elements),this.onUpdate(),this},subtract:function(t,n){return n||(n=t,t=this),r.vec3.subtract(this.elements,t.elements,n.elements),this.onUpdate(),this},multiply:function(t,n){return n||(n=t,t=this),r.vec3.multiply(this.elements,t.elements,n.elements),this.onUpdate(),this},divide:function(t,n){return n||(n=t,t=this),r.vec3.divide(this.elements,t.elements,n.elements),this.onUpdate(),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.onUpdate(),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.onUpdate(),this},min:function(t,n){return n||(n=t,t=this),r.vec3.min(this.elements,t.elements,n.elements),this.onUpdate(),this},max:function(t,n){return n||(n=t,t=this),r.vec3.max(this.elements,t.elements,n.elements),this.onUpdate(),this},round:function(){return r.vec3.round(this.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.onUpdate(),this},scaleAndAdd:function(t,n,e){return e||(e=n,n=this),r.vec3.scaleAndAdd(this.elements,n.elements,e.elements,t),this.onUpdate(),this},distance:function(t,n){return n||(n=t,t=this),r.vec3.distance(t.elements,n.elements)},squaredDistance:function(t,n){return n||(n=t,t=this),r.vec3.squaredDistance(t.elements,n.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.onUpdate(),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.onUpdate(),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.onUpdate(),this},dot:function(t,n){return n||(n=t,t=this),r.vec3.dot(t.elements,n.elements)},cross:function(t,n){return n||(n=t,t=this),r.vec3.cross(this.elements,t.elements,n.elements),this.onUpdate(),this},lerp:function(t,n){return r.vec3.lerp(this.elements,this.elements,t.elements,n),this.onUpdate(),this},hermite:function(t,n,e,i,u){return r.vec3.hermite(this.elements,t.elements,n.elements,e.elements,i.elements,u),this.onUpdate(),this},bezier:function(t,n,e,i,u){return r.vec3.bezier(this.elements,t.elements,n.elements,e.elements,i.elements,u),this.onUpdate(),this},random:function(t){return r.vec3.random(this.elements,t),this.onUpdate(),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.onUpdate(),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.onUpdate(),this},transformDirection:function(t){var n=this.elements,e=t.elements,r=n[0],i=n[1],u=n[2];return n[0]=r*e[0]+i*e[4]+u*e[8],n[1]=r*e[1]+i*e[5]+u*e[9],n[2]=r*e[2]+i*e[6]+u*e[10],this.onUpdate(),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.onUpdate(),this},rotateX:function(t,n){return r.vec3.rotateX(this.elements,this.elements,t.elements,n),this.onUpdate(),this},rotateY:function(t,n){return r.vec3.rotateY(this.elements,this.elements,t.elements,n),this.onUpdate(),this},rotateZ:function(t,n){return r.vec3.rotateZ(this.elements,this.elements,t.elements,n),this.onUpdate(),this},exactEquals:function(t,n){return n||(n=t,t=this),r.vec3.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),r.vec3.equals(t.elements,n.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}}});n.a=o},,function(t,n,e){"use strict";var r=e(1),i=e(5),u=r.a.create({className:"Plane",isPlane:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=n},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,n,e,r){return this.normal.set(t,n,e),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});n.a=u},function(t,n,e){"use strict";var r=e(1),i=e(5),u=new i.a,o=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var n=this.center,e=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements,r=0;r<16;r++)e[r]=t[n+r];return this.onUpdate(),this},set:function(t,n,e,r,u,o,s,a,c,f,h,l,d,m,E,_){return i.mat4.set(this.elements,t,n,e,r,u,o,s,a,c,f,h,l,d,m,E,_),this.onUpdate(),this},identity:function(){return i.mat4.identity(this.elements),this.onUpdate(),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.onUpdate(),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.onUpdate(),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.onUpdate(),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,n){return n||(n=t,t=this),i.mat4.multiply(this.elements,t.elements,n.elements),this.onUpdate(),this},premultiply:function(t){return this.multiply(t,this),this.onUpdate(),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.onUpdate(),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.onUpdate(),this},rotate:function(t,n){return i.mat4.rotate(this.elements,this.elements,t,n.elements),this.onUpdate(),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.onUpdate(),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.onUpdate(),this},fromRotation:function(t,n){return i.mat4.fromRotation(this.elements,t,n.elements),this.onUpdate(),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.onUpdate(),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.onUpdate(),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.onUpdate(),this},fromRotationTranslation:function(t,n){return i.mat4.fromRotationTranslation(this.elements,t.elements,n.elements),this.onUpdate(),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,n,e){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,n.elements,e.elements),this.onUpdate(),this},fromRotationTranslationScaleOrigin:function(t,n,e,r,u){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,n.elements,e.elements,r.elements),u||this.onUpdate(),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.onUpdate(),this},frustum:function(t,n,e,r,u,o){return i.mat4.frustum(this.elements,t,n,e,r,u,o),this.onUpdate(),this},perspective:function(t,n,e,r){return i.mat4.perspective(this.elements,t,n,e,r),this.onUpdate(),this},perspectiveFromFieldOfView:function(t,n,e){return i.mat4.perspectiveFromFieldOfView(this.elements,t,n,e),this.onUpdate(),this},ortho:function(t,n,e,r,u,o){return i.mat4.ortho(this.elements,t,n,e,r,u,o),this.onUpdate(),this},lookAt:function(t,n,e){return t.isVector3||(t=c.set(t.x,t.y,t.z)),n.isVector3||(n=f.set(n.x,n.y,n.z)),i.mat4.lookAt(this.elements,t.elements,n.elements,e.elements),this.onUpdate(),this},targetTo:function(t,n,e){t.isVector3||(t=c.set(t.x,t.y,t.z)),n.isVector3||(n=f.set(n.x,n.y,n.z)),t=t.elements,n=n.elements,e=e.elements;var r=this.elements,i=t[0],u=t[1],o=t[2],s=e[0],a=e[1],h=e[2],l=i-n[0],d=u-n[1],m=o-n[2],E=l*l+d*d+m*m;E>0?(l*=E=1/Math.sqrt(E),d*=E,m*=E):m=1;var _=a*m-h*d,R=h*l-s*m,M=s*d-a*l;return(E=_*_+R*R+M*M)>0?(_*=E=1/Math.sqrt(E),R*=E,M*=E):(E=(_=a*m-h*d)*_+(R=h*l-(s+=1e-7)*m)*R+(M=s*d-a*l)*M,_*=E=1/Math.sqrt(E),R*=E,M*=E),r[0]=_,r[1]=R,r[2]=M,r[3]=0,r[4]=d*M-m*R,r[5]=m*_-l*M,r[6]=l*R-d*_,r[7]=0,r[8]=l,r[9]=d,r[10]=m,r[11]=0,r[12]=i,r[13]=u,r[14]=o,r[15]=1,this.onUpdate(),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,n){return n||(n=t,t=this),i.mat4.add(this.elements,t.elements,n.elements),this.onUpdate(),this},subtract:function(t,n){return n||(n=t,t=this),i.mat4.subtract(this.elements,t.elements,n.elements),this.onUpdate(),this},exactEquals:function(t,n){return n||(n=t,t=this),i.mat4.exactEquals(t.elements,n.elements)},equals:function(t,n){return n||(n=t,t=this),i.mat4.equals(t.elements,n.elements)},compose:function(t,n,e,r){return r?this.fromRotationTranslationScaleOrigin(t,n,e,r):this.fromRotationTranslationScale(t,n,e),this},decompose:function(t,n,e,i){return this.getScaling(e),this.getTranslation(n),r||(r=new s.a),this.determinant()<0&&(e.x*=-1),r.copy(this),c.inverse(e),r.scale(c),t.fromMat4(r),i&&i.set(0,0,0),this}});n.a=h},function(t,n,e){"use strict";var r=e(1),i=e(6),u=e(12),o=i.a.DEG2RAD,s=i.a.RAD2DEG,a=r.a.create({Extends:u.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;u.a.call(this,t,n,e)},onUpdate:function(){},updateDegrees:function(){return a.superclass.updateDegrees.call(this),this.onUpdate(),this},updateRadians:function(){return a.superclass.updateRadians.call(this),this.onUpdate(),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.onUpdate()}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.onUpdate()}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.onUpdate()}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*s,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*s,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*s,this.onUpdate()}}});n.a=a},function(t,n,e){"use strict";var r=e(0),i=e(10),u=e(1),o=new i.a,s=u.a.create({className:"QuaternionNotifier",isQuaternionNotifier:!0,isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,n,e,i)},onUpdate:function(){},copy:function(t){return r.quat.copy(this.elements,t.elements),this.onUpdate(),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t},fromArray:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this.elements;return e[0]=t[n],e[1]=t[n+1],e[2]=t[n+2],e[3]=t[n+3],this.onUpdate(),this},set:function(t,n,e,i){return r.quat.set(this.elements,t,n,e,i),this.onUpdate(),this},identity:function(){return r.quat.identity(this.elements),this.onUpdate(),this},rotationTo:function(t,n){return r.quat.rotationTo(this.elements,t.elements,n.elements),this.onUpdate(),this},setAxes:function(t,n,e){return r.quat.setAxes(this.elements,t.elements,n.elements,e.elements),this.onUpdate(),this},setAxisAngle:function(t,n){return r.quat.setAxisAngle(this.elements,t.elements,n),this.onUpdate(),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t){return r.quat.add(this.elements,this.elements,t.elements),this.onUpdate(),this},multiply:function(t){return r.quat.multiply(this.elements,this.elements,t.elements),this.onUpdate(),this},premultiply:function(t){return r.quat.multiply(this.elements,t.elements,this.elements),this.onUpdate(),this},scale:function(t){return r.quat.scale(this.elements,this.elements,t),this.onUpdate(),this},rotateX:function(t){return r.quat.rotateX(this.elements,this.elements,t),this.onUpdate(),this},rotateY:function(t){return r.quat.rotateY(this.elements,this.elements,t),this.onUpdate(),this},rotateZ:function(t){return r.quat.rotateZ(this.elements,this.elements,t),this.onUpdate(),this},calculateW:function(){return r.quat.calculateW(this.elements,this.elements),this.onUpdate(),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,n){return r.quat.lerp(this.elements,this.elements,t.elements,n),this.onUpdate(),this},slerp:function(t,n){return r.quat.slerp(this.elements,this.elements,t.elements,n),this.onUpdate(),this},sqlerp:function(t,n,e,i,u){return r.quat.sqlerp(this.elements,t.elements,n.elements,e.elements,i.elements,u),this.onUpdate(),this},invert:function(){return r.quat.invert(this.elements,this.elements),this.onUpdate(),this},conjugate:function(){return r.quat.conjugate(this.elements,this.elements),this.onUpdate(),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(){return r.quat.normalize(this.elements,this.elements),this.onUpdate(),this},fromMat3:function(t){return r.quat.fromMat3(this.elements,t.elements),this.onUpdate(),this},fromMat4:function(t){return o.fromMat4(t),this.fromMat3(o),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,n){var e=.5*t.x,r=.5*t.y,i=.5*t.z,u=t.order||"ZYX",o=Math.sin(e),s=Math.cos(e),a=Math.sin(r),c=Math.cos(r),f=Math.sin(i),h=Math.cos(i),l=this.elements;return"XYZ"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h-o*a*f):"YXZ"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h+o*a*f):"ZXY"===u?(l[0]=o*c*h-s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h-o*a*f):"ZYX"===u?(l[0]=o*c*h-s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h+o*a*f):"YZX"===u?(l[0]=o*c*h+s*a*f,l[1]=s*a*h+o*c*f,l[2]=s*c*f-o*a*h,l[3]=s*c*h-o*a*f):"XZY"===u&&(l[0]=o*c*h-s*a*f,l[1]=s*a*h-o*c*f,l[2]=s*c*f+o*a*h,l[3]=s*c*h+o*a*f),n||this.onUpdate(),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.onUpdate()}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.onUpdate()}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.onUpdate()}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.onUpdate()}}});s.prototype.mul=s.prototype.multiply,s.prototype.len=s.prototype.length,s.prototype.sqrLen=s.prototype.squaredLength,n.a=s},function(t,n,e){"use strict";var r=e(1),i=e(18),u=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var n=t.planes;return this.planes.forEach((function(t,e){t.copy(n[e])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var n=this.planes,e=t.elements,r=e[0],i=e[1],u=e[2],o=e[3],s=e[4],a=e[5],c=e[6],f=e[7],h=e[8],l=e[9],d=e[10],m=e[11],E=e[12],_=e[13],R=e[14],M=e[15];return n[0].set(o-r,f-s,m-h,M-E).normalize(),n[1].set(o+r,f+s,m+h,M+E).normalize(),n[2].set(o+i,f+a,m+l,M+_).normalize(),n[3].set(o-i,f-a,m-l,M-_).normalize(),n[4].set(o-u,f-c,m-d,M-R).normalize(),n[5].set(o+u,f+c,m+d,M+R).normalize(),this},intersectsSphere:function(t){for(var n=this.planes,e=t.center,r=-t.radius,i=0;i<6;i++){if(n[i].distanceToPoint(e)l)return null;r(f,a,o);var m=i(e,f);if(m<0||d+m>l)return null;var E=i(s,f)/l;return t[0]=n[0]+E*e[0],t[1]=n[1]+E*e[1],t[2]=n[2]+E*e[2],t}},function(t,n){t.exports=function(t,n,e){var r=n[0],i=n[1],u=n[2],o=e[0],s=e[1],a=e[2];return t[0]=i*a-u*s,t[1]=u*o-r*a,t[2]=r*s-i*o,t}},function(t,n,e){var r=e(26),i=e(31),u=e(32),o=e(33);t.exports=function(t,n,e,a,c){var f=r(e,a);if(0!==f){var h=-(r(n,a)+c)/f;return h<0?null:(u(s,e,h),i(t,n,s))}return r(a,n)+c===0?o(t,n):null};var s=[0,0,0]},function(t,n,e){var r=e(92),i=e(26),u=e(30),o=e(93),s=e(32),a=e(31),c=[0,0,0];t.exports=function(t,n,e,f,h){u(c,f,n);var l=i(e,c);if(l<0)return null;o(c,n,e,l);var d=r(f,c),m=h*h;if(d>m)return null;return s(t,e,l-Math.sqrt(m-d)),a(t,t,n)}},function(t,n){t.exports=function(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}},function(t,n){t.exports=function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}},function(t,n){function e(t,n,e){for(var r=t.length,i=-1/0,u=1/0,o=0;oa){var c=s;s=a,a=c}if(au)return 1/0;s>i&&(i=s),au?1/0:i}t.exports=function(t,n,r,i){var u=e(n,r,i);if(u===1/0)t=null;else{t=t||[];for(var o=0;o
  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10858,6 +11106,107 @@

    + + + + +
    +
    +
    +

    + + inherited + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -10874,7 +11223,7 @@

    diff --git a/docs/Animation.html b/docs/Animation.html index 7cad045a..21e7d696 100644 --- a/docs/Animation.html +++ b/docs/Animation.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/AnimationStates.html b/docs/AnimationStates.html index 54d71748..4c77816e 100644 --- a/docs/AnimationStates.html +++ b/docs/AnimationStates.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/AreaLight.html b/docs/AreaLight.html index e829d45d..a4a29e3e 100644 --- a/docs/AreaLight.html +++ b/docs/AreaLight.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11139,6 +11387,107 @@

    + + + + +
    +
    +
    +

    + + inherited + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -11155,7 +11504,7 @@

    diff --git a/docs/AxisHelper.html b/docs/AxisHelper.html index 64558b3c..a669c929 100644 --- a/docs/AxisHelper.html +++ b/docs/AxisHelper.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10554,6 +10802,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11407,6 +11694,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -11434,7 +11760,7 @@

    @@ -11591,7 +11917,7 @@

    @@ -11737,7 +12063,7 @@

    @@ -11809,7 +12135,7 @@

    @@ -11910,7 +12236,7 @@

    @@ -12056,7 +12382,7 @@

    @@ -12202,7 +12528,7 @@

    @@ -12348,7 +12674,7 @@

    @@ -12449,7 +12775,7 @@

    @@ -12550,7 +12876,7 @@

    @@ -12651,7 +12977,7 @@

    @@ -12752,7 +13078,7 @@

    @@ -12913,7 +13239,7 @@

    @@ -13066,7 +13392,7 @@

    @@ -13259,7 +13585,7 @@

    @@ -13452,7 +13778,7 @@

    @@ -13601,7 +13927,7 @@

    @@ -13750,7 +14076,7 @@

    @@ -13896,7 +14222,7 @@

    @@ -14045,7 +14371,7 @@

    @@ -14191,7 +14517,7 @@

    @@ -14340,7 +14666,7 @@

    @@ -14486,7 +14812,7 @@

    @@ -14635,7 +14961,7 @@

    @@ -14781,7 +15107,7 @@

    @@ -14927,7 +15253,7 @@

    @@ -15138,7 +15464,7 @@

    @@ -15330,7 +15656,7 @@

    @@ -15522,7 +15848,7 @@

    @@ -15714,7 +16040,7 @@

    @@ -15866,7 +16192,7 @@

    @@ -16098,7 +16424,7 @@

    @@ -16311,7 +16637,7 @@

    diff --git a/docs/AxisNetHelper.html b/docs/AxisNetHelper.html index 36dfaac2..133a67af 100644 --- a/docs/AxisNetHelper.html +++ b/docs/AxisNetHelper.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10819,6 +11067,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11672,6 +11959,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12395,7 +12721,7 @@

    @@ -12541,7 +12867,7 @@

    @@ -12613,7 +12939,7 @@

    @@ -12714,7 +13040,7 @@

    @@ -12860,7 +13186,7 @@

    @@ -13006,7 +13332,7 @@

    @@ -13152,7 +13478,7 @@

    @@ -13253,7 +13579,7 @@

    @@ -13354,7 +13680,7 @@

    @@ -13455,7 +13781,7 @@

    @@ -13556,7 +13882,7 @@

    @@ -13717,7 +14043,7 @@

    @@ -13870,7 +14196,7 @@

    @@ -14063,7 +14389,7 @@

    @@ -14256,7 +14582,7 @@

    @@ -14405,7 +14731,7 @@

    @@ -14554,7 +14880,7 @@

    @@ -14700,7 +15026,7 @@

    @@ -14849,7 +15175,7 @@

    @@ -14995,7 +15321,7 @@

    @@ -15144,7 +15470,7 @@

    @@ -15290,7 +15616,7 @@

    @@ -15439,7 +15765,7 @@

    @@ -15585,7 +15911,7 @@

    @@ -15731,7 +16057,7 @@

    @@ -15942,7 +16268,7 @@

    @@ -16134,7 +16460,7 @@

    @@ -16326,7 +16652,7 @@

    @@ -16518,7 +16844,7 @@

    @@ -16670,7 +16996,7 @@

    diff --git a/docs/BasicLoader.html b/docs/BasicLoader.html index 71cbb189..b55fe57b 100644 --- a/docs/BasicLoader.html +++ b/docs/BasicLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11596,7 +11844,7 @@

    @@ -11803,7 +12051,7 @@

    @@ -11984,7 +12232,7 @@

    diff --git a/docs/BasicMaterial.html b/docs/BasicMaterial.html index 62d049df..0f1e64f8 100644 --- a/docs/BasicMaterial.html +++ b/docs/BasicMaterial.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -13817,6 +14065,152 @@
    Returns:
    + + + + +
    +
    +
    +

    + + inherited + + getShadowMaterial(shadowMaterial){Material} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影材质,子类可重写

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shadowMaterial + + +Material + + + + + +

    通用阴影材质

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Material + + +
    + + + +
    diff --git a/docs/BoxGeometry.html b/docs/BoxGeometry.html index ed60800f..f9eae58d 100644 --- a/docs/BoxGeometry.html +++ b/docs/BoxGeometry.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Buffer.html b/docs/Buffer.html index 2295e3f2..370dc133 100644 --- a/docs/Buffer.html +++ b/docs/Buffer.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10180,7 +10428,7 @@

    -

    static,readonlyBuffer.cache

    +

    static,readonlyBuffer.cacheCache

    @@ -10244,7 +10492,7 @@

    @@ -10314,7 +10562,7 @@

    @@ -10537,7 +10785,7 @@

    @@ -10760,7 +11008,7 @@

    @@ -10859,7 +11107,7 @@

    @@ -11003,7 +11251,7 @@

    @@ -11226,7 +11474,7 @@

    @@ -11366,7 +11614,7 @@

    @@ -11510,7 +11758,7 @@

    diff --git a/docs/Cache.html b/docs/Cache.html index a43f73b6..c935cdaa 100644 --- a/docs/Cache.html +++ b/docs/Cache.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Camera.html b/docs/Camera.html index 06d0d4bf..d0bab601 100644 --- a/docs/Camera.html +++ b/docs/Camera.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10614,6 +10862,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11467,6 +11754,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -13114,7 +13440,7 @@

    @@ -13271,7 +13597,7 @@

    @@ -13417,7 +13743,7 @@

    @@ -13489,7 +13815,7 @@

    @@ -13590,7 +13916,7 @@

    @@ -13736,7 +14062,7 @@

    @@ -13882,7 +14208,7 @@

    @@ -14028,7 +14354,7 @@

    @@ -14129,7 +14455,7 @@

    @@ -14230,7 +14556,7 @@

    @@ -14331,7 +14657,7 @@

    @@ -14432,7 +14758,7 @@

    @@ -14593,7 +14919,7 @@

    @@ -14746,7 +15072,7 @@

    @@ -14939,7 +15265,7 @@

    @@ -15132,7 +15458,7 @@

    @@ -15281,7 +15607,7 @@

    @@ -15430,7 +15756,7 @@

    @@ -15576,7 +15902,7 @@

    @@ -15725,7 +16051,7 @@

    @@ -15871,7 +16197,7 @@

    @@ -16020,7 +16346,7 @@

    @@ -16166,7 +16492,7 @@

    @@ -16315,7 +16641,7 @@

    @@ -16461,7 +16787,7 @@

    @@ -16607,7 +16933,7 @@

    @@ -16818,7 +17144,7 @@

    @@ -17010,7 +17336,7 @@

    @@ -17202,7 +17528,7 @@

    @@ -17394,7 +17720,7 @@

    @@ -17546,7 +17872,7 @@

    @@ -17778,7 +18104,7 @@

    @@ -17991,7 +18317,7 @@

    diff --git a/docs/CameraHelper.html b/docs/CameraHelper.html index ca1bed40..f682e2a4 100644 --- a/docs/CameraHelper.html +++ b/docs/CameraHelper.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -10782,6 +11030,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11635,6 +11922,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12358,7 +12684,7 @@

    @@ -12504,7 +12830,7 @@

    @@ -12576,7 +12902,7 @@

    @@ -12677,7 +13003,7 @@

    @@ -12823,7 +13149,7 @@

    @@ -12969,7 +13295,7 @@

    @@ -13115,7 +13441,7 @@

    @@ -13216,7 +13542,7 @@

    @@ -13317,7 +13643,7 @@

    @@ -13418,7 +13744,7 @@

    @@ -13519,7 +13845,7 @@

    @@ -13680,7 +14006,7 @@

    @@ -13833,7 +14159,7 @@

    @@ -14026,7 +14352,7 @@

    @@ -14219,7 +14545,7 @@

    @@ -14368,7 +14694,7 @@

    @@ -14517,7 +14843,7 @@

    @@ -14663,7 +14989,7 @@

    @@ -14812,7 +15138,7 @@

    @@ -14958,7 +15284,7 @@

    @@ -15107,7 +15433,7 @@

    @@ -15253,7 +15579,7 @@

    @@ -15402,7 +15728,7 @@

    @@ -15548,7 +15874,7 @@

    @@ -15694,7 +16020,7 @@

    @@ -15905,7 +16231,7 @@

    @@ -16097,7 +16423,7 @@

    @@ -16289,7 +16615,7 @@

    @@ -16481,7 +16807,7 @@

    @@ -16633,7 +16959,7 @@

    diff --git a/docs/Class.html b/docs/Class.html index a46d9b11..3acf5fc7 100644 --- a/docs/Class.html +++ b/docs/Class.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Color.html b/docs/Color.html index f69ffe5a..a9f67197 100644 --- a/docs/Color.html +++ b/docs/Color.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/CubeTexture.html b/docs/CubeTexture.html index 45e52224..9e211936 100644 --- a/docs/CubeTexture.html +++ b/docs/CubeTexture.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/CubeTextureLoader.html b/docs/CubeTextureLoader.html index ebaa0898..f910d9e3 100644 --- a/docs/CubeTextureLoader.html +++ b/docs/CubeTextureLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/DataTexture.html b/docs/DataTexture.html index f7be1c41..eeb3f348 100644 --- a/docs/DataTexture.html +++ b/docs/DataTexture.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/DirectionalLight.html b/docs/DirectionalLight.html index c813c3ac..ce6528be 100644 --- a/docs/DirectionalLight.html +++ b/docs/DirectionalLight.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10088,6 +10336,43 @@

    + + + + + + + + + lightShadow + + + + + + +LightShadow + + + + + + + + + + + null + + + + + + +

    光源阴影

    + + + @@ -10795,6 +11080,249 @@

    Methods
    +
    +
    +
    +

    + + getWorldDirection(){Vector3} +

    + + + + +
    +
    +
    + + +
    +

    获取世界空间方向

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Vector3 + + +
    + + + + +
    +
    + + +
    +
    +
    +

    + + getViewDirection(camera){Vector3} +

    + + + + +
    +
    +
    + + +
    +

    获取相机空间方向

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    camera + + +Camera + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Vector3 + + +
    + + + + +
    +
    + +
    @@ -10931,6 +11459,107 @@

    + +

    + + +
    +
    +
    +

    + + inherited + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -10947,7 +11576,7 @@

    diff --git a/docs/Euler.html b/docs/Euler.html index b0ecc15c..8d0ce9c5 100644 --- a/docs/Euler.html +++ b/docs/Euler.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/EulerNotifier.html b/docs/EulerNotifier.html index 364f2c1e..a2d0a09e 100644 --- a/docs/EulerNotifier.html +++ b/docs/EulerNotifier.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -9703,7 +9951,7 @@

    -

    欧拉角, 数据改变会发送事件

    +

    欧拉角,具有 onUpdate 回调

    @@ -9872,11 +10120,6 @@

    -

    Fires:
    -
      -
    • event:update 数据更新事件
    • -
    - @@ -9901,12 +10144,6 @@

    Extends

    -

    Mixes In

    - - - @@ -10357,6 +10594,76 @@

    Methods
    +
    +
    +
    +

    + + onUpdate() +

    + + + + +
    +
    +
    + + +
    +

    更新的回调

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + +
    diff --git a/docs/EventMixin.html b/docs/EventMixin.html index f8b02bcb..ea9e43dc 100644 --- a/docs/EventMixin.html +++ b/docs/EventMixin.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -9784,7 +10032,7 @@

    @@ -9991,7 +10239,7 @@

    @@ -10172,7 +10420,7 @@

    diff --git a/docs/Fog.html b/docs/Fog.html index 5357cc5f..6719aeab 100644 --- a/docs/Fog.html +++ b/docs/Fog.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Framebuffer.html b/docs/Framebuffer.html index 2dac9d39..f58e485f 100644 --- a/docs/Framebuffer.html +++ b/docs/Framebuffer.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11254,7 +11502,7 @@

    @@ -11324,7 +11572,7 @@

    @@ -11598,7 +11846,7 @@

    @@ -11792,7 +12040,7 @@

    @@ -12051,7 +12299,7 @@

    @@ -12121,7 +12369,7 @@

    @@ -12220,7 +12468,7 @@

    diff --git a/docs/Frustum.html b/docs/Frustum.html index 468e4a39..e286672a 100644 --- a/docs/Frustum.html +++ b/docs/Frustum.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/GLTFLoader.html b/docs/GLTFLoader.html index 9dc14734..e59d7e3e 100644 --- a/docs/GLTFLoader.html +++ b/docs/GLTFLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/GLTFParser.html b/docs/GLTFParser.html index 89d48a69..2da760cd 100644 --- a/docs/GLTFParser.html +++ b/docs/GLTFParser.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Geometry.html b/docs/Geometry.html index 6b334b24..68aa1e54 100644 --- a/docs/Geometry.html +++ b/docs/Geometry.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/GeometryData.html b/docs/GeometryData.html index 7897c8cd..233a2067 100644 --- a/docs/GeometryData.html +++ b/docs/GeometryData.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/GeometryMaterial.html b/docs/GeometryMaterial.html index e85fe35c..bc9363c2 100644 --- a/docs/GeometryMaterial.html +++ b/docs/GeometryMaterial.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -13488,6 +13736,152 @@
    Returns:
    + +
    + + +
    +
    +
    +

    + + inherited + + getShadowMaterial(shadowMaterial){Material} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影材质,子类可重写

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shadowMaterial + + +Material + + + + + +

    通用阴影材质

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Material + + +
    + + + +
    diff --git a/docs/HDRLoader.html b/docs/HDRLoader.html index 1d2a3077..b25c428e 100644 --- a/docs/HDRLoader.html +++ b/docs/HDRLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/KTXLoader.html b/docs/KTXLoader.html index 2b48d839..ae6e533d 100644 --- a/docs/KTXLoader.html +++ b/docs/KTXLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/LazyTexture.html b/docs/LazyTexture.html index 6614430b..363eb9bb 100644 --- a/docs/LazyTexture.html +++ b/docs/LazyTexture.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Light.html b/docs/Light.html index f37fdf37..4fa880aa 100644 --- a/docs/Light.html +++ b/docs/Light.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11107,6 +11355,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11960,6 +12247,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12109,6 +12435,105 @@

    + +

    + + +
    +
    +
    +

    + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -12123,7 +12548,7 @@

    @@ -12263,7 +12688,7 @@

    @@ -12420,7 +12845,7 @@

    @@ -12566,7 +12991,7 @@

    @@ -12638,7 +13063,7 @@

    @@ -12739,7 +13164,7 @@

    @@ -12885,7 +13310,7 @@

    @@ -13031,7 +13456,7 @@

    @@ -13177,7 +13602,7 @@

    @@ -13278,7 +13703,7 @@

    @@ -13379,7 +13804,7 @@

    @@ -13480,7 +13905,7 @@

    @@ -13581,7 +14006,7 @@

    @@ -13742,7 +14167,7 @@

    @@ -13895,7 +14320,7 @@

    @@ -14088,7 +14513,7 @@

    @@ -14281,7 +14706,7 @@

    @@ -14430,7 +14855,7 @@

    @@ -14579,7 +15004,7 @@

    @@ -14725,7 +15150,7 @@

    @@ -14874,7 +15299,7 @@

    @@ -15020,7 +15445,7 @@

    @@ -15169,7 +15594,7 @@

    @@ -15315,7 +15740,7 @@

    @@ -15464,7 +15889,7 @@

    @@ -15610,7 +16035,7 @@

    @@ -15756,7 +16181,7 @@

    @@ -15967,7 +16392,7 @@

    @@ -16159,7 +16584,7 @@

    @@ -16351,7 +16776,7 @@

    @@ -16543,7 +16968,7 @@

    @@ -16695,7 +17120,7 @@

    @@ -16927,7 +17352,7 @@

    @@ -17140,7 +17565,7 @@

    diff --git a/docs/LightManager.html b/docs/LightManager.html index dd83cc9c..84c2cae4 100644 --- a/docs/LightManager.html +++ b/docs/LightManager.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9916,6 +10164,43 @@

    + + + + + + + + + shadowEnabled + + + + + + +boolean + + + + + + + + + + + true + + + + + + +

    是否开启阴影

    + + + @@ -10157,7 +10442,7 @@

    @@ -10301,7 +10586,7 @@

    @@ -10445,7 +10730,7 @@

    @@ -10589,7 +10874,7 @@

    @@ -10733,7 +11018,7 @@

    @@ -10877,7 +11162,7 @@

    @@ -10976,7 +11261,7 @@

    @@ -11091,7 +11376,7 @@

    @@ -11190,7 +11475,7 @@

    @@ -11231,6 +11516,449 @@

    + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + getShadowMapCount(type){number} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影贴图数量

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +string + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + number + + +
    + + + + +
    +
    + + +
    +
    +
    +

    + + update(renderer, lights, camera) +

    + + + + +
    +
    +
    + + +
    +

    更新光源信息

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    renderer + + +WebGLRenderer + + + + + +
    lights + + +Array.<Light> + + + + + +
    camera + + +Camera + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +

    + + createShadowMap(renderer, camera) +

    + + + + +
    +
    +
    + + +
    +

    生成阴影贴图

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    renderer + + +WebGLRenderer + + + + + +
    camera + + +Camera + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + +
    diff --git a/docs/LightShadow.html b/docs/LightShadow.html new file mode 100644 index 00000000..01103afb --- /dev/null +++ b/docs/LightShadow.html @@ -0,0 +1,10719 @@ + + + + + Class: LightShadow + + + + + + + + + + + + + + + + + +
    + + +
    +

    Class: LightShadow

    + + + + +
    +
    +

    + LightShadow +

    + +
    + +
    +
    + + + + +
    +
    +
    +

    + + new LightShadow(params) +

    + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    params + + +object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    light + + +Light + + + + + + + + + + +
    renderer + + +WebGLRenderer + + + + + + + + + + +
    cameraInfo + + +object + + + + + + + optional + + + + + +
    width + + +number + + + + + + + + + + +
    height + + +number + + + + + + + + + + +
    debug + + +boolean + + + + + + + optional + + + + + +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + + + + +

    + Members + Show Inherited +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    + + isLightShadow + + + +boolean + + + + + + true + + + + + + + +
    + + className + + + +string + + + + + + LightShadow + + + + + + + +
    + + light + + + +Light + + + + + + null + + + + + + + +
    + + renderer + + + +WebGLRenderer + + + + + + null + + + + + + + +
    + + framebuffer + + + +Framebuffer + + + + + + null + + + + + + + +
    + + camera + + + +Camera + + + + + + null + + + + + + + +
    + + width + + + +number + + + + + + 1024 + + + + + + + +
    + + height + + + +number + + + + + + 1024 + + + + + + + +
    + + maxBias + + + +number + + + + + + 0.05 + + + + + + + +
    + + minBias + + + +number + + + + + + 0.005 + + + + + + + +
    + + cameraInfo + + + +any + + + + + + null + + + + + + + +
    +
    +
    + +
    + + + + + + + +
    + +
    + + + + + + + + +
    +
    + + + + + \ No newline at end of file diff --git a/docs/LoadCache.html b/docs/LoadCache.html index 4b154ba2..5e99cb76 100644 --- a/docs/LoadCache.html +++ b/docs/LoadCache.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/LoadQueue.html b/docs/LoadQueue.html index 2aa18827..7fc02198 100644 --- a/docs/LoadQueue.html +++ b/docs/LoadQueue.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Loader.html b/docs/Loader.html index 2e79e17f..db06790d 100644 --- a/docs/Loader.html +++ b/docs/Loader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Material.html b/docs/Material.html index d3110a5d..bfda838a 100644 --- a/docs/Material.html +++ b/docs/Material.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -12780,6 +13028,150 @@
    Returns:
    +
    +
    + + +
    +
    +
    +

    + + getShadowMaterial(shadowMaterial){Material} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影材质,子类可重写

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shadowMaterial + + +Material + + + + + +

    通用阴影材质

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Material + + +
    + + + +
    diff --git a/docs/Matrix3.html b/docs/Matrix3.html index 171c87fe..6e65af2f 100644 --- a/docs/Matrix3.html +++ b/docs/Matrix3.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Matrix4.html b/docs/Matrix4.html index 60786336..fe777efd 100644 --- a/docs/Matrix4.html +++ b/docs/Matrix4.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -17076,7 +17324,7 @@
    Returns:

    - compose(q, v, s, p){Matrix4} + compose(q, v, s, p){Matrix4}

    @@ -17137,6 +17385,11 @@

    + + + + +

    quaternion

    @@ -17160,6 +17413,11 @@

    + + + + +

    position

    @@ -17183,6 +17441,11 @@

    + + + + +

    scale

    @@ -17206,7 +17469,14 @@

    -

    [pivot]

    + + optional + + + + + +

    pivot

    diff --git a/docs/Matrix4Notifier.html b/docs/Matrix4Notifier.html index db5d60a4..d91089d4 100644 --- a/docs/Matrix4Notifier.html +++ b/docs/Matrix4Notifier.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -9703,7 +9951,7 @@

    -

    4x4 矩阵, 数据改变会发送事件

    +

    4x4 矩阵,具有 onUpdate 回调

    @@ -9963,6 +10211,76 @@

    Methods
    +
    +
    +
    +

    + + onUpdate() +

    + + + + +
    +
    +
    + + +
    +

    更新的回调

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + +
    @@ -10117,7 +10435,7 @@

    @@ -10311,7 +10629,7 @@

    @@ -10800,7 +11118,7 @@

    @@ -10899,7 +11217,7 @@

    @@ -10998,7 +11316,7 @@

    @@ -11157,7 +11475,7 @@

    @@ -11316,7 +11634,7 @@

    @@ -11415,7 +11733,7 @@

    @@ -11594,7 +11912,7 @@

    @@ -11738,7 +12056,7 @@

    @@ -11882,7 +12200,7 @@

    @@ -12026,7 +12344,7 @@

    @@ -12193,7 +12511,7 @@

    @@ -12337,7 +12655,7 @@

    @@ -12481,7 +12799,7 @@

    @@ -12625,7 +12943,7 @@

    @@ -12769,7 +13087,7 @@

    @@ -12913,7 +13231,7 @@

    @@ -13080,7 +13398,7 @@

    @@ -13224,7 +13542,7 @@

    @@ -13368,7 +13686,7 @@

    @@ -13512,7 +13830,7 @@

    @@ -13679,7 +13997,7 @@

    @@ -13841,7 +14159,7 @@

    @@ -14004,7 +14322,7 @@

    @@ -14151,7 +14469,7 @@

    @@ -14336,12 +14654,12 @@

    Returns:

    - fromRotationTranslationScaleOrigin(q, v, s, o, dontFireEvent){Matrix4Notifier} + fromRotationTranslationScaleOrigin(q, v, s, o, notCallUpdate){Matrix4Notifier}

    @@ -14511,7 +14829,7 @@

    - dontFireEvent + notCallUpdate @@ -14540,7 +14858,7 @@

    -

    dontFireEvent

    +

    notCallUpdate

    @@ -14628,7 +14946,7 @@

    @@ -14772,7 +15090,7 @@

    @@ -15031,7 +15349,7 @@

    @@ -15244,7 +15562,7 @@

    @@ -15434,7 +15752,7 @@

    @@ -15693,7 +16011,7 @@

    @@ -15883,7 +16201,7 @@

    @@ -16073,7 +16391,7 @@

    @@ -16172,7 +16490,7 @@

    @@ -16351,7 +16669,7 @@

    @@ -16530,7 +16848,7 @@

    @@ -16709,7 +17027,7 @@

    @@ -16888,7 +17206,7 @@

    @@ -17101,7 +17419,7 @@

    diff --git a/docs/Mesh.html b/docs/Mesh.html index 84e0de00..cac94886 100644 --- a/docs/Mesh.html +++ b/docs/Mesh.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10816,6 +11064,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11669,6 +11956,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12384,7 +12710,7 @@

    @@ -12530,7 +12856,7 @@

    @@ -12602,7 +12928,7 @@

    @@ -12703,7 +13029,7 @@

    @@ -12849,7 +13175,7 @@

    @@ -12995,7 +13321,7 @@

    @@ -13141,7 +13467,7 @@

    @@ -13242,7 +13568,7 @@

    @@ -13343,7 +13669,7 @@

    @@ -13444,7 +13770,7 @@

    @@ -13545,7 +13871,7 @@

    @@ -13706,7 +14032,7 @@

    @@ -13859,7 +14185,7 @@

    @@ -14052,7 +14378,7 @@

    @@ -14245,7 +14571,7 @@

    @@ -14394,7 +14720,7 @@

    @@ -14543,7 +14869,7 @@

    @@ -14689,7 +15015,7 @@

    @@ -14838,7 +15164,7 @@

    @@ -14984,7 +15310,7 @@

    @@ -15133,7 +15459,7 @@

    @@ -15279,7 +15605,7 @@

    @@ -15428,7 +15754,7 @@

    @@ -15574,7 +15900,7 @@

    @@ -15720,7 +16046,7 @@

    @@ -15931,7 +16257,7 @@

    @@ -16123,7 +16449,7 @@

    @@ -16315,7 +16641,7 @@

    @@ -16507,7 +16833,7 @@

    @@ -16659,7 +16985,7 @@

    diff --git a/docs/MeshPicker.html b/docs/MeshPicker.html index c5511592..a4688225 100644 --- a/docs/MeshPicker.html +++ b/docs/MeshPicker.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/MorphGeometry.html b/docs/MorphGeometry.html index 89a2c0f8..4decebff 100644 --- a/docs/MorphGeometry.html +++ b/docs/MorphGeometry.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Node.html b/docs/Node.html index 980c786e..f42d36ec 100644 --- a/docs/Node.html +++ b/docs/Node.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10459,6 +10707,43 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11266,6 +11551,43 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -11432,7 +11754,7 @@

    @@ -11587,7 +11909,7 @@

    @@ -11731,7 +12053,7 @@

    @@ -11801,7 +12123,7 @@

    @@ -11900,7 +12222,7 @@

    @@ -12044,7 +12366,7 @@

    @@ -12188,7 +12510,7 @@

    @@ -12332,7 +12654,7 @@

    @@ -12431,7 +12753,7 @@

    @@ -12530,7 +12852,7 @@

    @@ -12629,7 +12951,7 @@

    @@ -12728,7 +13050,7 @@

    @@ -12887,7 +13209,7 @@

    @@ -13038,7 +13360,7 @@

    @@ -13229,7 +13551,7 @@

    @@ -13420,7 +13742,7 @@

    @@ -13567,7 +13889,7 @@

    @@ -13714,7 +14036,7 @@

    @@ -13858,7 +14180,7 @@

    @@ -14005,7 +14327,7 @@

    @@ -14149,7 +14471,7 @@

    @@ -14296,7 +14618,7 @@

    @@ -14440,7 +14762,7 @@

    @@ -14587,7 +14909,7 @@

    @@ -14731,7 +15053,7 @@

    @@ -14875,7 +15197,7 @@

    @@ -15084,7 +15406,7 @@

    @@ -15274,7 +15596,7 @@

    @@ -15464,7 +15786,7 @@

    @@ -15654,7 +15976,7 @@

    @@ -15804,7 +16126,7 @@

    @@ -16034,7 +16356,7 @@

    @@ -16245,7 +16567,7 @@

    diff --git a/docs/OrthographicCamera.html b/docs/OrthographicCamera.html index e0da7d82..931f903c 100644 --- a/docs/OrthographicCamera.html +++ b/docs/OrthographicCamera.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11155,6 +11403,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -12008,6 +12295,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -13675,7 +14001,7 @@

    @@ -13832,7 +14158,7 @@

    @@ -13978,7 +14304,7 @@

    @@ -14050,7 +14376,7 @@

    @@ -14151,7 +14477,7 @@

    @@ -14297,7 +14623,7 @@

    @@ -14443,7 +14769,7 @@

    @@ -14589,7 +14915,7 @@

    @@ -14690,7 +15016,7 @@

    @@ -14791,7 +15117,7 @@

    @@ -14892,7 +15218,7 @@

    @@ -14993,7 +15319,7 @@

    @@ -15154,7 +15480,7 @@

    @@ -15307,7 +15633,7 @@

    @@ -15500,7 +15826,7 @@

    @@ -15693,7 +16019,7 @@

    @@ -15842,7 +16168,7 @@

    @@ -15991,7 +16317,7 @@

    @@ -16137,7 +16463,7 @@

    @@ -16286,7 +16612,7 @@

    @@ -16432,7 +16758,7 @@

    @@ -16581,7 +16907,7 @@

    @@ -16727,7 +17053,7 @@

    @@ -16876,7 +17202,7 @@

    @@ -17022,7 +17348,7 @@

    @@ -17168,7 +17494,7 @@

    @@ -17379,7 +17705,7 @@

    @@ -17571,7 +17897,7 @@

    @@ -17763,7 +18089,7 @@

    @@ -17955,7 +18281,7 @@

    @@ -18107,7 +18433,7 @@

    @@ -18339,7 +18665,7 @@

    @@ -18552,7 +18878,7 @@

    diff --git a/docs/PBRMaterial.html b/docs/PBRMaterial.html index 68d5f67d..d7e14d62 100644 --- a/docs/PBRMaterial.html +++ b/docs/PBRMaterial.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -14619,6 +14867,152 @@
    Returns:
    + +
    + + +
    +
    +
    +

    + + inherited + + getShadowMaterial(shadowMaterial){Material} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影材质,子类可重写

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shadowMaterial + + +Material + + + + + +

    通用阴影材质

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Material + + +
    + + + +
    diff --git a/docs/PerspectiveCamera.html b/docs/PerspectiveCamera.html index 4b7a0918..c3edca0f 100644 --- a/docs/PerspectiveCamera.html +++ b/docs/PerspectiveCamera.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11009,6 +11257,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11862,6 +12149,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -13529,7 +13855,7 @@

    @@ -13686,7 +14012,7 @@

    @@ -13832,7 +14158,7 @@

    @@ -13904,7 +14230,7 @@

    @@ -14005,7 +14331,7 @@

    @@ -14151,7 +14477,7 @@

    @@ -14297,7 +14623,7 @@

    @@ -14443,7 +14769,7 @@

    @@ -14544,7 +14870,7 @@

    @@ -14645,7 +14971,7 @@

    @@ -14746,7 +15072,7 @@

    @@ -14847,7 +15173,7 @@

    @@ -15008,7 +15334,7 @@

    @@ -15161,7 +15487,7 @@

    @@ -15354,7 +15680,7 @@

    @@ -15547,7 +15873,7 @@

    @@ -15696,7 +16022,7 @@

    @@ -15845,7 +16171,7 @@

    @@ -15991,7 +16317,7 @@

    @@ -16140,7 +16466,7 @@

    @@ -16286,7 +16612,7 @@

    @@ -16435,7 +16761,7 @@

    @@ -16581,7 +16907,7 @@

    @@ -16730,7 +17056,7 @@

    @@ -16876,7 +17202,7 @@

    @@ -17022,7 +17348,7 @@

    @@ -17233,7 +17559,7 @@

    @@ -17425,7 +17751,7 @@

    @@ -17617,7 +17943,7 @@

    @@ -17809,7 +18135,7 @@

    @@ -17961,7 +18287,7 @@

    @@ -18193,7 +18519,7 @@

    @@ -18406,7 +18732,7 @@

    diff --git a/docs/Plane.html b/docs/Plane.html index b5667d3c..f49882ff 100644 --- a/docs/Plane.html +++ b/docs/Plane.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/PlaneGeometry.html b/docs/PlaneGeometry.html index 3f5e1df6..39240894 100644 --- a/docs/PlaneGeometry.html +++ b/docs/PlaneGeometry.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/PointLight.html b/docs/PointLight.html index 57176f22..2f57bd4e 100644 --- a/docs/PointLight.html +++ b/docs/PointLight.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11326,6 +11574,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -12179,6 +12466,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12330,6 +12656,107 @@

    + + + + +
    +
    +
    +

    + + inherited + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -12346,7 +12773,7 @@

    @@ -12486,7 +12913,7 @@

    @@ -12643,7 +13070,7 @@

    @@ -12789,7 +13216,7 @@

    @@ -12861,7 +13288,7 @@

    @@ -12962,7 +13389,7 @@

    @@ -13108,7 +13535,7 @@

    @@ -13254,7 +13681,7 @@

    @@ -13400,7 +13827,7 @@

    @@ -13501,7 +13928,7 @@

    @@ -13602,7 +14029,7 @@

    @@ -13703,7 +14130,7 @@

    @@ -13804,7 +14231,7 @@

    @@ -13965,7 +14392,7 @@

    @@ -14118,7 +14545,7 @@

    @@ -14311,7 +14738,7 @@

    @@ -14504,7 +14931,7 @@

    @@ -14653,7 +15080,7 @@

    @@ -14802,7 +15229,7 @@

    @@ -14948,7 +15375,7 @@

    @@ -15097,7 +15524,7 @@

    @@ -15243,7 +15670,7 @@

    @@ -15392,7 +15819,7 @@

    @@ -15538,7 +15965,7 @@

    @@ -15687,7 +16114,7 @@

    @@ -15833,7 +16260,7 @@

    @@ -15979,7 +16406,7 @@

    @@ -16190,7 +16617,7 @@

    @@ -16382,7 +16809,7 @@

    @@ -16574,7 +17001,7 @@

    @@ -16766,7 +17193,7 @@

    @@ -16918,7 +17345,7 @@

    @@ -17150,7 +17577,7 @@

    @@ -17363,7 +17790,7 @@

    diff --git a/docs/Program.html b/docs/Program.html index e9212650..a697c457 100644 --- a/docs/Program.html +++ b/docs/Program.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10372,7 +10620,7 @@

    -

    static,readonlyProgram.cache

    +

    static,readonlyProgram.cacheCache

    @@ -10436,7 +10684,7 @@

    @@ -10506,7 +10754,7 @@

    @@ -10729,7 +10977,7 @@

    @@ -10873,7 +11121,7 @@

    @@ -10972,7 +11220,7 @@

    @@ -11042,7 +11290,7 @@

    @@ -11209,7 +11457,7 @@

    @@ -11279,7 +11527,7 @@

    @@ -11349,7 +11597,7 @@

    @@ -11493,7 +11741,7 @@

    diff --git a/docs/Quaternion.html b/docs/Quaternion.html index ec4d8c5c..ce457348 100644 --- a/docs/Quaternion.html +++ b/docs/Quaternion.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -9904,11 +10152,6 @@

    -

    Fires:
    -
      -
    • event:update 数据更新事件
    • -
    - @@ -9927,12 +10170,6 @@
    Fires:
    -

    Mixes In

    - - - @@ -10238,12 +10475,12 @@

    Methods

    - copy(q, dontFireEvent){Quaternion} + copy(q){Quaternion}

    @@ -10273,8 +10510,6 @@

    Type - Default - Description @@ -10298,55 +10533,10 @@

    - - - - - - - - - - - - - - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    @@ -10434,7 +10624,7 @@

    @@ -10533,7 +10723,7 @@

    @@ -10726,12 +10916,12 @@

    Returns:

    - fromArray(array, offset, dontFireEvent){Quaternion} + fromArray(array, offset){Quaternion}

    @@ -10841,42 +11031,6 @@

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -10956,12 +11110,12 @@

    Returns:

    - set(x, y, z, w, dontFireEvent){Quaternion} + set(x, y, z, w){Quaternion}

    @@ -10991,8 +11145,6 @@

    Type - Default - Description @@ -11016,18 +11168,9 @@

    - - - - - - - - -

    X component

    @@ -11048,18 +11191,9 @@

    - - - - - - - - -

    Y component

    @@ -11080,18 +11214,9 @@

    - - - - - - - - -

    Z component

    @@ -11112,58 +11237,13 @@

    - - - - - - - - -

    W component

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -11243,12 +11323,12 @@

    Returns:

    - identity(dontFireEvent){Quaternion} + identity(){Quaternion}

    @@ -11266,66 +11346,6 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefaultDescription
    dontFireEvent - - -Boolean - - - - - - false - - - - - optional - - - - - -

    wether or not don`t fire change event.

    -
    @@ -11402,12 +11422,12 @@
    Returns:

    - rotationTo(a, b, dontFireEvent){Quaternion} + rotationTo(a, b){Quaternion}

    @@ -11438,8 +11458,6 @@

    Type - Default - Description @@ -11463,18 +11481,9 @@

    - - - - - - - - -

    the initial vector

    @@ -11495,58 +11504,13 @@

    - - - - - - - - -

    the destination vector

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -11626,12 +11590,12 @@

    Returns:

    - setAxes(view, right, up, dontFireEvent){Quaternion} + setAxes(view, right, up){Quaternion}

    @@ -11663,8 +11627,6 @@

    Type - Default - Description @@ -11688,18 +11650,9 @@

    - - - - - - - - -

    the vector representing the viewing direction

    @@ -11720,18 +11673,9 @@

    - - - - - - - - -

    the vector representing the local "right" direction

    @@ -11752,58 +11696,13 @@

    - - - - - - - - -

    the vector representing the local "up" direction

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -11883,12 +11782,12 @@

    Returns:

    - setAxisAngle(axis, rad, dontFireEvent){Quaternion} + setAxisAngle(axis, rad){Quaternion}

    @@ -11919,8 +11818,6 @@

    Type - Default - Description @@ -11944,18 +11841,9 @@

    - - - - - - - - -

    the axis around which to rotate

    @@ -11976,69 +11864,24 @@

    - - - - - - - - -

    the angle in radians

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - - - - - - -
    - - - - - + + + + + +
    + + + + + @@ -12112,7 +11955,7 @@

    @@ -12258,12 +12101,12 @@

    Returns:

    - add(q, dontFireEvent){Quaternion} + add(q){Quaternion}

    @@ -12293,8 +12136,6 @@

    Type - Default - Description @@ -12318,55 +12159,10 @@

    - - - - - - - - - - - - - - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    @@ -12449,12 +12245,12 @@

    Returns:

    - multiply(q, dontFireEvent){Quaternion} + multiply(q){Quaternion}

    @@ -12484,8 +12280,6 @@

    Type - Default - Description @@ -12509,55 +12303,10 @@

    - - - - - - - - - - - - - - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    @@ -12640,12 +12389,12 @@

    Returns:

    - premultiply(q, dontFireEvent){Quaternion} + premultiply(q){Quaternion}

    @@ -12675,8 +12424,6 @@

    Type - Default - Description @@ -12700,55 +12447,10 @@

    - - - - - - - - - - - - - - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    @@ -12831,12 +12533,12 @@

    Returns:

    - scale(scale, dontFireEvent){Quaternion} + scale(scale){Quaternion}

    @@ -12866,8 +12568,6 @@

    Type - Default - Description @@ -12891,58 +12591,13 @@

    - - - - - - - - -

    the vector to scale

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -13022,12 +12677,12 @@

    Returns:

    - rotateX(rad, dontFireEvent){Quaternion} + rotateX(rad){Quaternion}

    @@ -13057,8 +12712,6 @@

    Type - Default - Description @@ -13082,58 +12735,13 @@

    - - - - - - - - -

    angle (in radians) to rotate

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -13213,12 +12821,12 @@

    Returns:

    - rotateY(rad, dontFireEvent){Quaternion} + rotateY(rad){Quaternion}

    @@ -13248,8 +12856,6 @@

    Type - Default - Description @@ -13273,58 +12879,13 @@

    - - - - - - - - -

    angle (in radians) to rotate

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -13404,12 +12965,12 @@

    Returns:

    - rotateZ(rad, dontFireEvent){Quaternion} + rotateZ(rad){Quaternion}

    @@ -13439,8 +13000,6 @@

    Type - Default - Description @@ -13464,58 +13023,13 @@

    - - - - - - - - -

    angle (in radians) to rotate

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -13595,12 +13109,12 @@

    Returns:

    - calculateW(dontFireEvent){Quaternion} + calculateW(){Quaternion}

    @@ -13620,66 +13134,6 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefaultDescription
    dontFireEvent - - -Boolean - - - - - - false - - - - - optional - - - - - -

    wether or not don`t fire change event.

    -
    @@ -13761,7 +13215,7 @@

    @@ -13900,12 +13354,12 @@

    Returns:

    - lerp(q, t, dontFireEvent){Quaternion} + lerp(q, t){Quaternion}

    @@ -13935,8 +13389,6 @@

    Type - Default - Description @@ -13960,18 +13412,9 @@

    - - - - - - - - - @@ -13992,58 +13435,13 @@

    - - - - - - - - -

    interpolation amount between the two inputs

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -14123,12 +13521,12 @@

    Returns:

    - slerp(q, t, dontFireEvent){Quaternion} + slerp(q, t){Quaternion}

    @@ -14158,8 +13556,6 @@

    Type - Default - Description @@ -14183,18 +13579,9 @@

    - - - - - - - - - @@ -14215,58 +13602,13 @@

    - - - - - - - - -

    interpolation amount between the two inputs

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -14346,12 +13688,12 @@

    Returns:

    - sqlerp(qa, qb, qc, qd, t, dontFireEvent){Quaternion} + sqlerp(qa, qb, qc, qd, t){Quaternion}

    @@ -14381,8 +13723,6 @@

    Type - Default - Description @@ -14406,18 +13746,9 @@

    - - - - - - - - - @@ -14438,18 +13769,9 @@

    - - - - - - - - - @@ -14470,18 +13792,9 @@

    - - - - - - - - - @@ -14502,18 +13815,9 @@

    - - - - - - - - - @@ -14534,58 +13838,13 @@

    - - - - - - - - -

    interpolation amount

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -14665,12 +13924,12 @@

    Returns:

    - invert(dontFireEvent){Quaternion} + invert(){Quaternion}

    @@ -14688,66 +13947,6 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefaultDescription
    dontFireEvent - - -Boolean - - - - - - false - - - - - optional - - - - - -

    wether or not don`t fire change event.

    -
    @@ -14823,90 +14022,30 @@
    Returns:

    - - conjugate(dontFireEvent){Quaternion} -

    - - - - -
    -
    -
    - - -
    -

    Calculates the conjugate of a quat -If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefaultDescription
    dontFireEvent - - -Boolean - - - - - - false - - - - - optional - - - - - -

    wether or not don`t fire change event.

    + + conjugate(){Quaternion} +

    + + + + + +

    +
    + + +
    +

    Calculates the conjugate of a quat +If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

    +
    + + + + + + @@ -14989,7 +14128,7 @@

    @@ -15088,7 +14227,7 @@

    @@ -15182,12 +14321,12 @@

    Returns:

    - normalize(dontFireEvent){Quaternion} + normalize(){Quaternion}

    @@ -15205,66 +14344,6 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefaultDescription
    dontFireEvent - - -Boolean - - - - - - false - - - - - optional - - - - - -

    wether or not don`t fire change event.

    -
    @@ -15341,12 +14420,12 @@
    Returns:

    - fromMat3(m, dontFireEvent){Quaternion} + fromMat3(m){Quaternion}

    @@ -15378,8 +14457,6 @@

    Type - Default - Description @@ -15403,58 +14480,13 @@

    - - - - - - - - -

    rotation matrix

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -15534,12 +14566,12 @@

    Returns:

    - fromMat4(m, dontFireEvent){Quaternion} + fromMat4(m){Quaternion}

    @@ -15571,8 +14603,6 @@

    Type - Default - Description @@ -15596,58 +14626,13 @@

    - - - - - - - - -

    rotation matrix

    - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    - - - @@ -15732,7 +14717,7 @@

    @@ -15876,7 +14861,7 @@

    @@ -16015,12 +15000,12 @@

    Returns:

    - fromEuler(euler, dontFireEvent){Quaternion} + fromEuler(euler){Quaternion}

    @@ -16050,8 +15035,6 @@

    Type - Default - Description @@ -16075,55 +15058,10 @@

    - - - - - - - - - - - - - - - - - dontFireEvent - - - - - -Boolean - - - - - - - - - false - - - - - - - optional - - - - - -

    wether or not don`t fire change event.

    @@ -16206,12 +15144,12 @@

    Returns:
    @@ -16229,6 +15167,51 @@

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    +
    @@ -16281,7 +15264,7 @@

    @@ -16351,7 +15334,7 @@

    diff --git a/docs/QuaternionNotifier.html b/docs/QuaternionNotifier.html new file mode 100644 index 00000000..56095eda --- /dev/null +++ b/docs/QuaternionNotifier.html @@ -0,0 +1,15578 @@ + + + + + Class: QuaternionNotifier + + + + + + + + + + + + + + + + + +
    + + +
    +

    Class: QuaternionNotifier

    + + + + +
    +
    +

    + QuaternionNotifier +

    + +
    + +
    +
    + + + + +
    +
    +
    +

    + + new QuaternionNotifier(x, y, z, w) +

    + + + + +
    +
    +
    + + +
    +

    四元数,具有 onUpdate 回调

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    x + + +Number + + + + + + 0 + + + + + optional + + + + + +

    X component

    y + + +Number + + + + + + 0 + + + + + optional + + + + + +

    Y component

    z + + +Number + + + + + + 0 + + + + + optional + + + + + +

    Z component

    w + + +Number + + + + + + 1 + + + + + optional + + + + + +

    W component

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + + + + +

    + Members + Show Inherited +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    + + className + + + +String + + + + + + QuaternionNotifier + + + +

    类名

    + + + +
    + + isQuaternionNotifier + + + +Boolean + + + + + + true + + + + + + + +
    + + isQuaternion + + + +Boolean + + + + + + true + + + + + + + +
    + + elements + + + +Float32Array + + + + + + + +

    数据

    + + + +
    + + x + + + +Number + + + + + + + +

    X component

    + + + +
    + + y + + + +Number + + + + + + + +

    Y component

    + + + +
    + + z + + + +Number + + + + + + + +

    Z component

    + + + +
    + + w + + + +Number + + + + + + + +

    W component

    + + + +
    +
    +
    + +
    + + + +

    Methods + Show Inherited +

    + +
    + +
    +
    +
    +

    + + onUpdate() +

    + + + + +
    +
    +
    + + +
    +

    更新的回调

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +

    + + copy(q){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Copy the values from one quat to this

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + clone(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Creates a new quat initialized with values from an existing quaternion

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + a new quaternion
    + + + + +
    +
    + + +
    +
    +
    +

    + + toArray(array, offset){Array} +

    + + + + +
    +
    +
    + + +
    +

    转换到数组

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    array + + +Array.<number> +| + +TypedArray + + + + + + [] + + + + + optional + + + + + +

    数组

    offset + + +Number + + + + + + 0 + + + + + optional + + + + + +

    数组偏移值

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Array + + +
    + + + + +
    +
    + + +
    +
    +
    +

    + + fromArray(array, offset){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    从数组赋值

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    array + + +Array.<number> +| + +TypedArray + + + + + + + + + + + + +

    数组

    offset + + +Number + + + + + + 0 + + + + + optional + + + + + +

    数组偏移值

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + set(x, y, z, w){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Set the components of a quat to the given values

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +Number + + + + + +

    X component

    y + + +Number + + + + + +

    Y component

    z + + +Number + + + + + +

    Z component

    w + + +Number + + + + + +

    W component

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + identity(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Set this to the identity quaternion

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + rotationTo(a, b){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Sets a quaternion to represent the shortest rotation from one +vector to another.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Vector3 + + + + + +

    the initial vector

    b + + +Vector3 + + + + + +

    the destination vector

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + setAxes(view, right, up){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Sets the specified quaternion with values corresponding to the given +axes. Each axis is a vec3 and is expected to be unit length and +perpendicular to all other specified axes.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    view + + +Vector3 + + + + + +

    the vector representing the viewing direction

    right + + +Vector3 + + + + + +

    the vector representing the local "right" direction

    up + + +Vector3 + + + + + +

    the vector representing the local "up" direction

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + setAxisAngle(axis, rad){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Sets a quat from the given angle and rotation axis, +then returns it.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    axis + + +Vector3 + + + + + +

    the axis around which to rotate

    rad + + +Number + + + + + +

    the angle in radians

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + getAxisAngle(out_axis){Number} +

    + + + + +
    +
    +
    + + +
    +

    Gets the rotation axis and angle for a given +quaternion. If a quaternion is created with +setAxisAngle, this method will return the same +values as providied in the original parameter list +OR functionally equivalent values. +Example: The quaternion formed by axis [0, 0, 1] and +angle -90 is the same as the quaternion formed by +[0, 0, 1] and 270. This method favors the latter.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    out_axis + + +Vector3 + + + + + +

    Vector receiving the axis of rotation

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Number + + + Angle, in radians, of the rotation
    + + + + +
    +
    + + +
    +
    +
    +

    + + add(q){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Adds two quat's

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + multiply(q){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Multiplies two quat's

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + premultiply(q){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    premultiply the quat

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + scale(scale){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Scales a quat by a scalar number

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Vector3 + + + + + +

    the vector to scale

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + rotateX(rad){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Rotates a quaternion by the given angle about the X axis

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    rad + + +Number + + + + + +

    angle (in radians) to rotate

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + rotateY(rad){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Rotates a quaternion by the given angle about the Y axis

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    rad + + +Number + + + + + +

    angle (in radians) to rotate

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + rotateZ(rad){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Rotates a quaternion by the given angle about the Z axis

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    rad + + +Number + + + + + +

    angle (in radians) to rotate

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + calculateW(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the W component of a quat from the X, Y, and Z components. +Assumes that quaternion is 1 unit in length. +Any existing W component will be ignored.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + dot(q){Number} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the dot product of two quat's

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Number + + + dot product of two quat's
    + + + + +
    +
    + + +
    +
    +
    +

    + + lerp(q, t){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Performs a linear interpolation between two quat's

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    t + + +Number + + + + + +

    interpolation amount between the two inputs

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + slerp(q, t){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Performs a spherical linear interpolation between two quat

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    t + + +Number + + + + + +

    interpolation amount between the two inputs

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + sqlerp(qa, qb, qc, qd, t){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Performs a spherical linear interpolation with two control points

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    qa + + +Quaternion + + + + + +
    qb + + +Quaternion + + + + + +
    qc + + +Quaternion + + + + + +
    qd + + +Quaternion + + + + + +
    t + + +Number + + + + + +

    interpolation amount

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + invert(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the inverse of a quat

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + conjugate(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the conjugate of a quat +If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + length(){Number} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the length of a quat

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Number + + + length of this
    + + + + +
    +
    + + +
    +
    +
    +

    + + squaredLength(){Number} +

    + + + + +
    +
    +
    + + +
    +

    Calculates the squared length of a quat

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Number + + + squared length of this
    + + + + +
    +
    + + +
    +
    +
    +

    + + normalize(){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Normalize this

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + fromMat3(m){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Creates a quaternion from the given 3x3 rotation matrix.

    +

    NOTE: The resultant quaternion is not normalized, so you should be sure +to renormalize the quaternion yourself where necessary.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    m + + +Matrix3 + + + + + +

    rotation matrix

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + fromMat4(m){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Creates a quaternion from the given 3x3 rotation matrix.

    +

    NOTE: The resultant quaternion is not normalized, so you should be sure +to renormalize the quaternion yourself where necessary.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    m + + +Matrix4 + + + + + +

    rotation matrix

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + exactEquals(q){Boolean} +

    + + + + +
    +
    +
    + + +
    +

    Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Boolean + + +
    + + + + +
    +
    + + +
    +
    +
    +

    + + equals(q){Boolean} +

    + + + + +
    +
    +
    + + +
    +

    Returns whether or not the quaternions have approximately the same elements in the same position.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +Quaternion + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Boolean + + +
    + + + + +
    +
    + + +
    +
    +
    +

    + + fromEuler(euler, notCallUpdate){Quaternion} +

    + + + + +
    +
    +
    + + +
    +

    Creates a quaternion from the given euler.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    euler + + +Euler + + + + + + + + + + + + +
    notCallUpdate + + +Boolean + + + + + + false + + + + + optional + + + + + +

    是否需要调用onUpdate

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Quaternion + + + this
    + + + + +
    +
    + + +
    +
    +
    +

    + + mul(q) +

    + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    q + + +QuaternionNotifier + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +

    + + len() +

    + + + + +
    +
    +
    + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +

    + + sqrLen() +

    + + + + +
    +
    +
    + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + + + + + + + + +
    +
    + + + + + \ No newline at end of file diff --git a/docs/Ray.html b/docs/Ray.html index 06ad2ca9..140fc6d3 100644 --- a/docs/Ray.html +++ b/docs/Ray.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/RenderInfo.html b/docs/RenderInfo.html index fa8ab942..d162c64c 100644 --- a/docs/RenderInfo.html +++ b/docs/RenderInfo.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/RenderList.html b/docs/RenderList.html index f98609e7..b52467db 100644 --- a/docs/RenderList.html +++ b/docs/RenderList.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Shader.html b/docs/Shader.html index 0d8f069c..102276b0 100644 --- a/docs/Shader.html +++ b/docs/Shader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/ShaderMaterial.html b/docs/ShaderMaterial.html index ada553cd..35f86af7 100644 --- a/docs/ShaderMaterial.html +++ b/docs/ShaderMaterial.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -13136,6 +13384,152 @@
    Returns:
    +

    + + + +
    +
    +
    +

    + + inherited + + getShadowMaterial(shadowMaterial){Material} +

    + + + + +
    +
    +
    + + +
    +

    获取阴影材质,子类可重写

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shadowMaterial + + +Material + + + + + +

    通用阴影材质

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Material + + +
    + + + +
    diff --git a/docs/ShaderMaterialLoader.html b/docs/ShaderMaterialLoader.html index 695858f7..9abd1f48 100644 --- a/docs/ShaderMaterialLoader.html +++ b/docs/ShaderMaterialLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Skeleton.html b/docs/Skeleton.html index c9d899f7..5cd9a296 100644 --- a/docs/Skeleton.html +++ b/docs/Skeleton.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/SkinedMesh.html b/docs/SkinedMesh.html index a92de8ea..c2e2b2cc 100644 --- a/docs/SkinedMesh.html +++ b/docs/SkinedMesh.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10949,6 +11197,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -11802,6 +12089,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -13023,7 +13349,7 @@

    @@ -13169,7 +13495,7 @@

    @@ -13241,7 +13567,7 @@

    @@ -13342,7 +13668,7 @@

    @@ -13488,7 +13814,7 @@

    @@ -13634,7 +13960,7 @@

    @@ -13780,7 +14106,7 @@

    @@ -13881,7 +14207,7 @@

    @@ -13982,7 +14308,7 @@

    @@ -14083,7 +14409,7 @@

    @@ -14184,7 +14510,7 @@

    @@ -14345,7 +14671,7 @@

    @@ -14498,7 +14824,7 @@

    @@ -14691,7 +15017,7 @@

    @@ -14884,7 +15210,7 @@

    @@ -15033,7 +15359,7 @@

    @@ -15182,7 +15508,7 @@

    @@ -15328,7 +15654,7 @@

    @@ -15477,7 +15803,7 @@

    @@ -15623,7 +15949,7 @@

    @@ -15772,7 +16098,7 @@

    @@ -15918,7 +16244,7 @@

    @@ -16067,7 +16393,7 @@

    @@ -16213,7 +16539,7 @@

    @@ -16359,7 +16685,7 @@

    @@ -16570,7 +16896,7 @@

    @@ -16762,7 +17088,7 @@

    @@ -16954,7 +17280,7 @@

    @@ -17146,7 +17472,7 @@

    @@ -17298,7 +17624,7 @@

    diff --git a/docs/SphereGeometry.html b/docs/SphereGeometry.html index 373cfa77..09fe078b 100644 --- a/docs/SphereGeometry.html +++ b/docs/SphereGeometry.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/SphericalHarmonics3.html b/docs/SphericalHarmonics3.html index c22aeb03..e8eb9d1e 100644 --- a/docs/SphericalHarmonics3.html +++ b/docs/SphericalHarmonics3.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/SpotLight.html b/docs/SpotLight.html index b0b64729..5b2d6b26 100644 --- a/docs/SpotLight.html +++ b/docs/SpotLight.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11545,6 +11793,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -12398,6 +12685,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -12549,6 +12875,107 @@

    + + + + +
    +
    +
    +

    + + inherited + + getRealColor(){Color} +

    + + + + +
    +
    +
    + + +
    +

    获取真正的颜色,光强度乘以颜色

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Color + + + 光强度乘以颜色后的颜色
    + + + +
    @@ -12565,7 +12992,7 @@

    @@ -12705,7 +13132,7 @@

    @@ -12862,7 +13289,7 @@

    @@ -13008,7 +13435,7 @@

    @@ -13080,7 +13507,7 @@

    @@ -13181,7 +13608,7 @@

    @@ -13327,7 +13754,7 @@

    @@ -13473,7 +13900,7 @@

    @@ -13619,7 +14046,7 @@

    @@ -13720,7 +14147,7 @@

    @@ -13821,7 +14248,7 @@

    @@ -13922,7 +14349,7 @@

    @@ -14023,7 +14450,7 @@

    @@ -14184,7 +14611,7 @@

    @@ -14337,7 +14764,7 @@

    @@ -14530,7 +14957,7 @@

    @@ -14723,7 +15150,7 @@

    @@ -14872,7 +15299,7 @@

    @@ -15021,7 +15448,7 @@

    @@ -15167,7 +15594,7 @@

    @@ -15316,7 +15743,7 @@

    @@ -15462,7 +15889,7 @@

    @@ -15611,7 +16038,7 @@

    @@ -15757,7 +16184,7 @@

    @@ -15906,7 +16333,7 @@

    @@ -16052,7 +16479,7 @@

    @@ -16198,7 +16625,7 @@

    @@ -16409,7 +16836,7 @@

    @@ -16601,7 +17028,7 @@

    @@ -16793,7 +17220,7 @@

    @@ -16985,7 +17412,7 @@

    @@ -17137,7 +17564,7 @@

    @@ -17369,7 +17796,7 @@

    @@ -17582,7 +18009,7 @@

    diff --git a/docs/Stage.html b/docs/Stage.html index 7bdb9906..99484ce4 100644 --- a/docs/Stage.html +++ b/docs/Stage.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11514,6 +11762,45 @@

    + + + + + onlySyncQuaternion + + + + + + +Boolean + + + + + + + + + + + false + + + + + + + inherited + +

    只同步四元数,不同步欧拉角

    + + + + + + + @@ -12367,6 +12654,45 @@

    + + + + + worldMatrixVersion + + + + + + +Number + + + + + + + + + + + 0 + + + + + + + inherited + +

    世界矩阵 version,每次改变会加一

    + + + + + + + @@ -13771,7 +14097,7 @@

    @@ -13928,7 +14254,7 @@

    @@ -14074,7 +14400,7 @@

    @@ -14146,7 +14472,7 @@

    @@ -14247,7 +14573,7 @@

    @@ -14393,7 +14719,7 @@

    @@ -14539,7 +14865,7 @@

    @@ -14685,7 +15011,7 @@

    @@ -14786,7 +15112,7 @@

    @@ -14887,7 +15213,7 @@

    @@ -14988,7 +15314,7 @@

    @@ -15089,7 +15415,7 @@

    @@ -15250,7 +15576,7 @@

    @@ -15403,7 +15729,7 @@

    @@ -15596,7 +15922,7 @@

    @@ -15789,7 +16115,7 @@

    @@ -15938,7 +16264,7 @@

    @@ -16087,7 +16413,7 @@

    @@ -16233,7 +16559,7 @@

    @@ -16382,7 +16708,7 @@

    @@ -16528,7 +16854,7 @@

    @@ -16677,7 +17003,7 @@

    @@ -16823,7 +17149,7 @@

    @@ -16972,7 +17298,7 @@

    @@ -17118,7 +17444,7 @@

    @@ -17264,7 +17590,7 @@

    @@ -17475,7 +17801,7 @@

    @@ -17667,7 +17993,7 @@

    @@ -17859,7 +18185,7 @@

    @@ -18051,7 +18377,7 @@

    @@ -18203,7 +18529,7 @@

    @@ -18435,7 +18761,7 @@

    diff --git a/docs/Texture.html b/docs/Texture.html index 7a25c8b0..a2e6c275 100644 --- a/docs/Texture.html +++ b/docs/Texture.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/TextureLoader.html b/docs/TextureLoader.html index 14a04fa2..0acc300f 100644 --- a/docs/TextureLoader.html +++ b/docs/TextureLoader.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Ticker.html b/docs/Ticker.html index 95a59c88..57528032 100644 --- a/docs/Ticker.html +++ b/docs/Ticker.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Tween.html b/docs/Tween.html index b72fb796..b2b60e82 100644 --- a/docs/Tween.html +++ b/docs/Tween.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/UniformBuffer.html b/docs/UniformBuffer.html index b3b1f867..013a991f 100644 --- a/docs/UniformBuffer.html +++ b/docs/UniformBuffer.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Vector2.html b/docs/Vector2.html index 8a51a77d..18cdbd25 100644 --- a/docs/Vector2.html +++ b/docs/Vector2.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Vector3.html b/docs/Vector3.html index 6a79036f..8ae21d9f 100644 --- a/docs/Vector3.html +++ b/docs/Vector3.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/Vector3Notifier.html b/docs/Vector3Notifier.html index bfdff122..c3d14b96 100644 --- a/docs/Vector3Notifier.html +++ b/docs/Vector3Notifier.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,7 +9942,7 @@

    @@ -9703,7 +9951,7 @@

    -

    三维向量, 数据改变会发送事件

    +

    三维向量,具有 onUpdate 回调

    @@ -9872,11 +10120,6 @@

    -

    Fires:
    -
      -
    • event:update 数据更新事件
    • -
    - @@ -9901,12 +10144,6 @@

    Extends

    -

    Mixes In

    - - - @@ -10211,6 +10448,76 @@

    Methods
    +
    +
    +
    +

    + + onUpdate() +

    + + + + +
    +
    +
    + + +
    +

    更新的回调

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    + +
    @@ -10365,7 +10672,7 @@

    @@ -10464,7 +10771,7 @@

    @@ -10662,7 +10969,7 @@

    @@ -10856,7 +11163,7 @@

    @@ -11046,7 +11353,7 @@

    @@ -11225,7 +11532,7 @@

    @@ -11404,7 +11711,7 @@

    @@ -11583,7 +11890,7 @@

    @@ -11762,7 +12069,7 @@

    @@ -11861,7 +12168,7 @@

    @@ -11960,7 +12267,7 @@

    @@ -12139,7 +12446,7 @@

    @@ -12318,7 +12625,7 @@

    @@ -12417,7 +12724,7 @@

    @@ -12561,7 +12868,7 @@

    @@ -12768,7 +13075,7 @@

    @@ -12947,7 +13254,7 @@

    @@ -13126,7 +13433,7 @@

    @@ -13225,7 +13532,7 @@

    @@ -13324,7 +13631,7 @@

    @@ -13423,7 +13730,7 @@

    @@ -13582,7 +13889,7 @@

    @@ -13681,7 +13988,7 @@

    @@ -13860,7 +14167,7 @@

    @@ -14039,7 +14346,7 @@

    @@ -14206,7 +14513,7 @@

    @@ -14442,7 +14749,7 @@

    @@ -14678,7 +14985,7 @@

    @@ -14837,7 +15144,7 @@

    @@ -14981,7 +15288,7 @@

    @@ -15125,7 +15432,7 @@

    @@ -15269,7 +15576,7 @@

    @@ -15413,7 +15720,7 @@

    @@ -15580,7 +15887,7 @@

    @@ -15747,7 +16054,7 @@

    @@ -15914,7 +16221,7 @@

    @@ -16093,7 +16400,7 @@

    diff --git a/docs/Vector4.html b/docs/Vector4.html index 9f6eeb9c..0dbc42e1 100644 --- a/docs/Vector4.html +++ b/docs/Vector4.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/VertexArrayObject.html b/docs/VertexArrayObject.html index 5cc1a62f..9e04a916 100644 --- a/docs/VertexArrayObject.html +++ b/docs/VertexArrayObject.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10115,7 +10363,7 @@

    -

    static,readonlyVertexArrayObject.cache

    +

    static,readonlyVertexArrayObject.cacheCache

    @@ -10179,7 +10427,7 @@

    @@ -10369,7 +10617,7 @@

    @@ -10484,7 +10732,7 @@

    @@ -10554,7 +10802,7 @@

    @@ -10624,7 +10872,7 @@

    @@ -10694,7 +10942,7 @@

    @@ -10764,7 +11012,7 @@

    @@ -10863,7 +11111,7 @@

    @@ -10993,7 +11241,7 @@

    @@ -11160,7 +11408,7 @@

    @@ -11373,7 +11621,7 @@

    @@ -11563,7 +11811,7 @@

    @@ -11722,7 +11970,7 @@

    @@ -11866,7 +12114,7 @@

    diff --git a/docs/WebGLRenderer.html b/docs/WebGLRenderer.html index 0171afad..ddc57c4d 100644 --- a/docs/WebGLRenderer.html +++ b/docs/WebGLRenderer.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -11064,7 +11312,7 @@

    -LightManager +ILightManager diff --git a/docs/WebGLResourceManager.html b/docs/WebGLResourceManager.html index c3d1119a..b7ceb58e 100644 --- a/docs/WebGLResourceManager.html +++ b/docs/WebGLResourceManager.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/WebGLState.html b/docs/WebGLState.html index 0aa7482c..a995f4eb 100644 --- a/docs/WebGLState.html +++ b/docs/WebGLState.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/WebGLSupport.html b/docs/WebGLSupport.html index 0e025957..a0e51a02 100644 --- a/docs/WebGLSupport.html +++ b/docs/WebGLSupport.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/animation_Animation.js.html b/docs/animation_Animation.js.html index 574bba95..e9b67dc7 100644 --- a/docs/animation_Animation.js.html +++ b/docs/animation_Animation.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/animation_AnimationStates.js.html b/docs/animation_AnimationStates.js.html index 9637929c..467d5565 100644 --- a/docs/animation_AnimationStates.js.html +++ b/docs/animation_AnimationStates.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9748,8 +9996,8 @@

    Source: if (p0.hermite) { p0.hermite(p0, m0.scale(tr), p1, m1.scale(tr), t); } else if (p0.isQuaternion) { - p0.fromArray(this._cubicSpline(p0.elements, m0.elements, p1.elements, m1.elements, tr, t), 0, true); - p0.normalize(true); + p0.fromArray(this._cubicSpline(p0.elements, m0.elements, p1.elements, m1.elements, tr, t), 0); + p0.normalize(); } else { if (!isArrayLike(p0)) { p0 = [p0]; diff --git a/docs/browser.html b/docs/browser.html index 050dbfbd..fb296df9 100644 --- a/docs/browser.html +++ b/docs/browser.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/camera_Camera.js.html b/docs/camera_Camera.js.html index 53478c27..4239f573 100644 --- a/docs/camera_Camera.js.html +++ b/docs/camera_Camera.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/camera_OrthographicCamera.js.html b/docs/camera_OrthographicCamera.js.html index 93d3a659..a542bcad 100644 --- a/docs/camera_OrthographicCamera.js.html +++ b/docs/camera_OrthographicCamera.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/camera_PerspectiveCamera.js.html b/docs/camera_PerspectiveCamera.js.html index 2959cf8a..0f31bd48 100644 --- a/docs/camera_PerspectiveCamera.js.html +++ b/docs/camera_PerspectiveCamera.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/capabilities.html b/docs/capabilities.html index 57603533..feb36657 100644 --- a/docs/capabilities.html +++ b/docs/capabilities.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9740,7 +9988,7 @@

    -

    staticcapabilities.isWebGL2

    +

    staticcapabilities.isWebGL2boolean

    @@ -10543,7 +10791,7 @@

    @@ -10658,7 +10906,7 @@

    @@ -10805,7 +11053,7 @@

    diff --git a/docs/constants.html b/docs/constants.html index 7e6d57ef..ffcb10bf 100644 --- a/docs/constants.html +++ b/docs/constants.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/constants_Hilo.js.html b/docs/constants_Hilo.js.html index dd55ac0d..6a9b7d49 100644 --- a/docs/constants_Hilo.js.html +++ b/docs/constants_Hilo.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/constants_index.js.html b/docs/constants_index.js.html index 6ef4e31c..caa2e48c 100644 --- a/docs/constants_index.js.html +++ b/docs/constants_index.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/constants_webgl.js.html b/docs/constants_webgl.js.html index 9b598e07..7432a8f1 100644 --- a/docs/constants_webgl.js.html +++ b/docs/constants_webgl.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/constants_webgl2.js.html b/docs/constants_webgl2.js.html index f9d20db4..9ff76754 100644 --- a/docs/constants_webgl2.js.html +++ b/docs/constants_webgl2.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/constants_webglExtensions.js.html b/docs/constants_webglExtensions.js.html index 0a354a23..f42c79ab 100644 --- a/docs/constants_webglExtensions.js.html +++ b/docs/constants_webglExtensions.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_Class.js.html b/docs/core_Class.js.html index ff68414f..73be8543 100644 --- a/docs/core_Class.js.html +++ b/docs/core_Class.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_EventMixin.js.html b/docs/core_EventMixin.js.html index 1f2a1c77..e90479ae 100644 --- a/docs/core_EventMixin.js.html +++ b/docs/core_EventMixin.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9685,13 +9933,11 @@

    Source: core/Even this.type = type; this.target = target; this.detail = detail; - this.timeStamp = +new Date(); }, type: null, target: null, detail: null, - timeStamp: 0, stopImmediatePropagation() { this._stopped = true; @@ -9814,7 +10060,6 @@

    Source: core/Even * @param {string} e.type 事件类型 * @param {any} e.detail 事件数据 * @param {any} e.target 事件触发对象 - * @param {number} e.timeStamp 时间戳 * @param {number} e.stageX 鼠标相对 stage 的 x 偏移 ( 仅鼠标事件有效 ) * @param {number} e.stageY 鼠标相对 stage 的 y 偏移 ( 仅鼠标事件有效 ) * @param {Node} e.eventTarget 触发鼠标事件的对象 ( 仅鼠标事件有效 ) diff --git a/docs/core_Fog.js.html b/docs/core_Fog.js.html index d1046f30..60617131 100644 --- a/docs/core_Fog.js.html +++ b/docs/core_Fog.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_Mesh.js.html b/docs/core_Mesh.js.html index 4d02092d..fa3919a6 100644 --- a/docs/core_Mesh.js.html +++ b/docs/core_Mesh.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_Node.js.html b/docs/core_Node.js.html index adfba625..69f7a5f5 100644 --- a/docs/core_Node.js.html +++ b/docs/core_Node.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9679,7 +9927,7 @@

    Source: core/Node.jsSource: core/Node.jsSource: core/Node.js { - this._onMatrixUpdate(); - }); - - this._position.on('update', () => { - this._onPositionUpdate(); - }); - - this._scale.on('update', () => { - this._onScaleUpdate(); - }); - - this._pivot.on('update', () => { - this._onPivotUpdate(); - }); + this._quaternion = new QuaternionNotifier(); - this._rotation.on('update', () => { - this._onRotationUpdate(); - }); - - this._quaternion.on('update', () => { - this._onQuaternionUpdate(); - }); + this._matrix.onUpdate = this._onMatrixUpdate.bind(this); + this._position.onUpdate = this._onPositionUpdate.bind(this); + this._scale.onUpdate = this._onScaleUpdate.bind(this); + this._pivot.onUpdate = this._onPivotUpdate.bind(this); + this._rotation.onUpdate = this._onRotationUpdate.bind(this); + this._quaternion.onUpdate = this._onQuaternionUpdate.bind(this); Object.assign(this, params); }, @@ -10058,6 +10296,7 @@

    Source: core/Node.jsSource: core/Node.jsSource: core/Node.js

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_SkinedMesh.js.html b/docs/core_SkinedMesh.js.html index f68c9315..008afebb 100644 --- a/docs/core_SkinedMesh.js.html +++ b/docs/core_SkinedMesh.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_Stage.js.html b/docs/core_Stage.js.html index 5c8dac32..6ea32196 100644 --- a/docs/core_Stage.js.html +++ b/docs/core_Stage.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/core_Tween.js.html b/docs/core_Tween.js.html index 3cf4a8ae..3c42cad2 100644 --- a/docs/core_Tween.js.html +++ b/docs/core_Tween.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/extensions.html b/docs/extensions.html index d10c1b70..d3b0a3e2 100644 --- a/docs/extensions.html +++ b/docs/extensions.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_BoxGeometry.js.html b/docs/geometry_BoxGeometry.js.html index a5a403b6..084cee1c 100644 --- a/docs/geometry_BoxGeometry.js.html +++ b/docs/geometry_BoxGeometry.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_Geometry.js.html b/docs/geometry_Geometry.js.html index c9f92de3..24650742 100644 --- a/docs/geometry_Geometry.js.html +++ b/docs/geometry_Geometry.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_GeometryData.js.html b/docs/geometry_GeometryData.js.html index 65321255..52ed8ba7 100644 --- a/docs/geometry_GeometryData.js.html +++ b/docs/geometry_GeometryData.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_MorphGeometry.js.html b/docs/geometry_MorphGeometry.js.html index c2c0ee2a..d044c7df 100644 --- a/docs/geometry_MorphGeometry.js.html +++ b/docs/geometry_MorphGeometry.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_PlaneGeometry.js.html b/docs/geometry_PlaneGeometry.js.html index 30ab6bd8..d47abfbf 100644 --- a/docs/geometry_PlaneGeometry.js.html +++ b/docs/geometry_PlaneGeometry.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/geometry_SphereGeometry.js.html b/docs/geometry_SphereGeometry.js.html index c1efcfe8..42a681b3 100644 --- a/docs/geometry_SphereGeometry.js.html +++ b/docs/geometry_SphereGeometry.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/glType.html b/docs/glType.html index bdfe5dee..cec3906d 100644 --- a/docs/glType.html +++ b/docs/glType.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/global.html b/docs/global.html index 53c211ec..0efb3a98 100644 --- a/docs/global.html +++ b/docs/global.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9849,7 +10097,7 @@

    @@ -9991,29 +10239,6 @@

    - - - timeStamp - - - - - -number - - - - - - - - - -

    时间戳

    - - - - stageX @@ -11388,7 +11613,7 @@

    diff --git a/docs/helper_AxisHelper.js.html b/docs/helper_AxisHelper.js.html index 9abeae49..e2bb731a 100644 --- a/docs/helper_AxisHelper.js.html +++ b/docs/helper_AxisHelper.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/helper_AxisNetHelper.js.html b/docs/helper_AxisNetHelper.js.html index db84731f..5f2ede38 100644 --- a/docs/helper_AxisNetHelper.js.html +++ b/docs/helper_AxisNetHelper.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/helper_CameraHelper.js.html b/docs/helper_CameraHelper.js.html index 4bfe2c97..2d0f8b51 100644 --- a/docs/helper_CameraHelper.js.html +++ b/docs/helper_CameraHelper.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9681,12 +9929,14 @@

    Source: helpe import Color from '../math/Color'; import constants from '../constants'; +import Matrix4 from '../math/Matrix4'; const { LINES } = constants; const tempVector3 = new Vector3(); +const tempMatrix4 = new Matrix4(); /** * 摄像机帮助类 * @class @@ -9726,7 +9976,8 @@

    Source: helpe this.material = new BasicMaterial({ lightType: 'NONE', - diffuse: this.color || new Color(0.5, 0.5, 0.5, 1) + diffuse: this.color || new Color(0.5, 0.5, 0.5, 1), + castShadows: false }); this.geometry = new Geometry({ @@ -9754,16 +10005,17 @@

    Source: helpe const height = 1; const depth = 1; - geometry.vertices.set(0, camera.unprojectVector(tempVector3.set(-width, -height, depth))); - geometry.vertices.set(1, camera.unprojectVector(tempVector3.set(-width, height, depth))); - geometry.vertices.set(2, camera.unprojectVector(tempVector3.set(width, height, depth))); - geometry.vertices.set(3, camera.unprojectVector(tempVector3.set(width, -height, depth))); - geometry.vertices.set(4, camera.unprojectVector(tempVector3.set(-width, -height, -depth))); - geometry.vertices.set(5, camera.unprojectVector(tempVector3.set(-width, height, -depth))); - geometry.vertices.set(6, camera.unprojectVector(tempVector3.set(width, height, -depth))); - geometry.vertices.set(7, camera.unprojectVector(tempVector3.set(width, -height, -depth))); - - geometry.vertices.set(8, camera.worldMatrix.getTranslation(tempVector3)); + tempMatrix4.multiply(camera.viewProjectionMatrix, this.worldMatrix); + tempMatrix4.invert(); + geometry.vertices.set(0, tempVector3.set(-width, -height, depth).transformMat4(tempMatrix4)); + geometry.vertices.set(1, tempVector3.set(-width, height, depth).transformMat4(tempMatrix4)); + geometry.vertices.set(2, tempVector3.set(width, height, depth).transformMat4(tempMatrix4)); + geometry.vertices.set(3, tempVector3.set(width, -height, depth).transformMat4(tempMatrix4)); + geometry.vertices.set(4, tempVector3.set(-width, -height, -depth).transformMat4(tempMatrix4)); + geometry.vertices.set(5, tempVector3.set(-width, height, -depth).transformMat4(tempMatrix4)); + geometry.vertices.set(6, tempVector3.set(width, height, -depth).transformMat4(tempMatrix4)); + geometry.vertices.set(7, tempVector3.set(width, -height, -depth).transformMat4(tempMatrix4)); + geometry.vertices.set(8, tempVector3.set(0, 0, -depth).transformMat4(tempMatrix4)); } }); diff --git a/docs/index.html b/docs/index.html index 60db5379..30573553 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9692,7 +9940,7 @@

    A 3D WebGL Rendering Engine


    InstallationDocumentationDevelopmentShowcaseExamplesAuthorsLicense

    -

    npm ci size gitter.im

    +

    npm ci size gitter.im

    Features

    • Compatible for multiple mobile and desktop browsers.
    • @@ -9708,8 +9956,8 @@

      Installation

    • -

      use script tag from a cdn

      -
      <script src='//cdn.jsdelivr.net/npm/hilo3d@1.18.0/build/Hilo3d.js'></script>
      +

      use script tag from a cdn

      +
      <script src='//cdn.jsdelivr.net/npm/hilo3d@1.19.0/build/Hilo3d.js'></script>
       
    diff --git a/docs/light_AmbientLight.js.html b/docs/light_AmbientLight.js.html index 97e2e3bd..bc1a69fb 100644 --- a/docs/light_AmbientLight.js.html +++ b/docs/light_AmbientLight.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/light_AreaLight.js.html b/docs/light_AreaLight.js.html index 469da4d5..4a2e53c3 100644 --- a/docs/light_AreaLight.js.html +++ b/docs/light_AreaLight.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/light_DirectionalLight.js.html b/docs/light_DirectionalLight.js.html index 03239645..9584e070 100644 --- a/docs/light_DirectionalLight.js.html +++ b/docs/light_DirectionalLight.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9698,6 +9946,12 @@

    Source: li * @type {string} */ className: 'DirectionalLight', + /** + * 光源阴影 + * @type {LightShadow} + * @default null + */ + lightShadow: null, /** * @constructs * @param {Object} [params] 创建对象的属性参数。可包含此类的所有属性。 @@ -9737,10 +9991,19 @@

    Source: li } this.lightShadow.createShadowMap(camera); }, + /** + * 获取世界空间方向 + * @returns {Vector3} + */ getWorldDirection() { tempVector3.copy(this.direction).transformDirection(this.worldMatrix).normalize(); return tempVector3; }, + /** + * 获取相机空间方向 + * @param {Camera} camera + * @returns {Vector3} + */ getViewDirection(camera) { const modelViewMatrix = camera.getModelViewMatrix(this, tempMatrix4); tempVector3.copy(this.direction).transformDirection(modelViewMatrix).normalize(); diff --git a/docs/light_Light.js.html b/docs/light_Light.js.html index 8fdd5340..c76d1e8d 100644 --- a/docs/light_Light.js.html +++ b/docs/light_Light.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9786,6 +10034,10 @@

    Source: light/Light.j out[offset + 2] = this.quadraticAttenuation; return this; }, + /** + * 获取真正的颜色,光强度乘以颜色 + * @returns {Color} 光强度乘以颜色后的颜色 + */ getRealColor() { return tempColor.copy(this.color).scale(this.amount); }, diff --git a/docs/light_LightManager.js.html b/docs/light_LightManager.js.html index 5800580e..c884577f 100644 --- a/docs/light_LightManager.js.html +++ b/docs/light_LightManager.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9699,6 +9947,13 @@

    Source: light/ * @type {string} */ className: 'LightManager', + + /** + * 是否开启阴影 + * @type {boolean} + * @default true + */ + shadowEnabled: true, /** * @constructs * @param {Object} [params] 创建对象的属性参数。可包含此类的所有属性。 @@ -10073,7 +10328,17 @@

    Source: light/ this.spotLights.length = 0; this.areaLights.length = 0; }, + + /** + * 获取阴影贴图数量 + * @param {string} type + * @returns {number} + */ getShadowMapCount(type) { + if (!this.shadowEnabled) { + return 0; + } + let lights = []; if (type === 'POINT_LIGHTS') { lights = this.pointLights; @@ -10091,7 +10356,32 @@

    Source: light/ }); return count; }, + + /** + * 更新光源信息 + * @param {WebGLRenderer} renderer + * @param {Light[]} lights + * @param {Camera} camera + */ + update(renderer, camera, lights) { + lights.forEach((light) => { + this.addLight(light); + }); + + this.createShadowMap(renderer, camera); + this.updateInfo(camera); + }, + + /** + * 生成阴影贴图 + * @param {WebGLRenderer} renderer + * @param {Camera} camera + */ createShadowMap(renderer, camera) { + if (!this.shadowEnabled) { + return; + } + this.directionalLights.forEach((light) => { light.createShadowMap(renderer, camera); }); @@ -10115,6 +10405,42 @@

    Source: light/ * @param { LightManager } lightManager * @param { Camera } camera */ + + +/** + * 灯光信息接口 + * @interface ILightInfo + * @property {string} uid + */ + +/** + * 灯光管理器接口 + * @interface ILightManager + * @property {boolean} shadowEnabled + * @property {ILightInfo} lightInfo + */ + +/** + * 重置所有光源信息 + * @function + * @name ILightManager#reset + */ + +/** + * 更新光源信息 + * @function + * @param {WebGLRenderer} renderer + * @param {Camera} camera + * @param {Light[]} lights + * @name ILightManager#update + */ + +/** + * 获取渲染配置 + * @function + * @param {object} [option] + * @name ILightManager#getRenderOption + */ diff --git a/docs/light_LightShadow.js.html b/docs/light_LightShadow.js.html index 7fb231ae..af135d79 100644 --- a/docs/light_LightShadow.js.html +++ b/docs/light_LightShadow.js.html @@ -35,15 +35,1321 @@

      @@ -471,6 +1825,75 @@

    +
  • + + utils/browser + + static + + + +
      + +
    +
      + +
    +
      + +
    +
  • +
  • utils/log @@ -484,14 +1907,14 @@

  • level
  • +
  • LEVEL_NONE
  • +
  • LEVEL_LOG
  • LEVEL_WARN
  • LEVEL_ERROR
  • -
  • LEVEL_NONE
  • -
      @@ -518,6 +1941,67 @@

    +
  • + + utils/util + + static + + +
      + +
    +
      + +
    + +
      + +
    +
  • +
  • animation/Animation @@ -551,12 +2035,12 @@

  • rootNode
  • +
  • animStatesList
  • +
  • validAnimationIds
  • id
  • -
  • animStatesList
  • -
  • clips
  • @@ -575,6 +2059,10 @@

  • getAnimStatesListTimeInfo
  • +
  • _initNodeNameMap
  • + +
  • tick
  • +
  • updateAnimStates
  • play
  • @@ -675,8 +2163,12 @@

  • name
  • +
  • anim
  • +
  • animationId
  • +
  • jointName
  • +
  • autoUpdateWorldMatrix
  • autoUpdateChildWorldMatrix
  • @@ -693,6 +2185,12 @@

  • useHandCursor
  • +
  • userData
  • + +
  • onUpdate
  • + +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -737,6 +2235,10 @@

  • quaternion
  • +
  • matrixVersion
  • + +
  • worldMatrixVersion
  • +
      @@ -1237,6 +2767,33 @@

    +
  • + + core/EventMixin + + +
      + +
    +
      + +
    + +
      + +
    +
  • +
  • core/Fog @@ -1299,12 +2856,18 @@

  • frustumTest
  • +
  • isDestroyed
  • +
  • isNode
  • name
  • +
  • anim
  • +
  • animationId
  • +
  • jointName
  • +
  • autoUpdateWorldMatrix
  • autoUpdateChildWorldMatrix
  • @@ -1321,6 +2884,12 @@

  • useHandCursor
  • +
  • userData
  • + +
  • onUpdate
  • + +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -1365,6 +2934,10 @@

  • quaternion
  • +
  • matrixVersion
  • + +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + core/Skeleton + + + + +
      @@ -1993,6 +3665,34 @@

    @@ -3201,6 +4973,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -3218,6 +4992,14 @@

    MembersShow Inherited +
  • ltcTexture1
  • + +
  • ltcTexture2
  • + +
  • ltcTextureReady
  • + +
  • ltcTextureUrl
  • +
  • isAreaLight
  • className
  • @@ -3242,6 +5024,10 @@

  • range
  • +
  • shadow
  • + +
  • isDirty
  • +
  • color
  • @@ -3252,8 +5038,12 @@

    MethodsShow Inherited +
  • loadLtcTexture
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -3275,7 +5065,7 @@

  • className
  • -
  • shadow
  • +
  • lightShadow
  • direction
  • @@ -3291,6 +5081,10 @@

  • range
  • +
  • shadow
  • + +
  • isDirty
  • +
  • color
  • @@ -3301,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -3332,6 +5132,10 @@

  • range
  • +
  • shadow
  • + +
  • isDirty
  • +
  • color
  • isNode
  • @@ -3340,8 +5144,12 @@

  • name
  • +
  • anim
  • +
  • animationId
  • +
  • jointName
  • +
  • autoUpdateWorldMatrix
  • autoUpdateChildWorldMatrix
  • @@ -3358,6 +5166,12 @@

  • useHandCursor
  • +
  • userData
  • + +
  • onUpdate
  • + +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -3402,6 +5216,10 @@

  • quaternion
  • +
  • matrixVersion
  • + +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
      @@ -4070,13 +6015,29 @@

  • -
  • +
  • - loader/IGLTFExtensionHandler + loader/KTXLoader
      @@ -4101,18 +6054,26 @@

  • -
  • +
  • - loader/KTXLoader + loader/LoadCache @@ -4321,10 +6296,16 @@

  • isMaterial
  • +
  • name
  • +
  • shaderCacheId
  • +
  • shaderName
  • +
  • wireframe
  • +
  • frontFace
  • +
  • depthTest
  • sampleAlphaToCoverage
  • @@ -4349,6 +6330,8 @@

  • isDiffuesEnvAndAmbientLightWorkTogether
  • +
  • userData
  • +
  • renderOrder
  • premultiplyAlpha
  • @@ -4385,6 +6368,22 @@

  • blendDstAlpha
  • +
  • stencilTest
  • + +
  • stencilMask
  • + +
  • stencilFunc
  • + +
  • stencilFuncRef
  • + +
  • stencilFuncMask
  • + +
  • stencilOpFail
  • + +
  • stencilOpZFail
  • + +
  • stencilOpZPass
  • +
  • isDirty
  • transparency
  • @@ -4397,6 +6396,10 @@

  • exposure
  • +
  • enableTextureLod
  • + +
  • enableDrawBuffers
  • +
  • needBasicUnifroms
  • needBasicAttributes
  • @@ -4429,6 +6432,8 @@

  • getTextures
  • +
  • getShadowMaterial
  • + +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -6149,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -6420,12 +8686,16 @@

    MembersShow Inherited +
  • cache
  • +
  • className
  • isFramebuffer
  • bufferInternalFormat
  • +
  • framebufferTarget
  • +
  • target
  • format
  • @@ -6438,6 +8708,10 @@

  • magFilter
  • +
  • wrapS
  • + +
  • wrapT
  • +
  • data
  • attachment
  • @@ -6454,6 +8728,10 @@

  • framebuffer
  • +
  • colorAttachmentInfos
  • + +
  • depthStencilAttachmentInfo
  • +
  • framebuffer
  • @@ -6464,6 +8742,12 @@

    MethodsShow Inherited +
  • reset
  • + +
  • destroy
  • + +
  • init
  • +
  • isComplete
  • bind
  • @@ -6476,6 +8760,10 @@

  • readPixels
  • +
  • copyFramebuffer
  • + +
  • destroy
  • +
  • destroyResource
  • @@ -6507,6 +8795,8 @@

  • uniforms
  • +
  • uniformBlocks
  • +
  • program
  • gl
  • @@ -6515,6 +8805,8 @@

  • alwaysUse
  • +
  • isWebGL2
  • +
  • id
  • @@ -6612,12 +8904,6 @@

      @@ -6635,6 +8921,35 @@

    +
  • + + renderer/UniformBuffer + + + +
      + +
    +
      + +
    +
      + +
    +
  • +
  • renderer/VertexArrayObject @@ -6644,6 +8959,8 @@

    MembersShow Inherited +
  • cache
  • +
  • className
  • isVertexArrayObject
  • @@ -6664,6 +8981,12 @@

    MethodsShow Inherited +
  • getVao
  • + +
  • reset
  • + +
  • bindSystemVao
  • +
  • bind
  • unbind
  • @@ -6680,7 +9003,7 @@

  • addInstancedAttribute
  • -
  • useResource
  • +
  • getResources
  • destroyIfNoRef
  • @@ -6751,8 +9074,14 @@

  • offsetY
  • +
  • forceMaterial
  • +
  • isInitFailed
  • +
  • isWebGL2
  • + +
  • preferWebGL2
  • +
  • clearColor
  • renderInfo
  • @@ -6765,6 +9094,10 @@

  • isInit
  • +
  • state
  • + +
  • framebuffer
  • + @@ -7057,6 +9396,8 @@

  • flipY
  • +
  • colorSpaceConversion
  • +
  • compressed
  • needUpdate
  • @@ -7095,6 +9436,8 @@

  • resizeImg
  • +
  • _fixInternalFormat
  • +
  • updateTexture
  • updateSubTexture
  • @@ -7164,6 +9507,8 @@

  • flipY
  • +
  • colorSpaceConversion
  • +
  • compressed
  • needUpdate
  • @@ -7202,6 +9547,8 @@

  • resizeImg
  • +
  • _fixInternalFormat
  • +
  • updateTexture
  • updateSubTexture
  • @@ -7277,6 +9624,8 @@

  • flipY
  • +
  • colorSpaceConversion
  • +
  • compressed
  • needUpdate
  • @@ -7317,6 +9666,8 @@

  • resizeImg
  • +
  • _fixInternalFormat
  • +
  • updateTexture
  • updateSubTexture
  • @@ -7344,6 +9695,8 @@

    MembersShow Inherited +
  • cache
  • +
  • isTexture
  • className
  • @@ -7382,6 +9735,8 @@

  • flipY
  • +
  • colorSpaceConversion
  • +
  • compressed
  • needUpdate
  • @@ -7412,6 +9767,8 @@

    MethodsShow Inherited +
  • reset
  • +
  • isImgPowerOfTwo
  • getSupportSize
  • @@ -7420,6 +9777,8 @@

  • resizeImg
  • +
  • _fixInternalFormat
  • +
  • updateTexture
  • updateSubTexture
  • @@ -7513,12 +9872,38 @@

      @@ -7545,6 +9930,7 @@

      Source: light/L import Color from '../math/Color'; import Matrix4 from '../math/Matrix4'; import constants from '../constants'; +import CameraHelper from '../helper/CameraHelper'; const { DEPTH, @@ -7561,26 +9947,75 @@

      Source: light/L /** * @class - * @private */ const LightShadow = Class.create(/** @lends LightShadow.prototype */{ + /** + * @type {boolean} + * @default true + */ isLightShadow: true, + /** + * @type {string} + * @default LightShadow + */ className: 'LightShadow', + /** + * @type {Light} + * @default null + */ light: null, + /** + * @type {WebGLRenderer} + * @default null + */ renderer: null, + /** + * @type {Framebuffer} + * @default null + */ framebuffer: null, + /** + * @type {Camera} + * @default null + */ camera: null, + /** + * @type {number} + * @default 1024 + */ width: 1024, + /** + * @type {number} + * @default 1024 + */ height: 1024, + /** + * @type {number} + * @default 0.05 + */ maxBias: 0.05, + /** + * @type {number} + * @default 0.005 + */ minBias: 0.005, /** - * 阴影摄像机信息 - * @type {Object} + * @type {any} + * @default null */ cameraInfo: null, debug: false, + /** + * @constructs + * @param {object} params + * @param {Light} params.light + * @param {WebGLRenderer} params.renderer + * @param {object} [params.cameraInfo] + * @param {number} params.width + * @param {number} params.height + * @param {boolean} [params.debug] + */ constructor(params) { this.id = math.generateUUID(this.className); Object.assign(this, params); @@ -7612,7 +10047,7 @@

      Source: light/L this.camera.lookAt(light.direction); if (this.cameraInfo) { - this.updateCustumCamera(this.cameraInfo); + this.updateCustomCamera(this.cameraInfo, currentCamera); } else { const geometry = currentCamera.getGeometry(); if (geometry) { @@ -7631,17 +10066,25 @@

      Source: light/L this.camera.updateViewMatrix(); }, - updateCustumCamera(cameraInfo) { + updateCustomCamera(cameraInfo, currentCamera) { for (let name in cameraInfo) { this.camera[name] = cameraInfo[name]; } + + if (!cameraInfo.far) { + this.camera.far = currentCamera.far; + } + + if (!cameraInfo.near) { + this.camera.near = currentCamera.near; + } }, updateSpotLightCamera(currentCamera) { const light = this.light; this.camera.lookAt(light.direction); if (this.cameraInfo) { - this.updateCustumCamera(this.cameraInfo); + this.updateCustomCamera(this.cameraInfo, currentCamera); } else { this.camera.fov = light.outerCutoff * 2; this.camera.near = 0.01; @@ -7659,11 +10102,13 @@

      Source: light/L this.camera = new PerspectiveCamera(); } this.camera.addTo(this.light); + this._createCameraHelper(); } - if (this._cameraMatrixVersion !== currentCamera.matrixVersion) { + if (this.light.isDirty || this._cameraMatrixVersion !== currentCamera.matrixVersion) { this.updateLightCamera(currentCamera); this._cameraMatrixVersion = currentCamera.matrixVersion; + this.light.isDirty = false; } }, createShadowMap(currentCamera) { @@ -7680,7 +10125,7 @@

      Source: light/L shadowMaterial = new GeometryMaterial({ vertexType: DEPTH, side: BACK, - writeOriginData: true + writeOriginData: false }); } @@ -7689,27 +10134,52 @@

      Source: light/L renderer.clear(clearColor); camera.updateViewProjectionMatrix(); semantic.setCamera(camera); - renderer.forceMaterial = shadowMaterial; - this.renderShadowScene(renderer); - delete renderer.forceMaterial; + this.renderShadowScene(renderer, shadowMaterial); framebuffer.unbind(); semantic.setCamera(currentCamera); renderer.viewport(); }, - renderShadowScene(renderer) { + renderShadowScene(renderer, shadowMaterial) { + const preForceMaterial = renderer.forceMaterial; + const renderList = renderer.renderList; renderList.traverse((mesh) => { if (isNeedRenderMesh(mesh)) { + renderer.forceMaterial = mesh.material.getShadowMaterial(shadowMaterial); renderer.renderMesh(mesh); } }, (instancedMeshes) => { - renderer.renderInstancedMeshes(instancedMeshes.filter(mesh => isNeedRenderMesh(mesh))); + if (instancedMeshes.length) { + renderer.forceMaterial = instancedMeshes[0].material.getShadowMaterial(shadowMaterial); + renderer.renderInstancedMeshes(instancedMeshes.filter(mesh => isNeedRenderMesh(mesh))); + } }); + + renderer.forceMaterial = preForceMaterial; }, showShadowMap() { this.renderer.on('afterRender', () => { this.framebuffer.render(0, 0.7, 0.3, 0.3); }); + }, + _createCameraHelper() { + if (!this.debug) { + return; + } + + const { + light, + camera, + } = this; + + if (!this._cameraHelper) { + this._cameraHelper = new CameraHelper({ + camera, + color: new Color(0, 1, 0), + }); + + light.addChild(this._cameraHelper); + } } }); @@ -7726,7 +10196,7 @@

      Source: light/L diff --git a/docs/light_PointLight.js.html b/docs/light_PointLight.js.html index aa5adb64..740ce0a7 100644 --- a/docs/light_PointLight.js.html +++ b/docs/light_PointLight.js.html @@ -2189,6 +2189,8 @@

    • onUpdate
    • +
    • onlySyncQuaternion
    • +
    • id
    • up
    • @@ -2235,6 +2237,8 @@

    • matrixVersion
    • +
    • worldMatrixVersion
    • +
    @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/light_SpotLight.js.html b/docs/light_SpotLight.js.html index 1d6fbcd0..52451ee5 100644 --- a/docs/light_SpotLight.js.html +++ b/docs/light_SpotLight.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_BasicLoader.js.html b/docs/loader_BasicLoader.js.html index 2030592a..84325aac 100644 --- a/docs/loader_BasicLoader.js.html +++ b/docs/loader_BasicLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_CubeTextureLoader.js.html b/docs/loader_CubeTextureLoader.js.html index 17936b54..4f2722d5 100644 --- a/docs/loader_CubeTextureLoader.js.html +++ b/docs/loader_CubeTextureLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_GLTFExtensions.js.html b/docs/loader_GLTFExtensions.js.html index 1439ec91..6e0eb289 100644 --- a/docs/loader_GLTFExtensions.js.html +++ b/docs/loader_GLTFExtensions.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_GLTFLoader.js.html b/docs/loader_GLTFLoader.js.html index ac702ca2..4491fe43 100644 --- a/docs/loader_GLTFLoader.js.html +++ b/docs/loader_GLTFLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_GLTFParser.js.html b/docs/loader_GLTFParser.js.html index af80c7d6..ece1f1b6 100644 --- a/docs/loader_GLTFParser.js.html +++ b/docs/loader_GLTFParser.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_HDRLoader.js.html b/docs/loader_HDRLoader.js.html index 87810251..5943eb08 100644 --- a/docs/loader_HDRLoader.js.html +++ b/docs/loader_HDRLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_KTXLoader.js.html b/docs/loader_KTXLoader.js.html index d6e63975..f1bb775c 100644 --- a/docs/loader_KTXLoader.js.html +++ b/docs/loader_KTXLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_LoadCache.js.html b/docs/loader_LoadCache.js.html index 8aa9ffa9..5614a232 100644 --- a/docs/loader_LoadCache.js.html +++ b/docs/loader_LoadCache.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_LoadQueue.js.html b/docs/loader_LoadQueue.js.html index ed797762..9230a56e 100644 --- a/docs/loader_LoadQueue.js.html +++ b/docs/loader_LoadQueue.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_Loader.js.html b/docs/loader_Loader.js.html index 379e4948..edb52d09 100644 --- a/docs/loader_Loader.js.html +++ b/docs/loader_Loader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_ShaderMaterialLoader.js.html b/docs/loader_ShaderMaterialLoader.js.html index e0540eb5..b715875a 100644 --- a/docs/loader_ShaderMaterialLoader.js.html +++ b/docs/loader_ShaderMaterialLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/loader_TextureLoader.js.html b/docs/loader_TextureLoader.js.html index bd32c1de..6e6acc4e 100644 --- a/docs/loader_TextureLoader.js.html +++ b/docs/loader_TextureLoader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/log.html b/docs/log.html index 8dda8a8f..fb8bd5a6 100644 --- a/docs/log.html +++ b/docs/log.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/material_BasicMaterial.js.html b/docs/material_BasicMaterial.js.html index 7ddd9b27..eb31f126 100644 --- a/docs/material_BasicMaterial.js.html +++ b/docs/material_BasicMaterial.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/material_GeometryMaterial.js.html b/docs/material_GeometryMaterial.js.html index 6f59cf6a..99f7e63e 100644 --- a/docs/material_GeometryMaterial.js.html +++ b/docs/material_GeometryMaterial.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/material_Material.js.html b/docs/material_Material.js.html index c2b87c22..3ce07681 100644 --- a/docs/material_Material.js.html +++ b/docs/material_Material.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10575,7 +10823,25 @@

    Source: materia origin[key] = data[key]; } } - } + }, + + /** + * 获取阴影材质,子类可重写 + * @param {Material} shadowMaterial 通用阴影材质 + * @return {Material} + */ + getShadowMaterial(shadowMaterial) { + if (shadowMaterial.side !== this.side) { + shadowMaterial.side = this.side; + shadowMaterial.isDirty = true; + } + + if (shadowMaterial.frontFace !== this.frontFace) { + shadowMaterial.frontFace = this.frontFace; + shadowMaterial.isDirty = true; + } + return shadowMaterial; + }, }); export default Material; diff --git a/docs/material_PBRMaterial.js.html b/docs/material_PBRMaterial.js.html index f12827b1..fcc799c4 100644 --- a/docs/material_PBRMaterial.js.html +++ b/docs/material_PBRMaterial.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/material_ShaderMaterial.js.html b/docs/material_ShaderMaterial.js.html index 9ddbe69a..8f3a53f3 100644 --- a/docs/material_ShaderMaterial.js.html +++ b/docs/material_ShaderMaterial.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/material_semantic.js.html b/docs/material_semantic.js.html index 8e5454ce..f2496a06 100644 --- a/docs/material_semantic.js.html +++ b/docs/material_semantic.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math.html b/docs/math.html index 7b8efadf..bb688e93 100644 --- a/docs/math.html +++ b/docs/math.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Color.js.html b/docs/math_Color.js.html index 0143a5e8..b1126c9a 100644 --- a/docs/math_Color.js.html +++ b/docs/math_Color.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Euler.js.html b/docs/math_Euler.js.html index 79f22b12..17633b01 100644 --- a/docs/math_Euler.js.html +++ b/docs/math_Euler.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_EulerNotifier.js.html b/docs/math_EulerNotifier.js.html index 7840fe3d..0564cb4d 100644 --- a/docs/math_EulerNotifier.js.html +++ b/docs/math_EulerNotifier.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9673,7 +9921,6 @@

    Source: math/E
    import Class from '../core/Class';
    -import EventMixin from '../core/EventMixin';
     import math from './math';
     import Euler from './Euler';
     
    @@ -9681,14 +9928,11 @@ 

    Source: math/E const RAD2DEG = math.RAD2DEG; /** - * 欧拉角, 数据改变会发送事件 + * 欧拉角,具有 onUpdate 回调 * @class - * @mixes EventMixin * @extends Euler - * @fires update 数据更新事件 */ const EulerNotifier = Class.create(/** @lends EulerNotifier.prototype */ { - Mixes: EventMixin, Extends: Euler, /** * 类名 @@ -9711,15 +9955,22 @@

    Source: math/E Euler.call(this, x, y, z); }, + /** + * 更新的回调 + */ + onUpdate() { + + }, + updateDegrees() { EulerNotifier.superclass.updateDegrees.call(this); - this.fire('update'); + this.onUpdate(); return this; }, updateRadians() { EulerNotifier.superclass.updateRadians.call(this); - this.fire('update'); + this.onUpdate(); return this; }, @@ -9734,7 +9985,7 @@

    Source: math/E set(value) { this._degX = value; this.elements[0] = value * DEG2RAD; - this.fire('update'); + this.onUpdate(); } }, @@ -9749,7 +10000,7 @@

    Source: math/E set(value) { this._degY = value; this.elements[1] = value * DEG2RAD; - this.fire('update'); + this.onUpdate(); } }, @@ -9764,7 +10015,7 @@

    Source: math/E set(value) { this._degZ = value; this.elements[2] = value * DEG2RAD; - this.fire('update'); + this.onUpdate(); } }, @@ -9779,7 +10030,7 @@

    Source: math/E set(value) { this.elements[0] = value; this._degX = value * RAD2DEG; - this.fire('update'); + this.onUpdate(); } }, /** @@ -9793,7 +10044,7 @@

    Source: math/E set(value) { this.elements[1] = value; this._degY = value * RAD2DEG; - this.fire('update'); + this.onUpdate(); } }, /** @@ -9807,7 +10058,7 @@

    Source: math/E set(value) { this.elements[2] = value; this._degZ = value * RAD2DEG; - this.fire('update'); + this.onUpdate(); } } }); diff --git a/docs/math_Frustum.js.html b/docs/math_Frustum.js.html index 0fab45f0..e847ec1f 100644 --- a/docs/math_Frustum.js.html +++ b/docs/math_Frustum.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Matrix3.js.html b/docs/math_Matrix3.js.html index 1b0c724c..251df801 100644 --- a/docs/math_Matrix3.js.html +++ b/docs/math_Matrix3.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Matrix4.js.html b/docs/math_Matrix4.js.html index e19a13ad..32b5e851 100644 --- a/docs/math_Matrix4.js.html +++ b/docs/math_Matrix4.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10250,7 +10498,7 @@

    Source: math/Matrix4 * @param {Quaternion} q quaternion * @param {Vector3} v position * @param {Vector3} s scale - * @param {Vector3} p [pivot] + * @param {Vector3} [p] pivot * @return {Matrix4} this */ compose(q, v, s, p) { diff --git a/docs/math_Matrix4Notifier.js.html b/docs/math_Matrix4Notifier.js.html index 1e0c7079..eb6cff2d 100644 --- a/docs/math_Matrix4Notifier.js.html +++ b/docs/math_Matrix4Notifier.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9676,7 +9924,6 @@

    Source: math mat4 } from 'gl-matrix'; import Class from '../core/Class'; -import EventMixin from '../core/EventMixin'; import Vector3 from './Vector3'; import Matrix4 from './Matrix4'; import Quaternion from './Quaternion'; @@ -9686,12 +9933,11 @@

    Source: math const tempVector32 = new Vector3(); /** - * 4x4 矩阵, 数据改变会发送事件 + * 4x4 矩阵,具有 onUpdate 回调 * @class * @extends {Matrix4} */ const Matrix4Notifier = Class.create(/** @lends Matrix4Notifier.prototype */ { - Mixes: EventMixin, Extends: Matrix4, /** * 类名 @@ -9714,6 +9960,12 @@

    Source: math * @type {Float32Array} */ this.elements = mat4.create(); + }, + /** + * 更新的回调 + */ + onUpdate() { + }, /** * Copy the values from one mat4 to this @@ -9722,7 +9974,7 @@

    Source: math */ copy(m) { mat4.copy(this.elements, m.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9736,7 +9988,7 @@

    Source: math for (let i = 0; i < 16; i++) { elements[i] = array[offset + i]; } - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9761,7 +10013,7 @@

    Source: math */ set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { mat4.set(this.elements, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9770,7 +10022,7 @@

    Source: math */ identity() { mat4.identity(this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9779,7 +10031,7 @@

    Source: math */ transpose() { mat4.transpose(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9789,7 +10041,7 @@

    Source: math */ invert(m = this) { mat4.invert(this.elements, m.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9799,7 +10051,7 @@

    Source: math */ adjoint(m = this) { mat4.adjoint(this.elements, m.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9821,7 +10073,7 @@

    Source: math a = this; } mat4.multiply(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9831,7 +10083,7 @@

    Source: math */ premultiply(m) { this.multiply(m, this); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9841,7 +10093,7 @@

    Source: math */ translate(v) { mat4.translate(this.elements, this.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9851,7 +10103,7 @@

    Source: math */ scale(v) { mat4.scale(this.elements, this.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9862,7 +10114,7 @@

    Source: math */ rotate(rad, axis) { mat4.rotate(this.elements, this.elements, rad, axis.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9872,7 +10124,7 @@

    Source: math */ rotateX(rad) { mat4.rotateX(this.elements, this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9882,7 +10134,7 @@

    Source: math */ rotateY(rad) { mat4.rotateY(this.elements, this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9892,7 +10144,7 @@

    Source: math */ rotateZ(rad) { mat4.rotateZ(this.elements, this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9902,7 +10154,7 @@

    Source: math */ fromTranslation(v) { mat4.fromTranslation(this.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9912,7 +10164,7 @@

    Source: math */ fromScaling(v) { mat4.fromScaling(this.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9923,7 +10175,7 @@

    Source: math */ fromRotation(rad, axis) { mat4.fromRotation(this.elements, rad, axis.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9933,7 +10185,7 @@

    Source: math */ fromXRotation(rad) { mat4.fromXRotation(this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9943,7 +10195,7 @@

    Source: math */ fromYRotation(rad) { mat4.fromYRotation(this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9953,7 +10205,7 @@

    Source: math */ fromZRotation(rad) { mat4.fromZRotation(this.elements, rad); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9964,7 +10216,7 @@

    Source: math */ fromRotationTranslation(q, v) { mat4.fromRotationTranslation(this.elements, q.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10013,7 +10265,7 @@

    Source: math */ fromRotationTranslationScale(q, v, s) { mat4.fromRotationTranslationScale(this.elements, q.elements, v.elements, s.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10022,13 +10274,13 @@

    Source: math * @param {Vector3} v Translation vector * @param {Vector3} s Scaling vector * @param {Vector3} o The origin vector around which to scale and rotate - * @param {Boolean} [dontFireEvent=false] dontFireEvent + * @param {Boolean} [notCallUpdate=false] notCallUpdate * @return {Matrix4Notifier} this */ - fromRotationTranslationScaleOrigin(q, v, s, o, dontFireEvent) { + fromRotationTranslationScaleOrigin(q, v, s, o, notCallUpdate) { mat4.fromRotationTranslationScaleOrigin(this.elements, q.elements, v.elements, s.elements, o.elements); - if (!dontFireEvent) { - this.fire('update'); + if (!notCallUpdate) { + this.onUpdate(); } return this; }, @@ -10039,7 +10291,7 @@

    Source: math */ fromQuat(q) { mat4.fromQuat(this.elements, q.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10054,7 +10306,7 @@

    Source: math */ frustum(left, right, bottom, top, near, far) { mat4.frustum(this.elements, left, right, bottom, top, near, far); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10067,7 +10319,7 @@

    Source: math */ perspective(fovy, aspect, near, far) { mat4.perspective(this.elements, fovy, aspect, near, far); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10079,7 +10331,7 @@

    Source: math */ perspectiveFromFieldOfView(fov, near, far) { mat4.perspectiveFromFieldOfView(this.elements, fov, near, far); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10094,7 +10346,7 @@

    Source: math */ ortho(left, right, bottom, top, near, far) { mat4.ortho(this.elements, left, right, bottom, top, near, far); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10114,7 +10366,7 @@

    Source: math mat4.lookAt(this.elements, eye.elements, center.elements, up.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10198,7 +10450,7 @@

    Source: math out[13] = eyey; out[14] = eyez; out[15] = 1; - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10220,7 +10472,7 @@

    Source: math a = this; } mat4.add(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10235,7 +10487,7 @@

    Source: math a = this; } mat4.subtract(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** diff --git a/docs/math_Plane.js.html b/docs/math_Plane.js.html index 9d54cd72..9a983336 100644 --- a/docs/math_Plane.js.html +++ b/docs/math_Plane.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Quaternion.js.html b/docs/math_Quaternion.js.html index 99c77317..24d3c572 100644 --- a/docs/math_Quaternion.js.html +++ b/docs/math_Quaternion.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9677,17 +9925,13 @@

    Source: math/Quat } from 'gl-matrix'; import Matrix3 from './Matrix3'; import Class from '../core/Class'; -import EventMixin from '../core/EventMixin'; const tempMat3 = new Matrix3(); /** * @class - * @mixes EventMixin - * @fires update 数据更新事件 */ const Quaternion = Class.create(/** @lends Quaternion.prototype */ { - Mixes: EventMixin, /** * 类名 * @type {String} @@ -9718,14 +9962,10 @@

    Source: math/Quat /** * Copy the values from one quat to this * @param {Quaternion} q - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - copy(q, dontFireEvent) { + copy(q) { quat.copy(this.elements, q.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9757,10 +9997,9 @@

    Source: math/Quat * 从数组赋值 * @param {number[]|TypedArray} array 数组 * @param {Number} [offset=0] 数组偏移值 - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - fromArray(array, offset = 0, dontFireEvent) { + fromArray(array, offset = 0) { const el = this.elements; el[0] = array[offset]; @@ -9768,10 +10007,6 @@

    Source: math/Quat el[2] = array[offset + 2]; el[3] = array[offset + 3]; - if (!dontFireEvent) { - this.fire('update'); - } - return this; }, @@ -9781,27 +10016,19 @@

    Source: math/Quat * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - set(x, y, z, w, dontFireEvent) { + set(x, y, z, w) { quat.set(this.elements, x, y, z, w); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Set this to the identity quaternion - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - identity(dontFireEvent) { + identity() { quat.identity(this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9809,14 +10036,10 @@

    Source: math/Quat * vector to another. * @param {Vector3} a the initial vector * @param {Vector3} b the destination vector - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - rotationTo(a, b, dontFireEvent) { + rotationTo(a, b) { quat.rotationTo(this.elements, a.elements, b.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9827,14 +10050,10 @@

    Source: math/Quat * @param {Vector3} view the vector representing the viewing direction * @param {Vector3} right the vector representing the local "right" direction * @param {Vector3} up the vector representing the local "up" direction - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - setAxes(view, right, up, dontFireEvent) { + setAxes(view, right, up) { quat.setAxes(this.elements, view.elements, right.elements, up.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9842,14 +10061,10 @@

    Source: math/Quat * then returns it. * @param {Vector3} axis the axis around which to rotate * @param {Number} rad the angle in radians - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - setAxisAngle(axis, rad, dontFireEvent) { + setAxisAngle(axis, rad) { quat.setAxisAngle(this.elements, axis.elements, rad); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9870,106 +10085,74 @@

    Source: math/Quat /** * Adds two quat's * @param {Quaternion} q - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - add(q, dontFireEvent) { + add(q) { quat.add(this.elements, this.elements, q.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Multiplies two quat's * @param {Quaternion} q - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - multiply(q, dontFireEvent) { + multiply(q) { quat.multiply(this.elements, this.elements, q.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * premultiply the quat * @param {Quaternion} q - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - premultiply(q, dontFireEvent) { + premultiply(q) { quat.multiply(this.elements, q.elements, this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Scales a quat by a scalar number * @param {Vector3} scale the vector to scale - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - scale(scale, dontFireEvent) { + scale(scale) { quat.scale(this.elements, this.elements, scale); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Rotates a quaternion by the given angle about the X axis * @param {Number} rad angle (in radians) to rotate - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - rotateX(rad, dontFireEvent) { + rotateX(rad) { quat.rotateX(this.elements, this.elements, rad); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Rotates a quaternion by the given angle about the Y axis * @param {Number} rad angle (in radians) to rotate - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - rotateY(rad, dontFireEvent) { + rotateY(rad) { quat.rotateY(this.elements, this.elements, rad); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Rotates a quaternion by the given angle about the Z axis * @param {Number} rad angle (in radians) to rotate - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - rotateZ(rad, dontFireEvent) { + rotateZ(rad) { quat.rotateZ(this.elements, this.elements, rad); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Calculates the W component of a quat from the X, Y, and Z components. * Assumes that quaternion is 1 unit in length. * Any existing W component will be ignored. - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @returns {Quaternion} this */ - calculateW(dontFireEvent) { + calculateW() { quat.calculateW(this.elements, this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -9984,28 +10167,20 @@

    Source: math/Quat * Performs a linear interpolation between two quat's * @param {Quaternion} q * @param {Number} t interpolation amount between the two inputs - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - lerp(q, t, dontFireEvent) { + lerp(q, t) { quat.lerp(this.elements, this.elements, q.elements, t); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Performs a spherical linear interpolation between two quat * @param {Quaternion} q * @param {Number} t interpolation amount between the two inputs - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - slerp(q, t, dontFireEvent) { + slerp(q, t) { quat.slerp(this.elements, this.elements, q.elements, t); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -10015,39 +10190,27 @@

    Source: math/Quat * @param {Quaternion} qc * @param {Quaternion} qd * @param {Number} t interpolation amount - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - sqlerp(qa, qb, qc, qd, t, dontFireEvent) { + sqlerp(qa, qb, qc, qd, t) { quat.sqlerp(this.elements, qa.elements, qb.elements, qc.elements, qd.elements, t); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Calculates the inverse of a quat - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - invert(dontFireEvent) { + invert() { quat.invert(this.elements, this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** * Calculates the conjugate of a quat * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - conjugate(dontFireEvent) { + conjugate() { quat.conjugate(this.elements, this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -10066,14 +10229,10 @@

    Source: math/Quat }, /** * Normalize this - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - normalize(dontFireEvent) { + normalize() { quat.normalize(this.elements, this.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -10083,14 +10242,10 @@

    Source: math/Quat * to renormalize the quaternion yourself where necessary. * * @param {Matrix3} m rotation matrix - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - fromMat3(mat, dontFireEvent) { + fromMat3(mat) { quat.fromMat3(this.elements, mat.elements); - if (!dontFireEvent) { - this.fire('update'); - } return this; }, /** @@ -10100,12 +10255,11 @@

    Source: math/Quat * to renormalize the quaternion yourself where necessary. * * @param {Matrix4} m rotation matrix - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - fromMat4(mat, dontFireEvent) { + fromMat4(mat) { tempMat3.fromMat4(mat); - this.fromMat3(tempMat3, dontFireEvent); + this.fromMat3(tempMat3); return this; }, /** @@ -10127,10 +10281,9 @@

    Source: math/Quat /** * Creates a quaternion from the given euler. * @param {Euler} euler - * @param {Boolean} [dontFireEvent=false] wether or not don`t fire change event. * @return {Quaternion} this */ - fromEuler(euler, dontFireEvent) { + fromEuler(euler) { // Based on https://github.com/mrdoob/three.js/blob/dev/src/math/Quaternion.js#L200 // quat.fromEuler(this.elements, euler.x, euler.y, euler.z); @@ -10180,10 +10333,6 @@

    Source: math/Quat out[3] = cx * cy * cz + sx * sy * sz; } - if (!dontFireEvent) { - this.fire('update'); - } - return this; }, /** @@ -10196,7 +10345,6 @@

    Source: math/Quat }, set(value) { this.elements[0] = value; - this.fire('update'); } }, /** @@ -10209,7 +10357,6 @@

    Source: math/Quat }, set(value) { this.elements[1] = value; - this.fire('update'); } }, /** @@ -10222,7 +10369,6 @@

    Source: math/Quat }, set(value) { this.elements[2] = value; - this.fire('update'); } }, /** @@ -10235,7 +10381,6 @@

    Source: math/Quat }, set(value) { this.elements[3] = value; - this.fire('update'); } } }); @@ -10243,6 +10388,7 @@

    Source: math/Quat /** * Alias for {@link Quaternion#multiply} * @function + * @param {Quaternion} q */ Quaternion.prototype.mul = Quaternion.prototype.multiply; diff --git a/docs/math_QuaternionNotifier.js.html b/docs/math_QuaternionNotifier.js.html new file mode 100644 index 00000000..f0dba9fb --- /dev/null +++ b/docs/math_QuaternionNotifier.js.html @@ -0,0 +1,10473 @@ + + + + + Source: math/QuaternionNotifier.js + + + + + + + + + + + + + + + + + +
    + + +
    +

    Source: math/QuaternionNotifier.js

    + + + + +
    +
    +
    import {
    +    quat
    +} from 'gl-matrix';
    +import Matrix3 from './Matrix3';
    +import Class from '../core/Class';
    +
    +const tempMat3 = new Matrix3();
    +
    +/**
    + * 四元数,具有 onUpdate 回调
    + * @class
    + */
    +const QuaternionNotifier = Class.create(/** @lends QuaternionNotifier.prototype */ {
    +    /**
    +     * 类名
    +     * @type {String}
    +     * @default QuaternionNotifier
    +     */
    +    className: 'QuaternionNotifier',
    +    /**
    +     * @type {Boolean}
    +     * @default true
    +     */
    +    isQuaternionNotifier: true,
    +    /**
    +     * @type {Boolean}
    +     * @default true
    +     */
    +    isQuaternion: true,
    +    /**
    +     * Creates a new identity quat
    +     * @constructs
    +     * @param  {Number} [x=0] X component
    +     * @param  {Number} [y=0] Y component
    +     * @param  {Number} [z=0] Z component
    +     * @param  {Number} [w=1] W component
    +    */
    +    constructor(x = 0, y = 0, z = 0, w = 1) {
    +    /**
    +     * 数据
    +     * @type {Float32Array}
    +     */
    +        this.elements = quat.fromValues(x, y, z, w);
    +    },
    +
    +    /**
    +     * 更新的回调
    +     */
    +    onUpdate() {
    +
    +    },
    +
    +    /**
    +   * Copy the values from one quat to this
    +   * @param  {Quaternion} q
    +   * @return {Quaternion} this
    +   */
    +    copy(q) {
    +        quat.copy(this.elements, q.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Creates a new quat initialized with values from an existing quaternion
    +   * @return {Quaternion} a new quaternion
    +   */
    +    clone() {
    +        const el = this.elements;
    +        return new this.constructor(el[0], el[1], el[2], el[3]);
    +    },
    +
    +    /**
    +   * 转换到数组
    +   * @param  {number[]|TypedArray}  [array=[]] 数组
    +   * @param  {Number} [offset=0] 数组偏移值
    +   * @return {Array}
    +   */
    +    toArray(array = [], offset = 0) {
    +        const el = this.elements;
    +
    +        array[offset] = el[0];
    +        array[offset + 1] = el[1];
    +        array[offset + 2] = el[2];
    +        array[offset + 3] = el[3];
    +
    +        return array;
    +    },
    +    /**
    +   * 从数组赋值
    +   * @param  {number[]|TypedArray} array  数组
    +   * @param  {Number} [offset=0] 数组偏移值
    +   * @return {Quaternion} this
    +   */
    +    fromArray(array, offset = 0) {
    +        const el = this.elements;
    +
    +        el[0] = array[offset];
    +        el[1] = array[offset + 1];
    +        el[2] = array[offset + 2];
    +        el[3] = array[offset + 3];
    +
    +        this.onUpdate();
    +
    +        return this;
    +    },
    +
    +    /**
    +   * Set the components of a quat to the given values
    +   * @param {Number} x  X component
    +   * @param {Number} y  Y component
    +   * @param {Number} z  Z component
    +   * @param {Number} w  W component
    +   * @return {Quaternion} this
    +   */
    +    set(x, y, z, w) {
    +        quat.set(this.elements, x, y, z, w);
    +        this.onUpdate();
    +        return this;
    +    },
    +
    +    /**
    +   * Set this to the identity quaternion
    +   * @return {Quaternion} this
    +   */
    +    identity() {
    +        quat.identity(this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Sets a quaternion to represent the shortest rotation from one
    +   * vector to another.
    +   * @param  {Vector3} a the initial vector
    +   * @param  {Vector3} b the destination vector
    +   * @return {Quaternion} this
    +   */
    +    rotationTo(a, b) {
    +        quat.rotationTo(this.elements, a.elements, b.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Sets the specified quaternion with values corresponding to the given
    +   * axes. Each axis is a vec3 and is expected to be unit length and
    +   * perpendicular to all other specified axes.
    +   *
    +   * @param {Vector3} view  the vector representing the viewing direction
    +   * @param {Vector3} right the vector representing the local "right" direction
    +   * @param {Vector3} up    the vector representing the local "up" direction
    +   * @return {Quaternion} this
    +   */
    +    setAxes(view, right, up) {
    +        quat.setAxes(this.elements, view.elements, right.elements, up.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Sets a quat from the given angle and rotation axis,
    +   * then returns it.
    +   * @param {Vector3} axis the axis around which to rotate
    +   * @param {Number} rad the angle in radians
    +   * @return {Quaternion} this
    +   */
    +    setAxisAngle(axis, rad) {
    +        quat.setAxisAngle(this.elements, axis.elements, rad);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Gets the rotation axis and angle for a given
    +   *  quaternion. If a quaternion is created with
    +   *  setAxisAngle, this method will return the same
    +   *  values as providied in the original parameter list
    +   *  OR functionally equivalent values.
    +   * Example: The quaternion formed by axis [0, 0, 1] and
    +   *  angle -90 is the same as the quaternion formed by
    +   *  [0, 0, 1] and 270. This method favors the latter.
    +   * @param  {Vector3} out_axis  Vector receiving the axis of rotation
    +   * @return {Number} Angle, in radians, of the rotation
    +   */
    +    getAxisAngle(axis) {
    +        return quat.getAxisAngle(axis.elements, this.elements);
    +    },
    +    /**
    +   * Adds two quat's
    +   * @param {Quaternion} q
    +   * @return {Quaternion} this
    +   */
    +    add(q) {
    +        quat.add(this.elements, this.elements, q.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Multiplies two quat's
    +   * @param  {Quaternion} q
    +   * @return {Quaternion} this
    +   */
    +    multiply(q) {
    +        quat.multiply(this.elements, this.elements, q.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * premultiply the quat
    +   * @param  {Quaternion} q
    +   * @return {Quaternion} this
    +   */
    +    premultiply(q) {
    +        quat.multiply(this.elements, q.elements, this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Scales a quat by a scalar number
    +   * @param  {Vector3} scale the vector to scale
    +   * @return {Quaternion} this
    +   */
    +    scale(scale) {
    +        quat.scale(this.elements, this.elements, scale);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Rotates a quaternion by the given angle about the X axis
    +   * @param  {Number} rad angle (in radians) to rotate
    +   * @return {Quaternion} this
    +   */
    +    rotateX(rad) {
    +        quat.rotateX(this.elements, this.elements, rad);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Rotates a quaternion by the given angle about the Y axis
    +   * @param  {Number} rad angle (in radians) to rotate
    +   * @return {Quaternion} this
    +   */
    +    rotateY(rad) {
    +        quat.rotateY(this.elements, this.elements, rad);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Rotates a quaternion by the given angle about the Z axis
    +   * @param  {Number} rad angle (in radians) to rotate
    +   * @return {Quaternion} this
    +   */
    +    rotateZ(rad) {
    +        quat.rotateZ(this.elements, this.elements, rad);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Calculates the W component of a quat from the X, Y, and Z components.
    +   * Assumes that quaternion is 1 unit in length.
    +   * Any existing W component will be ignored.
    +   * @returns {Quaternion} this
    +   */
    +    calculateW() {
    +        quat.calculateW(this.elements, this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Calculates the dot product of two quat's
    +   * @param  {Quaternion} q
    +   * @return {Number} dot product of two quat's
    +   */
    +    dot(q) {
    +        return quat.dot(this.elements, q.elements);
    +    },
    +    /**
    +   * Performs a linear interpolation between two quat's
    +   * @param  {Quaternion} q
    +   * @param  {Number} t interpolation amount between the two inputs
    +   * @return {Quaternion} this
    +   */
    +    lerp(q, t) {
    +        quat.lerp(this.elements, this.elements, q.elements, t);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Performs a spherical linear interpolation between two quat
    +   * @param  {Quaternion} q
    +   * @param  {Number} t interpolation amount between the two inputs
    +   * @return {Quaternion} this
    +   */
    +    slerp(q, t) {
    +        quat.slerp(this.elements, this.elements, q.elements, t);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Performs a spherical linear interpolation with two control points
    +   * @param  {Quaternion} qa
    +   * @param  {Quaternion} qb
    +   * @param  {Quaternion} qc
    +   * @param  {Quaternion} qd
    +   * @param  {Number} t interpolation amount
    +   * @return {Quaternion} this
    +   */
    +    sqlerp(qa, qb, qc, qd, t) {
    +        quat.sqlerp(this.elements, qa.elements, qb.elements, qc.elements, qd.elements, t);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Calculates the inverse of a quat
    +   * @return {Quaternion} this
    +   */
    +    invert() {
    +        quat.invert(this.elements, this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Calculates the conjugate of a quat
    +   * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
    +   * @return {Quaternion} this
    +   */
    +    conjugate() {
    +        quat.conjugate(this.elements, this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Calculates the length of a quat
    +   * @return {Number} length of this
    +   */
    +    length() {
    +        return quat.length(this.elements);
    +    },
    +    /**
    +   * Calculates the squared length of a quat
    +   * @return {Number} squared length of this
    +   */
    +    squaredLength() {
    +        return quat.squaredLength(this.elements);
    +    },
    +    /**
    +   * Normalize this
    +   * @return {Quaternion} this
    +   */
    +    normalize() {
    +        quat.normalize(this.elements, this.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Creates a quaternion from the given 3x3 rotation matrix.
    +   *
    +   * NOTE: The resultant quaternion is not normalized, so you should be sure
    +   * to renormalize the quaternion yourself where necessary.
    +   *
    +   * @param {Matrix3} m rotation matrix
    +   * @return {Quaternion} this
    +   */
    +    fromMat3(mat) {
    +        quat.fromMat3(this.elements, mat.elements);
    +        this.onUpdate();
    +        return this;
    +    },
    +    /**
    +   * Creates a quaternion from the given 3x3 rotation matrix.
    +   *
    +   * NOTE: The resultant quaternion is not normalized, so you should be sure
    +   * to renormalize the quaternion yourself where necessary.
    +   *
    +   * @param {Matrix4} m rotation matrix
    +   * @return {Quaternion} this
    +   */
    +    fromMat4(mat) {
    +        tempMat3.fromMat4(mat);
    +        this.fromMat3(tempMat3);
    +        return this;
    +    },
    +    /**
    +   * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
    +   * @param  {Quaternion} q
    +   * @return {Boolean}
    +   */
    +    exactEquals(q) {
    +        return quat.exactEquals(this.elements, q.elements);
    +    },
    +    /**
    +   * Returns whether or not the quaternions have approximately the same elements in the same position.
    +   * @param  {Quaternion} q
    +   * @return {Boolean}
    +   */
    +    equals(q) {
    +        return quat.equals(this.elements, q.elements);
    +    },
    +    /**
    +   * Creates a quaternion from the given euler.
    +   * @param  {Euler} euler
    +   * @param  {Boolean} [notCallUpdate=false] 是否需要调用onUpdate
    +   * @return {Quaternion} this
    +   */
    +    fromEuler(euler, notCallUpdate) {
    +    // Based on https://github.com/mrdoob/three.js/blob/dev/src/math/Quaternion.js#L200
    +
    +        // quat.fromEuler(this.elements, euler.x, euler.y, euler.z);
    +        const x = euler.x * .5;
    +        const y = euler.y * .5;
    +        const z = euler.z * .5;
    +        const order = euler.order || 'ZYX';
    +
    +        let sx = Math.sin(x);
    +        let cx = Math.cos(x);
    +        let sy = Math.sin(y);
    +        let cy = Math.cos(y);
    +        let sz = Math.sin(z);
    +        let cz = Math.cos(z);
    +
    +        const out = this.elements;
    +
    +        if (order === 'XYZ') {
    +            out[0] = sx * cy * cz + cx * sy * sz;
    +            out[1] = cx * sy * cz - sx * cy * sz;
    +            out[2] = cx * cy * sz + sx * sy * cz;
    +            out[3] = cx * cy * cz - sx * sy * sz;
    +        } else if (order === 'YXZ') {
    +            out[0] = sx * cy * cz + cx * sy * sz;
    +            out[1] = cx * sy * cz - sx * cy * sz;
    +            out[2] = cx * cy * sz - sx * sy * cz;
    +            out[3] = cx * cy * cz + sx * sy * sz;
    +        } else if (order === 'ZXY') {
    +            out[0] = sx * cy * cz - cx * sy * sz;
    +            out[1] = cx * sy * cz + sx * cy * sz;
    +            out[2] = cx * cy * sz + sx * sy * cz;
    +            out[3] = cx * cy * cz - sx * sy * sz;
    +        } else if (order === 'ZYX') {
    +            out[0] = sx * cy * cz - cx * sy * sz;
    +            out[1] = cx * sy * cz + sx * cy * sz;
    +            out[2] = cx * cy * sz - sx * sy * cz;
    +            out[3] = cx * cy * cz + sx * sy * sz;
    +        } else if (order === 'YZX') {
    +            out[0] = sx * cy * cz + cx * sy * sz;
    +            out[1] = cx * sy * cz + sx * cy * sz;
    +            out[2] = cx * cy * sz - sx * sy * cz;
    +            out[3] = cx * cy * cz - sx * sy * sz;
    +        } else if (order === 'XZY') {
    +            out[0] = sx * cy * cz - cx * sy * sz;
    +            out[1] = cx * sy * cz - sx * cy * sz;
    +            out[2] = cx * cy * sz + sx * sy * cz;
    +            out[3] = cx * cy * cz + sx * sy * sz;
    +        }
    +
    +        if (!notCallUpdate) {
    +            this.onUpdate();
    +        }
    +
    +        return this;
    +    },
    +    /**
    +   * X component
    +   * @type {Number}
    +   */
    +    x: {
    +        get() {
    +            return this.elements[0];
    +        },
    +        set(value) {
    +            this.elements[0] = value;
    +            this.onUpdate();
    +        }
    +    },
    +    /**
    +   * Y component
    +   * @type {Number}
    +   */
    +    y: {
    +        get() {
    +            return this.elements[1];
    +        },
    +        set(value) {
    +            this.elements[1] = value;
    +            this.onUpdate();
    +        }
    +    },
    +    /**
    +   * Z component
    +   * @type {Number}
    +   */
    +    z: {
    +        get() {
    +            return this.elements[2];
    +        },
    +        set(value) {
    +            this.elements[2] = value;
    +            this.onUpdate();
    +        }
    +    },
    +    /**
    +   * W component
    +   * @type {Number}
    +   */
    +    w: {
    +        get() {
    +            return this.elements[3];
    +        },
    +        set(value) {
    +            this.elements[3] = value;
    +            this.onUpdate();
    +        }
    +    }
    +});
    +
    +/**
    + * Alias for {@link QuaternionNotifier#multiply}
    + * @function
    + * @param  {QuaternionNotifier} q
    + */
    +QuaternionNotifier.prototype.mul = QuaternionNotifier.prototype.multiply;
    +
    +/**
    + * Alias for {@link QuaternionNotifier#length}
    + * @function
    + */
    +QuaternionNotifier.prototype.len = QuaternionNotifier.prototype.length;
    +
    +/**
    + * Alias for {@link QuaternionNotifier#squaredLength}
    + * @function
    + */
    +QuaternionNotifier.prototype.sqrLen = QuaternionNotifier.prototype.squaredLength;
    +
    +export default QuaternionNotifier;
    +
    +
    +
    + + + + + + + + + +
    +
    + + + + + diff --git a/docs/math_Ray.js.html b/docs/math_Ray.js.html index 21dbfdec..66b22980 100644 --- a/docs/math_Ray.js.html +++ b/docs/math_Ray.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Sphere.js.html b/docs/math_Sphere.js.html index 17c8c2fe..8aebbce7 100644 --- a/docs/math_Sphere.js.html +++ b/docs/math_Sphere.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_SphericalHarmonics3.js.html b/docs/math_SphericalHarmonics3.js.html index b7873ca7..bf0218b4 100644 --- a/docs/math_SphericalHarmonics3.js.html +++ b/docs/math_SphericalHarmonics3.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Vector2.js.html b/docs/math_Vector2.js.html index 83f85835..a9a34c9d 100644 --- a/docs/math_Vector2.js.html +++ b/docs/math_Vector2.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Vector3.js.html b/docs/math_Vector3.js.html index 7fd66947..e581c824 100644 --- a/docs/math_Vector3.js.html +++ b/docs/math_Vector3.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_Vector3Notifier.js.html b/docs/math_Vector3Notifier.js.html index 4864c817..5053d632 100644 --- a/docs/math_Vector3Notifier.js.html +++ b/docs/math_Vector3Notifier.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9676,18 +9924,14 @@

    Source: math vec3 } from 'gl-matrix'; import Class from '../core/Class'; -import EventMixin from '../core/EventMixin'; import Vector3 from './Vector3'; /** - * 三维向量, 数据改变会发送事件 + * 三维向量,具有 onUpdate 回调 * @class - * @mixes EventMixin * @extends Vector3 - * @fires update 数据更新事件 */ const Vector3Notifier = Class.create(/** @lends Vector3Notifier.prototype */ { - Mixes: EventMixin, Extends: Vector3, /** * 类名 notify @@ -9713,6 +9957,12 @@

    Source: math * @type {Float32Array} */ this.elements = vec3.fromValues(x, y, z); + }, + /** + * 更新的回调 + */ + onUpdate() { + }, /** * Copy the values from one vec3 to this @@ -9721,7 +9971,7 @@

    Source: math */ copy(v) { vec3.copy(this.elements, v.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9756,7 +10006,7 @@

    Source: math elements[0] = array[offset + 0]; elements[1] = array[offset + 1]; elements[2] = array[offset + 2]; - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9768,7 +10018,7 @@

    Source: math */ set(x, y, z) { vec3.set(this.elements, x, y, z); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9783,7 +10033,7 @@

    Source: math a = this; } vec3.add(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9798,7 +10048,7 @@

    Source: math a = this; } vec3.subtract(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9813,7 +10063,7 @@

    Source: math a = this; } vec3.multiply(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9828,7 +10078,7 @@

    Source: math a = this; } vec3.divide(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9837,7 +10087,7 @@

    Source: math */ ceil() { vec3.ceil(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9846,7 +10096,7 @@

    Source: math */ floor() { vec3.floor(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9861,7 +10111,7 @@

    Source: math a = this; } vec3.min(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9876,7 +10126,7 @@

    Source: math a = this; } vec3.max(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9885,7 +10135,7 @@

    Source: math */ round() { vec3.round(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9895,7 +10145,7 @@

    Source: math */ scale(scale) { vec3.scale(this.elements, this.elements, scale); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9911,7 +10161,7 @@

    Source: math a = this; } vec3.scaleAndAdd(this.elements, a.elements, b.elements, scale); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9960,7 +10210,7 @@

    Source: math */ negate() { vec3.negate(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9973,7 +10223,7 @@

    Source: math a = this; } vec3.inverse(this.elements, a.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -9982,7 +10232,7 @@

    Source: math */ normalize() { vec3.normalize(this.elements, this.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10010,7 +10260,7 @@

    Source: math a = this; } vec3.cross(this.elements, a.elements, b.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10021,7 +10271,7 @@

    Source: math */ lerp(v, t) { vec3.lerp(this.elements, this.elements, v.elements, t); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10035,7 +10285,7 @@

    Source: math */ hermite(a, b, c, d, t) { vec3.hermite(this.elements, a.elements, b.elements, c.elements, d.elements, t); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10049,7 +10299,7 @@

    Source: math */ bezier(a, b, c, d, t) { vec3.bezier(this.elements, a.elements, b.elements, c.elements, d.elements, t); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10059,7 +10309,7 @@

    Source: math */ random(scale) { vec3.random(this.elements, scale); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10069,7 +10319,7 @@

    Source: math */ transformMat3(m) { vec3.transformMat3(this.elements, this.elements, m.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10079,7 +10329,7 @@

    Source: math */ transformMat4(m) { vec3.transformMat4(this.elements, this.elements, m.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10098,7 +10348,7 @@

    Source: math elements[1] = x * mElements[1] + y * mElements[5] + z * mElements[9]; elements[2] = x * mElements[2] + y * mElements[6] + z * mElements[10]; - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10108,7 +10358,7 @@

    Source: math */ transformQuat(q) { vec3.transformQuat(this.elements, this.elements, q.elements); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10119,7 +10369,7 @@

    Source: math */ rotateX(origin, rotation) { vec3.rotateX(this.elements, this.elements, origin.elements, rotation); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10130,7 +10380,7 @@

    Source: math */ rotateY(origin, rotation) { vec3.rotateY(this.elements, this.elements, origin.elements, rotation); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10141,7 +10391,7 @@

    Source: math */ rotateZ(origin, rotation) { vec3.rotateZ(this.elements, this.elements, origin.elements, rotation); - this.fire('update'); + this.onUpdate(); return this; }, /** @@ -10180,7 +10430,7 @@

    Source: math }, set(value) { this.elements[0] = value; - this.fire('update'); + this.onUpdate(); } }, /** @@ -10193,7 +10443,7 @@

    Source: math }, set(value) { this.elements[1] = value; - this.fire('update'); + this.onUpdate(); } }, /** @@ -10206,7 +10456,7 @@

    Source: math }, set(value) { this.elements[2] = value; - this.fire('update'); + this.onUpdate(); } } }); diff --git a/docs/math_Vector4.js.html b/docs/math_Vector4.js.html index 28e43298..ebcea3a1 100644 --- a/docs/math_Vector4.js.html +++ b/docs/math_Vector4.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/math_math.js.html b/docs/math_math.js.html index 8f721330..7f2e37b3 100644 --- a/docs/math_math.js.html +++ b/docs/math_math.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_Buffer.js.html b/docs/renderer_Buffer.js.html index b83dcce4..bde2534e 100644 --- a/docs/renderer_Buffer.js.html +++ b/docs/renderer_Buffer.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9694,6 +9942,7 @@

    Source: renderer/ Statics: /** @lends Buffer */ { /** * 缓存 + * @type {Cache} * @readOnly * @return {Cache} */ diff --git a/docs/renderer_Framebuffer.js.html b/docs/renderer_Framebuffer.js.html index 5f1eab14..ce45a899 100644 --- a/docs/renderer_Framebuffer.js.html +++ b/docs/renderer_Framebuffer.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -10093,6 +10341,7 @@

    Source: rend bind() { this.init(); if (this._isInit) { + this._preFramebuffer = this.state.currentFramebuffer; this.state.bindFramebuffer(this.gl.FRAMEBUFFER, this.framebuffer); } }, @@ -10103,7 +10352,7 @@

    Source: rend this.init(); if (this._isInit) { const state = this.state; - state.bindFramebuffer(this.gl.FRAMEBUFFER, state.preFramebuffer); + state.bindFramebuffer(this.gl.FRAMEBUFFER, this._preFramebuffer); } }, clear(clearColor = new Color(0, 0, 0, 0)) { diff --git a/docs/renderer_Program.js.html b/docs/renderer_Program.js.html index 5f496204..0ae36bb0 100644 --- a/docs/renderer_Program.js.html +++ b/docs/renderer_Program.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9697,6 +9945,7 @@

    Source: renderer Statics: /** @lends Program */ { /** * 缓存 + * @type {Cache} * @readOnly * @return {Cache} */ diff --git a/docs/renderer_RenderInfo.js.html b/docs/renderer_RenderInfo.js.html index 2b971031..5295064e 100644 --- a/docs/renderer_RenderInfo.js.html +++ b/docs/renderer_RenderInfo.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_RenderList.js.html b/docs/renderer_RenderList.js.html index 1629ef77..ddc433b1 100644 --- a/docs/renderer_RenderList.js.html +++ b/docs/renderer_RenderList.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_UniformBuffer.js.html b/docs/renderer_UniformBuffer.js.html index 81ec8e80..18ab7284 100644 --- a/docs/renderer_UniformBuffer.js.html +++ b/docs/renderer_UniformBuffer.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_VertexArrayObject.js.html b/docs/renderer_VertexArrayObject.js.html index 0755031f..571dd792 100644 --- a/docs/renderer_VertexArrayObject.js.html +++ b/docs/renderer_VertexArrayObject.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9697,6 +9945,7 @@

    Source Statics: { /** * 缓存 + * @type {Cache} * @readOnly * @memberOf VertexArrayObject * @return {Cache} diff --git a/docs/renderer_WebGLRenderer.js.html b/docs/renderer_WebGLRenderer.js.html index 7c135879..ad551374 100644 --- a/docs/renderer_WebGLRenderer.js.html +++ b/docs/renderer_WebGLRenderer.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9971,7 +10219,7 @@

    Source: re /** * 灯光管理器 - * @type {LightManager} + * @type {ILightManager} * @default new LightManager */ this.lightManager = new LightManager(); @@ -10454,6 +10702,7 @@

    Source: re stage.updateMatrixWorld(); camera.updateViewProjectionMatrix(); + const lights = []; stage.traverse((node) => { if (!node.visible) { return Node.TRAVERSE_STOP_CHILDREN; @@ -10462,15 +10711,14 @@

    Source: re if (node.isMesh) { renderList.addMesh(node, camera); } else if (node.isLight) { - lightManager.addLight(node); + lights.push(node); } return Node.TRAVERSE_STOP_NONE; }); renderList.sort(); - lightManager.createShadowMap(this, camera); - lightManager.updateInfo(camera); + lightManager.update(this, camera, lights); if (fireEvent) { this.fire('beforeRender'); diff --git a/docs/renderer_WebGLResourceManager.js.html b/docs/renderer_WebGLResourceManager.js.html index 33af255c..26d16e7a 100644 --- a/docs/renderer_WebGLResourceManager.js.html +++ b/docs/renderer_WebGLResourceManager.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_WebGLState.js.html b/docs/renderer_WebGLState.js.html index a6f8f553..8933922e 100644 --- a/docs/renderer_WebGLState.js.html +++ b/docs/renderer_WebGLState.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_capabilities.js.html b/docs/renderer_capabilities.js.html index 5bfc97cf..9281dafc 100644 --- a/docs/renderer_capabilities.js.html +++ b/docs/renderer_capabilities.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • @@ -9685,6 +9933,7 @@

    Source: ren const capabilities = { /** * 是否是 WebGL2 + * @type {boolean} */ isWebGL2: false, /** diff --git a/docs/renderer_extensions.js.html b/docs/renderer_extensions.js.html index 2f8eaf44..2fc62957 100644 --- a/docs/renderer_extensions.js.html +++ b/docs/renderer_extensions.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_glType.js.html b/docs/renderer_glType.js.html index 7d2266eb..ce5d3c38 100644 --- a/docs/renderer_glType.js.html +++ b/docs/renderer_glType.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/renderer_logGLResource.js.html b/docs/renderer_logGLResource.js.html index 12e1af20..f52e452e 100644 --- a/docs/renderer_logGLResource.js.html +++ b/docs/renderer_logGLResource.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/semantic.html b/docs/semantic.html index d54e5616..89bfb772 100644 --- a/docs/semantic.html +++ b/docs/semantic.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/shader_Shader.js.html b/docs/shader_Shader.js.html index 228b652f..56180bbd 100644 --- a/docs/shader_Shader.js.html +++ b/docs/shader_Shader.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/texture_CubeTexture.js.html b/docs/texture_CubeTexture.js.html index eb675873..cbdc9af3 100644 --- a/docs/texture_CubeTexture.js.html +++ b/docs/texture_CubeTexture.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/texture_DataTexture.js.html b/docs/texture_DataTexture.js.html index 6a5295ca..7adff5df 100644 --- a/docs/texture_DataTexture.js.html +++ b/docs/texture_DataTexture.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/texture_LazyTexture.js.html b/docs/texture_LazyTexture.js.html index b94c71e2..8f974d2d 100644 --- a/docs/texture_LazyTexture.js.html +++ b/docs/texture_LazyTexture.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/texture_Texture.js.html b/docs/texture_Texture.js.html index 9a760620..8e29a5ce 100644 --- a/docs/texture_Texture.js.html +++ b/docs/texture_Texture.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/util.html b/docs/util.html index 97370815..b2bab4b6 100644 --- a/docs/util.html +++ b/docs/util.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_Cache.js.html b/docs/utils_Cache.js.html index be5904ec..6758d34a 100644 --- a/docs/utils_Cache.js.html +++ b/docs/utils_Cache.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_MeshPicker.js.html b/docs/utils_MeshPicker.js.html index a8ccd87e..451060a7 100644 --- a/docs/utils_MeshPicker.js.html +++ b/docs/utils_MeshPicker.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_Ticker.js.html b/docs/utils_Ticker.js.html index d05db971..9ac101d3 100644 --- a/docs/utils_Ticker.js.html +++ b/docs/utils_Ticker.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_WebGLSupport.js.html b/docs/utils_WebGLSupport.js.html index 13fff3d6..860b2903 100644 --- a/docs/utils_WebGLSupport.js.html +++ b/docs/utils_WebGLSupport.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_browser.js.html b/docs/utils_browser.js.html index 846756b6..5addcd73 100644 --- a/docs/utils_browser.js.html +++ b/docs/utils_browser.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_log.js.html b/docs/utils_log.js.html index b9337f30..69e9e810 100644 --- a/docs/utils_log.js.html +++ b/docs/utils_log.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/docs/utils_util.js.html b/docs/utils_util.js.html index a96115d1..8ac7f99b 100644 --- a/docs/utils_util.js.html +++ b/docs/utils_util.js.html @@ -2189,6 +2189,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -2235,6 +2237,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + @@ -5000,6 +5042,8 @@

  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5021,6 +5065,8 @@

  • className
  • +
  • lightShadow
  • +
  • direction
  • amount
  • @@ -5049,8 +5095,14 @@

    MethodsShow Inherited +
  • getWorldDirection
  • + +
  • getViewDirection
  • +
  • toInfoArray
  • +
  • getRealColor
  • +
  • createShadowMap
  • @@ -5118,6 +5170,8 @@

  • onUpdate
  • +
  • onlySyncQuaternion
  • +
  • id
  • up
  • @@ -5164,6 +5218,8 @@

  • matrixVersion
  • +
  • worldMatrixVersion
  • + +
      + +
    + + +
  • + + light/LightShadow + + + +
      + +
    +
      +
  • +
  • + + math/QuaternionNotifier + + + +
      + +
    + +
      + +
    +
  • +
  • math/Ray @@ -8167,6 +8413,8 @@

    MethodsShow Inherited +
  • onUpdate
  • +
  • copy
  • clone
  • diff --git a/package.json b/package.json index c3ddb5c0..9ed54f09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hilo3d", - "version": "1.18.0", + "version": "1.19.0", "description": "Hilo3d, a WebGL 3d engine.", "main": "build/Hilo3d.js", "types": "types/index.d.ts", diff --git a/types/index.d.ts b/types/index.d.ts index d90b2311..5b02a822 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -999,7 +999,6 @@ interface EventObject { * @param e.type - 事件类型 * @param e.detail - 事件数据 * @param e.target - 事件触发对象 - * @param e.timeStamp - 时间戳 * @param e.stageX - 鼠标相对 stage 的 x 偏移 ( 仅鼠标事件有效 ) * @param e.stageY - 鼠标相对 stage 的 y 偏移 ( 仅鼠标事件有效 ) * @param e.eventTarget - 触发鼠标事件的对象 ( 仅鼠标事件有效 ) @@ -1010,7 +1009,6 @@ type EventMixinCallback = (e: { type: string; detail: any; target: any; - timeStamp: number; stageX: number; stageY: number; eventTarget: Node; @@ -1160,6 +1158,40 @@ type GeometryDataTraverseByComponentCallback = (component: number, index: number */ type updateCustomInfoCallback = (lightManager: LightManager, camera: Camera) => void; +/** + * 灯光信息接口 + * @property uid + */ +interface ILightInfo { + uid: string; +} + +/** + * 灯光管理器接口 + * @property shadowEnabled + * @property lightInfo + */ +interface ILightManager { + /** + * 重置所有光源信息 + */ + reset(): void; + /** + * 更新光源信息 + * @param renderer + * @param camera + * @param lights + */ + update(renderer: WebGLRenderer, camera: Camera, lights: Light[]): void; + /** + * 获取渲染配置 + * @param [option] + */ + getRenderOption(option?: any): void; + shadowEnabled: boolean; + lightInfo: ILightInfo; +} + /** * GLTFExtension Handler 接口 */ @@ -1531,7 +1563,7 @@ namespace capabilities { /** * 是否是 WebGL2 */ - var isWebGL2: any; + var isWebGL2: boolean; /** * 最大纹理数量 */ @@ -2944,7 +2976,7 @@ class WebGLRenderer implements EventMixin { /** * 灯光管理器 */ - lightManager: LightManager; + lightManager: ILightManager; /** * 资源管理器 */ @@ -3113,7 +3145,7 @@ class VertexArrayObject { /** * 缓存 */ - static readonly cache: any; + static readonly cache: Cache; /** * 获取 vao * @param gl @@ -3309,7 +3341,7 @@ class Program { /** * 缓存 */ - static readonly cache: any; + static readonly cache: Cache; /** * 重置缓存 */ @@ -3578,7 +3610,7 @@ class Buffer { /** * 缓存 */ - static readonly cache: any; + static readonly cache: Cache; /** * 重置缓存 */ @@ -3905,16 +3937,13 @@ class Vector4 { sqrLen(): void; } -interface Vector3Notifier extends EventMixin { -} - /** - * 三维向量, 数据改变会发送事件 + * 三维向量,具有 onUpdate 回调 * @param [x = 0] - X component * @param [y = 0] - Y component * @param [z = 0] - Z component */ -class Vector3Notifier extends Vector3 implements EventMixin { +class Vector3Notifier extends Vector3 { constructor(x?: number, y?: number, z?: number); /** * 类名 notify @@ -3925,6 +3954,10 @@ class Vector3Notifier extends Vector3 implements EventMixin { * 数据 */ elements: Float32Array; + /** + * 更新的回调 + */ + onUpdate(): void; /** * X component */ @@ -4693,7 +4726,275 @@ class Ray { intersectsTriangleCell(cell: any[], positions: any[]): Vector3; } -interface Quaternion extends EventMixin { +/** + * 四元数,具有 onUpdate 回调 + * @param [x = 0] - X component + * @param [y = 0] - Y component + * @param [z = 0] - Z component + * @param [w = 1] - W component + */ +class QuaternionNotifier { + constructor(x?: number, y?: number, z?: number, w?: number); + /** + * 类名 + */ + className: string; + isQuaternionNotifier: boolean; + isQuaternion: boolean; + /** + * 数据 + */ + elements: Float32Array; + /** + * 更新的回调 + */ + onUpdate(): void; + /** + * Copy the values from one quat to this + * @param q + * @returns this + */ + copy(q: Quaternion): Quaternion; + /** + * Creates a new quat initialized with values from an existing quaternion + * @returns a new quaternion + */ + clone(): Quaternion; + /** + * 转换到数组 + * @param [array = []] - 数组 + * @param [offset = 0] - 数组偏移值 + */ + toArray(array?: number[] | TypedArray, offset?: number): any[]; + /** + * 从数组赋值 + * @param array - 数组 + * @param [offset = 0] - 数组偏移值 + * @returns this + */ + fromArray(array: number[] | TypedArray, offset?: number): Quaternion; + /** + * Set the components of a quat to the given values + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns this + */ + set(x: number, y: number, z: number, w: number): Quaternion; + /** + * Set this to the identity quaternion + * @returns this + */ + identity(): Quaternion; + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * @param a - the initial vector + * @param b - the destination vector + * @returns this + */ + rotationTo(a: Vector3, b: Vector3): Quaternion; + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local "right" direction + * @param up - the vector representing the local "up" direction + * @returns this + */ + setAxes(view: Vector3, right: Vector3, up: Vector3): Quaternion; + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns this + */ + setAxisAngle(axis: Vector3, rad: number): Quaternion; + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param out_axis - Vector receiving the axis of rotation + * @returns Angle, in radians, of the rotation + */ + getAxisAngle(out_axis: Vector3): number; + /** + * Adds two quat's + * @param q + * @returns this + */ + add(q: Quaternion): Quaternion; + /** + * Multiplies two quat's + * @param q + * @returns this + */ + multiply(q: Quaternion): Quaternion; + /** + * premultiply the quat + * @param q + * @returns this + */ + premultiply(q: Quaternion): Quaternion; + /** + * Scales a quat by a scalar number + * @param scale - the vector to scale + * @returns this + */ + scale(scale: Vector3): Quaternion; + /** + * Rotates a quaternion by the given angle about the X axis + * @param rad - angle (in radians) to rotate + * @returns this + */ + rotateX(rad: number): Quaternion; + /** + * Rotates a quaternion by the given angle about the Y axis + * @param rad - angle (in radians) to rotate + * @returns this + */ + rotateY(rad: number): Quaternion; + /** + * Rotates a quaternion by the given angle about the Z axis + * @param rad - angle (in radians) to rotate + * @returns this + */ + rotateZ(rad: number): Quaternion; + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @returns this + */ + calculateW(): Quaternion; + /** + * Calculates the dot product of two quat's + * @param q + * @returns dot product of two quat's + */ + dot(q: Quaternion): number; + /** + * Performs a linear interpolation between two quat's + * @param q + * @param t - interpolation amount between the two inputs + * @returns this + */ + lerp(q: Quaternion, t: number): Quaternion; + /** + * Performs a spherical linear interpolation between two quat + * @param q + * @param t - interpolation amount between the two inputs + * @returns this + */ + slerp(q: Quaternion, t: number): Quaternion; + /** + * Performs a spherical linear interpolation with two control points + * @param qa + * @param qb + * @param qc + * @param qd + * @param t - interpolation amount + * @returns this + */ + sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number): Quaternion; + /** + * Calculates the inverse of a quat + * @returns this + */ + invert(): Quaternion; + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @returns this + */ + conjugate(): Quaternion; + /** + * Calculates the length of a quat + * @returns length of this + */ + length(): number; + /** + * Calculates the squared length of a quat + * @returns squared length of this + */ + squaredLength(): number; + /** + * Normalize this + * @returns this + */ + normalize(): Quaternion; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @param m - rotation matrix + * @returns this + */ + fromMat3(m: Matrix3): Quaternion; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @param m - rotation matrix + * @returns this + */ + fromMat4(m: Matrix4): Quaternion; + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @param q + */ + exactEquals(q: Quaternion): boolean; + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @param q + */ + equals(q: Quaternion): boolean; + /** + * Creates a quaternion from the given euler. + * @param euler + * @param [notCallUpdate = false] - 是否需要调用onUpdate + * @returns this + */ + fromEuler(euler: Euler, notCallUpdate?: boolean): Quaternion; + /** + * X component + */ + x: number; + /** + * Y component + */ + y: number; + /** + * Z component + */ + z: number; + /** + * W component + */ + w: number; + /** + * Alias for {@link QuaternionNotifier#multiply} + * @param q + */ + mul(q: QuaternionNotifier): void; + /** + * Alias for {@link QuaternionNotifier#length} + */ + len(): void; + /** + * Alias for {@link QuaternionNotifier#squaredLength} + */ + sqrLen(): void; } /** @@ -4702,7 +5003,7 @@ interface Quaternion extends EventMixin { * @param [z = 0] - Z component * @param [w = 1] - W component */ -class Quaternion implements EventMixin { +class Quaternion { constructor(x?: number, y?: number, z?: number, w?: number); /** * 类名 @@ -4716,10 +5017,9 @@ class Quaternion implements EventMixin { /** * Copy the values from one quat to this * @param q - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - copy(q: Quaternion, dontFireEvent?: boolean): Quaternion; + copy(q: Quaternion): Quaternion; /** * Creates a new quat initialized with values from an existing quaternion * @returns a new quaternion @@ -4735,35 +5035,31 @@ class Quaternion implements EventMixin { * 从数组赋值 * @param array - 数组 * @param [offset = 0] - 数组偏移值 - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - fromArray(array: number[] | TypedArray, offset?: number, dontFireEvent?: boolean): Quaternion; + fromArray(array: number[] | TypedArray, offset?: number): Quaternion; /** * Set the components of a quat to the given values * @param x - X component * @param y - Y component * @param z - Z component * @param w - W component - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - set(x: number, y: number, z: number, w: number, dontFireEvent?: boolean): Quaternion; + set(x: number, y: number, z: number, w: number): Quaternion; /** * Set this to the identity quaternion - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - identity(dontFireEvent?: boolean): Quaternion; + identity(): Quaternion; /** * Sets a quaternion to represent the shortest rotation from one * vector to another. * @param a - the initial vector * @param b - the destination vector - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - rotationTo(a: Vector3, b: Vector3, dontFireEvent?: boolean): Quaternion; + rotationTo(a: Vector3, b: Vector3): Quaternion; /** * Sets the specified quaternion with values corresponding to the given * axes. Each axis is a vec3 and is expected to be unit length and @@ -4771,19 +5067,17 @@ class Quaternion implements EventMixin { * @param view - the vector representing the viewing direction * @param right - the vector representing the local "right" direction * @param up - the vector representing the local "up" direction - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - setAxes(view: Vector3, right: Vector3, up: Vector3, dontFireEvent?: boolean): Quaternion; + setAxes(view: Vector3, right: Vector3, up: Vector3): Quaternion; /** * Sets a quat from the given angle and rotation axis, * then returns it. * @param axis - the axis around which to rotate * @param rad - the angle in radians - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - setAxisAngle(axis: Vector3, rad: number, dontFireEvent?: boolean): Quaternion; + setAxisAngle(axis: Vector3, rad: number): Quaternion; /** * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with @@ -4800,60 +5094,52 @@ class Quaternion implements EventMixin { /** * Adds two quat's * @param q - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - add(q: Quaternion, dontFireEvent?: boolean): Quaternion; + add(q: Quaternion): Quaternion; /** * Multiplies two quat's * @param q - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - multiply(q: Quaternion, dontFireEvent?: boolean): Quaternion; + multiply(q: Quaternion): Quaternion; /** * premultiply the quat * @param q - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - premultiply(q: Quaternion, dontFireEvent?: boolean): Quaternion; + premultiply(q: Quaternion): Quaternion; /** * Scales a quat by a scalar number * @param scale - the vector to scale - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - scale(scale: Vector3, dontFireEvent?: boolean): Quaternion; + scale(scale: Vector3): Quaternion; /** * Rotates a quaternion by the given angle about the X axis * @param rad - angle (in radians) to rotate - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - rotateX(rad: number, dontFireEvent?: boolean): Quaternion; + rotateX(rad: number): Quaternion; /** * Rotates a quaternion by the given angle about the Y axis * @param rad - angle (in radians) to rotate - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - rotateY(rad: number, dontFireEvent?: boolean): Quaternion; + rotateY(rad: number): Quaternion; /** * Rotates a quaternion by the given angle about the Z axis * @param rad - angle (in radians) to rotate - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - rotateZ(rad: number, dontFireEvent?: boolean): Quaternion; + rotateZ(rad: number): Quaternion; /** * Calculates the W component of a quat from the X, Y, and Z components. * Assumes that quaternion is 1 unit in length. * Any existing W component will be ignored. - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - calculateW(dontFireEvent?: boolean): Quaternion; + calculateW(): Quaternion; /** * Calculates the dot product of two quat's * @param q @@ -4864,18 +5150,16 @@ class Quaternion implements EventMixin { * Performs a linear interpolation between two quat's * @param q * @param t - interpolation amount between the two inputs - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - lerp(q: Quaternion, t: number, dontFireEvent?: boolean): Quaternion; + lerp(q: Quaternion, t: number): Quaternion; /** * Performs a spherical linear interpolation between two quat * @param q * @param t - interpolation amount between the two inputs - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - slerp(q: Quaternion, t: number, dontFireEvent?: boolean): Quaternion; + slerp(q: Quaternion, t: number): Quaternion; /** * Performs a spherical linear interpolation with two control points * @param qa @@ -4883,23 +5167,20 @@ class Quaternion implements EventMixin { * @param qc * @param qd * @param t - interpolation amount - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number, dontFireEvent?: boolean): Quaternion; + sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number): Quaternion; /** * Calculates the inverse of a quat - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - invert(dontFireEvent?: boolean): Quaternion; + invert(): Quaternion; /** * Calculates the conjugate of a quat * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - conjugate(dontFireEvent?: boolean): Quaternion; + conjugate(): Quaternion; /** * Calculates the length of a quat * @returns length of this @@ -4912,30 +5193,27 @@ class Quaternion implements EventMixin { squaredLength(): number; /** * Normalize this - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - normalize(dontFireEvent?: boolean): Quaternion; + normalize(): Quaternion; /** * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure * to renormalize the quaternion yourself where necessary. * @param m - rotation matrix - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - fromMat3(m: Matrix3, dontFireEvent?: boolean): Quaternion; + fromMat3(m: Matrix3): Quaternion; /** * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure * to renormalize the quaternion yourself where necessary. * @param m - rotation matrix - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - fromMat4(m: Matrix4, dontFireEvent?: boolean): Quaternion; + fromMat4(m: Matrix4): Quaternion; /** * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) * @param q @@ -4949,10 +5227,9 @@ class Quaternion implements EventMixin { /** * Creates a quaternion from the given euler. * @param euler - * @param [dontFireEvent = false] - wether or not don`t fire change event. * @returns this */ - fromEuler(euler: Euler, dontFireEvent?: boolean): Quaternion; + fromEuler(euler: Euler): Quaternion; /** * X component */ @@ -4971,8 +5248,9 @@ class Quaternion implements EventMixin { w: number; /** * Alias for {@link Quaternion#multiply} + * @param q */ - mul(): void; + mul(q: Quaternion): void; /** * Alias for {@link Quaternion#length} */ @@ -5041,7 +5319,7 @@ class Plane { } /** - * 4x4 矩阵, 数据改变会发送事件 + * 4x4 矩阵,具有 onUpdate 回调 */ class Matrix4Notifier extends Matrix4 { /** @@ -5053,6 +5331,10 @@ class Matrix4Notifier extends Matrix4 { * 数据 */ elements: Float32Array; + /** + * 更新的回调 + */ + onUpdate(): void; } /** @@ -5376,10 +5658,10 @@ class Matrix4 { * @param q - quaternion * @param v - position * @param s - scale - * @param p - [pivot] + * @param [p] - pivot * @returns this */ - compose(q: Quaternion, v: Vector3, s: Vector3, p: Vector3): Matrix4; + compose(q: Quaternion, v: Vector3, s: Vector3, p?: Vector3): Matrix4; /** * decompose * @param q - quaternion @@ -5627,22 +5909,23 @@ class Frustum { intersectsSphere(sphere: Sphere): boolean; } -interface EulerNotifier extends EventMixin { -} - /** - * 欧拉角, 数据改变会发送事件 + * 欧拉角,具有 onUpdate 回调 * @param [x = 0] - 角度 X, 弧度制 * @param [y = 0] - 角度 Y, 弧度制 * @param [z = 0] - 角度 Z, 弧度制 */ -class EulerNotifier extends Euler implements EventMixin { +class EulerNotifier extends Euler { constructor(x?: number, y?: number, z?: number); /** * 类名 */ className: string; isEulerNotifier: boolean; + /** + * 更新的回调 + */ + onUpdate(): void; /** * 角度 X, 角度制 */ @@ -6319,6 +6602,11 @@ class Material { * 获取材质全部贴图 */ getTextures(): Texture[]; + /** + * 获取阴影材质,子类可重写 + * @param shadowMaterial - 通用阴影材质 + */ + getShadowMaterial(shadowMaterial: Material): Material; } /** @@ -6986,6 +7274,37 @@ class PointLight extends Light { className: string; } +/** + * @param params + * @param params.light + * @param params.renderer + * @param [params.cameraInfo] + * @param params.width + * @param params.height + * @param [params.debug] + */ +class LightShadow { + constructor(params: { + light: Light; + renderer: WebGLRenderer; + cameraInfo?: any; + width: number; + height: number; + debug?: boolean; + }); + isLightShadow: boolean; + className: string; + light: Light; + renderer: WebGLRenderer; + framebuffer: Framebuffer; + camera: Camera; + width: number; + height: number; + maxBias: number; + minBias: number; + cameraInfo: any; +} + /** * 光管理类 * @param [params] - 创建对象的属性参数。可包含此类的所有属性。 @@ -6994,6 +7313,10 @@ class LightManager { constructor(params?: any); isLightManager: boolean; className: string; + /** + * 是否开启阴影 + */ + shadowEnabled: boolean; ambientLights: AmbientLight[]; directionalLights: DirectionalLight[]; pointLights: PointLight[]; @@ -7046,6 +7369,24 @@ class LightManager { * 重置所有光源 */ reset(): void; + /** + * 获取阴影贴图数量 + * @param type + */ + getShadowMapCount(type: string): number; + /** + * 更新光源信息 + * @param renderer + * @param lights + * @param camera + */ + update(renderer: WebGLRenderer, lights: Light[], camera: Camera): void; + /** + * 生成阴影贴图 + * @param renderer + * @param camera + */ + createShadowMap(renderer: WebGLRenderer, camera: Camera): void; } /** @@ -7131,6 +7472,11 @@ class Light extends Node { * @param offset - 偏移值 */ toInfoArray(out: any[], offset: number): void; + /** + * 获取真正的颜色,光强度乘以颜色 + * @returns 光强度乘以颜色后的颜色 + */ + getRealColor(): Color; /** * 生成阴影贴图,支持阴影的子类需要重写 * @param renderer @@ -7157,10 +7503,23 @@ class DirectionalLight extends Light { }); isDirectionalLight: boolean; className: string; + /** + * 光源阴影 + */ + lightShadow: LightShadow; /** * 光方向 */ direction: Vector3; + /** + * 获取世界空间方向 + */ + getWorldDirection(): Vector3; + /** + * 获取相机空间方向 + * @param camera + */ + getViewDirection(camera: Camera): Vector3; } /** @@ -8445,6 +8804,10 @@ class Node implements EventMixin { * update 回调 */ onUpdate: (...params: any[]) => any; + /** + * 只同步四元数,不同步欧拉角 + */ + onlySyncQuaternion: boolean; id: string; /** * 元素的up向量 @@ -8723,6 +9086,10 @@ class Node implements EventMixin { * 矩阵 version,每次改变会加一 */ readonly matrixVersion: number; + /** + * 世界矩阵 version,每次改变会加一 + */ + worldMatrixVersion: number; /** * 获取元素的包围盒信息 * @param [parent] - 元素相对于哪个祖先元素的包围盒,不传表示世界