csyjk 1.2.2 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. package/{dist/app.js → app.js} +0 -0
  2. package/{dist/index.html → index.html} +0 -0
  3. package/package.json +5 -40
  4. package/{dist/style.css → style.css} +0 -0
  5. package/.babelrc +0 -7
  6. package/.idea/modules.xml +0 -8
  7. package/.idea/xx.iml +0 -12
  8. package/public/gltf.js +0 -2241
  9. package/public/index.html +0 -10
  10. package/src/index.js +0 -3
  11. package/src/lib/gltf/assets/check.jpg +0 -0
  12. package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
  13. package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
  14. package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
  15. package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
  16. package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
  17. package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
  18. package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
  19. package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
  20. package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
  21. package/src/lib/gltf/assets/yjkkit-sdk/package.json +0 -15
  22. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
  23. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
  24. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
  25. package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
  26. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
  27. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
  28. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
  29. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
  30. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
  31. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
  32. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
  33. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
  34. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
  35. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
  36. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
  37. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
  38. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
  39. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
  40. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
  41. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
  42. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
  43. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
  44. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
  45. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
  46. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
  47. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
  48. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
  49. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
  50. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
  51. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
  52. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
  53. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
  54. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
  55. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
  56. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
  57. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
  58. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
  59. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
  60. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
  61. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
  62. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
  63. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
  64. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
  65. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
  66. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
  67. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
  68. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
  69. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
  70. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
  71. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
  72. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
  73. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
  74. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
  75. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
  76. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
  77. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
  78. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
  79. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
  80. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
  81. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
  82. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
  83. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
  84. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
  85. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
  86. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
  87. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
  88. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
  89. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
  90. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
  91. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
  92. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
  93. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
  94. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
  95. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
  96. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
  97. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
  98. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
  99. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
  100. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
  101. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
  102. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
  103. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
  104. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
  105. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
  106. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
  107. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
  108. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
  109. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
  110. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
  111. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
  112. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
  113. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
  114. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
  115. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
  116. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
  117. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
  118. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
  119. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
  120. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
  121. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
  122. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
  123. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
  124. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
  125. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
  126. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
  127. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
  128. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
  129. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
  130. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
  131. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
  132. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
  133. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
  134. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
  135. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
  136. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
  137. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
  138. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
  139. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
  140. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
  141. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
  142. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
  143. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
  144. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
  145. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
  146. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
  147. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
  148. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
  149. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
  150. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
  151. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
  152. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
  153. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
  154. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
  155. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
  156. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
  157. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
  158. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
  159. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
  160. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
  161. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
  162. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
  163. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
  164. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
  165. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
  166. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
  167. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
  168. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
  169. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
  170. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
  171. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
  172. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
  173. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
  174. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
  175. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
  176. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
  177. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
  178. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
  179. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
  180. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
  181. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
  182. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
  183. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
  184. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
  185. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
  186. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
  187. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
  188. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
  189. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
  190. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
  191. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
  192. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
  193. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
  194. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
  195. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
  196. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
  197. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
  198. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
  199. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
  200. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
  201. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
  202. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
  203. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
  204. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
  205. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
  206. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
  207. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
  208. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
  209. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
  210. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
  211. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
  212. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
  213. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
  214. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
  215. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
  216. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
  217. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
  218. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
  219. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
  220. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
  221. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
  222. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
  223. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
  224. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
  225. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
  226. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
  227. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
  228. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
  229. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
  230. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
  231. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
  232. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
  233. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
  234. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
  235. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
  236. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
  237. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
  238. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
  239. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
  240. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
  241. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
  242. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
  243. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
  244. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
  245. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
  246. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
  247. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
  248. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
  249. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
  250. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
  251. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
  252. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
  253. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
  254. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
  255. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
  256. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
  257. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
  258. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
  259. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
  260. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
  261. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
  262. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
  263. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
  264. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
  265. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
  266. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
  267. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
  268. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
  269. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
  270. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
  271. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
  272. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
  273. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
  274. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
  275. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
  276. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
  277. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
  278. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
  279. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
  280. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
  281. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
  282. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
  283. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
  284. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
  285. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
  286. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
  287. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
  288. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
  289. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
  290. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
  291. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
  292. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
  293. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
  294. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
  295. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
  296. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
  297. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
  298. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
  299. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
  300. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
  301. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
  302. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
  303. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
  304. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
  305. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
  306. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
  307. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
  308. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
  309. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
  310. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
  311. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
  312. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
  313. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
  314. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
  315. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
  316. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
  317. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
  318. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
  319. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
  320. package/src/lib/gltf/gltf.css +0 -392
  321. package/src/lib/gltf/gltf.js +0 -2241
  322. package/webpack.config.js +0 -70
@@ -1,1017 +0,0 @@
1
- import {WEBGL_INFO} from "../../../../webglInfo.js";
2
- import {ENTITY_FLAGS} from '../../ENTITY_FLAGS.js';
3
- import {RENDER_PASSES} from '../../RENDER_PASSES.js';
4
-
5
- import {math} from "../../../../math/math.js";
6
- import {RenderState} from "../../../../webgl/RenderState.js";
7
- import {ArrayBuf} from "../../../../webgl/ArrayBuf.js";
8
- import {geometryCompressionUtils} from "../../../../math/geometryCompressionUtils.js";
9
- import {getBatchingRenderers} from "./TrianglesBatchingRenderers.js";
10
- import {TrianglesBatchingBuffer} from "./TrianglesBatchingBuffer.js";
11
- import {quantizePositions, transformAndOctEncodeNormals} from "../../compression.js";
12
-
13
- const tempMat4 = math.mat4();
14
- const tempMat4b = math.mat4();
15
- const tempVec4a = math.vec4([0, 0, 0, 1]);
16
- const tempVec4b = math.vec4([0, 0, 0, 1]);
17
- const tempVec4c = math.vec4([0, 0, 0, 1]);
18
- const tempOBB3 = math.OBB3();
19
-
20
- /**
21
- * @private
22
- */
23
- class TrianglesBatchingLayer {
24
-
25
- /**
26
- * @param model
27
- * @param cfg
28
- * @param cfg.layerIndex
29
- * @param cfg.positionsDecodeMatrix
30
- * @param cfg.maxGeometryBatchSize
31
- * @param cfg.rtcCenter
32
- * @param cfg.scratchMemory
33
- * @param cfg.solid
34
- */
35
- constructor(model, cfg) {
36
-
37
- /**
38
- * State sorting key.
39
- * @type {string}
40
- */
41
- this.sortId = "TrianglesBatchingLayer" + cfg.solid ? "-solid" : "-surface";
42
-
43
- /**
44
- * Index of this TrianglesBatchingLayer in {@link PerformanceModel#_layerList}.
45
- * @type {Number}
46
- */
47
- this.layerIndex = cfg.layerIndex;
48
-
49
- this._batchingRenderers = getBatchingRenderers(model.scene);
50
- this.model = model;
51
- this._buffer = new TrianglesBatchingBuffer(cfg.maxGeometryBatchSize);
52
- this._scratchMemory = cfg.scratchMemory;
53
-
54
- this._state = new RenderState({
55
- positionsBuf: null,
56
- offsetsBuf: null,
57
- normalsBuf: null,
58
- colorsBuf: null,
59
- metallicRoughnessBuf: null,
60
- flagsBuf: null,
61
- flags2Buf: null,
62
- indicesBuf: null,
63
- edgeIndicesBuf: null,
64
- positionsDecodeMatrix: math.mat4(),
65
- rtcCenter: null
66
- });
67
-
68
- // These counts are used to avoid unnecessary render passes
69
- this._numPortions = 0;
70
- this._numVisibleLayerPortions = 0;
71
- this._numTransparentLayerPortions = 0;
72
- this._numXRayedLayerPortions = 0;
73
- this._numSelectedLayerPortions = 0;
74
- this._numHighlightedLayerPortions = 0;
75
- this._numClippableLayerPortions = 0;
76
- this._numEdgesLayerPortions = 0;
77
- this._numPickableLayerPortions = 0;
78
- this._numCulledLayerPortions = 0;
79
-
80
- this._modelAABB = math.collapseAABB3(); // Model-space AABB
81
- this._portions = [];
82
-
83
- this._finalized = false;
84
- this._positionsDecodeMatrix = cfg.positionsDecodeMatrix;
85
- this._preCompressed = (!!this._positionsDecodeMatrix);
86
-
87
- if (cfg.rtcCenter) {
88
- this._state.rtcCenter = math.vec3(cfg.rtcCenter);
89
- }
90
-
91
- /**
92
- * The axis-aligned World-space boundary of this TrianglesBatchingLayer's positions.
93
- * @type {*|Float64Array}
94
- */
95
- this.aabb = math.collapseAABB3();
96
-
97
- /**
98
- * When true, this layer contains solid triangle meshes, otherwise this layer contains surface triangle meshes
99
- * @type {boolean}
100
- */
101
- this.solid = !!cfg.solid;
102
- }
103
-
104
- /**
105
- * Tests if there is room for another portion in this TrianglesBatchingLayer.
106
- *
107
- * @param lenPositions Number of positions we'd like to create in the portion.
108
- * @param lenIndices Number of indices we'd like to create in this portion.
109
- * @returns {boolean} True if OK to create another portion.
110
- */
111
- canCreatePortion(lenPositions, lenIndices) {
112
- if (this._finalized) {
113
- throw "Already finalized";
114
- }
115
- return ((this._buffer.positions.length + lenPositions) < (this._buffer.maxVerts * 3) && (this._buffer.indices.length + lenIndices) < (this._buffer.maxIndices));
116
- }
117
-
118
- /**
119
- * Creates a new portion within this TrianglesBatchingLayer, returns the new portion ID.
120
- *
121
- * Gives the portion the specified geometry, color and matrix.
122
- *
123
- * @param cfg.positions Flat float Local-space positions array.
124
- * @param [cfg.normals] Flat float normals array.
125
- * @param [cfg.colors] Flat float colors array.
126
- * @param cfg.indices Flat int indices array.
127
- * @param [cfg.edgeIndices] Flat int edges indices array.
128
- * @param cfg.color Quantized RGB color [0..255,0..255,0..255,0..255]
129
- * @param cfg.metallic Metalness factor [0..255]
130
- * @param cfg.roughness Roughness factor [0..255]
131
- * @param cfg.opacity Opacity [0..255]
132
- * @param [cfg.meshMatrix] Flat float 4x4 matrix
133
- * @param [cfg.worldMatrix] Flat float 4x4 matrix
134
- * @param cfg.worldAABB Flat float AABB World-space AABB
135
- * @param cfg.pickColor Quantized pick color
136
- * @returns {number} Portion ID
137
- */
138
- createPortion(cfg) {
139
-
140
- if (this._finalized) {
141
- throw "Already finalized";
142
- }
143
-
144
- const positions = cfg.positions;
145
- const normals = cfg.normals;
146
- const indices = cfg.indices;
147
- const edgeIndices = cfg.edgeIndices;
148
- const color = cfg.color;
149
- const metallic = cfg.metallic;
150
- const roughness = cfg.roughness;
151
- const colors = cfg.colors;
152
- const opacity = cfg.opacity;
153
- const meshMatrix = cfg.meshMatrix;
154
- const worldMatrix = cfg.worldMatrix;
155
- const worldAABB = cfg.worldAABB;
156
- const pickColor = cfg.pickColor;
157
-
158
- const buffer = this._buffer;
159
- const positionsIndex = buffer.positions.length;
160
- const vertsIndex = positionsIndex / 3;
161
- const numVerts = positions.length / 3;
162
- const lenPositions = positions.length;
163
-
164
- if (this._preCompressed) {
165
-
166
- for (let i = 0, len = positions.length; i < len; i++) {
167
- buffer.positions.push(positions[i]);
168
- }
169
-
170
- const bounds = geometryCompressionUtils.getPositionsBounds(positions);
171
-
172
- const min = geometryCompressionUtils.decompressPosition(bounds.min, this._positionsDecodeMatrix, []);
173
- const max = geometryCompressionUtils.decompressPosition(bounds.max, this._positionsDecodeMatrix, []);
174
-
175
- worldAABB[0] = min[0];
176
- worldAABB[1] = min[1];
177
- worldAABB[2] = min[2];
178
- worldAABB[3] = max[0];
179
- worldAABB[4] = max[1];
180
- worldAABB[5] = max[2];
181
-
182
- if (worldMatrix) {
183
- math.AABB3ToOBB3(worldAABB, tempOBB3);
184
- math.transformOBB3(worldMatrix, tempOBB3);
185
- math.OBB3ToAABB3(tempOBB3, worldAABB);
186
- }
187
-
188
- } else {
189
-
190
- const positionsBase = buffer.positions.length;
191
-
192
- for (let i = 0, len = positions.length; i < len; i++) {
193
- buffer.positions.push(positions[i]);
194
- }
195
-
196
- if (meshMatrix) {
197
-
198
- for (let i = positionsBase, len = positionsBase + lenPositions; i < len; i += 3) {
199
-
200
- tempVec4a[0] = buffer.positions[i + 0];
201
- tempVec4a[1] = buffer.positions[i + 1];
202
- tempVec4a[2] = buffer.positions[i + 2];
203
-
204
- math.transformPoint4(meshMatrix, tempVec4a, tempVec4b);
205
-
206
- buffer.positions[i + 0] = tempVec4b[0];
207
- buffer.positions[i + 1] = tempVec4b[1];
208
- buffer.positions[i + 2] = tempVec4b[2];
209
-
210
- math.expandAABB3Point3(this._modelAABB, tempVec4b);
211
-
212
- if (worldMatrix) {
213
- math.transformPoint4(worldMatrix, tempVec4b, tempVec4c);
214
- math.expandAABB3Point3(worldAABB, tempVec4c);
215
- } else {
216
- math.expandAABB3Point3(worldAABB, tempVec4b);
217
- }
218
- }
219
-
220
- } else {
221
-
222
- for (let i = positionsBase, len = positionsBase + lenPositions; i < len; i += 3) {
223
-
224
- tempVec4a[0] = buffer.positions[i + 0];
225
- tempVec4a[1] = buffer.positions[i + 1];
226
- tempVec4a[2] = buffer.positions[i + 2];
227
-
228
- math.expandAABB3Point3(this._modelAABB, tempVec4a);
229
-
230
- if (worldMatrix) {
231
- math.transformPoint4(worldMatrix, tempVec4a, tempVec4b);
232
- math.expandAABB3Point3(worldAABB, tempVec4b);
233
- } else {
234
- math.expandAABB3Point3(worldAABB, tempVec4a);
235
- }
236
- }
237
- }
238
- }
239
-
240
- if (this._state.rtcCenter) {
241
- const rtcCenter = this._state.rtcCenter;
242
- worldAABB[0] += rtcCenter[0];
243
- worldAABB[1] += rtcCenter[1];
244
- worldAABB[2] += rtcCenter[2];
245
- worldAABB[3] += rtcCenter[0];
246
- worldAABB[4] += rtcCenter[1];
247
- worldAABB[5] += rtcCenter[2];
248
- }
249
-
250
- math.expandAABB3(this.aabb, worldAABB);
251
-
252
- if (normals) {
253
-
254
- if (this._preCompressed) {
255
-
256
- for (let i = 0, len = normals.length; i < len; i++) {
257
- buffer.normals.push(normals[i]);
258
- }
259
-
260
- } else {
261
-
262
- const worldNormalMatrix = tempMat4;
263
-
264
- if (meshMatrix) {
265
- math.inverseMat4(math.transposeMat4(meshMatrix, tempMat4b), worldNormalMatrix); // Note: order of inverse and transpose doesn't matter
266
-
267
- } else {
268
- math.identityMat4(worldNormalMatrix, worldNormalMatrix);
269
- }
270
-
271
- transformAndOctEncodeNormals(worldNormalMatrix, normals, normals.length, buffer.normals, buffer.normals.length);
272
- }
273
- }
274
-
275
- if (colors) {
276
-
277
- for (let i = 0, len = colors.length; i < len; i += 3) {
278
- buffer.colors.push(colors[i] * 255);
279
- buffer.colors.push(colors[i + 1] * 255);
280
- buffer.colors.push(colors[i + 2] * 255);
281
- buffer.colors.push(255);
282
- }
283
-
284
- } else if (color) {
285
-
286
- const r = color[0]; // Color is pre-quantized by PerformanceModel
287
- const g = color[1];
288
- const b = color[2];
289
- const a = opacity;
290
-
291
- const metallicValue = (metallic !== null && metallic !== undefined) ? metallic : 0;
292
- const roughnessValue = (roughness !== null && roughness !== undefined) ? roughness : 255;
293
-
294
- for (let i = 0; i < numVerts; i++) {
295
-
296
- buffer.colors.push(r);
297
- buffer.colors.push(g);
298
- buffer.colors.push(b);
299
- buffer.colors.push(a);
300
-
301
- buffer.metallicRoughness.push(metallicValue);
302
- buffer.metallicRoughness.push(roughnessValue);
303
- }
304
- }
305
-
306
- if (indices) {
307
- for (let i = 0, len = indices.length; i < len; i++) {
308
- buffer.indices.push(indices[i] + vertsIndex);
309
- }
310
- }
311
-
312
- if (edgeIndices) {
313
- for (let i = 0, len = edgeIndices.length; i < len; i++) {
314
- buffer.edgeIndices.push(edgeIndices[i] + vertsIndex);
315
- }
316
- }
317
-
318
- {
319
- const pickColorsBase = buffer.pickColors.length;
320
- const lenPickColors = numVerts * 4;
321
- for (let i = pickColorsBase, len = pickColorsBase + lenPickColors; i < len; i += 4) {
322
- buffer.pickColors.push(pickColor[0]);
323
- buffer.pickColors.push(pickColor[1]);
324
- buffer.pickColors.push(pickColor[2]);
325
- buffer.pickColors.push(pickColor[3]);
326
- }
327
- }
328
-
329
- if (this.model.scene.entityOffsetsEnabled) {
330
- for (let i = 0; i < numVerts; i++) {
331
- buffer.offsets.push(0);
332
- buffer.offsets.push(0);
333
- buffer.offsets.push(0);
334
- }
335
- }
336
-
337
- const portionId = this._portions.length / 2;
338
-
339
- this._portions.push(vertsIndex);
340
- this._portions.push(numVerts);
341
-
342
- this._numPortions++;
343
- this.model.numPortions++;
344
-
345
- return portionId;
346
- }
347
-
348
- /**
349
- * Builds batch VBOs from appended geometries.
350
- * No more portions can then be created.
351
- */
352
- finalize() {
353
-
354
- if (this._finalized) {
355
- this.model.error("Already finalized");
356
- return;
357
- }
358
-
359
- const state = this._state;
360
- const gl = this.model.scene.canvas.gl;
361
- const buffer = this._buffer;
362
-
363
- if (buffer.positions.length > 0) {
364
- if (this._preCompressed) {
365
- state.positionsDecodeMatrix = this._positionsDecodeMatrix;
366
- const positions = new Uint16Array(buffer.positions);
367
- state.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, positions, buffer.positions.length, 3, gl.STATIC_DRAW);
368
- } else {
369
- const quantizedPositions = quantizePositions(buffer.positions, this._modelAABB, state.positionsDecodeMatrix); // BOTTLENECK
370
- state.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, quantizedPositions, buffer.positions.length, 3, gl.STATIC_DRAW);
371
- }
372
- }
373
-
374
- if (buffer.normals.length > 0) {
375
- const normals = new Int8Array(buffer.normals);
376
- let normalized = true; // For oct encoded UInts
377
- //let normalized = false; // For scaled
378
- state.normalsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, normals, buffer.normals.length, 3, gl.STATIC_DRAW, normalized);
379
- }
380
-
381
- if (buffer.colors.length > 0) {
382
- const colors = new Uint8Array(buffer.colors);
383
- let normalized = false;
384
- state.colorsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, colors, buffer.colors.length, 4, gl.DYNAMIC_DRAW, normalized);
385
- }
386
-
387
- if (buffer.metallicRoughness.length > 0) {
388
- const metallicRoughness = new Uint8Array(buffer.metallicRoughness);
389
- let normalized = false;
390
- state.metallicRoughnessBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, metallicRoughness, buffer.metallicRoughness.length, 2, gl.STATIC_DRAW, normalized);
391
- }
392
-
393
- if (buffer.colors.length > 0) { // Because we build flags arrays here, get their length from the colors array
394
- const flagsLength = buffer.colors.length;
395
- const flags = new Uint8Array(flagsLength);
396
- const flags2 = new Uint8Array(flagsLength);
397
- let notNormalized = false;
398
- let normalized = true;
399
- state.flagsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, flags, flags.length, 4, gl.DYNAMIC_DRAW, notNormalized);
400
- state.flags2Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, flags2, flags2.length, 4, gl.DYNAMIC_DRAW, normalized);
401
- }
402
-
403
- if (buffer.pickColors.length > 0) {
404
- const pickColors = new Uint8Array(buffer.pickColors);
405
- let normalized = false;
406
- state.pickColorsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, pickColors, buffer.pickColors.length, 4, gl.STATIC_DRAW, normalized);
407
- }
408
-
409
- if (this.model.scene.entityOffsetsEnabled) {
410
- if (buffer.offsets.length > 0) {
411
- const offsets = new Float32Array(buffer.offsets);
412
- state.offsetsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, offsets, buffer.offsets.length, 3, gl.DYNAMIC_DRAW);
413
- }
414
- }
415
-
416
- const bigIndicesSupported = WEBGL_INFO.SUPPORTED_EXTENSIONS["OES_element_index_uint"];
417
-
418
- if (buffer.indices.length > 0) {
419
- const indices = bigIndicesSupported ? new Uint32Array(buffer.indices) : new Uint16Array(buffer.indices);
420
- state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, indices, buffer.indices.length, 1, gl.STATIC_DRAW);
421
- }
422
- if (buffer.edgeIndices.length > 0) {
423
- const edgeIndices = bigIndicesSupported ? new Uint32Array(buffer.edgeIndices) : new Uint16Array(buffer.edgeIndices);
424
- state.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, edgeIndices, buffer.edgeIndices.length, 1, gl.STATIC_DRAW);
425
- }
426
-
427
- this._buffer = null;
428
- this._finalized = true;
429
- }
430
-
431
- initFlags(portionId, flags, meshTransparent) {
432
- if (flags & ENTITY_FLAGS.VISIBLE) {
433
- this._numVisibleLayerPortions++;
434
- this.model.numVisibleLayerPortions++;
435
- }
436
- if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
437
- this._numHighlightedLayerPortions++;
438
- this.model.numHighlightedLayerPortions++;
439
- }
440
- if (flags & ENTITY_FLAGS.XRAYED) {
441
- this._numXRayedLayerPortions++;
442
- this.model.numXRayedLayerPortions++;
443
- }
444
- if (flags & ENTITY_FLAGS.SELECTED) {
445
- this._numSelectedLayerPortions++;
446
- this.model.numSelectedLayerPortions++;
447
- }
448
- if (flags & ENTITY_FLAGS.CLIPPABLE) {
449
- this._numClippableLayerPortions++;
450
- this.model.numClippableLayerPortions++;
451
- }
452
- if (flags & ENTITY_FLAGS.EDGES) {
453
- this._numEdgesLayerPortions++;
454
- this.model.numEdgesLayerPortions++;
455
- }
456
- if (flags & ENTITY_FLAGS.PICKABLE) {
457
- this._numPickableLayerPortions++;
458
- this.model.numPickableLayerPortions++;
459
- }
460
- if (flags & ENTITY_FLAGS.CULLED) {
461
- this._numCulledLayerPortions++;
462
- this.model.numCulledLayerPortions++;
463
- }
464
- if (meshTransparent) {
465
- this._numTransparentLayerPortions++;
466
- this.model.numTransparentLayerPortions++;
467
- }
468
- this._setFlags(portionId, flags, meshTransparent);
469
- this._setFlags2(portionId, flags);
470
- }
471
-
472
- setVisible(portionId, flags, transparent) {
473
- if (!this._finalized) {
474
- throw "Not finalized";
475
- }
476
- if (flags & ENTITY_FLAGS.VISIBLE) {
477
- this._numVisibleLayerPortions++;
478
- this.model.numVisibleLayerPortions++;
479
- } else {
480
- this._numVisibleLayerPortions--;
481
- this.model.numVisibleLayerPortions--;
482
- }
483
- this._setFlags(portionId, flags, transparent);
484
- }
485
-
486
- setHighlighted(portionId, flags, transparent) {
487
- if (!this._finalized) {
488
- throw "Not finalized";
489
- }
490
- if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
491
- this._numHighlightedLayerPortions++;
492
- this.model.numHighlightedLayerPortions++;
493
- } else {
494
- this._numHighlightedLayerPortions--;
495
- this.model.numHighlightedLayerPortions--;
496
- }
497
- this._setFlags(portionId, flags, transparent);
498
- }
499
-
500
- setXRayed(portionId, flags, transparent) {
501
- if (!this._finalized) {
502
- throw "Not finalized";
503
- }
504
- if (flags & ENTITY_FLAGS.XRAYED) {
505
- this._numXRayedLayerPortions++;
506
- this.model.numXRayedLayerPortions++;
507
- } else {
508
- this._numXRayedLayerPortions--;
509
- this.model.numXRayedLayerPortions--;
510
- }
511
- this._setFlags(portionId, flags, transparent);
512
- }
513
-
514
- setSelected(portionId, flags, transparent) {
515
- if (!this._finalized) {
516
- throw "Not finalized";
517
- }
518
- if (flags & ENTITY_FLAGS.SELECTED) {
519
- this._numSelectedLayerPortions++;
520
- this.model.numSelectedLayerPortions++;
521
- } else {
522
- this._numSelectedLayerPortions--;
523
- this.model.numSelectedLayerPortions--;
524
- }
525
- this._setFlags(portionId, flags, transparent);
526
- }
527
-
528
- setEdges(portionId, flags, transparent) {
529
- if (!this._finalized) {
530
- throw "Not finalized";
531
- }
532
- if (flags & ENTITY_FLAGS.EDGES) {
533
- this._numEdgesLayerPortions++;
534
- this.model.numEdgesLayerPortions++;
535
- } else {
536
- this._numEdgesLayerPortions--;
537
- this.model.numEdgesLayerPortions--;
538
- }
539
- this._setFlags(portionId, flags, transparent);
540
- }
541
-
542
- setClippable(portionId, flags) {
543
- if (!this._finalized) {
544
- throw "Not finalized";
545
- }
546
- if (flags & ENTITY_FLAGS.CLIPPABLE) {
547
- this._numClippableLayerPortions++;
548
- this.model.numClippableLayerPortions++;
549
- } else {
550
- this._numClippableLayerPortions--;
551
- this.model.numClippableLayerPortions--;
552
- }
553
- this._setFlags2(portionId, flags);
554
- }
555
-
556
- setCulled(portionId, flags, transparent) {
557
- if (!this._finalized) {
558
- throw "Not finalized";
559
- }
560
- if (flags & ENTITY_FLAGS.CULLED) {
561
- this._numCulledLayerPortions++;
562
- this.model.numCulledLayerPortions++;
563
- } else {
564
- this._numCulledLayerPortions--;
565
- this.model.numCulledLayerPortions--;
566
- }
567
- this._setFlags(portionId, flags, transparent);
568
- }
569
-
570
- setCollidable(portionId, flags) {
571
- if (!this._finalized) {
572
- throw "Not finalized";
573
- }
574
- }
575
-
576
- setPickable(portionId, flags, transparent) {
577
- if (!this._finalized) {
578
- throw "Not finalized";
579
- }
580
- if (flags & ENTITY_FLAGS.PICKABLE) {
581
- this._numPickableLayerPortions++;
582
- this.model.numPickableLayerPortions++;
583
- } else {
584
- this._numPickableLayerPortions--;
585
- this.model.numPickableLayerPortions--;
586
- }
587
- this._setFlags(portionId, flags, transparent);
588
- }
589
-
590
- setColor(portionId, color) {
591
- if (!this._finalized) {
592
- throw "Not finalized";
593
- }
594
- const portionsIdx = portionId * 2;
595
- const vertexBase = this._portions[portionsIdx];
596
- const numVerts = this._portions[portionsIdx + 1];
597
- const firstColor = vertexBase * 4;
598
- const lenColor = numVerts * 4;
599
- const tempArray = this._scratchMemory.getUInt8Array(lenColor);
600
- const r = color[0];
601
- const g = color[1];
602
- const b = color[2];
603
- const a = color[3];
604
- for (let i = 0; i < lenColor; i += 4) {
605
- tempArray[i + 0] = r;
606
- tempArray[i + 1] = g;
607
- tempArray[i + 2] = b;
608
- tempArray[i + 3] = a;
609
- }
610
- this._state.colorsBuf.setData(tempArray, firstColor, lenColor);
611
- }
612
-
613
- setTransparent(portionId, flags, transparent) {
614
- if (transparent) {
615
- this._numTransparentLayerPortions++;
616
- this.model.numTransparentLayerPortions++;
617
- } else {
618
- this._numTransparentLayerPortions--;
619
- this.model.numTransparentLayerPortions--;
620
- }
621
- this._setFlags(portionId, flags, transparent);
622
- }
623
-
624
- _setFlags(portionId, flags, transparent) {
625
-
626
- if (!this._finalized) {
627
- throw "Not finalized";
628
- }
629
-
630
- const portionsIdx = portionId * 2;
631
- const vertexBase = this._portions[portionsIdx];
632
- const numVerts = this._portions[portionsIdx + 1];
633
- const firstFlag = vertexBase * 4;
634
- const lenFlags = numVerts * 4;
635
- const tempArray = this._scratchMemory.getUInt8Array(lenFlags);
636
-
637
- const visible = !!(flags & ENTITY_FLAGS.VISIBLE);
638
- const xrayed = !!(flags & ENTITY_FLAGS.XRAYED);
639
- const highlighted = !!(flags & ENTITY_FLAGS.HIGHLIGHTED);
640
- const selected = !!(flags & ENTITY_FLAGS.SELECTED);
641
- const edges = !!(flags & ENTITY_FLAGS.EDGES);
642
- const pickable = !!(flags & ENTITY_FLAGS.PICKABLE);
643
- const culled = !!(flags & ENTITY_FLAGS.CULLED);
644
-
645
- // Color
646
-
647
- let f0;
648
- if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
649
- f0 = RENDER_PASSES.NOT_RENDERED;
650
- } else {
651
- if (transparent) {
652
- f0 = RENDER_PASSES.COLOR_TRANSPARENT;
653
- } else {
654
- f0 = RENDER_PASSES.COLOR_OPAQUE;
655
- }
656
- }
657
-
658
- // Silhouette
659
-
660
- let f1;
661
- if (!visible || culled) {
662
- f1 = RENDER_PASSES.NOT_RENDERED;
663
- } else if (selected) {
664
- f1 = RENDER_PASSES.SILHOUETTE_SELECTED;
665
- } else if (highlighted) {
666
- f1 = RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;
667
- } else if (xrayed) {
668
- f1 = RENDER_PASSES.SILHOUETTE_XRAYED;
669
- } else {
670
- f1 = RENDER_PASSES.NOT_RENDERED;
671
- }
672
-
673
- // Edges
674
-
675
- let f2 = 0;
676
- if (!visible || culled) {
677
- f2 = RENDER_PASSES.NOT_RENDERED;
678
- } else if (selected) {
679
- f2 = RENDER_PASSES.EDGES_SELECTED;
680
- } else if (highlighted) {
681
- f2 = RENDER_PASSES.EDGES_HIGHLIGHTED;
682
- } else if (xrayed) {
683
- f2 = RENDER_PASSES.EDGES_XRAYED;
684
- } else if (edges) {
685
- if (transparent) {
686
- f2 = RENDER_PASSES.EDGES_COLOR_TRANSPARENT;
687
- } else {
688
- f2 = RENDER_PASSES.EDGES_COLOR_OPAQUE;
689
- }
690
- } else {
691
- f2 = RENDER_PASSES.NOT_RENDERED;
692
- }
693
-
694
- // Pick
695
-
696
- let f3 = (visible && !culled && pickable) ? RENDER_PASSES.PICK : RENDER_PASSES.NOT_RENDERED;
697
-
698
- for (let i = 0; i < lenFlags; i += 4) {
699
- tempArray[i + 0] = f0; // x - normal fill
700
- tempArray[i + 1] = f1; // y - emphasis fill
701
- tempArray[i + 2] = f2; // z - edges
702
- tempArray[i + 3] = f3; // w - pick
703
- }
704
-
705
- this._state.flagsBuf.setData(tempArray, firstFlag, lenFlags);
706
- }
707
-
708
- _setFlags2(portionId, flags) {
709
-
710
- if (!this._finalized) {
711
- throw "Not finalized";
712
- }
713
-
714
- const portionsIdx = portionId * 2;
715
- const vertexBase = this._portions[portionsIdx];
716
- const numVerts = this._portions[portionsIdx + 1];
717
- const firstFlag = vertexBase * 4;
718
- const lenFlags = numVerts * 4;
719
- const tempArray = this._scratchMemory.getUInt8Array(lenFlags);
720
-
721
- const clippable = !!(flags & ENTITY_FLAGS.CLIPPABLE) ? 255 : 0;
722
-
723
- for (let i = 0; i < lenFlags; i += 4) {
724
- tempArray[i + 0] = clippable;
725
- }
726
-
727
- this._state.flags2Buf.setData(tempArray, firstFlag, lenFlags);
728
- }
729
-
730
- setOffset(portionId, offset) {
731
- if (!this._finalized) {
732
- throw "Not finalized";
733
- }
734
- if (!this.model.scene.entityOffsetsEnabled) {
735
- this.model.error("Entity#offset not enabled for this Viewer"); // See Viewer entityOffsetsEnabled
736
- return;
737
- }
738
- const portionsIdx = portionId * 2;
739
- const vertexBase = this._portions[portionsIdx];
740
- const numVerts = this._portions[portionsIdx + 1];
741
- const firstOffset = vertexBase * 3;
742
- const lenOffsets = numVerts * 3;
743
- const tempArray = this._scratchMemory.getFloat32Array(lenOffsets);
744
- const x = offset[0];
745
- const y = offset[1];
746
- const z = offset[2];
747
- for (let i = 0; i < lenOffsets; i += 3) {
748
- tempArray[i + 0] = x;
749
- tempArray[i + 1] = y;
750
- tempArray[i + 2] = z;
751
- }
752
- this._state.offsetsBuf.setData(tempArray, firstOffset, lenOffsets);
753
- }
754
-
755
- // ---------------------- COLOR RENDERING -----------------------------------
756
-
757
- drawColorOpaque(renderFlags, frameCtx) {
758
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
759
- return;
760
- }
761
- this._updateBackfaceCull(renderFlags, frameCtx);
762
- if (frameCtx.withSAO && this.model.saoEnabled) {
763
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
764
- if (this._batchingRenderers.colorQualityRendererWithSAO) {
765
- this._batchingRenderers.colorQualityRendererWithSAO.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
766
- }
767
- } else {
768
- if (this._batchingRenderers.colorRendererWithSAO) {
769
- this._batchingRenderers.colorRendererWithSAO.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
770
- }
771
- }
772
- } else {
773
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
774
- if (this._batchingRenderers.colorQualityRenderer) {
775
- this._batchingRenderers.colorQualityRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
776
- }
777
- } else {
778
- if (this._batchingRenderers.colorRenderer) {
779
- this._batchingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
780
- }
781
- }
782
- }
783
- }
784
-
785
- _updateBackfaceCull(renderFlags, frameCtx) {
786
- const backfaces = this.model.backfaces || (!this.solid) || renderFlags.sectioned;
787
- if (frameCtx.backfaces !== backfaces) {
788
- const gl = frameCtx.gl;
789
- if (backfaces) {
790
- gl.disable(gl.CULL_FACE);
791
- } else {
792
- gl.enable(gl.CULL_FACE);
793
- }
794
- frameCtx.backfaces = backfaces;
795
- }
796
- }
797
-
798
- drawColorTransparent(renderFlags, frameCtx) {
799
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === 0 || this._numXRayedLayerPortions === this._numPortions) {
800
- return;
801
- }
802
- this._updateBackfaceCull(renderFlags, frameCtx);
803
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
804
- if (this._batchingRenderers.colorQualityRenderer) {
805
- this._batchingRenderers.colorQualityRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_TRANSPARENT);
806
- }
807
- } else {
808
- if (this._batchingRenderers.colorRenderer) {
809
- this._batchingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_TRANSPARENT);
810
- }
811
- }
812
- }
813
-
814
- // ---------------------- RENDERING SAO POST EFFECT TARGETS --------------
815
-
816
- drawDepth(renderFlags, frameCtx) {
817
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
818
- return;
819
- }
820
- this._updateBackfaceCull(renderFlags, frameCtx);
821
- if (this._batchingRenderers.depthRenderer) {
822
- this._batchingRenderers.depthRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE); // Assume whatever post-effect uses depth (eg SAO) does not apply to transparent objects
823
- }
824
- }
825
-
826
- drawNormals(renderFlags, frameCtx) {
827
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
828
- return;
829
- }
830
- this._updateBackfaceCull(renderFlags, frameCtx);
831
- if (this._batchingRenderers.normalsRenderer) {
832
- this._batchingRenderers.normalsRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE); // Assume whatever post-effect uses normals (eg SAO) does not apply to transparent objects
833
- }
834
- }
835
-
836
- // ---------------------- SILHOUETTE RENDERING -----------------------------------
837
-
838
- drawSilhouetteXRayed(renderFlags, frameCtx) {
839
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numXRayedLayerPortions === 0) {
840
- return;
841
- }
842
- this._updateBackfaceCull(renderFlags, frameCtx);
843
- if (this._batchingRenderers.silhouetteRenderer) {
844
- this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_XRAYED);
845
- }
846
- }
847
-
848
- drawSilhouetteHighlighted(renderFlags, frameCtx) {
849
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numHighlightedLayerPortions === 0) {
850
- return;
851
- }
852
- this._updateBackfaceCull(renderFlags, frameCtx);
853
- if (this._batchingRenderers.silhouetteRenderer) {
854
- this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_HIGHLIGHTED);
855
- }
856
- }
857
-
858
- drawSilhouetteSelected(renderFlags, frameCtx) {
859
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numSelectedLayerPortions === 0) {
860
- return;
861
- }
862
- this._updateBackfaceCull(renderFlags, frameCtx);
863
- if (this._batchingRenderers.silhouetteRenderer) {
864
- this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_SELECTED);
865
- }
866
- }
867
-
868
- // ---------------------- EDGES RENDERING -----------------------------------
869
-
870
- drawEdgesColorOpaque(renderFlags, frameCtx) {
871
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0) {
872
- return;
873
- }
874
- if (this._batchingRenderers.edgesColorRenderer) {
875
- this._batchingRenderers.edgesColorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_COLOR_OPAQUE);
876
- }
877
- }
878
-
879
- drawEdgesColorTransparent(renderFlags, frameCtx) {
880
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0 || this._numTransparentLayerPortions === 0) {
881
- return;
882
- }
883
- if (this._batchingRenderers.edgesColorRenderer) {
884
- this._batchingRenderers.edgesColorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_COLOR_TRANSPARENT);
885
- }
886
- }
887
-
888
- drawEdgesHighlighted(renderFlags, frameCtx) {
889
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numHighlightedLayerPortions === 0) {
890
- return;
891
- }
892
- if (this._batchingRenderers.edgesRenderer) {
893
- this._batchingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_HIGHLIGHTED);
894
- }
895
- }
896
-
897
- drawEdgesSelected(renderFlags, frameCtx) {
898
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numSelectedLayerPortions === 0) {
899
- return;
900
- }
901
- if (this._batchingRenderers.edgesRenderer) {
902
- this._batchingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_SELECTED);
903
- }
904
- }
905
-
906
- drawEdgesXRayed(renderFlags, frameCtx) {
907
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numXRayedLayerPortions === 0) {
908
- return;
909
- }
910
- if (this._batchingRenderers.edgesRenderer) {
911
- this._batchingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_XRAYED);
912
- }
913
- }
914
-
915
- // ---------------------- OCCLUSION CULL RENDERING -----------------------------------
916
-
917
- drawOcclusion(renderFlags, frameCtx) {
918
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
919
- return;
920
- }
921
- this._updateBackfaceCull(renderFlags, frameCtx);
922
- if (this._batchingRenderers.occlusionRenderer) {
923
- this._batchingRenderers.occlusionRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
924
- }
925
- }
926
-
927
- // ---------------------- SHADOW BUFFER RENDERING -----------------------------------
928
-
929
- drawShadow(renderFlags, frameCtx) {
930
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
931
- return;
932
- }
933
- this._updateBackfaceCull(renderFlags, frameCtx);
934
- if (this._batchingRenderers.shadowRenderer) {
935
- this._batchingRenderers.shadowRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
936
- }
937
- }
938
-
939
- //---- PICKING ----------------------------------------------------------------------------------------------------
940
-
941
- drawPickMesh(renderFlags, frameCtx) {
942
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
943
- return;
944
- }
945
- this._updateBackfaceCull(renderFlags, frameCtx);
946
- if (this._batchingRenderers.pickMeshRenderer) {
947
- this._batchingRenderers.pickMeshRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
948
- }
949
- }
950
-
951
- drawPickDepths(renderFlags, frameCtx) {
952
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
953
- return;
954
- }
955
- this._updateBackfaceCull(renderFlags, frameCtx);
956
- if (this._batchingRenderers.pickDepthRenderer) {
957
- this._batchingRenderers.pickDepthRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
958
- }
959
- }
960
-
961
- drawPickNormals(renderFlags, frameCtx) {
962
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
963
- return;
964
- }
965
- this._updateBackfaceCull(renderFlags, frameCtx);
966
- if (this._batchingRenderers.pickNormalsRenderer) {
967
- this._batchingRenderers.pickNormalsRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
968
- }
969
- }
970
-
971
- destroy() {
972
- const state = this._state;
973
- if (state.positionsBuf) {
974
- state.positionsBuf.destroy();
975
- state.positionsBuf = null;
976
- }
977
- if (state.offsetsBuf) {
978
- state.offsetsBuf.destroy();
979
- state.offsetsBuf = null;
980
- }
981
- if (state.normalsBuf) {
982
- state.normalsBuf.destroy();
983
- state.normalsBuf = null;
984
- }
985
- if (state.colorsBuf) {
986
- state.colorsBuf.destroy();
987
- state.colorsBuf = null;
988
- }
989
- if (state.metallicRoughnessBuf) {
990
- state.metallicRoughnessBuf.destroy();
991
- state.metallicRoughnessBuf = null;
992
- }
993
- if (state.flagsBuf) {
994
- state.flagsBuf.destroy();
995
- state.flagsBuf = null;
996
- }
997
- if (state.flags2Buf) {
998
- state.flags2Buf.destroy();
999
- state.flags2Buf = null;
1000
- }
1001
- if (state.pickColorsBuf) {
1002
- state.pickColorsBuf.destroy();
1003
- state.pickColorsBuf = null;
1004
- }
1005
- if (state.indicesBuf) {
1006
- state.indicesBuf.destroy();
1007
- state.indicessBuf = null;
1008
- }
1009
- if (state.edgeIndicesBuf) {
1010
- state.edgeIndicesBuf.destroy();
1011
- state.edgeIndicessBuf = null;
1012
- }
1013
- state.destroy();
1014
- }
1015
- }
1016
-
1017
- export {TrianglesBatchingLayer};