@realsee/five 5.0.0-alpha.100

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.
Files changed (173) hide show
  1. package/README.md +362 -0
  2. package/TERMS.txt +56 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/assets/highlight.css +134 -0
  5. package/docs/assets/icons.css +1043 -0
  6. package/docs/assets/icons.png +0 -0
  7. package/docs/assets/icons@2x.png +0 -0
  8. package/docs/assets/main.js +52 -0
  9. package/docs/assets/search.js +1 -0
  10. package/docs/assets/style.css +1388 -0
  11. package/docs/assets/widgets.png +0 -0
  12. package/docs/assets/widgets@2x.png +0 -0
  13. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  14. package/docs/classes/five.BVH.html +10 -0
  15. package/docs/classes/five.BVHIntersect.html +1 -0
  16. package/docs/classes/five.BVHNode.html +7 -0
  17. package/docs/classes/five.BVHVector3.html +1 -0
  18. package/docs/classes/five.Camera.html +11 -0
  19. package/docs/classes/five.Five.html +303 -0
  20. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  21. package/docs/classes/five.IntersectMesh.html +1 -0
  22. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  23. package/docs/classes/five.Model.html +77 -0
  24. package/docs/classes/five.NetworkSubscribe.html +50 -0
  25. package/docs/classes/five.PBMContainer.html +17 -0
  26. package/docs/classes/five.PBMGroup.html +19 -0
  27. package/docs/classes/five.PBMMaterial.html +15 -0
  28. package/docs/classes/five.PBMMesh.html +7 -0
  29. package/docs/classes/five.PanoCircleMesh.html +7 -0
  30. package/docs/classes/five.Scene.html +3 -0
  31. package/docs/classes/five.Subscribe.html +56 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +182 -0
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +96 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +16 -0
  59. package/docs/interfaces/five.ImageURLOptions.html +1 -0
  60. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  61. package/docs/interfaces/five.Intersection.html +7 -0
  62. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  63. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  64. package/docs/interfaces/five.MovePanoOptions.html +39 -0
  65. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  66. package/docs/interfaces/five.PBMParameters.html +15 -0
  67. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  68. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  69. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  70. package/docs/interfaces/five.Pose.html +35 -0
  71. package/docs/interfaces/five.Scissor.html +14 -0
  72. package/docs/interfaces/five.State.html +19 -0
  73. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  74. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  75. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  78. package/docs/interfaces/five.TextureOptions.html +18 -0
  79. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  80. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  81. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  82. package/docs/interfaces/five.WorkImage.html +21 -0
  83. package/docs/interfaces/five.WorkInitial.html +13 -0
  84. package/docs/interfaces/five.WorkModel.html +11 -0
  85. package/docs/interfaces/five.WorkObserver.html +25 -0
  86. package/docs/interfaces/five.WorkTile.html +1 -0
  87. package/docs/interfaces/five.WorkVideo.html +9 -0
  88. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  89. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  90. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  91. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  92. package/docs/interfaces/server.Intersection.html +7 -0
  93. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  94. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  95. package/docs/media/coordinate.jpg +0 -0
  96. package/docs/media/topview.jpg +0 -0
  97. package/docs/media/typescript.jpg +0 -0
  98. package/docs/modules/five.SubscribeMixinType.html +1 -0
  99. package/docs/modules/five.html +481 -0
  100. package/docs/modules/gltf_loader.html +1 -0
  101. package/docs/modules/line.html +1 -0
  102. package/docs/modules/react.html +130 -0
  103. package/docs/modules/server.html +18 -0
  104. package/docs/modules/sticker.html +1 -0
  105. package/docs/modules.html +1 -0
  106. package/exporters/staticify.js +203 -0
  107. package/five/index.d.ts +2061 -0
  108. package/five/index.js +372 -0
  109. package/gltf-loader/index.d.ts +75 -0
  110. package/gltf-loader/index.js +260 -0
  111. package/line/index.d.ts +68 -0
  112. package/line/index.js +260 -0
  113. package/package.json +36 -0
  114. package/react/index.d.ts +812 -0
  115. package/react/index.js +260 -0
  116. package/resource/basis/basis_transcoder.js +22 -0
  117. package/resource/basis/basis_transcoder.wasm +0 -0
  118. package/resource/gltf/draco_decoder.js +31 -0
  119. package/resource/gltf/draco_decoder.wasm +0 -0
  120. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  121. package/scripts/five-plugin-init.js +83 -0
  122. package/scripts/five-quick-start-init.js +80 -0
  123. package/scripts/five-react-component-init.js +83 -0
  124. package/scripts/five-staticify.js +21 -0
  125. package/server/index.d.ts +568 -0
  126. package/server/index.js +367 -0
  127. package/sticker/index.d.ts +70 -0
  128. package/sticker/index.js +260 -0
  129. package/templates/plugin/README.md +38 -0
  130. package/templates/plugin/devtools/external-five.js +5 -0
  131. package/templates/plugin/devtools/external-three.js +5 -0
  132. package/templates/plugin/devtools/tsconfig.build.json +18 -0
  133. package/templates/plugin/devtools/webpack.bundle.js +44 -0
  134. package/templates/plugin/devtools/webpack.example.js +39 -0
  135. package/templates/plugin/docs/.gitkeep +0 -0
  136. package/templates/plugin/examples/data.json +507 -0
  137. package/templates/plugin/examples/index.html +28 -0
  138. package/templates/plugin/examples/index.ts +12 -0
  139. package/templates/plugin/lib/index.ts +30 -0
  140. package/templates/plugin/package.json +32 -0
  141. package/templates/plugin/tsconfig.json +26 -0
  142. package/templates/quick-start/README.md +47 -0
  143. package/templates/quick-start/assets/work.json +507 -0
  144. package/templates/quick-start/index.html +54 -0
  145. package/templates/quick-start/index.tsx +123 -0
  146. package/templates/quick-start/package.json +25 -0
  147. package/templates/quick-start/tsconfig.json +27 -0
  148. package/templates/quick-start/webpack.config.js +45 -0
  149. package/templates/quick-start/webpack.production.js +42 -0
  150. package/templates/react-component/README.md +32 -0
  151. package/templates/react-component/devtools/external-five.js +5 -0
  152. package/templates/react-component/devtools/external-react.js +5 -0
  153. package/templates/react-component/devtools/external-three.js +5 -0
  154. package/templates/react-component/devtools/tsconfig.build.json +19 -0
  155. package/templates/react-component/devtools/webpack.bundle.js +44 -0
  156. package/templates/react-component/devtools/webpack.example.js +39 -0
  157. package/templates/react-component/docs/.gitkeep +0 -0
  158. package/templates/react-component/examples/data.json +507 -0
  159. package/templates/react-component/examples/index.html +17 -0
  160. package/templates/react-component/examples/index.tsx +62 -0
  161. package/templates/react-component/lib/index.tsx +157 -0
  162. package/templates/react-component/package.json +38 -0
  163. package/templates/react-component/tsconfig.json +27 -0
  164. package/umd/five-gltf-loader.js +2 -0
  165. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  166. package/umd/five-line.js +2 -0
  167. package/umd/five-line.js.LICENSE.txt +14 -0
  168. package/umd/five-react.js +2 -0
  169. package/umd/five-react.js.LICENSE.txt +14 -0
  170. package/umd/five-sticker.js +2 -0
  171. package/umd/five-sticker.js.LICENSE.txt +14 -0
  172. package/umd/five.js +2 -0
  173. package/umd/five.js.LICENSE.txt +116 -0
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-line.js.LICENSE.txt */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(function(){return(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),M=B>=-1&&B<=1,P=v.distanceTo(A)<.5*c;if(M&&P){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-react.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_React=t():e.FiveSDK_React=t()}(self,(function(){return(()=>{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},751:e=>{if(!("React"in window))throw new Error('"React" is not available. Please include "react" in your HTML.');e.exports=window.React},438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var u=t[r]={exports:{}};return e[r](u,u.exports,n),u.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FiveCanvas:()=>h,INJECTION_PROPNAME:()=>T,Store:()=>oe,createFiveFeature:()=>te,createFiveProvider:()=>v,createStore:()=>ue,unsafe__useFiveInstance:()=>y,useFiveAction:()=>L,useFiveCameraDirection:()=>V,useFiveCameraRaycaster:()=>x,useFiveCurrentObserver:()=>E,useFiveCurrentState:()=>C,useFiveEventCallback:()=>k,useFiveFloor:()=>_,useFiveHelper:()=>W,useFiveModelIntersectRaycaster:()=>O,useFiveModelReadyState:()=>M,useFiveProject2d:()=>F,useFiveScene:()=>S,useFiveSceneEffect:()=>m,useFiveState:()=>b,useFiveWork:()=>w,withFive:()=>ee});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])})(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 r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function u(e,t,n){if(n||2===arguments.length)for(var r,o=0,u=t.length;o<u;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create;var i=n(751),a=n(438),f=[],c=i.createContext(null);function s(){var e=i.useContext(c);if(!e)throw new Error("FiveProvider never found.");return e.five}function l(){var e=i.useContext(c);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}var d=n(348);function v(e){return void 0===e&&(e={}),function(n){function r(t){var r,u=n.call(this,t)||this,i=function(e){var t=void 0===e?{}:e,n=t.backgroundColor,r=void 0===n?1579548:n,o=t.backgroundAlpha,u=void 0===o?1:o,i=t.pixelRatio,c=void 0===i?1:i;if("undefined"!=typeof window){var s=f.shift();return s||((s=new a.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=a.sRGBEncoding),s.setPixelRatio(c),s.setClearColor(r,u),s.autoClear=!0,s}}({pixelRatio:1===(0,d.getViewportScale)()?window.devicePixelRatio:1});return u.five=new d.Five(o({renderer:i},e)),(t.work||t.initialWork)&&u.five.load(t.work||t.initialWork,t.initialState,void 0,null===(r=t.initialUserAction)||void 0===r||r),u.five.on("load",(function(){var e;u.props.onWorkChange&&u.props.onWorkChange(null===(e=u.five)||void 0===e?void 0:e.work)})),u.five.on("stateChange",(function(e,t){u.props.onStateChange&&u.props.onStateChange(e,t)})),u.five.on("currentStateChange",(function(e,t){u.props.onCurrentStateChange&&u.props.onCurrentStateChange(e,t)})),u.five.on("error",(function(e){u.props.onError?u.props.onError(e):console.warn(e.message)})),u}return t(r,n),r.prototype.loadWork=function(e,t,n,r){if(void 0===r&&(r=!0),this.props.work)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(e,t,n,r)},r.prototype.shouldComponentUpdate=function(e){var t,n;return e.work&&e.work!==(null===(t=this.five)||void 0===t?void 0:t.work)&&(null===(n=this.five)||void 0===n||n.load(e.work,e.initialState)),!0},r.prototype.componentWillUnmount=function(){var e;this.five&&(this.five.dispose(),(e=this.five.renderer)&&-1===f.indexOf(e)&&f.push(e),delete this.five)},r.prototype.render=function(){var e=this;return i.createElement(c.Provider,{value:{five:this.five,loadWork:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.loadWork.apply(e,t)}}},this.props.children)},r}(i.Component)}var p={display:"inline-block",overflow:"hidden"},h=function(e){var t=e.width,n=e.height,r=s(),u=i.createRef(),a=o({width:t,height:n},p);return i.useLayoutEffect((function(){if(u.current&&r.renderer){if(null!==r.renderer.domElement.parentNode&&r.renderer.domElement.parentNode!==u.current)throw new Error("There are more than 2 fiveCanvas in this context.");r.renderer.domElement.parentNode!==u.current&&u.current.appendChild(r.renderer.domElement),r.camera.aspect=t/n,r.camera.updateProjectionMatrix(),r.renderer.setSize(t,n),r.needsRender=!0}}),[t,n,u.current]),i.createElement("div",{ref:u,style:a})};function y(){return s()}function m(e,t){var n=s(),r=[n];void 0!==t&&(r=r.concat(t)),i.useLayoutEffect((function(){return e(n.scene)}),r)}var S=m;function w(){var e=s(),t=l(),n=i.useState((function(){return e.work})),r=n[0],o=n[1];return i.useLayoutEffect((function(){return e.on("load",(function(){return o(e.work)}))}),[e]),[r,t]}function g(e){return o({},e.state)}function b(){var e=s(),t=i.useState((function(){return g(e)})),n=t[0],r=t[1],o=i.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;e.setState(o,n,r)}),[e]);return i.useLayoutEffect((function(){return e.on("stateChange",(function(){return r(g(e))}))}),[e]),[n,o]}function C(){var e=s(),t=i.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1],o=i.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;e.setState(o,n,r)}),[e]);return i.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),[n,o]}function E(){var e=s(),t=i.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1];return i.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),e.work?e.work.observers[n.panoIndex]:null}function k(e,t,n){var r=s(),o=[r,e];void 0!==n&&(o=o.concat(n)),i.useLayoutEffect((function(){return r.on(e,t)}),o)}function L(){var e=s();return{updateCamera:i.useCallback((function(t,n){return e.updateCamera(t,n)}),[e]),initBasisLoader:i.useCallback((function(t){return e.initBasisLoader(t)}),[e]),getPixels:i.useCallback((function(t,n,r,o,u){return e.getPixels(t,n,r,o,u)}),[e]),render:i.useCallback((function(t){return e.render(t)}),[e]),needsRender:i.useCallback((function(){return e.needsRender=!0}),[e]),preloadPano:i.useCallback((function(t,n){return e.preloadPano(t,n)}),[e])}}function F(){var e=s(),t=i.useState((function(){return Symbol()})),n=(t[0],t[1]);return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return n(Symbol())}))}),[e]),i.useCallback((function(t,n){return e.project2d(t,n)}),[e])}function R(e){var t=e.camera.getWorldDirection(new a.Vector3);return new a.Raycaster(e.camera.position,t)}function x(){var e=s(),t=i.useState((function(){return R(e)})),n=t[0],r=t[1];return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(R(e))}))}),[e]),n}function P(e){return e.camera.getWorldDirection(new a.Vector3)}function V(){var e=s(),t=i.useState((function(){return P(e)})),n=t[0],r=t[1];return i.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(P(e))}))}),[e]),n}function O(){var e=s();return i.useCallback((function(t){return e.model.intersectRaycaster(t)}),[e])}function j(e){return e.model.empty?"Empty":"Loaded"}function M(){var e=s(),t=i.useState((function(){return j(e)})),n=t[0],r=t[1];return i.useLayoutEffect((function(){return e.on("modelLoaded",(function(){return r(j(e))}))}),[e]),n}function _(){var e=s(),t=i.useState(e.model.shownFloor),n=t[0],r=t[1],o=i.useState(e.model.floorLength),u=o[0],a=o[1],f=i.useCallback((function(t){"number"==typeof t?e.model.show(t):e.model.show()}),[e]);return i.useLayoutEffect((function(){var t=[];return t.push(e.on("modelShownFloorChange",(function(){return r(e.model.shownFloor)}))),t.push(e.on("modelLoaded",(function(){return a(e.model.floorLength)}))),function(){for(var e;e=t.shift();)e()}}),[e]),[n,u,f]}function W(){var e=s(),t=i.useState(e.helperVisible),n=t[0],r=t[1],o=i.useCallback((function(t){e.helperVisible=t}),[e]);return i.useLayoutEffect((function(){return e.on("helpersVisibleChange",(function(e){return r(e)}))}),[e]),[n,o]}var T="$five";function D(e,t){return t.indexOf(e)>=0}function N(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];void 0!==t[o]&&(e[o]=t[o])}}function H(e,t){if(D("loadWork",t))return e}function I(e,t){if(D("setState",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.setState.apply(e,t)}}function U(e,t){if(D("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.on.apply(e,t)}}function A(e,t){if(D("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.once.apply(e,t)}}function B(e,t){if(D("off",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.off.apply(e,t)}}function K(e,t){if(D("intersectRaycaster",t))return function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(t=e.model).intersectRaycaster.apply(t,n)}}function G(e,t){if(D("project2d",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.project2d.apply(e,t)}}function $(e,t){if(D("updateCamera",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.updateCamera.apply(e,t)}}function z(e,t){if(D("initBasisLoader",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.initBasisLoader.apply(e,t)}}function J(e,t){if(D("getPixels",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.getPixels.apply(e,t)}}function q(e,t){if(D("render",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.render.apply(e,t)}}function Q(e,t){if(D("needsRender",t))return function(){e.needsRender=!0}}function X(e,t){if(D("preloadPano",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.preloadPano.apply(e,t)}}function Y(e,t){if(D("showFloor",t))return function(t){"number"==typeof t?e.model.show(t):e.model.show()}}function Z(e,t){if(D("toggleHelperVisible",t))return function(t){e.helperVisible=t}}function ee(e){return function(t){return i.forwardRef((function(n,r){var u=s(),f=l(),c=function(e,t){return[D("unsafe__fiveInstance",t)?e:void 0]}(u,e)[0],d=function(e,t){var n=D("state",t),r=i.useState(Symbol()),u=r[0],a=r[1],f=i.useMemo((function(){if(n)return o({},e.state)}),[e,u]);return i.useLayoutEffect((function(){if(n)return e.on("stateChange",(function(){return a(Symbol())}))}),[e]),[f,u]}(u,e),v=d[0],p=d[1],h=function(e,t){var n=D("currentState",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),y=h[0],m=h[1],S=function(e,t){var n=D("currentObserver",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return u(Symbol())}))}),[e]),[a?e.work?e.work.observers[a.panoIndex]:null:void 0,o]}(u,e),w=S[0],g=S[1],b=function(e,t){var n=D("work",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.work}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("load",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),C=b[0],E=b[1],k=function(e,t){var n=D("model",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.model}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),L=k[0],F=k[1],R=function(e,t){return[D("scene",t)?e.scene:void 0]}(u,e)[0],x=function(e,t){var n=D("cameraDirection",t),r=i.useState(Symbol()),o=r[0],u=r[1],f=i.useMemo((function(){if(n)return e.camera.getWorldDirection(new a.Vector3)}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return u(Symbol())}))}),[e]),[f,o]}(u,e),P=x[0],V=x[1],O=function(e,t){var n=D("cameraRaycaster",t),r=i.useState(Symbol()),o=r[0],u=r[1],f=i.useMemo((function(){if(n){var t=e.camera.getWorldDirection(new a.Vector3);return new a.Raycaster(e.camera.position,t)}}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return u(Symbol())}))}),[e]),[f,o]}(u,e),j=O[0],M=O[1],_=function(e,t){var n=D("modelReadyState",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.model.empty?"Empty":"Loaded"}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),W=_[0],T=_[1],ee=function(e,t){var n=D("shownFloor",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.model.shownFloor}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("modelShownFloorChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),te=ee[0],ne=ee[1],re=function(e,t){var n=D("totalFloorLength",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.model.hasFloors()}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),oe=re[0],ue=re[1],ie=function(e,t){var n=D("helperVisible",t),r=i.useState(Symbol()),o=r[0],u=r[1],a=i.useMemo((function(){if(n)return e.helperVisible}),[e,o]);return i.useLayoutEffect((function(){if(n)return e.on("helpersVisibleChange",(function(){return u(Symbol())}))}),[e]),[a,o]}(u,e),ae=ie[0],fe=ie[1],ce=i.useMemo((function(){var t={};return N(t,{setState:I(u,e),loadWork:H(f,e),on:U(u,e),once:A(u,e),off:B(u,e),intersectRaycaster:K(u,e),project2d:G(u,e),updateCamera:$(u,e),initBasisLoader:z(u,e),getPixels:J(u,e),render:q(u,e),needsRender:Q(u,e),preloadPano:X(u,e),showFloor:Y(u,e),toggleHelperVisible:Z(u,e)}),t}),[u,f]),se=i.useMemo((function(){var e=o({},ce);return N(e,{unsafe__fiveInstance:c,state:v,currentState:y,currentObserver:w,work:C,model:L,scene:R,cameraDirection:P,cameraRaycaster:j,modelReadyState:W,shownFloor:te,totalFloorLength:oe,helperVisible:ae}),e}),[u,ce,p,m,g,E,F,V,M,T,ne,ue,fe]);return i.createElement(t,o({ref:r,$five:se},n))}))}}function te(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function ne(e,t){for(var n={},r=t.length,o=-1;++o<r;){var u=t[o];u in e&&(n[u]=e[u])}return n}function re(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<t.length;r++)if(e[n]===t[r])return!0;return!1}var oe=function(){function e(e,t){this.values=e,this.listeners=[],this.onValuesChange=t}return e.prototype.on=function(e,t){var n=this,r=[e,t];return this.listeners.push(r),function(){var e=n.listeners.indexOf(r);e>=0&&n.listeners.splice(e,1)}},e.prototype.getValues=function(e){return ne(this.values,e)},e.prototype.setValues=function(e,t){var n,r,u=[];for(var i in t)e.indexOf(i)>=0&&(n=t[i],r=this.values[i],!("number"==typeof n&&"number"==typeof r&&isNaN(n)&&isNaN(r)||n===r))&&u.push(i);if(0!==u.length){for(var a=o({},this.values),f=0,c=u;f<c.length;f++){var s=c[f];this.values[s]=t[s]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var v=d[l],p=v[0],h=v[1];if(re(p,u)){var y=ne(a,p);h(ne(this.values,p),y)}}}},e}();function ue(e){var n=i.createContext(null);return{useStore:function(e){var t=i.useContext(n);if(null===t)throw new Error("StoreProvider never found.");var r=i.useRef(!0),o=i.useState(t.getValues(e)),a=o[0],f=o[1],c=u([t],e,!0);return i.useLayoutEffect((function(){return r.current?r.current=!1:f(t.getValues(e)),t.on(e,(function(e){return f(e)}))}),c),[a,i.useCallback((function(n){return t.setValues(e,n)}),c)]},useStoreSetter:function(e){var t=i.useContext(n);if(null===t)throw new Error("StoreProvider never found.");return i.useCallback((function(n){return t.setValues(e,n)}),u([t],e,!0))},watchStore:function(e,t,r){var o=i.useContext(n);if(null===o)throw new Error("StoreProvider never found.");var a=u([o],e,!0);void 0!==r&&(a=a.concat(r)),i.useLayoutEffect((function(){return o.on(e,t)}),a)},useStoreAction:function(t){var r=i.useContext(n);if(null===r)throw new Error("StoreProvider never found.");return i.useCallback((function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=e[t],a=i[0],f=i.slice(1),c=function(){return r.getValues(f)},s=function(e){return r.setValues(f,e)};return a.apply(void 0,u([c,s],n,!1))}),[])},StoreProvider:function(e){function r(t){var n=e.call(this,t)||this;return n.store=new oe(t.initialValue,(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.props.onValuesChange&&(e=n.props).onValuesChange.apply(e,t)})),n}return t(r,e),r.prototype.shouldComponentUpdate=function(e){return e.children!==this.props.children},r.prototype.render=function(){return i.createElement(n.Provider,{value:this.store},this.props.children)},r}(i.Component)}}})(),r})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five-sticker.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(function(){return(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var h=y.map=new t.VideoTexture(o);h.wrapS=t.ClampToEdgeWrapping,h.wrapT=t.ClampToEdgeWrapping,h.minFilter=t.LinearFilter,h.encoding=t.sRGBEncoding,d(h,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh)})(),r})()}));
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */