@realsee/five 5.0.0-alpha.11 → 5.0.0-alpha.112

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 (445) hide show
  1. package/README.md +75 -63
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/{images/icons.png → icons.png} +0 -0
  6. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  7. package/docs/assets/main.js +52 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1413 -0
  10. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  11. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  12. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  13. package/docs/classes/five.BVH.html +10 -0
  14. package/docs/classes/five.BVHIntersect.html +1 -0
  15. package/docs/classes/five.BVHNode.html +7 -0
  16. package/docs/classes/five.BVHVector3.html +1 -0
  17. package/docs/classes/five.Camera.html +11 -0
  18. package/docs/classes/five.Five.html +303 -0
  19. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  20. package/docs/classes/five.IntersectMesh.html +1 -0
  21. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  22. package/docs/classes/five.Model.html +77 -0
  23. package/docs/classes/five.NetworkSubscribe.html +50 -0
  24. package/docs/classes/five.PBMContainer.html +17 -0
  25. package/docs/classes/five.PBMGroup.html +19 -0
  26. package/docs/classes/five.PBMMaterial.html +15 -0
  27. package/docs/classes/five.PBMMesh.html +7 -0
  28. package/docs/classes/five.PanoCircleMesh.html +7 -0
  29. package/docs/classes/five.Scene.html +3 -0
  30. package/docs/classes/five.Subscribe.html +56 -0
  31. package/docs/classes/five.Work.html +30 -0
  32. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  33. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  34. package/docs/classes/line.Line.html +1 -0
  35. package/docs/classes/line.LineGeometry.html +1 -0
  36. package/docs/classes/line.LineMaterial.html +1 -0
  37. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  38. package/docs/classes/line.THREE_Line2.html +1 -0
  39. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  40. package/docs/classes/react.Store.html +29 -0
  41. package/docs/classes/server.BVH.html +10 -0
  42. package/docs/classes/server.BVHIntersect.html +1 -0
  43. package/docs/classes/server.BVHNode.html +7 -0
  44. package/docs/classes/server.BVHVector3.html +1 -0
  45. package/docs/classes/server.Model.html +63 -0
  46. package/docs/classes/server.PBMGroup.html +9 -0
  47. package/docs/classes/server.PBMMesh.html +7 -0
  48. package/docs/classes/sticker.Sticker.html +32 -0
  49. package/docs/index.html +166 -420
  50. package/docs/interfaces/five.AddableObject.html +1 -0
  51. package/docs/interfaces/five.AnimationFrame.html +1 -0
  52. package/docs/interfaces/five.CameraPose.html +1 -0
  53. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  54. package/docs/interfaces/five.EventCallback.html +391 -0
  55. package/docs/interfaces/five.FiveInitArgs.html +96 -0
  56. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  57. package/docs/interfaces/five.ImageOptions.html +18 -0
  58. package/docs/interfaces/five.ImageURLOptions.html +15 -0
  59. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  60. package/docs/interfaces/five.Intersection.html +7 -0
  61. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  62. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  63. package/docs/interfaces/five.MovePanoOptions.html +40 -0
  64. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  65. package/docs/interfaces/five.PBMParameters.html +15 -0
  66. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  67. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  68. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  69. package/docs/interfaces/five.Pose.html +35 -0
  70. package/docs/interfaces/five.Scissor.html +14 -0
  71. package/docs/interfaces/five.State.html +19 -0
  72. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  73. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  74. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  75. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  77. package/docs/interfaces/five.TextureOptions.html +20 -0
  78. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  79. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  80. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  81. package/docs/interfaces/five.WorkImage.html +21 -0
  82. package/docs/interfaces/five.WorkInitial.html +13 -0
  83. package/docs/interfaces/five.WorkModel.html +11 -0
  84. package/docs/interfaces/five.WorkObserver.html +25 -0
  85. package/docs/interfaces/five.WorkTile.html +1 -0
  86. package/docs/interfaces/five.WorkVideo.html +9 -0
  87. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  88. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  89. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  90. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  91. package/docs/interfaces/server.Intersection.html +7 -0
  92. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  93. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  94. package/docs/modules/five.SubscribeMixinType.html +1 -0
  95. package/docs/modules/five.html +481 -0
  96. package/docs/modules/gltf_loader.html +1 -0
  97. package/docs/modules/line.html +1 -0
  98. package/docs/modules/react.html +130 -941
  99. package/docs/modules/server.html +18 -0
  100. package/docs/modules/sticker.html +1 -0
  101. package/docs/modules.html +1 -119
  102. package/exporters/staticify.js +203 -0
  103. package/five/index.d.ts +2073 -0
  104. package/five/index.js +372 -0
  105. package/gltf-loader/index.d.ts +75 -0
  106. package/gltf-loader/index.js +260 -0
  107. package/line/index.d.ts +68 -0
  108. package/line/index.js +260 -0
  109. package/package.json +20 -18
  110. package/react/index.d.ts +812 -17
  111. package/react/index.js +260 -1
  112. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  113. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  114. package/resource/gltf/draco_decoder.js +31 -0
  115. package/resource/gltf/draco_decoder.wasm +0 -0
  116. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  117. package/scripts/five-staticify.js +21 -0
  118. package/server/index.d.ts +568 -5
  119. package/server/index.js +367 -1
  120. package/sticker/index.d.ts +70 -0
  121. package/sticker/index.js +260 -0
  122. package/templates/plugin/examples/index.html +1 -1
  123. package/templates/quick-start/README.md +1 -1
  124. package/templates/quick-start/index.tsx +1 -1
  125. package/templates/quick-start/package.json +1 -1
  126. package/templates/react-component/examples/index.html +1 -1
  127. package/templates/react-component/examples/index.tsx +4 -4
  128. package/templates/react-component/lib/index.tsx +5 -5
  129. package/umd/five-gltf-loader.js +2 -0
  130. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  131. package/umd/five-line.js +2 -0
  132. package/umd/five-line.js.LICENSE.txt +14 -0
  133. package/umd/five-react.js +2 -0
  134. package/umd/five-react.js.LICENSE.txt +14 -0
  135. package/umd/five-sticker.js +2 -0
  136. package/umd/five-sticker.js.LICENSE.txt +14 -0
  137. package/umd/five.js +2 -0
  138. package/umd/five.js.LICENSE.txt +116 -0
  139. package/application/constant.d.ts +0 -6
  140. package/application/constant.js +0 -1
  141. package/application/controllers.d.ts +0 -31
  142. package/application/controllers.js +0 -1
  143. package/application/events.d.ts +0 -140
  144. package/application/events.js +0 -1
  145. package/application/five.d.ts +0 -418
  146. package/application/five.js +0 -1
  147. package/application/fiveInitArgs.d.ts +0 -157
  148. package/application/fiveInitArgs.js +0 -1
  149. package/application/generateDefaultVideoElement.d.ts +0 -2
  150. package/application/generateDefaultVideoElement.js +0 -1
  151. package/application/getViewportScale.d.ts +0 -2
  152. package/application/getViewportScale.js +0 -1
  153. package/application/initLights.d.ts +0 -3
  154. package/application/initLights.js +0 -1
  155. package/bundles/five.js +0 -2
  156. package/bundles/five.js.LICENSE.txt +0 -160
  157. package/controllers/base.d.ts +0 -80
  158. package/controllers/base.js +0 -1
  159. package/controllers/depthPanorama.d.ts +0 -40
  160. package/controllers/depthPanorama.js +0 -1
  161. package/controllers/events.d.ts +0 -273
  162. package/controllers/events.js +0 -1
  163. package/controllers/floorplan.d.ts +0 -102
  164. package/controllers/floorplan.js +0 -1
  165. package/controllers/model.d.ts +0 -23
  166. package/controllers/model.js +0 -1
  167. package/controllers/panorama.d.ts +0 -69
  168. package/controllers/panorama.js +0 -1
  169. package/controllers/panoramaLike.d.ts +0 -88
  170. package/controllers/panoramaLike.js +0 -1
  171. package/controllers/topview.d.ts +0 -28
  172. package/controllers/topview.js +0 -1
  173. package/controllers/vrPanorama.d.ts +0 -40
  174. package/controllers/vrPanorama.js +0 -1
  175. package/core/camera.d.ts +0 -15
  176. package/core/camera.js +0 -1
  177. package/core/cubeTexture.d.ts +0 -6
  178. package/core/cubeTexture.js +0 -1
  179. package/core/internalWebGLRenderer.d.ts +0 -11
  180. package/core/internalWebGLRenderer.js +0 -1
  181. package/core/pbmGroup.d.ts +0 -22
  182. package/core/pbmGroup.js +0 -1
  183. package/core/pbmMaterial.d.ts +0 -39
  184. package/core/pbmMaterial.js +0 -1
  185. package/core/pbmMesh.d.ts +0 -10
  186. package/core/pbmMesh.js +0 -1
  187. package/core/pbmParameters.d.ts +0 -36
  188. package/core/pbmParameters.js +0 -1
  189. package/core/scene.d.ts +0 -5
  190. package/core/scene.js +0 -1
  191. package/core/subscribe.d.ts +0 -76
  192. package/core/subscribe.js +0 -1
  193. package/core/updatableTexture.d.ts +0 -12
  194. package/core/updatableTexture.js +0 -1
  195. package/docs/assets/css/main.css +0 -2660
  196. package/docs/assets/js/main.js +0 -248
  197. package/docs/assets/js/search.js +0 -1
  198. package/docs/classes/index.five.html +0 -2567
  199. package/docs/classes/index.fivecamera.html +0 -427
  200. package/docs/classes/index.fiveline.html +0 -458
  201. package/docs/classes/index.fivescene.html +0 -302
  202. package/docs/classes/index.internalwebglrenderer.html +0 -316
  203. package/docs/classes/index.model.html +0 -999
  204. package/docs/classes/index.pbmgroup.html +0 -531
  205. package/docs/classes/index.pbmmaterial.html +0 -637
  206. package/docs/classes/index.pbmmesh.html +0 -358
  207. package/docs/classes/index.subscribe.html +0 -672
  208. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -524
  209. package/docs/interfaces/index.fiveeventcallback.html +0 -2568
  210. package/docs/interfaces/index.fiveinitargs.html +0 -811
  211. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -399
  212. package/docs/interfaces/index.imageoptions.html +0 -436
  213. package/docs/interfaces/index.intersection.html +0 -331
  214. package/docs/interfaces/index.intersectmeshinterface.html +0 -292
  215. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -470
  216. package/docs/interfaces/index.modeleventcallback.html +0 -432
  217. package/docs/interfaces/index.movepanooptions.html +0 -573
  218. package/docs/interfaces/index.panocirclemeshinterface.html +0 -465
  219. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -549
  220. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -468
  221. package/docs/interfaces/index.pbmparameters.html +0 -578
  222. package/docs/interfaces/index.pose.html +0 -374
  223. package/docs/interfaces/index.scissor.html +0 -356
  224. package/docs/interfaces/index.state.html +0 -404
  225. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -330
  226. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -536
  227. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -530
  228. package/docs/interfaces/react.injectfivetoprops.html +0 -231
  229. package/docs/modules/index.html +0 -925
  230. package/five.js.LICENSE.txt +0 -160
  231. package/index.d.ts +0 -33
  232. package/index.js +0 -1
  233. package/loaders/basis/BasisTextureLoader.d.ts +0 -116
  234. package/loaders/basis/BasisTextureLoader.js +0 -1
  235. package/loaders/basis/index.d.ts +0 -3
  236. package/loaders/basis/index.js +0 -1
  237. package/loaders/cubeTexture/imagePool.d.ts +0 -7
  238. package/loaders/cubeTexture/imagePool.js +0 -1
  239. package/loaders/cubeTexture/index.d.ts +0 -58
  240. package/loaders/cubeTexture/index.js +0 -1
  241. package/loaders/depthTexture/index.d.ts +0 -60
  242. package/loaders/depthTexture/index.js +0 -1
  243. package/loaders/model/at3d.d.ts +0 -7
  244. package/loaders/model/at3d.js +0 -1
  245. package/loaders/model/dome.d.ts +0 -14
  246. package/loaders/model/dome.js +0 -1
  247. package/loaders/model/domez.d.ts +0 -7
  248. package/loaders/model/domez.js +0 -1
  249. package/loaders/model/index.d.ts +0 -135
  250. package/loaders/model/index.js +0 -1
  251. package/loaders/model/pbm.d.ts +0 -27
  252. package/loaders/model/pbm.js +0 -1
  253. package/loaders/model/tools/bvhtree/index.d.ts +0 -2
  254. package/loaders/model/tools/bvhtree/index.js +0 -1
  255. package/loaders/model/tools/lzma/index.d.ts +0 -2
  256. package/loaders/model/tools/lzma/index.js +0 -1
  257. package/loaders/model/tools/lzma/lzma-caller.d.ts +0 -13
  258. package/loaders/model/tools/lzma/lzma-caller.js +0 -1
  259. package/loaders/model/tools/lzma/lzma.d.ts +0 -2
  260. package/loaders/model/tools/lzma/lzma.js +0 -1
  261. package/loaders/model/tools/lzma/lzmaWorker.d.ts +0 -1
  262. package/loaders/model/tools/lzma/lzmaWorker.js +0 -1
  263. package/loaders/tileTexture/index.d.ts +0 -26
  264. package/loaders/tileTexture/index.js +0 -1
  265. package/meshes/boundingMesh.d.ts +0 -9
  266. package/meshes/boundingMesh.js +0 -1
  267. package/meshes/intersectMesh.d.ts +0 -11
  268. package/meshes/intersectMesh.js +0 -1
  269. package/meshes/panoCircleMesh.d.ts +0 -29
  270. package/meshes/panoCircleMesh.js +0 -1
  271. package/meshes/panoSphereMesh.d.ts +0 -16
  272. package/meshes/panoSphereMesh.js +0 -1
  273. package/objects/line/circle_png.d.ts +0 -1
  274. package/objects/line/circle_png.js +0 -1
  275. package/objects/line/index.d.ts +0 -12
  276. package/objects/line/index.js +0 -1
  277. package/objects/line/utils/Line2.d.ts +0 -7
  278. package/objects/line/utils/Line2.js +0 -1
  279. package/objects/line/utils/LineGeometry.d.ts +0 -10
  280. package/objects/line/utils/LineGeometry.js +0 -1
  281. package/objects/line/utils/LineMaterial.d.ts +0 -20
  282. package/objects/line/utils/LineMaterial.js +0 -1
  283. package/objects/line/utils/LineSegments2.d.ts +0 -11
  284. package/objects/line/utils/LineSegments2.js +0 -1
  285. package/objects/line/utils/LineSegmentsGeometry.d.ts +0 -15
  286. package/objects/line/utils/LineSegmentsGeometry.js +0 -1
  287. package/react/canvas.d.ts +0 -19
  288. package/react/canvas.js +0 -1
  289. package/react/context.d.ts +0 -9
  290. package/react/context.js +0 -1
  291. package/react/createProvider.d.ts +0 -65
  292. package/react/createProvider.js +0 -1
  293. package/react/createStore.d.ts +0 -138
  294. package/react/createStore.js +0 -1
  295. package/react/hooks/unsafe__useFiveInstance.d.ts +0 -9
  296. package/react/hooks/unsafe__useFiveInstance.js +0 -1
  297. package/react/hooks/useFiveAction.d.ts +0 -154
  298. package/react/hooks/useFiveAction.js +0 -1
  299. package/react/hooks/useFiveCameraDirection.d.ts +0 -7
  300. package/react/hooks/useFiveCameraDirection.js +0 -1
  301. package/react/hooks/useFiveCameraRaycaster.d.ts +0 -7
  302. package/react/hooks/useFiveCameraRaycaster.js +0 -1
  303. package/react/hooks/useFiveCurrentState.d.ts +0 -15
  304. package/react/hooks/useFiveCurrentState.js +0 -1
  305. package/react/hooks/useFiveEvent.d.ts +0 -12
  306. package/react/hooks/useFiveEvent.js +0 -1
  307. package/react/hooks/useFiveModelIntersectRaycaster.d.ts +0 -21
  308. package/react/hooks/useFiveModelIntersectRaycaster.js +0 -1
  309. package/react/hooks/useFiveModelReadyState.d.ts +0 -8
  310. package/react/hooks/useFiveModelReadyState.js +0 -1
  311. package/react/hooks/useFiveProject2d.d.ts +0 -20
  312. package/react/hooks/useFiveProject2d.js +0 -1
  313. package/react/hooks/useFiveScene.d.ts +0 -16
  314. package/react/hooks/useFiveScene.js +0 -1
  315. package/react/hooks/useFiveState.d.ts +0 -6
  316. package/react/hooks/useFiveState.js +0 -1
  317. package/react/hooks/useFiveWork.d.ts +0 -30
  318. package/react/hooks/useFiveWork.js +0 -1
  319. package/react/rendererPool.d.ts +0 -8
  320. package/react/rendererPool.js +0 -1
  321. package/react/withFive.d.ts +0 -239
  322. package/react/withFive.js +0 -1
  323. package/scripts/export-five-resource/chfs.exe +0 -0
  324. package/scripts/export-five-resource/fileify.js +0 -192
  325. package/scripts/export-five-resource/format-work.js +0 -71
  326. package/scripts/export-five-resource/staticify.js +0 -327
  327. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  328. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  329. package/scripts/transcode-model/MTLLoader.js +0 -602
  330. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  331. package/scripts/transcode-model/obj2pbm.js +0 -65
  332. package/server/core/pbmGroup.d.ts +0 -11
  333. package/server/core/pbmGroup.js +0 -1
  334. package/server/core/pbmMesh.d.ts +0 -9
  335. package/server/core/pbmMesh.js +0 -1
  336. package/server/model/at3d.d.ts +0 -5
  337. package/server/model/at3d.js +0 -1
  338. package/server/model/dome.d.ts +0 -11
  339. package/server/model/dome.js +0 -1
  340. package/server/model/domez.d.ts +0 -5
  341. package/server/model/domez.js +0 -1
  342. package/server/model/index.d.ts +0 -134
  343. package/server/model/index.js +0 -1
  344. package/server/model/pbm.d.ts +0 -24
  345. package/server/model/pbm.js +0 -1
  346. package/server/model/tools/bvhtree/index.d.ts +0 -2
  347. package/server/model/tools/bvhtree/index.js +0 -1
  348. package/server/model/tools/fetchArraybuffer.d.ts +0 -2
  349. package/server/model/tools/fetchArraybuffer.js +0 -1
  350. package/server/model/tools/lzma/index.d.ts +0 -2
  351. package/server/model/tools/lzma/index.js +0 -1
  352. package/server/model/tools/lzma/lzma.d.ts +0 -2
  353. package/server/model/tools/lzma/lzma.js +0 -1
  354. package/shaders/depth/fragment.d.ts +0 -2
  355. package/shaders/depth/fragment.js +0 -1
  356. package/shaders/depth/vertex.d.ts +0 -2
  357. package/shaders/depth/vertex.js +0 -1
  358. package/shaders/pbm/fragment.d.ts +0 -2
  359. package/shaders/pbm/fragment.js +0 -1
  360. package/shaders/pbm/vertex.d.ts +0 -2
  361. package/shaders/pbm/vertex.js +0 -1
  362. package/three-version-check.d.ts +0 -1
  363. package/three-version-check.js +0 -1
  364. package/types/imageOptions.d.ts +0 -24
  365. package/types/imageOptions.js +0 -1
  366. package/types/mode.d.ts +0 -23
  367. package/types/mode.js +0 -1
  368. package/types/movePanoOptions.d.ts +0 -40
  369. package/types/movePanoOptions.js +0 -1
  370. package/types/plugin.d.ts +0 -26
  371. package/types/plugin.js +0 -1
  372. package/types/pose.d.ts +0 -16
  373. package/types/pose.js +0 -1
  374. package/types/scissor.d.ts +0 -18
  375. package/types/scissor.js +0 -1
  376. package/types/state.d.ts +0 -18
  377. package/types/state.js +0 -1
  378. package/utils/BufferGeometryUtils.d.ts +0 -31
  379. package/utils/BufferGeometryUtils.js +0 -1
  380. package/utils/ajax.d.ts +0 -13
  381. package/utils/ajax.js +0 -1
  382. package/utils/animationFrame.d.ts +0 -24
  383. package/utils/animationFrame.js +0 -1
  384. package/utils/arrayMax.d.ts +0 -10
  385. package/utils/arrayMax.js +0 -1
  386. package/utils/arrayMin.d.ts +0 -11
  387. package/utils/arrayMin.js +0 -1
  388. package/utils/busy.d.ts +0 -13
  389. package/utils/busy.js +0 -1
  390. package/utils/calculateProgress.d.ts +0 -37
  391. package/utils/calculateProgress.js +0 -1
  392. package/utils/calculateThreeMouse.d.ts +0 -13
  393. package/utils/calculateThreeMouse.js +0 -1
  394. package/utils/cameraWorldToLocal.d.ts +0 -13
  395. package/utils/cameraWorldToLocal.js +0 -1
  396. package/utils/coordinatesToVector.d.ts +0 -7
  397. package/utils/coordinatesToVector.js +0 -1
  398. package/utils/createImage.d.ts +0 -2
  399. package/utils/createImage.js +0 -1
  400. package/utils/detector.d.ts +0 -13
  401. package/utils/detector.js +0 -1
  402. package/utils/formatRad.d.ts +0 -7
  403. package/utils/formatRad.js +0 -1
  404. package/utils/headingToLongitude.d.ts +0 -6
  405. package/utils/headingToLongitude.js +0 -1
  406. package/utils/imageLoader.d.ts +0 -10
  407. package/utils/imageLoader.js +0 -1
  408. package/utils/imageURL.d.ts +0 -9
  409. package/utils/imageURL.js +0 -1
  410. package/utils/isAbsoluteURL.d.ts +0 -6
  411. package/utils/isAbsoluteURL.js +0 -1
  412. package/utils/isNil.d.ts +0 -6
  413. package/utils/isNil.js +0 -1
  414. package/utils/longitudeToHeading.d.ts +0 -6
  415. package/utils/longitudeToHeading.js +0 -1
  416. package/utils/mouseWheel.d.ts +0 -17
  417. package/utils/mouseWheel.js +0 -1
  418. package/utils/noop.d.ts +0 -6
  419. package/utils/noop.js +0 -1
  420. package/utils/now.d.ts +0 -5
  421. package/utils/now.js +0 -1
  422. package/utils/preload.d.ts +0 -5
  423. package/utils/preload.js +0 -1
  424. package/utils/tween.d.ts +0 -88
  425. package/utils/tween.js +0 -1
  426. package/utils/uuid.d.ts +0 -5
  427. package/utils/uuid.js +0 -1
  428. package/utils/vectorTocoordinates.d.ts +0 -7
  429. package/utils/vectorTocoordinates.js +0 -1
  430. package/utils/webglError.d.ts +0 -7
  431. package/utils/webglError.js +0 -1
  432. package/webvr/helper.img.d.ts +0 -1
  433. package/webvr/helper.img.js +0 -1
  434. package/webvr/vrEffect.d.ts +0 -13
  435. package/webvr/vrEffect.js +0 -1
  436. package/work/index.d.ts +0 -5
  437. package/work/index.js +0 -1
  438. package/work/looseWorkType.d.ts +0 -61
  439. package/work/looseWorkType.js +0 -1
  440. package/work/parse.d.ts +0 -4
  441. package/work/parse.js +0 -1
  442. package/work/stringify.d.ts +0 -4
  443. package/work/stringify.js +0 -1
  444. package/work/workType.d.ts +0 -49
  445. package/work/workType.js +0 -1
@@ -1,327 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const http = require("http");
4
- const mkdirp = require("mkdirp");
5
- const crypto = require("crypto");
6
- const formatWork = require("./format-work");
7
-
8
- const [
9
- __command__,
10
- __scriptPath__,
11
- workPath,
12
- exportPath,
13
- ] = process.argv;
14
-
15
- const work = JSON.parse(fs.readFileSync(workPath));
16
-
17
- if (!fs.existsSync(exportPath)) fs.mkdirSync(exportPath);
18
-
19
- function md5(contents) {
20
- const md5 = crypto.createHash("md5");
21
- md5.update(contents);
22
- return md5.digest("hex");
23
- }
24
-
25
- function shortPath(path) {
26
- const array = path.split("/");
27
- if (array.length < 3) return path;
28
- const start = array.shift();
29
- const end = array.pop();
30
- return [start, md5(array.join("/")), end].join("/");
31
- }
32
-
33
-
34
- function imageURL(url, options = {}) {
35
- if (typeof options.transform === "function") {
36
- return options.transform(url, options)
37
- }
38
- if (url.indexOf("//vrlab-public.ljcdn.com") >= 0) {
39
- if (/\.basis(\?|$)/.test(url) && options.basisLoaderInitialized !== true) {
40
- url = url.replace(/\.basis(\?|$)/, ".jpg$1");
41
- }
42
- if (/\.jpg$/.test(url)) {
43
- const { size, quality, format } = options;
44
- if (size || quality || format) {
45
- let suffix = "?imageMogr2";
46
- if (quality) suffix += "/quality/" + quality;
47
- if (size) suffix += "/thumbnail/" + size + "x";
48
- if (format) suffix += "/format/" + format;
49
- url = url.replace("//vrlab-public.ljcdn.com", "//vrlab-image4.ljcdn.com") + suffix;
50
- }
51
- }
52
- }
53
- return url;
54
- }
55
-
56
- function download(url, filename) {
57
- filename = path.resolve(filename);
58
- mkdirp.sync(path.dirname(filename));
59
- return new Promise(resolve => {
60
- http.get(url.replace(/^https\:/, "http:"), res => {
61
- const writeStream = fs.createWriteStream(filename);
62
- res.pipe(writeStream);
63
- res.on("end", resolve);
64
- })
65
- })
66
- }
67
-
68
- function traverse(json, callback, keyPath = "") {
69
- json = callback(json, keyPath);
70
- if (json) {
71
- if (typeof json === "array") {
72
- for (let i = 0; i < json.length; i++) {
73
- json[i] = traverse(json[i], callback, keyPath + "." + i);
74
- }
75
- } else if (typeof json === "object") {
76
- for (let i = 0, keys = Object.keys(json); i < keys.length; i++) {
77
- const key = keys[i];
78
- json[key] = traverse(json[key], callback, keyPath + "." + key);
79
- }
80
- }
81
- }
82
- return json;
83
- }
84
-
85
- const urlRegExp = /^https?:\/\/(?:[\w-]+\.)*[\w-]{1,63}(?:\.(?:\w+))(?:$|\/)/i;
86
- const fileRegExp = /\.[a-z0-9]{1,6}$/i;
87
-
88
- const htmlExample = `
89
- <!DOCTYPE html>
90
- <html lang="en">
91
- <head>
92
- <meta charset="UTF-8">
93
- <title>如视 VR SDK 调用实例</title>
94
- <meta name="viewport" content="width=device-width, initial-scale=1">
95
- <style>
96
- html, body { height: 100%; width: 100%; overflow: hidden; }
97
- * { margin: 0; padding: 0 }
98
- #app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
99
- .buttons { position: fixed; top: 10px; left: 10px; }
100
- .buttons button { display: block; margin-top: 10px; }
101
- </style>
102
- </head>
103
- <body>
104
- <script>
105
- if (location.href.indexOf("file:") === 0) {
106
- alert("Please follow the README.md file to run the project.\n请根据README.md文件来启动项目。")
107
- }
108
- </script>
109
- <!-- 试图渲染容器 -->
110
- <div id="app"></div>
111
-
112
- <!-- 简易空间按钮 -->
113
- <div class="buttons">
114
- <!-- 点击进入相机全景模式 -->
115
- <button onclick="five.changeMode(Five.Mode.Panorama)">全景模式(Panorama)</button>
116
- <!-- 点击进入相机模型自由模式 -->
117
- <button onclick="five.changeMode(Five.Mode.Floorplan, {latitude: Math.PI / 4, longitude: Math.PI / 4})">模型自由模式(Floorplan)</button>
118
- <!-- 点击进入相机模型垂直模式 -->
119
- <button onclick="five.changeMode(Five.Mode.Topview)">模型垂直模式(Topview)</button>
120
- <!-- 点击进入相机VR眼睛模式 -->
121
- <button onclick="five.changeMode(Five.Mode.VRPanorama)">眼睛模式(VRPanorama)</button>
122
- <!-- 点击进入相机模型漫游模式 -->
123
- <button onclick="five.changeMode(Five.Mode.Model)">模型漫游模式(Model)</button>
124
- </div>
125
-
126
- <script src="./five.js"></script>
127
- <script>
128
- // Five 是 如视 VR 视图渲染库的构造函数,通过 new 关键字产生实例。
129
- // 构造函数的具体参数见文档,这边仅配置常用的几项
130
- var five = new Five({
131
- // 初始化为全景观测状态状态
132
- mode: Five.Mode.Panorama,
133
- // 初始化为摄像机位于第 0 个观测点的位置
134
- panoIndex: 0,
135
- // 初始化为摄像机水平角度为 0
136
- longitude: 0,
137
- // 初始化为摄像机俯仰角度为 0
138
- latitude: 0,
139
- // 取消初始化镜头过度动画
140
- initWithTransition: false,
141
- // 按需渲染
142
- onlyRenderIfNeeds: true,
143
- })
144
-
145
- // 将渲染视图的 canvas 添加到 DOM 中
146
- five.appendTo(document.getElementById("app"))
147
-
148
- // 如果显示区域需要变动,在变动时请调用 refresh 重置显示参数
149
- window.addEventListener("resize", function () {
150
- five.refresh()
151
- })
152
-
153
- // 获取当前 VR 的房间数据,加载进来
154
- ajax("./work.json?__random=" + Date.now(), function (error, json) {
155
- if (error) throw error
156
- // 房间数据在 work.json 中,具体数据定义请在文档中查询
157
- five.load(JSON.parse(json))
158
- })
159
-
160
- // five 可以通过 on 方法来监听生命周期及交互事件
161
- // 具体的事件类型和描述详见文档
162
- // 这里肩痛 模型加载完成的事件
163
- // 在这个事件之后,模型加载完成
164
- five.on("modelLoaded", function() {
165
- var buttons = document.getElementsByClassName("buttons")[0]
166
- // 通过 five.model.hasFloors() 方法可以获取当前房间的模型有多少楼层
167
- // 该方法请在 modelLoaded 之前之后执行
168
- var floors = five.model.hasFloors()
169
- function createButton (title, value) {
170
- var button = document.createElement("button")
171
- button.innerHTML = title
172
- button.value = value
173
- button.onclick = function buttonClick (event) {
174
- var floor = JSON.parse(this.value)
175
- // 通过 five.model.show 方法可以只显示某一层的模型
176
- if (floor === null) five.model.show()
177
- else five.model.show(floor)
178
- }
179
- return button
180
- }
181
- buttons.appendChild(createButton("全部楼层", "null"))
182
- for (var index = 0; index < floors; index++) {
183
- buttons.appendChild(createButton("第" + index + "层", String(index)))
184
- }
185
- })
186
-
187
- // === 帮助函数 ===
188
-
189
- /**
190
- * 通过 xhr 异步获取数据
191
- * @param {String} url 请求数据的地址
192
- * @param {Function} callback 数据返回的回掉函数
193
- *
194
- * callback (error, responseText)
195
- * @param {Error|Null} error 如果请求失败返回 error, 如果成功则为 null
196
- * @param {String|Undefined} responseText 如果成功, 返回异步获取的数据的字符串
197
- */
198
- function ajax (url, callback) {
199
- var xhr = new XMLHttpRequest()
200
- xhr.onreadystatechange = function () {
201
- if (xhr.readyState !== 4) return
202
- if (xhr.status === 200 || xhr.status === 0) {
203
- if (callback) callback(null, xhr.response)
204
- } else {
205
- if (callback) callback(new Error("status:" + xhr.status))
206
- }
207
- }
208
- xhr.open("GET", url, true)
209
- xhr.send(null)
210
- }
211
- </script>
212
- </body>
213
- </html>
214
- `;
215
-
216
- const pyServer = `
217
- import webbrowser
218
- import posixpath
219
- import urllib
220
- import os
221
- from datetime import datetime
222
- from SimpleHTTPServer import SimpleHTTPRequestHandler
223
- from BaseHTTPServer import HTTPServer
224
-
225
- class RootedHTTPServer(HTTPServer):
226
- def __init__(self, base_path, *args, **kwargs):
227
- HTTPServer.__init__(self, *args, **kwargs)
228
- self.RequestHandlerClass.base_path = base_path
229
-
230
- class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
231
- def translate_path(self, path):
232
- path = posixpath.normpath(urllib.unquote(path)).split("?")[0]
233
- words = path.split("/")
234
- words = filter(None, words)
235
- path = self.base_path
236
- for word in words:
237
- drive, word = os.path.splitdrive(word)
238
- head, word = os.path.split(word)
239
- if word in (os.curdir, os.pardir):
240
- continue
241
- path = os.path.join(path, word)
242
- return path
243
-
244
- def server(HandlerClass=RootedHTTPRequestHandler, ServerClass=RootedHTTPServer):
245
- server_address = ("127.0.0.1", 8080)
246
- print os.path.dirname(os.path.abspath(__file__))
247
- httpd = ServerClass(os.path.dirname(os.path.abspath(__file__)), server_address, HandlerClass)
248
- sa = httpd.socket.getsockname()
249
- print "Serving HTTP on http://127.0.0.1:8080 ..."
250
- webbrowser.open("http://127.0.0.1:8080/?__random=" + datetime.now().strftime("%s"), new=2)
251
- httpd.serve_forever()
252
-
253
- if __name__ == "__main__":
254
- server()
255
- `;
256
-
257
- const readme = `
258
- # How to run a project
259
-
260
- Windows:
261
- 1. run chfs.exe
262
- 2. open \`http://127.0.0.1\`.
263
-
264
- MacOS & Linux:
265
- 1. make sure you have *Python* on your computer already.
266
- 2. run \`python server.py\`.
267
- 3. if broswer is not open automatically, open \`http://127.0.0.1:8080\`.
268
-
269
- # 如何使用
270
-
271
- Windows:
272
- 1. 运行 chfs.exe
273
- 2. 打开浏览器访问 \`http://127.0.0.1\`.
274
-
275
- MacOS & Linux:
276
- 1. 确保你已经安装了 *Python*;
277
- 2. 运行 \`python server.py\`;
278
- 3. 如果你的浏览器没有自动打开,那么请自行访问 \`http://127.0.0.1:8080\`。
279
- `
280
-
281
- let downloadQueue = Promise.resolve()
282
-
283
- function main(work, exportPath) {
284
-
285
- // 生成输出目录
286
- mkdirp(path.resolve(exportPath));
287
-
288
- // 修改work
289
- traverse(work, (value, keyPath) => {
290
- if (typeof value === "string" && urlRegExp.test(value) && fileRegExp.test(value)) {
291
- const relativeValue = value.replace(urlRegExp, match => "downloads/" + md5(match) + "/");
292
- const filename = shortPath(path.resolve(exportPath, relativeValue));
293
- downloadQueue = downloadQueue.then(() => {
294
- if (keyPath.indexOf("model.material_textures") >= 0) {
295
- value = imageURL(value, { size: 512 });
296
- }
297
- return download(value, filename)
298
- .then(() => console.log(`success ${value} => ${filename}`))
299
- .catch(() => console.log(`error ${value} => ${filename}`));
300
- })
301
- return relativeValue;
302
- }
303
- return value;
304
- })
305
-
306
- work.base_url = "./";
307
-
308
- // 输出 work.json
309
- fs.writeFileSync(path.resolve(exportPath, "work.json"), JSON.stringify(work, "", " "), "utf-8");
310
-
311
- // 输出 html
312
- fs.writeFileSync(path.resolve(exportPath, "index.html"), htmlExample, "utf-8");
313
-
314
- // 输出 readme
315
- fs.writeFileSync(path.resolve(exportPath, "README.md"), readme, "utf-8");
316
-
317
- // copy five.js
318
- fs.copyFileSync(path.join(__dirname, "../bundles/five.js"), path.resolve(exportPath, "five.js"));
319
-
320
- // copy five.js
321
- fs.copyFileSync(path.join(__dirname, "chfs.exe"), path.resolve(exportPath, "chfs.exe"));
322
-
323
- // 输出 server.py
324
- fs.writeFileSync(path.resolve(exportPath, "server.py"), pyServer, "utf-8");
325
- }
326
-
327
- main(formatWork(work), exportPath);