@realsee/five 5.0.0-alpha.16 → 5.0.0-alpha.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -11
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/{images/icons.png → icons.png} +0 -0
- package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1414 -0
- package/docs/assets/{images/widgets.png → widgets.png} +0 -0
- package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
- package/docs/classes/five.AnimationFrameLoop.html +15 -0
- package/docs/classes/five.BVH.html +10 -0
- package/docs/classes/five.BVHIntersect.html +1 -0
- package/docs/classes/five.BVHNode.html +7 -0
- package/docs/classes/five.BVHVector3.html +1 -0
- package/docs/classes/five.Camera.html +11 -0
- package/docs/classes/five.Clipper.html +1 -0
- package/docs/classes/five.Five.html +338 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -0
- package/docs/classes/five.IntersectMesh.html +1 -0
- package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
- package/docs/classes/five.Model.html +87 -0
- package/docs/classes/five.NetworkSubscribe.html +50 -0
- package/docs/classes/five.PBMContainer.html +17 -0
- package/docs/classes/five.PBMGroup.html +19 -0
- package/docs/classes/five.PBMMaterial.html +27 -0
- package/docs/classes/five.PBMMesh.html +7 -0
- package/docs/classes/five.PanoCircleMesh.html +7 -0
- package/docs/classes/five.PanoCircleMeshDark.html +8 -0
- package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
- package/docs/classes/five.Scene.html +3 -0
- package/docs/classes/five.Subscribe.html +56 -0
- package/docs/classes/five.TextureLoader.html +1 -0
- package/docs/classes/five.Tile3D.html +34 -0
- package/docs/classes/five.Tile3DModel.html +15 -0
- package/docs/classes/five.TileBoundingSphere.html +1 -0
- package/docs/classes/five.TileCacheNode.html +1 -0
- package/docs/classes/five.TileCubeTextureTarget.html +1 -0
- package/docs/classes/five.TileCullingVolume.html +1 -0
- package/docs/classes/five.TileOrientedBoundingBox.html +1 -0
- package/docs/classes/five.TilePlane.html +1 -0
- package/docs/classes/five.TileRequestScheduler.html +16 -0
- package/docs/classes/five.Tileset3D.html +11 -0
- package/docs/classes/five.Tileset3DTraverser.html +1 -0
- package/docs/classes/five.TilesetCache.html +1 -0
- package/docs/classes/five.Work.html +30 -0
- package/docs/classes/five.XRButton.html +1 -0
- package/docs/classes/gltf_loader.DDSLoader.html +1 -0
- package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
- package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
- package/docs/classes/gltf_loader.GLTFObject.html +7 -0
- package/docs/classes/gltf_loader.GLTFParser.html +1 -0
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
- package/docs/classes/line.Line.html +1 -0
- package/docs/classes/line.LineGeometry.html +1 -0
- package/docs/classes/line.LineMaterial.html +1 -0
- package/docs/classes/line.LineSegmentsGeometry.html +1 -0
- package/docs/classes/line.THREE_Line2.html +1 -0
- package/docs/classes/line.THREE_LineSegments2.html +1 -0
- package/docs/classes/react.Store.html +29 -0
- package/docs/classes/server.BVH.html +10 -0
- package/docs/classes/server.BVHIntersect.html +1 -0
- package/docs/classes/server.BVHNode.html +7 -0
- package/docs/classes/server.BVHVector3.html +1 -0
- package/docs/classes/server.Model.html +63 -0
- package/docs/classes/server.PBMGroup.html +9 -0
- package/docs/classes/server.PBMMesh.html +7 -0
- package/docs/classes/sticker.Sticker.html +32 -0
- package/docs/classes/vfx.Airflow.html +1 -0
- package/docs/classes/vfx.Flame.html +1 -0
- package/docs/classes/vfx.Particle.html +89 -0
- package/docs/classes/vfx.SpotLight.html +1 -0
- package/docs/index.html +166 -434
- package/docs/interfaces/five.AddableObject.html +1 -0
- package/docs/interfaces/five.AnimationFrame.html +1 -0
- package/docs/interfaces/five.CameraPose.html +1 -0
- package/docs/interfaces/five.ClipperParameter.html +1 -0
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
- package/docs/interfaces/five.EventCallback.html +400 -0
- package/docs/interfaces/five.FiveInitArgs.html +109 -0
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -0
- package/docs/interfaces/five.ImageOptions.html +18 -0
- package/docs/interfaces/five.ImageURLMappings.html +1 -0
- package/docs/interfaces/five.ImageURLOptions.html +17 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
- package/docs/interfaces/five.Intersection.html +7 -0
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/five.ModelEventCallback.html +22 -0
- package/docs/interfaces/five.MotionKeyframe.html +1 -0
- package/docs/interfaces/five.MovePanoOptions.html +42 -0
- package/docs/interfaces/five.NetworkOptions.html +9 -0
- package/docs/interfaces/five.PBMPanoPicture.html +7 -0
- package/docs/interfaces/five.PBMParameters.html +27 -0
- package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +35 -0
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/five.Pose.html +37 -0
- package/docs/interfaces/five.Scissor.html +14 -0
- package/docs/interfaces/five.State.html +21 -0
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
- package/docs/interfaces/five.TextureOptions.html +20 -0
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
- package/docs/interfaces/five.TileBoundingVolume.html +19 -0
- package/docs/interfaces/five.TileContent.html +1 -0
- package/docs/interfaces/five.TileCubeNode.html +1 -0
- package/docs/interfaces/five.TileCubeTree.html +1 -0
- package/docs/interfaces/five.Tileset3dOptions.html +1 -0
- package/docs/interfaces/five.TilesetJSON.html +1 -0
- package/docs/interfaces/five.TilesetJSONNode.html +1 -0
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -0
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +31 -0
- package/docs/interfaces/five.WebXRSelectParams.html +1 -0
- package/docs/interfaces/five.WorkCubeImage.html +13 -0
- package/docs/interfaces/five.WorkImage.html +21 -0
- package/docs/interfaces/five.WorkInitial.html +13 -0
- package/docs/interfaces/five.WorkModel.html +11 -0
- package/docs/interfaces/five.WorkModelTiles.html +3 -0
- package/docs/interfaces/five.WorkObserver.html +25 -0
- package/docs/interfaces/five.WorkTile.html +1 -0
- package/docs/interfaces/five.WorkVideo.html +9 -0
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +31 -0
- package/docs/interfaces/gltf_loader.DDS.html +1 -0
- package/docs/interfaces/gltf_loader.GLTF.html +7 -0
- package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
- package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
- package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
- package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
- package/docs/interfaces/server.Intersection.html +7 -0
- package/docs/interfaces/server.ModelEventCallback.html +18 -0
- package/docs/interfaces/sticker.IntersectionLike.html +8 -0
- package/docs/interfaces/vfx.ParticleArgs.html +75 -0
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
- package/docs/modules/five.SubscribeMixinType.html +1 -0
- package/docs/modules/five.html +479 -3002
- package/docs/modules/gltf_loader.html +1 -155
- package/docs/modules/line.html +1 -202
- package/docs/modules/react.html +133 -1507
- package/docs/modules/server.html +18 -526
- package/docs/modules/sticker.html +1 -151
- package/docs/modules/vfx.html +1 -0
- package/docs/modules/vue.html +112 -0
- package/docs/modules.html +1 -136
- package/exporters/staticify.js +210 -0
- package/five/index.d.ts +1445 -264
- package/five/index.js +372 -1
- package/gltf-loader/index.d.ts +90 -5
- package/gltf-loader/index.js +260 -1
- package/line/index.d.ts +15 -2
- package/line/index.js +260 -1
- package/package.json +13 -13
- package/react/index.d.ts +75 -22
- package/react/index.js +260 -1
- package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
- package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
- package/resource/{draco_decoder.js → gltf/draco_decoder.js} +0 -0
- package/resource/{draco_decoder.wasm → gltf/draco_decoder.wasm} +0 -0
- package/resource/{draco_wasm_wrapper.js → gltf/draco_wasm_wrapper.js} +0 -0
- package/scripts/five-staticify.js +26 -0
- package/server/index.d.ts +197 -26
- package/server/index.js +367 -1
- package/sticker/index.d.ts +2 -1
- package/sticker/index.js +260 -1
- package/templates/quick-start/README.md +1 -1
- package/templates/quick-start/package.json +1 -1
- package/umd/five-gltf-loader.js +1 -0
- package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
- package/umd/five-line.js +1 -0
- package/umd/five-line.js.LICENSE.txt +14 -0
- package/umd/five-react.js +1 -0
- package/umd/five-react.js.LICENSE.txt +14 -0
- package/umd/five-sticker.js +1 -0
- package/umd/five-sticker.js.LICENSE.txt +14 -0
- package/umd/five-vfx.js +1 -0
- package/umd/five-vue.js +1 -0
- package/umd/five.js +2 -0
- package/umd/five.js.LICENSE.txt +107 -0
- package/vfx/index.d.ts +264 -0
- package/vfx/index.js +260 -0
- package/vue/index.d.ts +440 -0
- package/vue/index.js +260 -0
- package/bundles/five.js +0 -2
- package/bundles/five.js.LICENSE.txt +0 -160
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/five.camera.html +0 -323
- package/docs/classes/five.five-1.html +0 -2670
- package/docs/classes/five.hashcubetexture.html +0 -252
- package/docs/classes/five.internalwebglrenderer.html +0 -212
- package/docs/classes/five.model.html +0 -982
- package/docs/classes/five.pbmgroup.html +0 -427
- package/docs/classes/five.pbmmaterial.html +0 -533
- package/docs/classes/five.pbmmesh.html +0 -254
- package/docs/classes/five.scene.html +0 -263
- package/docs/classes/five.subscribe.html +0 -569
- package/docs/classes/gltf_loader.gltfloader.html +0 -412
- package/docs/classes/gltf_loader.gltfobject.html +0 -287
- package/docs/classes/line.line-1.html +0 -381
- package/docs/classes/line.linegeometry.html +0 -524
- package/docs/classes/line.linematerial.html +0 -300
- package/docs/classes/line.linesegmentsgeometry.html +0 -471
- package/docs/classes/react.store.html +0 -605
- package/docs/classes/server.model.html +0 -823
- package/docs/classes/server.pbmgroup.html +0 -366
- package/docs/classes/server.pbmmesh.html +0 -335
- package/docs/classes/sticker.sticker-1.html +0 -465
- package/docs/interfaces/five.addableobject.html +0 -234
- package/docs/interfaces/five.depthpanoramacontrollercustominitargs.html +0 -420
- package/docs/interfaces/five.eventcallback.html +0 -2548
- package/docs/interfaces/five.fiveinitargs.html +0 -707
- package/docs/interfaces/five.floorplancontrollercustominitargs.html +0 -295
- package/docs/interfaces/five.imageoptions.html +0 -332
- package/docs/interfaces/five.intersection.html +0 -227
- package/docs/interfaces/five.intersectmeshinterface.html +0 -188
- package/docs/interfaces/five.modelcontrollercustominitargs.html +0 -366
- package/docs/interfaces/five.modeleventcallback.html +0 -367
- package/docs/interfaces/five.movepanooptions.html +0 -469
- package/docs/interfaces/five.panocirclemeshinterface.html +0 -361
- package/docs/interfaces/five.panoramacontrollercustominitargs.html +0 -464
- package/docs/interfaces/five.panoramalikecontrollercustominitargs.html +0 -364
- package/docs/interfaces/five.pbmparameters.html +0 -474
- package/docs/interfaces/five.pose.html +0 -270
- package/docs/interfaces/five.scissor.html +0 -252
- package/docs/interfaces/five.state.html +0 -300
- package/docs/interfaces/five.subscribemixintype.emit.html +0 -180
- package/docs/interfaces/five.subscribemixintype.haslistener.html +0 -171
- package/docs/interfaces/five.subscribemixintype.off.html +0 -198
- package/docs/interfaces/five.subscribemixintype.on.html +0 -213
- package/docs/interfaces/five.subscribemixintype.once.html +0 -210
- package/docs/interfaces/five.topviewcontrollercustominitargs.html +0 -226
- package/docs/interfaces/five.vrpanoramacontrollercustominitargs.html +0 -452
- package/docs/interfaces/gltf_loader.gltf.html +0 -304
- package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -580
- package/docs/interfaces/react.fiveinjectiontypes.html +0 -1625
- package/docs/interfaces/react.injectfivetoprops.html +0 -280
- package/docs/interfaces/server.intersection.html +0 -308
- package/docs/interfaces/server.modeleventcallback.html +0 -409
- package/docs/interfaces/sticker.intersectionlike.html +0 -223
- package/docs/modules/five.subscribemixintype.html +0 -143
- package/five.js.LICENSE.txt +0 -160
- package/scripts/export-five-resource/chfs.exe +0 -0
- package/scripts/export-five-resource/fileify.js +0 -192
- package/scripts/export-five-resource/format-work.js +0 -71
- package/scripts/export-five-resource/staticify.js +0 -327
- package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
- package/scripts/transcode-model/LoaderSupport.js +0 -1545
- package/scripts/transcode-model/MTLLoader.js +0 -602
- package/scripts/transcode-model/OBJLoader2.js +0 -1470
- package/scripts/transcode-model/obj2pbm.js +0 -65
package/umd/five-vfx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_VFX=t():e.FiveSDK_VFX=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Airflow:()=>b,Flame:()=>v,Particle:()=>T,SpotLight:()=>h});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;for(var o=n(438),r="\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform float uOpacity;\n\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float alpha = 1.0;\n float gradient = mix(0.0, 1.0, -vPosition.y + 1.75);\n if(vNoise > 0.3 * gradient) {\n alpha = 0.0;\n }\n float mask = mix(0.3, 1.0, -vPosition.y + 0.5);\n alpha = clamp(alpha * (mask * 10.0), 0.0, 1.0);\n vec3 color = mix(uColor1, uColor2, -vPosition.y + 0.5);\n color.g = color.g * (1.0 + gradient * vNoise);\n gl_FragColor = vec4(color, alpha * uOpacity);\n}\n",a="\n// Simplex 4D Noise\n// by Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x) {\n return mod((x * 34.0 + 1.0) * x, 289.0);\n}\nfloat permute(float x) {\n return floor( mod((x * 34.0 + 1.0) * x, 289.0) );\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\nfloat simplexNoise(vec4 v) {\n const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4\n 0.309016994374947451); // (sqrt(5) - 1)/4 F4\n // First corner\n vec4 i = floor(v + dot(v, C.yyyy) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C\n vec4 x1 = x0 - i1 + 1.0 * C.xxxx;\n vec4 x2 = x0 - i2 + 2.0 * C.xxxx;\n vec4 x3 = x0 - i3 + 3.0 * C.xxxx;\n vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;\n\n // Permutations\n i = mod(i, 289.0);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients\n // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n",s="\nfloat scale(float value, float fromMin, float fromMax, float toMin, float toMax) {\n return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);\n}\n",l="\nuniform float uTime;\nuniform float uNoise;\nuniform float uSpeed;\n\nvarying vec3 vPosition;\nvarying float vNoise;\n\n".concat(a,"\n").concat(s,"\n\nfloat fbm(vec4 x) {\n float v = 0.0;\n float a = 0.5;\n vec4 shift = vec4(100.0);\n #pragma unroll_loop_start\n for ( int i = 0; i < FRAGMENTATION_DEGREE; i ++ ) {\n v += a * simplexNoise(x);\n x = x * 2.0 + shift;\n a *= 0.5;\n }\n #pragma unroll_loop_end\n return v;\n}\n\nvoid main() {\n vPosition = position;\n vNoise = fbm(vec4((position / uNoise) - vec3(0.0, uTime * uSpeed, 0.0), 0.0));\n vNoise = scale(vNoise, -1.0, 1.0, 0.0, 1.0);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);\n}\n"),u=new o.SphereBufferGeometry(1,300,300),c=[],d=0;d<2;d++)c.push(new o.Vector2(Math.sin(d)/2+1,2*d-.8));var p=new o.LatheBufferGeometry(c,300),v=function(e){function n(t){var n,i=e.call(this)||this;i.needsRender=!0,n=t instanceof o.BufferGeometry?t:"ring"===t?p:u,i.uniforms={uTime:{value:0},uColor1:{value:new o.Color("rgb(255, 177, 20)")},uColor2:{value:new o.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},i.defines={FRAGMENTATION_DEGREE:2};var a=new o.Mesh(n,new o.ShaderMaterial({uniforms:i.uniforms,defines:i.defines,vertexShader:l,fragmentShader:r,transparent:!0,depthWrite:!1,side:o.BackSide})),s=new o.Mesh(n,new o.ShaderMaterial({uniforms:i.uniforms,defines:i.defines,vertexShader:l,fragmentShader:r,transparent:!0,depthWrite:!1,side:o.FrontSide}));return a.scale.setScalar(.1),s.scale.setScalar(.1),i.add(a),i.add(s),i}return t(n,e),n.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse((function(e){e instanceof o.Mesh&&e.material instanceof o.ShaderMaterial&&(e.material.needsUpdate=!0)})),this.needsRender=!0},enumerable:!1,configurable:!0}),n}(o.Group),f="\n\nuniform float uTime;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\n".concat(a,"\n").concat(s,"\n\nvoid main(){\n\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vNoise = simplexNoise(vec4(position - vec3(0.0, uTime * 0.4, 0.0), 0));\n vNoise = scale(vNoise, -1.0, 1.0, 0.5, 1.0);\n\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"),h=function(e){function n(t,n,i){void 0===t&&(t=1),void 0===n&&(n=.1),void 0===i&&(i=.2);var r=e.call(this)||this;r.needsRender=!0,r.uniforms={uTime:{value:0},uAttenuation:{value:.9*t},uAnglePower:{value:2},uSpotPosition:{value:r.position},uLightColor:{value:new o.Color(16777215)}};var a=new o.CylinderBufferGeometry(n,i,t,64,20,!0);a.applyMatrix4((new o.Matrix4).makeTranslation(0,-t/2,0)),a.applyMatrix4((new o.Matrix4).makeRotationX(-Math.PI/2));var s=new o.Mesh(a,new o.ShaderMaterial({uniforms:r.uniforms,vertexShader:f,fragmentShader:"\nuniform vec3 uLightColor;\nuniform vec3 uSpotPosition;\nuniform float uAttenuation;\nuniform float uAnglePower;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\nvoid main() {\n float intensity;\n intensity\t= distance(vWorldPosition, uSpotPosition) / uAttenuation;\n intensity\t= 1.0 - clamp(intensity, 0.1, 1.0);\n\n vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );\n intensity\t= intensity * angleIntensity * vNoise;\n gl_FragColor = vec4( uLightColor, intensity );\n}\n",transparent:!0,side:o.FrontSide,depthWrite:!1}));return r.add(s),r}return t(n,e),n.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(o.Group),m="\nuniform vec3 uColor;\nuniform float uOpacity;\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);\n gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);\n}\n",y="\n\nuniform float uTime;\nuniform float uSpeed;\nuniform float uScale;\nuniform float uExpand;\nvarying float vNoise;\nvarying vec3 vPosition;\n\n".concat(a,"\n").concat(s,"\n\nvoid main(){\n\n vPosition = position;\n vNoise = simplexNoise(vec4(position.x * uScale, position.y + uTime * uSpeed, 0.0, 0.0));\n vNoise = scale(vNoise, 0.0, 1.0, 0.5, 1.0);\n\n vec4 transformed = vec4( position, 1.0 );\n transformed.x = transformed.x * scale(abs(transformed.y), 0.0, 1.0, 1.0, uExpand);\n\n gl_Position\t= projectionMatrix * modelViewMatrix * transformed;\n}\n"),g=new o.PlaneBufferGeometry(1,1,200,200);g.translate(0,-.5,0);var b=function(e){function n(){var t=e.call(this)||this;t.needsRender=!0;var n=t.outer=new o.Mesh(g,new o.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new o.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:y,fragmentShader:m,transparent:!0,side:o.DoubleSide,depthWrite:!1})),i=t.inner=new o.Mesh(g,new o.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new o.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:y,fragmentShader:m,transparent:!0,side:o.DoubleSide,depthWrite:!1}));return n.rotateX(-Math.PI/2),i.rotateX(-Math.PI/2),t.add(n),t.add(i),t}return t(n,e),n.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(n.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(o.Group);function x(e,t){return e+t*(Math.random()-.5)}function w(e,t){var n=new o.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return(new o.Vector3).addVectors(e,(new o.Vector3).multiplyVectors(t,n))}function S(e,t,n){return e*n+t*n*n/2}function A(e,t){for(var n=e.times.length,i=0;i<n&&t>e.times[i];)i++;if(0==i)return e.values[0];if(i==n)return e.values[n-1];var o=(t-e.times[i-1])/(e.times[i]-e.times[i-1]),r=e.values[i-1],a=e.values[i];return"number"==typeof e.values[0]?r+o*(a-r):r.clone().lerp(a,o)}var P=function(){function e(e,t,n,i,o,r,a,s,l,u,c,d,p,v){this.birthTime=e,this.deathAge=t,this.position=n.clone(),this.velocity=i.clone(),this.acceleration=o.clone(),this.angle=r,this.angleVelocity=a,this.angleAcceleration=s,this.color=l,this.colorTween=u,this.size=c,this.sizeTween=d,this.opacity=p,this.opacityTween=v}return e.prototype.getAlive=function(e){return this.deathAge>e-this.birthTime},e.prototype.getState=function(e){var t=this.getAlive(e),n=Math.min(this.deathAge,e-this.birthTime),i=function(e,t,n){return new o.Vector3(S(e.x,t.x,n),S(e.y,t.y,n),S(e.z,t.z,n))}(this.velocity,this.acceleration,n).add(this.position),r=S(this.angleVelocity,this.angleAcceleration,n)+this.angle,a=(this.sizeTween?A(this.sizeTween,n):0)+this.size,s=(this.colorTween?A(this.colorTween,n):new o.Vector3).add(this.color);return{alive:t,age:n,position:i,angle:r,size:a,color:(new o.Color).setHSL(s.x,s.y,s.z),opacity:(this.opacityTween?A(this.opacityTween,n):0)+this.opacity}},e}(),T=function(e){function n(t){var n,i,r,a,s,l,u,c,d,p,v,f,h,m,y,g,b,x,w,S,A,P,T,M,C,B,z,E,N,_,j,O,V,R,F,U,D,I,G=this,X=new o.BufferGeometry;X.setAttribute("position",new o.BufferAttribute(new Float32Array,3)),X.setAttribute("alive",new o.BufferAttribute(new Float32Array,1)),X.setAttribute("color",new o.BufferAttribute(new Float32Array,3)),X.setAttribute("opacity",new o.BufferAttribute(new Float32Array,1)),X.setAttribute("size",new o.BufferAttribute(new Float32Array,1)),X.setAttribute("angle",new o.BufferAttribute(new Float32Array,1));var L=new o.ShaderMaterial({uniforms:{map:{value:null!==(n=t.texture)&&void 0!==n?n:null}},defines:{USE_MAP:!!t.texture},vertexShader:"\nattribute vec3 color;\nattribute float opacity;\nattribute float size;\nattribute float alive; // float used as boolean (0 = false, 1 = true)\n\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n attribute float angle;\n varying float vAngle;\n#endif\n\nvoid main() {\n if (alive > 0.5) {\n vColor = vec4(color, opacity);\n } else {\n vColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n #if defined(USE_MAP)\n vAngle = angle;\n #endif\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n varying float vAngle;\n#endif\n\nvoid main() {\n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // rotate UV coordinates to rotate texture\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n vec4 rotatedTexture = texture2D(map, rotatedUV);\n gl_FragColor = vColor * rotatedTexture;\n #endif\n}\n",transparent:!0,blending:null!==(i=t.blending)&&void 0!==i?i:o.NormalBlending,depthWrite:!1});return(G=e.call(this,X,L)||this).instances=[],G.needsRender=!0,G.birthTime=Date.now()/1e3,G.disposed=!1,G.paused=!1,G.positionBase=null!==(a=null===(r=t.positionBase)||void 0===r?void 0:r.clone())&&void 0!==a?a:new o.Vector3,G.positionStyle=null!==(s=t.positionStyle)&&void 0!==s?s:"CUBE",G.positionCubeSpread=null!==(u=null===(l=t.positionCubeSpread)||void 0===l?void 0:l.clone())&&void 0!==u?u:new o.Vector3,G.positionSphereSpread=null!==(c=t.positionSphereSpread)&&void 0!==c?c:0,G.velocityStyle=null!==(d=t.velocityStyle)&&void 0!==d?d:"CUBE",G.velocityCubeBase=null!==(v=null===(p=t.velocityCubeBase)||void 0===p?void 0:p.clone())&&void 0!==v?v:new o.Vector3,G.velocityCubeSpread=null!==(h=null===(f=t.velocityCubeSpread)||void 0===f?void 0:f.clone())&&void 0!==h?h:new o.Vector3,G.velocitySphereBase=null!==(m=t.velocitySphereBase)&&void 0!==m?m:0,G.velocitySphereSpread=null!==(y=t.velocitySphereSpread)&&void 0!==y?y:0,G.accelerationBase=null!==(b=null===(g=t.accelerationBase)||void 0===g?void 0:g.clone())&&void 0!==b?b:new o.Vector3,G.accelerationSpread=null!==(w=null===(x=t.accelerationSpread)||void 0===x?void 0:x.clone())&&void 0!==w?w:new o.Vector3,G.angleBase=null!==(S=t.angleBase)&&void 0!==S?S:0,G.angleSpread=null!==(A=t.angleSpread)&&void 0!==A?A:0,G.angleVelocityBase=null!==(P=t.angleVelocityBase)&&void 0!==P?P:0,G.angleVelocitySpread=null!==(T=t.angleVelocitySpread)&&void 0!==T?T:0,G.angleAccelerationBase=null!==(M=t.angleAccelerationBase)&&void 0!==M?M:0,G.angleAccelerationSpread=null!==(C=t.angleAccelerationSpread)&&void 0!==C?C:0,G.sizeBase=null!==(B=t.sizeBase)&&void 0!==B?B:.1,G.sizeSpread=null!==(z=t.sizeSpread)&&void 0!==z?z:0,G.sizeTween=null!==(E=t.sizeTween)&&void 0!==E?E:null,G.colorBase=null!==(_=null===(N=t.colorBase)||void 0===N?void 0:N.clone())&&void 0!==_?_:new o.Vector3,G.colorSpread=null!==(O=null===(j=t.colorSpread)||void 0===j?void 0:j.clone())&&void 0!==O?O:new o.Vector3,G.colorTween=null!==(V=t.colorTween)&&void 0!==V?V:null,G.opacityBase=(null!==(R=t.opacityBase)&&void 0!==R?R:t.opacityTween)?0:1,G.opacitySpread=null!==(F=t.opacitySpread)&&void 0!==F?F:0,G.opacityTween=null!==(U=t.opacityTween)&&void 0!==U?U:null,G.particlesPerSecond=null!==(D=t.particlesPerSecond)&&void 0!==D?D:60,G.particleDeathAge=null!==(I=t.particleDeathAge)&&void 0!==I?I:1,G}return t(n,e),Object.defineProperty(n.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,null===e?!1!==this.material.defines.USE_MAP&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):!0!==this.material.defines.USE_MAP&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),n.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":t=w(this.positionBase,this.positionCubeSpread);break;case"SPHERE":var n=2*Math.random()-1,i=2*Math.PI*Math.random(),r=Math.sqrt(1-n*n),a=new o.Vector3(r*Math.cos(i),r*Math.sin(i),n);t=(new o.Vector3).addVectors(this.positionBase,a.multiplyScalar(this.positionSphereSpread))}var s=new o.Vector3;switch(this.velocityStyle){case"CUBE":s=w(this.velocityCubeBase,this.velocityCubeSpread);break;case"SPHERE":var l=(new o.Vector3).subVectors(t,this.positionBase),u=x(this.velocitySphereBase,this.velocitySphereSpread);s=l.normalize().multiplyScalar(u)}return new P(e,this.particleDeathAge,t,s,w(this.accelerationBase,this.accelerationSpread),x(this.angleBase,this.angleSpread),x(this.angleVelocityBase,this.angleVelocitySpread),x(this.angleAccelerationBase,this.angleAccelerationSpread),w(this.colorBase,this.colorSpread),this.colorTween,x(this.sizeBase,this.sizeSpread),this.sizeTween,x(this.opacityBase,this.opacitySpread),this.opacityTween)},n.prototype.pause=function(){!0!==this.paused&&(this.paused=!0,this.birthTime=Date.now()/1e3)},n.prototype.play=function(){!1!==this.paused&&(this.paused=!1,this.birthTime=Date.now()/1e3)},n.prototype.setTime=function(e){if(!this.disposed){var t,n=(e/=1e3)-this.birthTime,i=Math.ceil(this.particlesPerSecond*this.particleDeathAge);this.geometry.attributes.position.count<i&&((c=new Float32Array(3*i)).set(this.geometry.attributes.position.array,0),(t=new o.BufferAttribute(c,3)).needsUpdate=!0,this.geometry.setAttribute("position",t)),this.geometry.attributes.alive.count<i&&((d=new Float32Array(i)).set(this.geometry.attributes.alive.array,0),(t=new o.BufferAttribute(d,1)).needsUpdate=!0,this.geometry.setAttribute("alive",t)),this.geometry.attributes.color.count<i&&((p=new Float32Array(3*i)).set(this.geometry.attributes.color.array,0),(t=new o.BufferAttribute(p,3)).needsUpdate=!0,this.geometry.setAttribute("color",t)),this.geometry.attributes.opacity.count<i&&((v=new Float32Array(i)).set(this.geometry.attributes.opacity.array,0),(t=new o.BufferAttribute(v,1)).needsUpdate=!0,this.geometry.setAttribute("opacity",t)),this.geometry.attributes.size.count<i&&((f=new Float32Array(i)).set(this.geometry.attributes.size.array,0),(t=new o.BufferAttribute(f,1)).needsUpdate=!0,this.geometry.setAttribute("size",t)),this.geometry.attributes.angle.count<i&&((h=new Float32Array(i)).set(this.geometry.attributes.angle.array,0),(t=new o.BufferAttribute(h,1)).needsUpdate=!0,this.geometry.setAttribute("angle",t)),this.instances.length<i&&(this.instances.length=i);for(var r=0;r<this.instances.length;r++){var a=this.instances[r];if(r<i&&!1===this.paused&&(void 0===a||!1===a.getAlive(e))){var s=this.particleDeathAge/i*r;if(n>s){var l=e-(n-s)%this.particleDeathAge;this.instances[r]=a=this.createInstance(l)}}if(a){var u=a.getState(e),c=u.position,d=u.alive,p=u.color,v=u.opacity,f=u.size,h=u.angle;this.geometry.attributes.position.setXYZ(r,c.x,c.y,c.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(r,d?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(r,p.r,p.g,p.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(r,v),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(r,f),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(r,h),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new o.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},n.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),null===(e=this.texture)||void 0===e||e.dispose(),this.material.dispose()},n}(o.Points)})(),i})()));
|
package/umd/five-vue.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.FiveSDK_Vue=n():e.FiveSDK_Vue=n()}(self,(()=>(()=>{var e={348:e=>{if(!("FiveSDK"in window))throw new Error('"FiveSDK" is not available. Please include "five" in your HTML.');e.exports=window.FiveSDK},438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const n=Number(THREE.REVISION);if(n<115||n>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE},928:e=>{if(!("Vue"in window))throw new Error('"Vue" is not available. Please include "vue" in your HTML.');e.exports=window.Vue}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=(e,n)=>{for(var t in n)o.o(n,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};return(()=>{"use strict";o.r(t),o.d(t,{FiveCanvas:()=>l,FiveProvider:()=>s,unsafe__useFiveInject:()=>U,useFiveAction:()=>g,useFiveCameraDirection:()=>R,useFiveCameraRaycaster:()=>S,useFiveCurrentObserver:()=>h,useFiveCurrentState:()=>w,useFiveEventCallback:()=>m,useFiveFloor:()=>O,useFiveHelper:()=>B,useFiveModel:()=>T,useFiveModelBounding:()=>L,useFiveModelIntersectRaycaster:()=>j,useFiveModelReadyState:()=>x,useFiveProject2d:()=>y,useFiveScene:()=>V,useFiveState:()=>p,useFiveWork:()=>v});var e=function(){return e=Object.assign||function(e){for(var n,o=1,t=arguments.length;o<t;o++)for(var r in n=arguments[o])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},e.apply(this,arguments)};Object.create,Object.create;var n=o(928),r=!1,i=Symbol();function u(){var e=(0,n.inject)(i);if(!e)throw new Error("Inject five error!");return e}var a={display:"inline-block",overflow:"hidden"},l=(0,n.defineComponent)({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(o){var t=(0,n.toRef)(o,"width"),r=(0,n.toRef)(o,"height"),i=u(),l=(0,n.ref)(null);return(0,n.watch)([t,r,l],(function(){if(i.renderer&&l.value){if(null!==i.renderer.domElement.parentNode&&i.renderer.domElement.parentNode!==l.value)throw new Error("There are more than 2 fiveCanvas in this context.");i.renderer.domElement.parentNode!==l.value&&l.value.appendChild(i.renderer.domElement),i.camera.aspect=t.value/r.value,i.camera.updateProjectionMatrix(),i.renderer.setSize(t.value,r.value),i.needsRender=!0}})),function(){return(0,n.h)("div",{id:"five",style:e({width:"".concat(t.value,"px"),height:"".concat(r.value,"px")},a),ref:l})}}}),f=o(348),c=o(438),d=[],s=(0,n.defineComponent)({props:{work:Object,initialWork:Object,initialState:Object,initialUserAction:Boolean,onWorkChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(o){var t,u,a=(0,n.toRefs)(o).work,l=function(e){var n=void 0===e?{}:e,o=n.backgroundColor,t=void 0===o?1579548:o,r=n.backgroundAlpha,i=void 0===r?1:r,u=n.pixelRatio,a=void 0===u?1:u;if("undefined"!=typeof window){var l=d.shift();return l||((l=new c.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=c.sRGBEncoding),l.setPixelRatio(a),l.setClearColor(t,i),l.autoClear=!0,l}}({pixelRatio:1===(0,f.getViewportScale)()?window.devicePixelRatio:1}),s=new f.Five(e({renderer:l},o.fiveInitArgs));return(o.work||o.initialWork)&&s.load(o.work||o.initialWork,o.initialState,void 0,null===(t=o.initialUserAction)||void 0===t||t),u=!!o.work,r=u,a&&(0,n.watch)(a,(function(e,n){e&&e!==(null==s?void 0:s.work)&&(null==s||s.load(e,o.initialState))})),(0,n.onBeforeUnmount)((function(){s&&(s.dispose(),function(e){e&&-1===d.indexOf(e)&&d.push(e)}(s.renderer))})),s.on("load",(function(){o.onWorkChange&&s.work&&o.onWorkChange(null==s?void 0:s.work)})),s.on("stateChange",(function(e,n){o.onStateChange&&o.onStateChange(e,n)})),s.on("currentStateChange",(function(e,n){o.onCurrentStateChange&&o.onCurrentStateChange(e,n)})),s.on("error",(function(e){o.onError?o.onError(e):console.warn(e.message)})),(0,n.provide)(i,s),{five:(0,n.shallowReadonly)(s)}},render:function(){return(0,n.h)("div",{style:this.$props.style},this.$slots)}});function v(){var e=u(),o=(0,n.ref)(e.work),t=(0,n.readonly)(o),i=e.on("load",(function(){o.value=e.work}));return(0,n.onBeforeUnmount)((function(){i()})),[t,function(n,o,t,i){if(r)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(n,o,t,i)}]}function p(){var o=u(),t=(0,n.ref)(e({},o.state)),r=o.on("stateChange",(function(n){Object.assign(t.value,e({},n))}));return(0,n.onBeforeUnmount)((function(){r()})),[t,function(e,n,t){void 0===n&&(n=!1),void 0===t&&(t=!0);var r="function"==typeof e?e(o.getCurrentState()):e;o.setState(r,n,t)}]}function w(){var e=u(),o=(0,n.ref)(e.getCurrentState()),t=e.on("currentStateChange",(function(){Object.assign(o.value,e.getCurrentState())}));return(0,n.onBeforeUnmount)((function(){t()})),[o,function(n,o,t){var r="function"==typeof n?n(e.getCurrentState()):n;e.setState(r,o,t)}]}function h(){var e=u(),o=(0,n.reactive)(e.getCurrentState()),t=(0,n.ref)(e.work?e.work.observers[o.panoIndex]:null),r=e.on("currentStateChange",(function(){Object.assign(o,e.getCurrentState()),e.work&&(t.value=e.work.observers[o.panoIndex])}));return(0,n.onBeforeUnmount)((function(){r()})),t}function m(e,o){var t=u().on(e,o);(0,n.onBeforeUnmount)((function(){t()}))}function g(){var e=u();return{updateCamera:function(n,o){return e.updateCamera(n,o)},initBasisLoader:function(n){return e.initBasisLoader(n)},getPixels:function(n,o,t,r,i){return e.getPixels(n,o,t,r,i)},render:function(n){return e.render(n)},needsRender:function(){return e.needsRender=!0},preloadPano:function(n,o){return e.preloadPano(n,o)}}}function b(e,o){void 0===o&&(o=!1);var t=u(),r=(0,n.ref)(Symbol()),i=(0,n.shallowRef)(e?t.project2d((0,n.isRef)(e)?e.value:e,o):null),a=t.on("cameraUpdate",(function(){r.value=Symbol()}));return(0,n.onBeforeUnmount)((function(){a()})),(0,n.watch)([r,e],(function(){i.value=t.project2d((0,n.isRef)(e)?e.value:e,o)})),i}function y(){return b}function C(e){var n=e.camera.getWorldDirection(new c.Vector3);return new c.Raycaster(e.camera.position,n)}function S(){var e=u(),o=(0,n.shallowRef)(C(e)),t=e.on("cameraUpdate",(function(){o.value=C(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function F(e){return e.camera.getWorldDirection(new c.Vector3)}function R(){var e=u(),o=(0,n.shallowRef)(F(e)),t=e.on("cameraUpdate",(function(){o.value=F(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function E(e){var o=u(),t=(0,n.shallowRef)([]);return(0,n.watch)(e,(function(){t.value=o.model.intersectRaycaster((0,n.isRef)(e)?e.value:e)})),t}function j(){return E}function k(e){return e.model.empty?"Empty":"Loaded"}function x(){var e=u(),o=(0,n.ref)(k(e)),t=e.on("modelLoaded",(function(){o.value=k(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function O(){var e=u(),o=(0,n.ref)(e.model.shownFloor),t=(0,n.ref)(e.model.floorLength),r=[];return r.push(e.on("modelShownFloorChange",(function(){o.value=e.model.shownFloor}))),r.push(e.on("modelLoaded",(function(){t.value=e.model.floorLength}))),(0,n.onBeforeUnmount)((function(){for(var e;e=r.shift();)e()})),[o,t,function(n){"number"==typeof n?e.model.show(n):e.model.show()}]}function B(){var e=u(),o=(0,n.ref)(e.helperVisible),t=e.on("helpersVisibleChange",(function(e){o.value=e}));return(0,n.onBeforeUnmount)((function(){t()})),[o,function(n){e.helperVisible=n}]}function U(){return u()}function P(e){return e.model.bounding.clone()}function L(){var e=u(),o=(0,n.shallowRef)(P(e)),t=e.on("modelLoaded",(function(){o.value=P(e)}));return(0,n.onBeforeUnmount)((function(){t()})),o}function V(){return u().scene}function T(){var e=u(),o=(0,n.shallowRef)(e.model),t=e.on("modelLoaded",(function(){o.value=e.model}));return(0,n.onBeforeUnmount)((function(){t()})),o}})(),t})()));
|