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,969 +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 {buildEdgeIndices} from '../../../../math/buildEdgeIndices.js';
7
- import {RenderState} from "../../../../webgl/RenderState.js";
8
- import {ArrayBuf} from "../../../../webgl/ArrayBuf.js";
9
- import {geometryCompressionUtils} from "../../../../math/geometryCompressionUtils.js";
10
- import {getInstancingRenderers} from "./TrianglesInstancingRenderers.js";
11
- import {quantizePositions, octEncodeNormals} from "../../compression.js";
12
-
13
- const bigIndicesSupported = WEBGL_INFO.SUPPORTED_EXTENSIONS["OES_element_index_uint"];
14
-
15
- const tempUint8Vec4 = new Uint8Array(4);
16
- const tempVec4a = math.vec4([0, 0, 0, 1]);
17
- const tempVec4b = math.vec4([0, 0, 0, 1]);
18
- const tempVec4c = math.vec4([0, 0, 0, 1]);
19
- const tempVec3fa = new Float32Array(3);
20
-
21
- /**
22
- * @private
23
- */
24
- class TrianglesInstancingLayer {
25
-
26
- /**
27
- * @param model
28
- * @param cfg
29
- * @param cfg.layerIndex
30
- * @param cfg.positions Flat float Local-space positions array.
31
- * @param [cfg.normals] Flat float normals array.
32
- * @param cfg.indices Flat int indices array.
33
- * @param [cfg.edgeIndices] Flat int edges indices array.
34
- * @param cfg.edgeThreshold
35
- * @param cfg.rtcCenter
36
- * @params cfg.solid
37
- */
38
- constructor(model, cfg) {
39
-
40
- /**
41
- * State sorting key.
42
- * @type {string}
43
- */
44
- this.sortId = "TrianglesInstancingLayer" + cfg.solid ? "-solid" : "-surface";
45
-
46
- /**
47
- * Index of this InstancingLayer in PerformanceModel#_layerList
48
- * @type {Number}
49
- */
50
- this.layerIndex = cfg.layerIndex;
51
-
52
- this._instancingRenderers = getInstancingRenderers(model.scene);
53
- this.model = model;
54
- this._aabb = math.collapseAABB3();
55
-
56
- const stateCfg = {
57
- positionsDecodeMatrix: math.mat4(),
58
- numInstances: 0,
59
- obb: math.OBB3(),
60
- rtcCenter: null
61
- };
62
-
63
- const preCompressed = (!!cfg.positionsDecodeMatrix);
64
- const gl = this.model.scene.canvas.gl;
65
-
66
- if (cfg.positions) {
67
-
68
- if (preCompressed) {
69
-
70
- let normalized = false;
71
- stateCfg.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, cfg.positions, cfg.positions.length, 3, gl.STATIC_DRAW, normalized);
72
- stateCfg.positionsDecodeMatrix.set(cfg.positionsDecodeMatrix);
73
-
74
- let localAABB = math.collapseAABB3();
75
- math.expandAABB3Points3(localAABB, cfg.positions);
76
- geometryCompressionUtils.decompressAABB(localAABB, stateCfg.positionsDecodeMatrix);
77
- math.AABB3ToOBB3(localAABB, stateCfg.obb);
78
-
79
- } else {
80
-
81
- let lenPositions = cfg.positions.length;
82
- let localAABB = math.collapseAABB3();
83
- math.expandAABB3Points3(localAABB, cfg.positions);
84
- math.AABB3ToOBB3(localAABB, stateCfg.obb);
85
- const quantizedPositions = quantizePositions(cfg.positions, localAABB, stateCfg.positionsDecodeMatrix);
86
- let normalized = false;
87
- stateCfg.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, quantizedPositions, lenPositions, 3, gl.STATIC_DRAW, normalized);
88
- }
89
- }
90
-
91
- if (cfg.normals) {
92
-
93
- if (preCompressed) {
94
-
95
- const normalized = true; // For oct-encoded UInt8
96
- stateCfg.normalsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, cfg.normals, cfg.normals.length, 3, gl.STATIC_DRAW, normalized);
97
-
98
- } else {
99
-
100
- const compressedNormals = octEncodeNormals(cfg.normals);
101
- const normalized = true; // For oct-encoded UInt8
102
- stateCfg.normalsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, compressedNormals, compressedNormals.length, 3, gl.STATIC_DRAW, normalized);
103
- }
104
- }
105
-
106
- if (cfg.indices) {
107
- stateCfg.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, bigIndicesSupported ? new Uint32Array(cfg.indices) : new Uint16Array(cfg.indices), cfg.indices.length, 1, gl.STATIC_DRAW);
108
- }
109
-
110
- let edgeIndices = cfg.edgeIndices;
111
- if (!edgeIndices) {
112
- edgeIndices = buildEdgeIndices(cfg.positions, cfg.indices, null, cfg.edgeThreshold || 10);
113
- }
114
- stateCfg.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, bigIndicesSupported ? new Uint32Array(edgeIndices) : new Uint16Array(edgeIndices), edgeIndices.length, 1, gl.STATIC_DRAW);
115
-
116
-
117
- this._state = new RenderState(stateCfg);
118
-
119
- // These counts are used to avoid unnecessary render passes
120
- this._numPortions = 0;
121
- this._numVisibleLayerPortions = 0;
122
- this._numTransparentLayerPortions = 0;
123
- this._numXRayedLayerPortions = 0;
124
- this._numHighlightedLayerPortions = 0;
125
- this._numSelectedLayerPortions = 0;
126
- this._numClippableLayerPortions = 0;
127
- this._numEdgesLayerPortions = 0;
128
- this._numPickableLayerPortions = 0;
129
- this._numCulledLayerPortions = 0;
130
-
131
- /** @private */
132
- this.numIndices = (cfg.indices) ? cfg.indices.length / 3 : 0;
133
-
134
- // Vertex arrays
135
- this._colors = [];
136
- this._metallicRoughness = [];
137
- this._pickColors = [];
138
- this._offsets = [];
139
-
140
- // Modeling matrix per instance, array for each column
141
- this._modelMatrixCol0 = [];
142
- this._modelMatrixCol1 = [];
143
- this._modelMatrixCol2 = [];
144
-
145
- // Modeling normal matrix per instance, array for each column
146
- this._modelNormalMatrixCol0 = [];
147
- this._modelNormalMatrixCol1 = [];
148
- this._modelNormalMatrixCol2 = [];
149
-
150
- this._portions = [];
151
-
152
- if (cfg.rtcCenter) {
153
- this._state.rtcCenter = math.vec3(cfg.rtcCenter);
154
- }
155
-
156
- this._finalized = false;
157
-
158
- /**
159
- * The axis-aligned World-space boundary of this InstancingLayer's positions.
160
- * @type {*|Float64Array}
161
- */
162
- this.aabb = math.collapseAABB3();
163
-
164
- /**
165
- * When true, this layer contains solid triangle meshes, otherwise this layer contains surface triangle meshes
166
- * @type {boolean}
167
- */
168
- this.solid = !!cfg.solid;
169
- }
170
-
171
- /**
172
- * Creates a new portion within this InstancingLayer, returns the new portion ID.
173
- *
174
- * The portion will instance this InstancingLayer's geometry.
175
- *
176
- * Gives the portion the specified color and matrix.
177
- *
178
- * @param cfg Portion params
179
- * @param cfg.color Color [0..255,0..255,0..255]
180
- * @param cfg.metallic Metalness factor [0..255]
181
- * @param cfg.roughness Roughness factor [0..255]
182
- * @param cfg.opacity Opacity [0..255].
183
- * @param cfg.meshMatrix Flat float 4x4 matrix.
184
- * @param [cfg.worldMatrix] Flat float 4x4 matrix.
185
- * @param cfg.worldAABB Flat float AABB.
186
- * @param cfg.pickColor Quantized pick color
187
- * @returns {number} Portion ID.
188
- */
189
- createPortion(cfg) {
190
-
191
- const color = cfg.color;
192
- const metallic = cfg.metallic;
193
- const roughness = cfg.roughness;
194
- const opacity = cfg.opacity;
195
- const meshMatrix = cfg.meshMatrix;
196
- const worldMatrix = cfg.worldMatrix;
197
- const worldAABB = cfg.aabb;
198
- const pickColor = cfg.pickColor;
199
-
200
- if (this._finalized) {
201
- throw "Already finalized";
202
- }
203
-
204
- // TODO: find AABB for portion by transforming the geometry local AABB by the given meshMatrix?
205
-
206
- const r = color[0]; // Color is pre-quantized by PerformanceModel
207
- const g = color[1];
208
- const b = color[2];
209
- const a = color[3];
210
-
211
- this._colors.push(r);
212
- this._colors.push(g);
213
- this._colors.push(b);
214
- this._colors.push(opacity);
215
-
216
- this._metallicRoughness.push((metallic !== null && metallic !== undefined) ? metallic : 0);
217
- this._metallicRoughness.push((roughness !== null && roughness !== undefined) ? roughness : 255);
218
-
219
- if (this.model.scene.entityOffsetsEnabled) {
220
- this._offsets.push(0);
221
- this._offsets.push(0);
222
- this._offsets.push(0);
223
- }
224
-
225
- this._modelMatrixCol0.push(meshMatrix[0]);
226
- this._modelMatrixCol0.push(meshMatrix[4]);
227
- this._modelMatrixCol0.push(meshMatrix[8]);
228
- this._modelMatrixCol0.push(meshMatrix[12]);
229
-
230
- this._modelMatrixCol1.push(meshMatrix[1]);
231
- this._modelMatrixCol1.push(meshMatrix[5]);
232
- this._modelMatrixCol1.push(meshMatrix[9]);
233
- this._modelMatrixCol1.push(meshMatrix[13]);
234
-
235
- this._modelMatrixCol2.push(meshMatrix[2]);
236
- this._modelMatrixCol2.push(meshMatrix[6]);
237
- this._modelMatrixCol2.push(meshMatrix[10]);
238
- this._modelMatrixCol2.push(meshMatrix[14]);
239
-
240
- // Note: order of inverse and transpose doesn't matter
241
-
242
- let transposedMat = math.transposeMat4(meshMatrix, math.mat4()); // TODO: Use cached matrix
243
- let normalMatrix = math.inverseMat4(transposedMat);
244
-
245
- this._modelNormalMatrixCol0.push(normalMatrix[0]);
246
- this._modelNormalMatrixCol0.push(normalMatrix[4]);
247
- this._modelNormalMatrixCol0.push(normalMatrix[8]);
248
- this._modelNormalMatrixCol0.push(normalMatrix[12]);
249
-
250
- this._modelNormalMatrixCol1.push(normalMatrix[1]);
251
- this._modelNormalMatrixCol1.push(normalMatrix[5]);
252
- this._modelNormalMatrixCol1.push(normalMatrix[9]);
253
- this._modelNormalMatrixCol1.push(normalMatrix[13]);
254
-
255
- this._modelNormalMatrixCol2.push(normalMatrix[2]);
256
- this._modelNormalMatrixCol2.push(normalMatrix[6]);
257
- this._modelNormalMatrixCol2.push(normalMatrix[10]);
258
- this._modelNormalMatrixCol2.push(normalMatrix[14]);
259
-
260
- // Per-vertex pick colors
261
-
262
- this._pickColors.push(pickColor[0]);
263
- this._pickColors.push(pickColor[1]);
264
- this._pickColors.push(pickColor[2]);
265
- this._pickColors.push(pickColor[3]);
266
-
267
- // Expand AABB
268
-
269
- math.collapseAABB3(worldAABB);
270
- const obb = this._state.obb;
271
- const lenPositions = obb.length;
272
- for (let i = 0; i < lenPositions; i += 4) {
273
- tempVec4a[0] = obb[i + 0];
274
- tempVec4a[1] = obb[i + 1];
275
- tempVec4a[2] = obb[i + 2];
276
- math.transformPoint4(meshMatrix, tempVec4a, tempVec4b);
277
- if (worldMatrix) {
278
- math.transformPoint4(worldMatrix, tempVec4b, tempVec4c);
279
- math.expandAABB3Point3(worldAABB, tempVec4c);
280
- } else {
281
- math.expandAABB3Point3(worldAABB, tempVec4b);
282
- }
283
- }
284
-
285
- if (this._state.rtcCenter) {
286
- const rtcCenter = this._state.rtcCenter;
287
- worldAABB[0] += rtcCenter[0];
288
- worldAABB[1] += rtcCenter[1];
289
- worldAABB[2] += rtcCenter[2];
290
- worldAABB[3] += rtcCenter[0];
291
- worldAABB[4] += rtcCenter[1];
292
- worldAABB[5] += rtcCenter[2];
293
- }
294
-
295
- math.expandAABB3(this.aabb, worldAABB);
296
-
297
- this._state.numInstances++;
298
-
299
- const portionId = this._portions.length;
300
- this._portions.push({});
301
-
302
- this._numPortions++;
303
- this.model.numPortions++;
304
-
305
- return portionId;
306
- }
307
-
308
- finalize() {
309
- if (this._finalized) {
310
- throw "Already finalized";
311
- }
312
- const gl = this.model.scene.canvas.gl;
313
- const colorsLength = this._colors.length;
314
- const flagsLength = colorsLength;
315
- if (colorsLength > 0) {
316
- let notNormalized = false;
317
- this._state.colorsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Uint8Array(this._colors), this._colors.length, 4, gl.DYNAMIC_DRAW, notNormalized);
318
- this._colors = []; // Release memory
319
- }
320
- if (this._metallicRoughness.length > 0) {
321
- const metallicRoughness = new Uint8Array(this._metallicRoughness);
322
- let normalized = false;
323
- this._state.metallicRoughnessBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, metallicRoughness, this._metallicRoughness.length, 2, gl.STATIC_DRAW, normalized);
324
- }
325
- if (flagsLength > 0) {
326
- // Because we only build flags arrays here,
327
- // get their length from the colors array
328
- let notNormalized = false;
329
- let normalized = true;
330
- this._state.flagsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Uint8Array(flagsLength), flagsLength, 4, gl.DYNAMIC_DRAW, notNormalized);
331
- this._state.flags2Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Uint8Array(flagsLength), flagsLength, 4, gl.DYNAMIC_DRAW, normalized);
332
- }
333
- if (this.model.scene.entityOffsetsEnabled) {
334
- if (this._offsets.length > 0) {
335
- const notNormalized = false;
336
- this._state.offsetsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._offsets), this._offsets.length, 3, gl.DYNAMIC_DRAW, notNormalized);
337
- this._offsets = []; // Release memory
338
- }
339
- }
340
- if (this._modelMatrixCol0.length > 0) {
341
-
342
- const normalized = false;
343
-
344
- this._state.modelMatrixCol0Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelMatrixCol0), this._modelMatrixCol0.length, 4, gl.STATIC_DRAW, normalized);
345
- this._state.modelMatrixCol1Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelMatrixCol1), this._modelMatrixCol1.length, 4, gl.STATIC_DRAW, normalized);
346
- this._state.modelMatrixCol2Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelMatrixCol2), this._modelMatrixCol2.length, 4, gl.STATIC_DRAW, normalized);
347
- this._modelMatrixCol0 = [];
348
- this._modelMatrixCol1 = [];
349
- this._modelMatrixCol2 = [];
350
-
351
- this._state.modelNormalMatrixCol0Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelNormalMatrixCol0), this._modelNormalMatrixCol0.length, 4, gl.STATIC_DRAW, normalized);
352
- this._state.modelNormalMatrixCol1Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelNormalMatrixCol1), this._modelNormalMatrixCol1.length, 4, gl.STATIC_DRAW, normalized);
353
- this._state.modelNormalMatrixCol2Buf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Float32Array(this._modelNormalMatrixCol2), this._modelNormalMatrixCol2.length, 4, gl.STATIC_DRAW, normalized);
354
- this._modelNormalMatrixCol0 = [];
355
- this._modelNormalMatrixCol1 = [];
356
- this._modelNormalMatrixCol2 = [];
357
- }
358
- if (this._pickColors.length > 0) {
359
- const normalized = false;
360
- this._state.pickColorsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, new Uint8Array(this._pickColors), this._pickColors.length, 4, gl.STATIC_DRAW, normalized);
361
- this._pickColors = []; // Release memory
362
- }
363
- this._finalized = true;
364
- }
365
-
366
- // The following setters are called by PerformanceMesh, in turn called by PerformanceNode, only after the layer is finalized.
367
- // It's important that these are called after finalize() in order to maintain integrity of counts like _numVisibleLayerPortions etc.
368
-
369
- initFlags(portionId, flags, meshTransparent) {
370
- if (flags & ENTITY_FLAGS.VISIBLE) {
371
- this._numVisibleLayerPortions++;
372
- this.model.numVisibleLayerPortions++;
373
- }
374
- if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
375
- this._numHighlightedLayerPortions++;
376
- this.model.numHighlightedLayerPortions++;
377
- }
378
- if (flags & ENTITY_FLAGS.XRAYED) {
379
- this._numXRayedLayerPortions++;
380
- this.model.numXRayedLayerPortions++;
381
- }
382
- if (flags & ENTITY_FLAGS.SELECTED) {
383
- this._numSelectedLayerPortions++;
384
- this.model.numSelectedLayerPortions++;
385
- }
386
- if (flags & ENTITY_FLAGS.CLIPPABLE) {
387
- this._numClippableLayerPortions++;
388
- this.model.numClippableLayerPortions++;
389
- }
390
- if (flags & ENTITY_FLAGS.EDGES) {
391
- this._numEdgesLayerPortions++;
392
- this.model.numEdgesLayerPortions++;
393
- }
394
- if (flags & ENTITY_FLAGS.PICKABLE) {
395
- this._numPickableLayerPortions++;
396
- this.model.numPickableLayerPortions++;
397
- }
398
- if (flags & ENTITY_FLAGS.CULLED) {
399
- this._numCulledLayerPortions++;
400
- this.model.numCulledLayerPortions++;
401
- }
402
- if (meshTransparent) {
403
- this._numTransparentLayerPortions++;
404
- this.model.numTransparentLayerPortions++;
405
- }
406
- this._setFlags(portionId, flags, meshTransparent);
407
- this._setFlags2(portionId, flags);
408
- }
409
-
410
- setVisible(portionId, flags, meshTransparent) {
411
- if (!this._finalized) {
412
- throw "Not finalized";
413
- }
414
- if (flags & ENTITY_FLAGS.VISIBLE) {
415
- this._numVisibleLayerPortions++;
416
- this.model.numVisibleLayerPortions++;
417
- } else {
418
- this._numVisibleLayerPortions--;
419
- this.model.numVisibleLayerPortions--;
420
- }
421
- this._setFlags(portionId, flags, meshTransparent);
422
- }
423
-
424
- setHighlighted(portionId, flags, meshTransparent) {
425
- if (!this._finalized) {
426
- throw "Not finalized";
427
- }
428
- if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
429
- this._numHighlightedLayerPortions++;
430
- this.model.numHighlightedLayerPortions++;
431
- } else {
432
- this._numHighlightedLayerPortions--;
433
- this.model.numHighlightedLayerPortions--;
434
- }
435
- this._setFlags(portionId, flags, meshTransparent);
436
- }
437
-
438
- setXRayed(portionId, flags, meshTransparent) {
439
- if (!this._finalized) {
440
- throw "Not finalized";
441
- }
442
- if (flags & ENTITY_FLAGS.XRAYED) {
443
- this._numXRayedLayerPortions++;
444
- this.model.numXRayedLayerPortions++;
445
- } else {
446
- this._numXRayedLayerPortions--;
447
- this.model.numXRayedLayerPortions--;
448
- }
449
- this._setFlags(portionId, flags, meshTransparent);
450
- }
451
-
452
- setSelected(portionId, flags, meshTransparent) {
453
- if (!this._finalized) {
454
- throw "Not finalized";
455
- }
456
- if (flags & ENTITY_FLAGS.SELECTED) {
457
- this._numSelectedLayerPortions++;
458
- this.model.numSelectedLayerPortions++;
459
- } else {
460
- this._numSelectedLayerPortions--;
461
- this.model.numSelectedLayerPortions--;
462
- }
463
- this._setFlags(portionId, flags, meshTransparent);
464
- }
465
-
466
- setEdges(portionId, flags, meshTransparent) {
467
- if (!this._finalized) {
468
- throw "Not finalized";
469
- }
470
- if (flags & ENTITY_FLAGS.EDGES) {
471
- this._numEdgesLayerPortions++;
472
- this.model.numEdgesLayerPortions++;
473
- } else {
474
- this._numEdgesLayerPortions--;
475
- this.model.numEdgesLayerPortions--;
476
- }
477
- this._setFlags(portionId, flags, meshTransparent);
478
- }
479
-
480
- setClippable(portionId, flags) {
481
- if (!this._finalized) {
482
- throw "Not finalized";
483
- }
484
- if (flags & ENTITY_FLAGS.CLIPPABLE) {
485
- this._numClippableLayerPortions++;
486
- this.model.numClippableLayerPortions++;
487
- } else {
488
- this._numClippableLayerPortions--;
489
- this.model.numClippableLayerPortions--;
490
- }
491
- this._setFlags2(portionId, flags);
492
- }
493
-
494
- setCollidable(portionId, flags) {
495
- if (!this._finalized) {
496
- throw "Not finalized";
497
- }
498
- }
499
-
500
- setPickable(portionId, flags, meshTransparent) {
501
- if (!this._finalized) {
502
- throw "Not finalized";
503
- }
504
- if (flags & ENTITY_FLAGS.PICKABLE) {
505
- this._numPickableLayerPortions++;
506
- this.model.numPickableLayerPortions++;
507
- } else {
508
- this._numPickableLayerPortions--;
509
- this.model.numPickableLayerPortions--;
510
- }
511
- this._setFlags2(portionId, flags, meshTransparent);
512
- }
513
-
514
- setCulled(portionId, flags, meshTransparent) {
515
- if (!this._finalized) {
516
- throw "Not finalized";
517
- }
518
- if (flags & ENTITY_FLAGS.CULLED) {
519
- this._numCulledLayerPortions++;
520
- this.model.numCulledLayerPortions++;
521
- } else {
522
- this._numCulledLayerPortions--;
523
- this.model.numCulledLayerPortions--;
524
- }
525
- this._setFlags(portionId, flags, meshTransparent);
526
- }
527
-
528
- setColor(portionId, color) { // RGBA color is normalized as ints
529
- if (!this._finalized) {
530
- throw "Not finalized";
531
- }
532
- tempUint8Vec4[0] = color[0];
533
- tempUint8Vec4[1] = color[1];
534
- tempUint8Vec4[2] = color[2];
535
- tempUint8Vec4[3] = color[3];
536
- this._state.colorsBuf.setData(tempUint8Vec4, portionId * 4, 4);
537
- }
538
-
539
- setTransparent(portionId, flags, transparent) {
540
- if (transparent) {
541
- this._numTransparentLayerPortions++;
542
- this.model.numTransparentLayerPortions++;
543
- } else {
544
- this._numTransparentLayerPortions--;
545
- this.model.numTransparentLayerPortions--;
546
- }
547
- this._setFlags(portionId, flags, transparent);
548
- }
549
-
550
- // setMatrix(portionId, matrix) {
551
- //
552
- // if (!this._finalized) {
553
- // throw "Not finalized";
554
- // }
555
- //
556
- // var offset = portionId * 4;
557
- //
558
- // tempFloat32Vec4[0] = matrix[0];
559
- // tempFloat32Vec4[1] = matrix[4];
560
- // tempFloat32Vec4[2] = matrix[8];
561
- // tempFloat32Vec4[3] = matrix[12];
562
- //
563
- // this._state.modelMatrixCol0Buf.setData(tempFloat32Vec4, offset, 4);
564
- //
565
- // tempFloat32Vec4[0] = matrix[1];
566
- // tempFloat32Vec4[1] = matrix[5];
567
- // tempFloat32Vec4[2] = matrix[9];
568
- // tempFloat32Vec4[3] = matrix[13];
569
- //
570
- // this._state.modelMatrixCol1Buf.setData(tempFloat32Vec4, offset, 4);
571
- //
572
- // tempFloat32Vec4[0] = matrix[2];
573
- // tempFloat32Vec4[1] = matrix[6];
574
- // tempFloat32Vec4[2] = matrix[10];
575
- // tempFloat32Vec4[3] = matrix[14];
576
- //
577
- // this._state.modelMatrixCol2Buf.setData(tempFloat32Vec4, offset, 4);
578
- // }
579
-
580
- _setFlags(portionId, flags, meshTransparent) {
581
-
582
- if (!this._finalized) {
583
- throw "Not finalized";
584
- }
585
-
586
- const visible = !!(flags & ENTITY_FLAGS.VISIBLE);
587
- const xrayed = !!(flags & ENTITY_FLAGS.XRAYED);
588
- const highlighted = !!(flags & ENTITY_FLAGS.HIGHLIGHTED);
589
- const selected = !!(flags & ENTITY_FLAGS.SELECTED);
590
- const edges = !!(flags & ENTITY_FLAGS.EDGES);
591
- const pickable = !!(flags & ENTITY_FLAGS.PICKABLE);
592
- const culled = !!(flags & ENTITY_FLAGS.CULLED);
593
-
594
- // Normal fill
595
-
596
- let f0;
597
- if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
598
- f0 = RENDER_PASSES.NOT_RENDERED;
599
- } else {
600
- if (meshTransparent) {
601
- f0 = RENDER_PASSES.COLOR_TRANSPARENT;
602
- } else {
603
- f0 = RENDER_PASSES.COLOR_OPAQUE;
604
- }
605
- }
606
-
607
- // Emphasis fill
608
-
609
- let f1;
610
- if (!visible || culled) {
611
- f1 = RENDER_PASSES.NOT_RENDERED;
612
- } else if (selected) {
613
- f1 = RENDER_PASSES.SILHOUETTE_SELECTED;
614
- } else if (highlighted) {
615
- f1 = RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;
616
- } else if (xrayed) {
617
- f1 = RENDER_PASSES.SILHOUETTE_XRAYED;
618
- } else {
619
- f1 = RENDER_PASSES.NOT_RENDERED;
620
- }
621
-
622
- // Edges
623
-
624
- let f2 = 0;
625
- if (!visible || culled) {
626
- f2 = RENDER_PASSES.NOT_RENDERED;
627
- } else if (selected) {
628
- f2 = RENDER_PASSES.EDGES_SELECTED;
629
- } else if (highlighted) {
630
- f2 = RENDER_PASSES.EDGES_HIGHLIGHTED;
631
- } else if (xrayed) {
632
- f2 = RENDER_PASSES.EDGES_XRAYED;
633
- } else if (edges) {
634
- if (meshTransparent) {
635
- f2 = RENDER_PASSES.EDGES_COLOR_TRANSPARENT;
636
- } else {
637
- f2 = RENDER_PASSES.EDGES_COLOR_OPAQUE;
638
- }
639
- } else {
640
- f2 = RENDER_PASSES.NOT_RENDERED;
641
- }
642
-
643
- // Pick
644
-
645
- let f3 = (visible && !culled && pickable) ? RENDER_PASSES.PICK : RENDER_PASSES.NOT_RENDERED;
646
-
647
- tempUint8Vec4[0] = f0; // x - normal fill
648
- tempUint8Vec4[1] = f1; // y - emphasis fill
649
- tempUint8Vec4[2] = f2; // z - edges
650
- tempUint8Vec4[3] = f3; // w - pick
651
-
652
- this._state.flagsBuf.setData(tempUint8Vec4, portionId * 4, 4);
653
- }
654
-
655
- _setFlags2(portionId, flags) {
656
-
657
- if (!this._finalized) {
658
- throw "Not finalized";
659
- }
660
-
661
- const clippable = !!(flags & ENTITY_FLAGS.CLIPPABLE) ? 255 : 0;
662
- tempUint8Vec4[0] = clippable;
663
-
664
- this._state.flags2Buf.setData(tempUint8Vec4, portionId * 4, 4);
665
- }
666
-
667
- setOffset(portionId, offset) {
668
- if (!this._finalized) {
669
- throw "Not finalized";
670
- }
671
- if (!this.model.scene.entityOffsetsEnabled) {
672
- this.model.error("Entity#offset not enabled for this Viewer"); // See Viewer entityOffsetsEnabled
673
- return;
674
- }
675
- tempVec3fa[0] = offset[0];
676
- tempVec3fa[1] = offset[1];
677
- tempVec3fa[2] = offset[2];
678
- this._state.offsetsBuf.setData(tempVec3fa, portionId * 3, 3);
679
- }
680
-
681
- // ---------------------- COLOR RENDERING -----------------------------------
682
-
683
- drawColorOpaque(renderFlags, frameCtx) {
684
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
685
- return;
686
- }
687
- this._updateBackfaceCull(renderFlags, frameCtx);
688
- if (frameCtx.withSAO && this.model.saoEnabled) {
689
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
690
- if (this._instancingRenderers.colorQualityRendererWithSAO) {
691
- this._instancingRenderers.colorQualityRendererWithSAO.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
692
- }
693
- } else {
694
- if (this._instancingRenderers.colorRendererWithSAO) {
695
- this._instancingRenderers.colorRendererWithSAO.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
696
- }
697
- }
698
- } else {
699
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
700
- if (this._instancingRenderers.colorQualityRenderer) {
701
- this._instancingRenderers.colorQualityRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
702
- }
703
- } else {
704
- if (this._instancingRenderers.colorRenderer) {
705
- this._instancingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
706
- }
707
- }
708
- }
709
- }
710
-
711
- _updateBackfaceCull(renderFlags, frameCtx) {
712
- const backfaces = this.model.backfaces || (!this.solid) || renderFlags.sectioned;
713
- if (frameCtx.backfaces !== backfaces) {
714
- const gl = frameCtx.gl;
715
- if (backfaces) {
716
- gl.disable(gl.CULL_FACE);
717
- } else {
718
- gl.enable(gl.CULL_FACE);
719
- }
720
- frameCtx.backfaces = backfaces;
721
- }
722
- }
723
-
724
- drawColorTransparent(renderFlags, frameCtx) {
725
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === 0 || this._numXRayedLayerPortions === this._numPortions) {
726
- return;
727
- }
728
- this._updateBackfaceCull(renderFlags, frameCtx);
729
- if (frameCtx.pbrEnabled && this.model.pbrEnabled) {
730
- if (this._instancingRenderers.colorQualityRenderer) {
731
- this._instancingRenderers.colorQualityRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_TRANSPARENT);
732
- }
733
- } else {
734
- if (this._instancingRenderers.colorRenderer) {
735
- this._instancingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_TRANSPARENT);
736
- }
737
- }
738
- }
739
-
740
- // ---------------------- RENDERING SAO POST EFFECT TARGETS --------------
741
-
742
- drawDepth(renderFlags, frameCtx) {
743
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
744
- return;
745
- }
746
- this._updateBackfaceCull(renderFlags, frameCtx);
747
- if (this._instancingRenderers.depthRenderer) {
748
- this._instancingRenderers.depthRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE); // Assume whatever post-effect uses depth (eg SAO) does not apply to transparent objects
749
- }
750
- }
751
-
752
- drawNormals(renderFlags, frameCtx) {
753
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
754
- return;
755
- }
756
- this._updateBackfaceCull(renderFlags, frameCtx);
757
- if (this._instancingRenderers.normalsRenderer) {
758
- this._instancingRenderers.normalsRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE); // Assume whatever post-effect uses normals (eg SAO) does not apply to transparent objects
759
- }
760
- }
761
-
762
- // ---------------------- SILHOUETTE RENDERING -----------------------------------
763
-
764
- drawSilhouetteXRayed(renderFlags, frameCtx) {
765
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numXRayedLayerPortions === 0) {
766
- return;
767
- }
768
- this._updateBackfaceCull(renderFlags, frameCtx);
769
- if (this._instancingRenderers.silhouetteRenderer) {
770
- this._instancingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_XRAYED);
771
- }
772
- }
773
-
774
- drawSilhouetteHighlighted(renderFlags, frameCtx) {
775
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numHighlightedLayerPortions === 0) {
776
- return;
777
- }
778
- this._updateBackfaceCull(renderFlags, frameCtx);
779
- if (this._instancingRenderers.silhouetteRenderer) {
780
- this._instancingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_HIGHLIGHTED);
781
- }
782
- }
783
-
784
- drawSilhouetteSelected(renderFlags, frameCtx) {
785
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numSelectedLayerPortions === 0) {
786
- return;
787
- }
788
- this._updateBackfaceCull(renderFlags, frameCtx);
789
- if (this._instancingRenderers.silhouetteRenderer) {
790
- this._instancingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_SELECTED);
791
- }
792
- }
793
-
794
- // ---------------------- EDGES RENDERING -----------------------------------
795
-
796
- drawEdgesColorOpaque(renderFlags, frameCtx) {
797
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0) {
798
- return;
799
- }
800
- if (this._instancingRenderers.edgesColorRenderer) {
801
- this._instancingRenderers.edgesColorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_COLOR_OPAQUE);
802
- }
803
- }
804
-
805
- drawEdgesColorTransparent(renderFlags, frameCtx) {
806
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numEdgesLayerPortions === 0) {
807
- return;
808
- }
809
- if (this._instancingRenderers.edgesColorRenderer) {
810
- this._instancingRenderers.edgesColorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_COLOR_TRANSPARENT);
811
- }
812
- }
813
-
814
- drawEdgesXRayed(renderFlags, frameCtx) {
815
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numXRayedLayerPortions === 0) {
816
- return;
817
- }
818
- if (this._instancingRenderers.edgesRenderer) {
819
- this._instancingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_XRAYED);
820
- }
821
- }
822
-
823
- drawEdgesHighlighted(renderFlags, frameCtx) {
824
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numHighlightedLayerPortions === 0) {
825
- return;
826
- }
827
- if (this._instancingRenderers.edgesRenderer) {
828
- this._instancingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_HIGHLIGHTED);
829
- }
830
- }
831
-
832
- drawEdgesSelected(renderFlags, frameCtx) {
833
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numSelectedLayerPortions === 0) {
834
- return;
835
- }
836
- if (this._instancingRenderers.edgesRenderer) {
837
- this._instancingRenderers.edgesRenderer.drawLayer(frameCtx, this, RENDER_PASSES.EDGES_SELECTED);
838
- }
839
- }
840
-
841
- // ---------------------- OCCLUSION CULL RENDERING -----------------------------------
842
-
843
- drawOcclusion(renderFlags, frameCtx) {
844
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
845
- return;
846
- }
847
- this._updateBackfaceCull(renderFlags, frameCtx);
848
- if (this._instancingRenderers.occlusionRenderer) {
849
- // Only opaque, filled objects can be occluders
850
- this._instancingRenderers.occlusionRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
851
- }
852
- }
853
-
854
- // ---------------------- SHADOW BUFFER RENDERING -----------------------------------
855
-
856
- drawShadow(renderFlags, frameCtx) {
857
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
858
- return;
859
- }
860
- this._updateBackfaceCull(renderFlags, frameCtx);
861
- if (this._instancingRenderers.shadowRenderer) {
862
- this._instancingRenderers.shadowRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
863
- }
864
- }
865
-
866
- //---- PICKING ----------------------------------------------------------------------------------------------------
867
-
868
- drawPickMesh(renderFlags, frameCtx) {
869
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
870
- return;
871
- }
872
- this._updateBackfaceCull(renderFlags, frameCtx);
873
- if (this._instancingRenderers.pickMeshRenderer) {
874
- this._instancingRenderers.pickMeshRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
875
- }
876
- }
877
-
878
- drawPickDepths(renderFlags, frameCtx) {
879
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
880
- return;
881
- }
882
- this._updateBackfaceCull(renderFlags, frameCtx);
883
- if (this._instancingRenderers.pickDepthRenderer) {
884
- this._instancingRenderers.pickDepthRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
885
- }
886
- }
887
-
888
- drawPickNormals(renderFlags, frameCtx) {
889
- if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0) {
890
- return;
891
- }
892
- this._updateBackfaceCull(renderFlags, frameCtx);
893
- if (this._instancingRenderers.pickNormalsRenderer) {
894
- this._instancingRenderers.pickNormalsRenderer.drawLayer(frameCtx, this, RENDER_PASSES.PICK);
895
- }
896
- }
897
-
898
-
899
- destroy() {
900
- const state = this._state;
901
- if (state.positionsBuf) {
902
- state.positionsBuf.destroy();
903
- state.positionsBuf = null;
904
- }
905
- if (state.normalsBuf) {
906
- state.normalsBuf.destroy();
907
- state.normalsBuf = null;
908
- }
909
- if (state.colorsBuf) {
910
- state.colorsBuf.destroy();
911
- state.colorsBuf = null;
912
- }
913
- if (state.metallicRoughnessBuf) {
914
- state.metallicRoughnessBuf.destroy();
915
- state.metallicRoughnessBuf = null;
916
- }
917
- if (state.flagsBuf) {
918
- state.flagsBuf.destroy();
919
- state.flagsBuf = null;
920
- }
921
- if (state.flags2Buf) {
922
- state.flags2Buf.destroy();
923
- state.flags2Buf = null;
924
- }
925
- if (state.offsetsBuf) {
926
- state.offsetsBuf.destroy();
927
- state.offsetsBuf = null;
928
- }
929
- if (state.modelMatrixCol0Buf) {
930
- state.modelMatrixCol0Buf.destroy();
931
- state.modelMatrixCol0Buf = null;
932
- }
933
- if (state.modelMatrixCol1Buf) {
934
- state.modelMatrixCol1Buf.destroy();
935
- state.modelMatrixCol1Buf = null;
936
- }
937
- if (state.modelMatrixCol2Buf) {
938
- state.modelMatrixCol2Buf.destroy();
939
- state.modelMatrixCol2Buf = null;
940
- }
941
- if (state.modelNormalMatrixCol0Buf) {
942
- state.modelNormalMatrixCol0Buf.destroy();
943
- state.modelNormalMatrixCol0Buf = null;
944
- }
945
- if (state.modelNormalMatrixCol1Buf) {
946
- state.modelNormalMatrixCol1Buf.destroy();
947
- state.modelNormalMatrixCol1Buf = null;
948
- }
949
- if (state.modelNormalMatrixCol2Buf) {
950
- state.modelNormalMatrixCol2Buf.destroy();
951
- state.modelNormalMatrixCol2Buf = null;
952
- }
953
- if (state.indicesBuf) {
954
- state.indicesBuf.destroy();
955
- state.indicessBuf = null;
956
- }
957
- if (state.edgeIndicesBuf) {
958
- state.edgeIndicesBuf.destroy();
959
- state.edgeIndicessBuf = null;
960
- }
961
- if (state.pickColorsBuf) {
962
- state.pickColorsBuf.destroy();
963
- state.pickColorsBuf = null;
964
- }
965
- state.destroy();
966
- }
967
- }
968
-
969
- export {TrianglesInstancingLayer};