@realsee/five 5.0.0-alpha.20 → 5.0.0-alpha.201

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 (252) hide show
  1. package/README.md +18 -8
  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/main.js +52 -0
  6. package/docs/assets/search.js +1 -0
  7. package/docs/assets/style.css +1414 -0
  8. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  9. package/docs/classes/five.BVH.html +10 -0
  10. package/docs/classes/five.BVHIntersect.html +1 -0
  11. package/docs/classes/five.BVHNode.html +7 -0
  12. package/docs/classes/five.BVHVector3.html +1 -0
  13. package/docs/classes/five.Camera.html +11 -0
  14. package/docs/classes/five.Clipper.html +1 -0
  15. package/docs/classes/five.Five.html +333 -0
  16. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  17. package/docs/classes/five.IntersectMesh.html +1 -0
  18. package/docs/classes/five.Model.html +91 -0
  19. package/docs/classes/five.NetworkSubscribe.html +50 -0
  20. package/docs/classes/five.PBMContainer.html +17 -0
  21. package/docs/classes/five.PBMGroup.html +19 -0
  22. package/docs/classes/five.PBMMaterial.html +29 -0
  23. package/docs/classes/five.PBMMesh.html +7 -0
  24. package/docs/classes/five.PanoCircleMesh.html +7 -0
  25. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  26. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  27. package/docs/classes/five.Scene.html +3 -0
  28. package/docs/classes/five.Subscribe.html +56 -0
  29. package/docs/classes/five.TextureLoader.html +1 -0
  30. package/docs/classes/five.Tile3D.html +34 -0
  31. package/docs/classes/five.Tile3DModel.html +15 -0
  32. package/docs/classes/five.TileBoundingSphere.html +1 -0
  33. package/docs/classes/five.TileCacheNode.html +1 -0
  34. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  35. package/docs/classes/five.TileCullingVolume.html +1 -0
  36. package/docs/classes/five.TileOrientedBoundingBox.html +1 -0
  37. package/docs/classes/five.TileRequestScheduler.html +16 -0
  38. package/docs/classes/five.Tileset3D.html +11 -0
  39. package/docs/classes/five.Tileset3DTraverser.html +1 -0
  40. package/docs/classes/five.TilesetCache.html +1 -0
  41. package/docs/classes/five.Work.html +32 -0
  42. package/docs/classes/five.XRButton.html +1 -0
  43. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  44. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  45. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  46. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  47. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  48. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  49. package/docs/classes/line.Line.html +1 -0
  50. package/docs/classes/line.LineGeometry.html +1 -0
  51. package/docs/classes/line.LineMaterial.html +1 -0
  52. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  53. package/docs/classes/line.THREE_Line2.html +1 -0
  54. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  55. package/docs/classes/react.Store.html +29 -0
  56. package/docs/classes/server.BVH.html +10 -0
  57. package/docs/classes/server.BVHIntersect.html +1 -0
  58. package/docs/classes/server.BVHNode.html +7 -0
  59. package/docs/classes/server.BVHVector3.html +1 -0
  60. package/docs/classes/server.Model.html +70 -0
  61. package/docs/classes/server.PBMContainer.html +7 -0
  62. package/docs/classes/server.PBMGroup.html +9 -0
  63. package/docs/classes/server.PBMMesh.html +7 -0
  64. package/docs/classes/sticker.Sticker.html +32 -0
  65. package/docs/classes/vfx.Airflow.html +1 -0
  66. package/docs/classes/vfx.Flame.html +1 -0
  67. package/docs/classes/vfx.Particle.html +89 -0
  68. package/docs/classes/vfx.SpotLight.html +1 -0
  69. package/docs/index.html +166 -434
  70. package/docs/interfaces/five.AddableObject.html +9 -0
  71. package/docs/interfaces/five.AnimationFrame.html +1 -0
  72. package/docs/interfaces/five.CameraPose.html +1 -0
  73. package/docs/interfaces/five.ClipperParameter.html +1 -0
  74. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  75. package/docs/interfaces/five.EventCallback.html +400 -0
  76. package/docs/interfaces/five.FiveInitArgs.html +111 -0
  77. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -0
  78. package/docs/interfaces/five.ImageOptions.html +18 -0
  79. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  80. package/docs/interfaces/five.ImageURLOptions.html +15 -0
  81. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  82. package/docs/interfaces/five.Intersection.html +7 -0
  83. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  84. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  85. package/docs/interfaces/five.ModelEventCallback.html +26 -0
  86. package/docs/interfaces/five.ModelLodOptions.html +1 -0
  87. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  88. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  89. package/docs/interfaces/five.NetworkOptions.html +9 -0
  90. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  91. package/docs/interfaces/five.PBMParameters.html +29 -0
  92. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  93. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  94. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  95. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  96. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +35 -0
  97. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  98. package/docs/interfaces/five.Pose.html +37 -0
  99. package/docs/interfaces/five.Scissor.html +14 -0
  100. package/docs/interfaces/five.State.html +21 -0
  101. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  102. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  103. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  104. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  105. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  106. package/docs/interfaces/five.TextureOptions.html +20 -0
  107. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  108. package/docs/interfaces/five.TileBoundingVolume.html +19 -0
  109. package/docs/interfaces/five.TileContent.html +1 -0
  110. package/docs/interfaces/five.TileCubeNode.html +1 -0
  111. package/docs/interfaces/five.TileCubeTree.html +1 -0
  112. package/docs/interfaces/five.Tileset3dOptions.html +1 -0
  113. package/docs/interfaces/five.TilesetJSON.html +1 -0
  114. package/docs/interfaces/five.TilesetJSONNode.html +1 -0
  115. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -0
  116. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +31 -0
  117. package/docs/interfaces/five.WebXRSelectParams.html +1 -0
  118. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  119. package/docs/interfaces/five.WorkImage.html +21 -0
  120. package/docs/interfaces/five.WorkInitial.html +13 -0
  121. package/docs/interfaces/five.WorkModel.html +11 -0
  122. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  123. package/docs/interfaces/five.WorkObserver.html +27 -0
  124. package/docs/interfaces/five.WorkTile.html +1 -0
  125. package/docs/interfaces/five.WorkVideo.html +9 -0
  126. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +31 -0
  127. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  128. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  129. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  130. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  131. package/docs/interfaces/react.FiveActionReactCallbacks.html +52 -0
  132. package/docs/interfaces/react.FiveInjectionTypes.html +181 -0
  133. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  134. package/docs/interfaces/server.Intersection.html +7 -0
  135. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  136. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  137. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  138. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  139. package/docs/interfaces/vue.FiveActionVueCallbacks.html +60 -0
  140. package/docs/modules/five.SubscribeMixinType.html +1 -0
  141. package/docs/modules/five.html +465 -3002
  142. package/docs/modules/gltf_loader.html +1 -155
  143. package/docs/modules/line.html +1 -202
  144. package/docs/modules/react.html +130 -1507
  145. package/docs/modules/server.html +18 -526
  146. package/docs/modules/sticker.html +1 -151
  147. package/docs/modules/vfx.html +1 -0
  148. package/docs/modules/vue.html +115 -0
  149. package/docs/modules.html +1 -136
  150. package/exporters/staticify.js +210 -0
  151. package/five/index.d.ts +1465 -286
  152. package/five/index.js +362 -1
  153. package/gltf-loader/index.d.ts +90 -5
  154. package/gltf-loader/index.js +260 -1
  155. package/line/index.d.ts +15 -2
  156. package/line/index.js +260 -1
  157. package/package.json +12 -11
  158. package/react/index.d.ts +73 -72
  159. package/react/index.js +260 -1
  160. package/scripts/five-staticify.js +26 -0
  161. package/server/index.d.ts +222 -27
  162. package/server/index.js +357 -1
  163. package/sticker/index.d.ts +2 -1
  164. package/sticker/index.js +260 -1
  165. package/templates/quick-start/package.json +1 -1
  166. package/umd/five-gltf-loader.js +1 -2
  167. package/umd/five-line.js +1 -2
  168. package/umd/five-react.js +1 -2
  169. package/umd/five-sticker.js +1 -2
  170. package/umd/five-vfx.js +1 -0
  171. package/umd/five-vue.js +1 -0
  172. package/umd/five.js +1 -1
  173. package/umd/five.js.LICENSE.txt +58 -118
  174. package/vfx/index.d.ts +264 -0
  175. package/vfx/index.js +260 -0
  176. package/vue/index.d.ts +441 -0
  177. package/vue/index.js +260 -0
  178. package/docs/assets/css/main.css +0 -2660
  179. package/docs/assets/js/main.js +0 -248
  180. package/docs/assets/js/search.js +0 -1
  181. package/docs/classes/five.camera.html +0 -323
  182. package/docs/classes/five.five-1.html +0 -2670
  183. package/docs/classes/five.hashcubetexture.html +0 -252
  184. package/docs/classes/five.internalwebglrenderer.html +0 -212
  185. package/docs/classes/five.model.html +0 -982
  186. package/docs/classes/five.pbmgroup.html +0 -427
  187. package/docs/classes/five.pbmmaterial.html +0 -533
  188. package/docs/classes/five.pbmmesh.html +0 -254
  189. package/docs/classes/five.scene.html +0 -263
  190. package/docs/classes/five.subscribe.html +0 -569
  191. package/docs/classes/gltf_loader.gltfloader.html +0 -412
  192. package/docs/classes/gltf_loader.gltfobject.html +0 -287
  193. package/docs/classes/line.line-1.html +0 -381
  194. package/docs/classes/line.linegeometry.html +0 -524
  195. package/docs/classes/line.linematerial.html +0 -300
  196. package/docs/classes/line.linesegmentsgeometry.html +0 -471
  197. package/docs/classes/react.store.html +0 -605
  198. package/docs/classes/server.model.html +0 -823
  199. package/docs/classes/server.pbmgroup.html +0 -366
  200. package/docs/classes/server.pbmmesh.html +0 -335
  201. package/docs/classes/sticker.sticker-1.html +0 -465
  202. package/docs/interfaces/five.addableobject.html +0 -234
  203. package/docs/interfaces/five.depthpanoramacontrollercustominitargs.html +0 -420
  204. package/docs/interfaces/five.eventcallback.html +0 -2548
  205. package/docs/interfaces/five.fiveinitargs.html +0 -707
  206. package/docs/interfaces/five.floorplancontrollercustominitargs.html +0 -295
  207. package/docs/interfaces/five.imageoptions.html +0 -332
  208. package/docs/interfaces/five.intersection.html +0 -227
  209. package/docs/interfaces/five.intersectmeshinterface.html +0 -188
  210. package/docs/interfaces/five.modelcontrollercustominitargs.html +0 -366
  211. package/docs/interfaces/five.modeleventcallback.html +0 -367
  212. package/docs/interfaces/five.movepanooptions.html +0 -469
  213. package/docs/interfaces/five.panocirclemeshinterface.html +0 -361
  214. package/docs/interfaces/five.panoramacontrollercustominitargs.html +0 -464
  215. package/docs/interfaces/five.panoramalikecontrollercustominitargs.html +0 -364
  216. package/docs/interfaces/five.pbmparameters.html +0 -474
  217. package/docs/interfaces/five.pose.html +0 -270
  218. package/docs/interfaces/five.scissor.html +0 -252
  219. package/docs/interfaces/five.state.html +0 -300
  220. package/docs/interfaces/five.subscribemixintype.emit.html +0 -180
  221. package/docs/interfaces/five.subscribemixintype.haslistener.html +0 -171
  222. package/docs/interfaces/five.subscribemixintype.off.html +0 -198
  223. package/docs/interfaces/five.subscribemixintype.on.html +0 -213
  224. package/docs/interfaces/five.subscribemixintype.once.html +0 -210
  225. package/docs/interfaces/five.topviewcontrollercustominitargs.html +0 -226
  226. package/docs/interfaces/five.vrpanoramacontrollercustominitargs.html +0 -452
  227. package/docs/interfaces/gltf_loader.gltf.html +0 -304
  228. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -580
  229. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1625
  230. package/docs/interfaces/react.injectfivetoprops.html +0 -280
  231. package/docs/interfaces/server.intersection.html +0 -308
  232. package/docs/interfaces/server.modeleventcallback.html +0 -409
  233. package/docs/interfaces/sticker.intersectionlike.html +0 -223
  234. package/docs/modules/five.subscribemixintype.html +0 -143
  235. package/scripts/export-five-resource/chfs.exe +0 -0
  236. package/scripts/export-five-resource/fileify.js +0 -192
  237. package/scripts/export-five-resource/format-work.js +0 -71
  238. package/scripts/export-five-resource/staticify.js +0 -327
  239. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  240. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  241. package/scripts/transcode-model/MTLLoader.js +0 -602
  242. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  243. package/scripts/transcode-model/obj2pbm.js +0 -65
  244. /package/docs/assets/{images/icons.png → icons.png} +0 -0
  245. /package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  246. /package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  247. /package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  248. /package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  249. /package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  250. /package/resource/{draco_decoder.js → gltf/draco_decoder.js} +0 -0
  251. /package/resource/{draco_decoder.wasm → gltf/draco_decoder.wasm} +0 -0
  252. /package/resource/{draco_wasm_wrapper.js → gltf/draco_wasm_wrapper.js} +0 -0
package/docs/modules.html CHANGED
@@ -1,136 +1 @@
1
- <!doctype html>
2
- <html class="default no-js">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>如视 Five SDK - v5.0.0-alpha.20</title>
7
- <meta name="description" content="Documentation for 如视 Five SDK - v5.0.0-alpha.20">
8
- <meta name="viewport" content="width=device-width, initial-scale=1">
9
- <link rel="stylesheet" href="assets/css/main.css">
10
- <script async src="assets/js/search.js" id="search-script"></script>
11
- </head>
12
- <body>
13
- <header>
14
- <div class="tsd-page-toolbar">
15
- <div class="container">
16
- <div class="table-wrap">
17
- <div class="table-cell" id="tsd-search" data-index="assets/js/search.json" data-base=".">
18
- <div class="field">
19
- <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
20
- <input id="tsd-search-field" type="text" />
21
- </div>
22
- <ul class="results">
23
- <li class="state loading">Preparing search index...</li>
24
- <li class="state failure">The search index is not available</li>
25
- </ul>
26
- <a href="index.html" class="title">如视 Five SDK - v5.0.0-alpha.20</a>
27
- </div>
28
- <div class="table-cell" id="tsd-widgets">
29
- <div id="tsd-filter">
30
- <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
31
- <div class="tsd-filter-group">
32
- <div class="tsd-select" id="tsd-filter-visibility">
33
- <span class="tsd-select-label">All</span>
34
- <ul class="tsd-select-list">
35
- <li data-value="public">Public</li>
36
- <li data-value="protected">Public/Protected</li>
37
- <li data-value="private" class="selected">All</li>
38
- </ul>
39
- </div>
40
- <input type="checkbox" id="tsd-filter-inherited" checked />
41
- <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
42
- </div>
43
- </div>
44
- <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- <div class="tsd-page-title">
50
- <div class="container">
51
- <h1>如视 Five SDK - v5.0.0-alpha.20</h1>
52
- </div>
53
- </div>
54
- </header>
55
- <div class="container container-main">
56
- <div class="row">
57
- <div class="col-8 col-content">
58
- <section class="tsd-panel-group tsd-index-group">
59
- <h2>Index</h2>
60
- <section class="tsd-panel tsd-index-panel">
61
- <div class="tsd-index-content">
62
- <section class="tsd-index-section ">
63
- <h3>Modules</h3>
64
- <ul class="tsd-index-list">
65
- <li class="tsd-kind-module"><a href="modules/five.html" class="tsd-kind-icon">five</a></li>
66
- <li class="tsd-kind-module"><a href="modules/gltf_loader.html" class="tsd-kind-icon">gltf-<wbr>loader</a></li>
67
- <li class="tsd-kind-module"><a href="modules/line.html" class="tsd-kind-icon">line</a></li>
68
- <li class="tsd-kind-module"><a href="modules/react.html" class="tsd-kind-icon">react</a></li>
69
- <li class="tsd-kind-module"><a href="modules/server.html" class="tsd-kind-icon">server</a></li>
70
- <li class="tsd-kind-module"><a href="modules/sticker.html" class="tsd-kind-icon">sticker</a></li>
71
- </ul>
72
- </section>
73
- </div>
74
- </section>
75
- </section>
76
- </div>
77
- <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
78
- <nav class="tsd-navigation primary">
79
- <ul>
80
- <li class="current ">
81
- <a href="modules.html">Modules</a>
82
- </li>
83
- <li class=" tsd-kind-module">
84
- <a href="modules/five.html">five</a>
85
- </li>
86
- <li class=" tsd-kind-module">
87
- <a href="modules/gltf_loader.html">gltf-<wbr>loader</a>
88
- </li>
89
- <li class=" tsd-kind-module">
90
- <a href="modules/line.html">line</a>
91
- </li>
92
- <li class=" tsd-kind-module">
93
- <a href="modules/react.html">react</a>
94
- </li>
95
- <li class=" tsd-kind-module">
96
- <a href="modules/server.html">server</a>
97
- </li>
98
- <li class=" tsd-kind-module">
99
- <a href="modules/sticker.html">sticker</a>
100
- </li>
101
- </ul>
102
- </nav>
103
- <nav class="tsd-navigation secondary menu-sticky">
104
- <ul class="before-current">
105
- </ul>
106
- </nav>
107
- </div>
108
- </div>
109
- </div>
110
- <footer>
111
- <div class="container">
112
- <h2>Legend</h2>
113
- <div class="tsd-legend-group">
114
- <ul class="tsd-legend">
115
- <li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li>
116
- <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
117
- <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
118
- <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
119
- <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
120
- <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
121
- </ul>
122
- <ul class="tsd-legend">
123
- <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
124
- <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
125
- </ul>
126
- <ul class="tsd-legend">
127
- <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
128
- <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
129
- </ul>
130
- </div>
131
- </div>
132
- </footer>
133
- <div class="overlay"></div>
134
- <script src="assets/js/main.js"></script>
135
- </body>
136
- </html>
1
+ <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>如视 Five SDK - v5.0.0-alpha.201</title><meta name="description" content="Documentation for 如视 Five SDK - v5.0.0-alpha.201"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">如视 Five SDK - v5.0.0-alpha.201</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> 如视 Five SDK - v5.0.0-alpha.201 </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Modules</h3><ul class="tsd-index-list"><li class="tsd-kind-module"><a href="modules/five.html" class="tsd-kind-icon">five</a></li><li class="tsd-kind-module"><a href="modules/gltf_loader.html" class="tsd-kind-icon">gltf-<wbr/>loader</a></li><li class="tsd-kind-module"><a href="modules/line.html" class="tsd-kind-icon">line</a></li><li class="tsd-kind-module"><a href="modules/react.html" class="tsd-kind-icon">react</a></li><li class="tsd-kind-module"><a href="modules/server.html" class="tsd-kind-icon">server</a></li><li class="tsd-kind-module"><a href="modules/sticker.html" class="tsd-kind-icon">sticker</a></li><li class="tsd-kind-module"><a href="modules/vfx.html" class="tsd-kind-icon">vfx</a></li><li class="tsd-kind-module"><a href="modules/vue.html" class="tsd-kind-icon">vue</a></li></ul></section></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/five.html">five</a></li><li class=" tsd-kind-module"><a href="modules/gltf_loader.html">gltf-<wbr/>loader</a></li><li class=" tsd-kind-module"><a href="modules/line.html">line</a></li><li class=" tsd-kind-module"><a href="modules/react.html">react</a></li><li class=" tsd-kind-module"><a href="modules/server.html">server</a></li><li class=" tsd-kind-module"><a href="modules/sticker.html">sticker</a></li><li class=" tsd-kind-module"><a href="modules/vfx.html">vfx</a></li><li class=" tsd-kind-module"><a href="modules/vue.html">vue</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li><li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li><li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="assets/main.js"></script></body></html>
@@ -0,0 +1,210 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const archiver = require("archiver");
4
+ const ejs = require("ejs");
5
+ const { parseWork } = require("@realsee/five/server");
6
+
7
+ function matchJsonpFunctionName(url) {
8
+ const regExps = [
9
+ /\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,
10
+ /jsonp_([0-9a-z]+)([\?\#].*)?$/i
11
+ ];
12
+ for (const regExp of regExps) {
13
+ const matched = url.match(regExp);
14
+ if (matched) {
15
+ return "jsonp_" + matched[1];
16
+ }
17
+ }
18
+ return null;
19
+ };
20
+
21
+ const CDN_PUBLIC_BASE = "//vrlab-public.ljcdn.com";
22
+ const CDN_IMAGE_BASE = "//vrlab-image4.ljcdn.com";
23
+ const CDN_TEST_PUBLIC_BASE = "//test-vr-public.realsee-cdn.com";
24
+ const CDN_TEST_IMAGE_BASE = "//test-vr-image.realsee-cdn.com";
25
+ function imageURL(url, size) {
26
+ if (url.indexOf(CDN_PUBLIC_BASE) >= 0) {
27
+ if (/\.(jpg|png)$/.test(url)) {
28
+ // 默认使用数据万象
29
+ // https://cloud.tencent.com/document/product/460/36544
30
+ if (size) {
31
+ let suffix = "?imageMogr2";
32
+ if (size) suffix += "/thumbnail/" + size + "x";
33
+ url = url.replace(CDN_PUBLIC_BASE, CDN_IMAGE_BASE) + suffix;
34
+ }
35
+ }
36
+ }
37
+ if (url.indexOf(CDN_TEST_PUBLIC_BASE) >= 0) {
38
+ if (/\.(jpg|png)$/.test(url)) {
39
+ // 默认使用数据万象
40
+ // https://cloud.tencent.com/document/product/460/36544
41
+ if (size) {
42
+ let suffix = "?imageMogr2";
43
+ if (size) suffix += "/thumbnail/" + size + "x";
44
+ url = url.replace(CDN_TEST_PUBLIC_BASE, CDN_TEST_IMAGE_BASE) + suffix;
45
+ }
46
+ }
47
+ }
48
+ return url;
49
+ }
50
+
51
+ async function download(url, jsonpHandleKey) {
52
+ const request = /^https\:/.test(url) ? require("https") : require("http");
53
+ return new Promise((resolve, reject) => {
54
+ const req = request.get(url, res => {
55
+ const mime = res.headers['content-type'];
56
+ const buffers = [];
57
+
58
+ res.on('data', chunk => buffers.push(chunk));
59
+ res.on('end', () => {
60
+ const contents = Buffer.concat(buffers);
61
+ if (jsonpHandleKey) {
62
+ const dataURL = `data:${mime};base64,${contents.toString('base64')}`;
63
+ const jsopContents = `window[${JSON.stringify(jsonpHandleKey)}] && window[${JSON.stringify(jsonpHandleKey)}](${JSON.stringify(dataURL)})`;
64
+ resolve(Buffer.from(jsopContents));
65
+ } else {
66
+ resolve(Buffer.from(contents));
67
+ }
68
+ })
69
+ res.on("error", () => reject(new Error(`fetch ${url} got error`)));
70
+ });
71
+ req.on("error", () => reject(new Error(`fetch ${url} got error`)));
72
+ })
73
+ }
74
+
75
+ const template = `
76
+ <!DOCTYPE html>
77
+ <html lang="en">
78
+ <head>
79
+ <meta charset="UTF-8">
80
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
81
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
82
+ <title>REALSEE PREVIEW</title>
83
+ <style>
84
+ * { margin: 0; padding: 0; }
85
+ html, body { height: 100%; width: 100%; overflow: hidden; }
86
+ #app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
87
+ .buttons { position: fixed; top: 10px; left: 10px; pointer-events: none; }
88
+ .buttons h3 { margin-top: 10px; text-shadow: 0 0 2px rgba(255, 255, 255, 0.5); }
89
+ .buttons button { pointer-events: auto; display: block; font-size: 14px; color: #FFF; background: #5a6268; padding: 3px 10px; border: 1px solid #333; margin-right: 2px; border-radius: 2px; cursor: pointer; margin-top: 10px; }
90
+ .buttons button:active { background: #333; }
91
+ </style>
92
+ <script src="./three.min.js"></script>
93
+ <script src="./five.js"></script>
94
+ <script>const workJSON = <%- JSON.stringify(work_json) %></script>
95
+ </head>
96
+ <body>
97
+ <!-- 试图渲染容器 -->
98
+ <div id="app"></div>
99
+ <script>
100
+ const five = new FiveSDK.Five();
101
+ five.appendTo(document.getElementById("app"));
102
+ const work = FiveSDK.parseWork(workJSON, { baseURL: "./", shortPath: <%- JSON.stringify(short_path) %>, jsonp: <%- JSON.stringify(jsonp) %> });
103
+ five.load(work);
104
+
105
+ const modeButtons = [
106
+ { mode: "Panorama", label: "全景模式" },
107
+ { mode: "Floorplan", label: "模型纵览模式" },
108
+ { mode: "Topview", label: "模型俯视模式" },
109
+ { mode: "Model", label: "模型漫游模式" },
110
+ ];
111
+
112
+ const buttons = document.createElement("div");
113
+ buttons.className = "buttons";
114
+ document.body.appendChild(buttons);
115
+ buttons.appendChild(document.createElement("h3")).innerHTML = "模式控制";
116
+
117
+ // 模态按钮
118
+ for (let i = 0; i < modeButtons.length; i++) {
119
+ const button = document.createElement("button");
120
+ button.innerHTML = modeButtons[i].label;
121
+ button.addEventListener('click', () => {
122
+ // 通过 changeMode 方法可以切换模态
123
+ five.changeMode(FiveSDK.Five.Mode[modeButtons[i].mode]);
124
+ });
125
+ buttons.appendChild(button);
126
+ }
127
+ window.addEventListener("resize", () => five.refresh(), false);
128
+ </script>
129
+ </body>
130
+ </html>
131
+ `;
132
+
133
+ function getThreeJsBuffer() {
134
+ let tempPath = path.resolve(__dirname);
135
+ while (!(tempPath === '/' || tempPath === ".")) {
136
+ const threeFilePath = path.join(tempPath, "node_modules/three/build/three.min.js");
137
+ if (fs.existsSync(threeFilePath)) {
138
+ return fs.readFileSync(threeFilePath);
139
+ }
140
+ tempPath = path.dirname(tempPath);
141
+ }
142
+ throw new Error("three.js is not found");
143
+ }
144
+
145
+ function getFiveJsBuffer() {
146
+ return fs.readFileSync(path.join(__dirname, "../umd/five.js"));
147
+ }
148
+
149
+ async function staticify(work, output, shortPath = false, jsonp = false, preview = true) {
150
+ const zipFilename = /\.zip$/.test(output) ? output : output + ".zip";
151
+ const outputStream = fs.createWriteStream(zipFilename);
152
+ const archive = archiver("zip", { zlib: { level: 9 } });
153
+ archive.on("error", (err) => { throw err; });
154
+ outputStream.on("close", function() {
155
+ console.log(`zip ${archive.pointer()} total bytes`);
156
+ console.log(`dist ${zipFilename}`);
157
+ });
158
+ archive.pipe(outputStream);
159
+
160
+ const resources = [];
161
+ const workJSONObject = JSON.parse(fs.readFileSync(work, "utf8"));
162
+ parseWork(workJSONObject, { shortPath, jsonp }, (origin, _, relative, type) => {
163
+ resources.push({ origin, relative, type });
164
+ });
165
+
166
+ const textureCount = resources.filter(({ type }) => type === "texture").length;
167
+ let textureSize;
168
+ if (textureCount > 50) {
169
+ textureSize = 64;
170
+ } else if (textureCount > 40) {
171
+ textureSize = 128;
172
+ } else if (textureCount > 30) {
173
+ textureSize = 256;
174
+ } else if (textureCount > 15) {
175
+ textureSize = 512;
176
+ } else if (textureCount > 10) {
177
+ textureSize = 1024;
178
+ }
179
+ if (textureSize) {
180
+ for (const resource of resources) {
181
+ if (resource.type === "texture") {
182
+ resource.origin = imageURL(resource.origin, textureSize);
183
+ }
184
+ }
185
+ }
186
+ for (const { origin, relative } of resources) {
187
+ const buffer = await download(origin, matchJsonpFunctionName(relative));
188
+ console.log(`${origin} -> ${relative}`);
189
+ archive.append(buffer, { name: relative });
190
+ }
191
+ archive.append(fs.readFileSync(work), { name: "work.json" });
192
+
193
+ if (preview) {
194
+ archive.append(getFiveJsBuffer(), { name: "five.js" });
195
+ archive.append(getThreeJsBuffer(), { name: "three.min.js" });
196
+
197
+ const data = {
198
+ work_json: workJSONObject,
199
+ short_path: Boolean(shortPath),
200
+ jsonp: Boolean(jsonp),
201
+ };
202
+
203
+ const html = typeof preview === 'string' ? ejs.render(fs.readFileSync(preview, "utf8"), data) : ejs.render(template, data);
204
+ archive.append(html, { name: "index.html" });
205
+ }
206
+
207
+ archive.finalize();
208
+ }
209
+
210
+ module.exports = staticify;