csyjk 1.2.2 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/app.js → app.js} +0 -0
- package/{dist/index.html → index.html} +0 -0
- package/package.json +5 -40
- package/{dist/style.css → style.css} +0 -0
- package/.babelrc +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/xx.iml +0 -12
- package/public/gltf.js +0 -2241
- package/public/index.html +0 -10
- package/src/index.js +0 -3
- package/src/lib/gltf/assets/check.jpg +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
- package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
- package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
- package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
- package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/package.json +0 -15
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
- package/src/lib/gltf/gltf.css +0 -392
- package/src/lib/gltf/gltf.js +0 -2241
- package/webpack.config.js +0 -70
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
Parser for .XKT Format V4
|
|
4
|
-
|
|
5
|
-
.XKT specifications: https://github.com/yjkkit/yjkkit-sdk/wiki/XKT-Format
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import {utils} from "../../../viewer/scene/utils.js";
|
|
10
|
-
import * as p from "./lib/pako.js";
|
|
11
|
-
|
|
12
|
-
let pako = window.pako || p;
|
|
13
|
-
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
|
14
|
-
pako = pako.default;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function extract(elements) {
|
|
18
|
-
return {
|
|
19
|
-
positions: elements[0],
|
|
20
|
-
normals: elements[1],
|
|
21
|
-
indices: elements[2],
|
|
22
|
-
edgeIndices: elements[3],
|
|
23
|
-
decodeMatrices: elements[4],
|
|
24
|
-
matrices: elements[5],
|
|
25
|
-
eachPrimitivePositionsAndNormalsPortion: elements[6],
|
|
26
|
-
eachPrimitiveIndicesPortion: elements[7],
|
|
27
|
-
eachPrimitiveEdgeIndicesPortion: elements[8],
|
|
28
|
-
eachPrimitiveDecodeMatricesPortion: elements[9],
|
|
29
|
-
eachPrimitiveColor: elements[10],
|
|
30
|
-
primitiveInstances: elements[11],
|
|
31
|
-
eachEntityId: elements[12],
|
|
32
|
-
eachEntityPrimitiveInstancesPortion: elements[13],
|
|
33
|
-
eachEntityMatricesPortion: elements[14],
|
|
34
|
-
eachEntityMatrix: elements[15]
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function inflate(deflatedData) {
|
|
39
|
-
return {
|
|
40
|
-
positions: new Uint16Array(pako.inflate(deflatedData.positions).buffer),
|
|
41
|
-
normals: new Int8Array(pako.inflate(deflatedData.normals).buffer),
|
|
42
|
-
indices: new Uint32Array(pako.inflate(deflatedData.indices).buffer),
|
|
43
|
-
edgeIndices: new Uint32Array(pako.inflate(deflatedData.edgeIndices).buffer),
|
|
44
|
-
decodeMatrices: new Float32Array(pako.inflate(deflatedData.decodeMatrices).buffer),
|
|
45
|
-
matrices: new Float32Array(pako.inflate(deflatedData.matrices).buffer),
|
|
46
|
-
eachPrimitivePositionsAndNormalsPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitivePositionsAndNormalsPortion).buffer),
|
|
47
|
-
eachPrimitiveIndicesPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitiveIndicesPortion).buffer),
|
|
48
|
-
eachPrimitiveEdgeIndicesPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitiveEdgeIndicesPortion).buffer),
|
|
49
|
-
eachPrimitiveDecodeMatricesPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitiveDecodeMatricesPortion).buffer),
|
|
50
|
-
eachPrimitiveColor: new Uint8Array(pako.inflate(deflatedData.eachPrimitiveColor).buffer),
|
|
51
|
-
primitiveInstances: new Uint32Array(pako.inflate(deflatedData.primitiveInstances).buffer),
|
|
52
|
-
eachEntityId: pako.inflate(deflatedData.eachEntityId, {to: 'string'}),
|
|
53
|
-
eachEntityPrimitiveInstancesPortion: new Uint32Array(pako.inflate(deflatedData.eachEntityPrimitiveInstancesPortion).buffer),
|
|
54
|
-
eachEntityMatricesPortion: new Uint32Array(pako.inflate(deflatedData.eachEntityMatricesPortion).buffer)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const decompressColor = (function () {
|
|
59
|
-
const color2 = new Float32Array(3);
|
|
60
|
-
return function (color) {
|
|
61
|
-
color2[0] = color[0] / 255.0;
|
|
62
|
-
color2[1] = color[1] / 255.0;
|
|
63
|
-
color2[2] = color[2] / 255.0;
|
|
64
|
-
return color2;
|
|
65
|
-
};
|
|
66
|
-
})();
|
|
67
|
-
|
|
68
|
-
function load(viewer, options, inflatedData, performanceModel) {
|
|
69
|
-
|
|
70
|
-
performanceModel.positionsCompression = "precompressed";
|
|
71
|
-
performanceModel.normalsCompression = "precompressed";
|
|
72
|
-
|
|
73
|
-
const positions = inflatedData.positions;
|
|
74
|
-
const normals = inflatedData.normals;
|
|
75
|
-
const indices = inflatedData.indices;
|
|
76
|
-
const edgeIndices = inflatedData.edgeIndices;
|
|
77
|
-
const decodeMatrices = inflatedData.decodeMatrices;
|
|
78
|
-
const matrices = inflatedData.matrices;
|
|
79
|
-
|
|
80
|
-
const eachPrimitivePositionsAndNormalsPortion = inflatedData.eachPrimitivePositionsAndNormalsPortion;
|
|
81
|
-
const eachPrimitiveIndicesPortion = inflatedData.eachPrimitiveIndicesPortion;
|
|
82
|
-
const eachPrimitiveEdgeIndicesPortion = inflatedData.eachPrimitiveEdgeIndicesPortion;
|
|
83
|
-
const eachPrimitiveDecodeMatricesPortion = inflatedData.eachPrimitiveDecodeMatricesPortion;
|
|
84
|
-
const eachPrimitiveColor = inflatedData.eachPrimitiveColor;
|
|
85
|
-
|
|
86
|
-
const primitiveInstances = inflatedData.primitiveInstances;
|
|
87
|
-
|
|
88
|
-
const eachEntityId = JSON.parse(inflatedData.eachEntityId);
|
|
89
|
-
const eachEntityPrimitiveInstancesPortion = inflatedData.eachEntityPrimitiveInstancesPortion;
|
|
90
|
-
const eachEntityMatricesPortion = inflatedData.eachEntityMatricesPortion;
|
|
91
|
-
|
|
92
|
-
const numPrimitives = eachPrimitivePositionsAndNormalsPortion.length;
|
|
93
|
-
const numPrimitiveInstances = primitiveInstances.length;
|
|
94
|
-
const primitiveInstanceCounts = new Uint8Array(numPrimitives); // For each mesh, how many times it is instanced
|
|
95
|
-
const orderedPrimitiveIndexes = new Uint32Array(numPrimitives); // For each mesh, its index sorted into runs that share the same decode matrix
|
|
96
|
-
|
|
97
|
-
const numEntities = eachEntityId.length;
|
|
98
|
-
|
|
99
|
-
// Get lookup that orders primitives into runs that share the same decode matrices;
|
|
100
|
-
// this is used to create meshes in batches that use the same decode matrix
|
|
101
|
-
|
|
102
|
-
for (let primitiveIndex = 0; primitiveIndex < numPrimitives; primitiveIndex++) {
|
|
103
|
-
orderedPrimitiveIndexes[primitiveIndex] = primitiveIndex;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
orderedPrimitiveIndexes.sort((i1, i2) => {
|
|
107
|
-
if (eachPrimitiveDecodeMatricesPortion[i1] < eachPrimitiveDecodeMatricesPortion[i2]) {
|
|
108
|
-
return -1;
|
|
109
|
-
}
|
|
110
|
-
if (eachPrimitiveDecodeMatricesPortion[i1] > eachPrimitiveDecodeMatricesPortion[i2]) {
|
|
111
|
-
return 1;
|
|
112
|
-
}
|
|
113
|
-
return 0;
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
// Count instances of each primitive
|
|
117
|
-
|
|
118
|
-
for (let primitiveInstanceIndex = 0; primitiveInstanceIndex < numPrimitiveInstances; primitiveInstanceIndex++) {
|
|
119
|
-
const primitiveIndex = primitiveInstances[primitiveInstanceIndex];
|
|
120
|
-
primitiveInstanceCounts[primitiveIndex]++;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Map batched primitives to the entities that will use them
|
|
124
|
-
|
|
125
|
-
const batchedPrimitiveEntityIndexes = {};
|
|
126
|
-
|
|
127
|
-
for (let entityIndex = 0; entityIndex < numEntities; entityIndex++) {
|
|
128
|
-
|
|
129
|
-
const lastEntityIndex = (numEntities - 1);
|
|
130
|
-
const atLastEntity = (entityIndex === lastEntityIndex);
|
|
131
|
-
const firstEntityPrimitiveInstanceIndex = eachEntityPrimitiveInstancesPortion [entityIndex];
|
|
132
|
-
const lastEntityPrimitiveInstanceIndex = atLastEntity ? eachEntityPrimitiveInstancesPortion[lastEntityIndex] : eachEntityPrimitiveInstancesPortion[entityIndex + 1];
|
|
133
|
-
|
|
134
|
-
for (let primitiveInstancesIndex = firstEntityPrimitiveInstanceIndex; primitiveInstancesIndex < lastEntityPrimitiveInstanceIndex; primitiveInstancesIndex++) {
|
|
135
|
-
|
|
136
|
-
const primitiveIndex = primitiveInstances[primitiveInstancesIndex];
|
|
137
|
-
const primitiveInstanceCount = primitiveInstanceCounts[primitiveIndex];
|
|
138
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
139
|
-
|
|
140
|
-
if (!isInstancedPrimitive) {
|
|
141
|
-
batchedPrimitiveEntityIndexes[primitiveIndex] = entityIndex;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
var countGeometries = 0;
|
|
147
|
-
|
|
148
|
-
// Create 1) geometries for instanced primitives, and 2) meshes for batched primitives. We create all the
|
|
149
|
-
// batched meshes now, before we create entities, because we're creating the batched meshes in runs that share
|
|
150
|
-
// the same decode matrices. Each run of meshes with the same decode matrix will end up in the same
|
|
151
|
-
// BatchingLayer; the PerformanceModel#createMesh() method starts a new BatchingLayer each time the decode
|
|
152
|
-
// matrix has changed since the last invocation of that method, hence why we need to order batched meshes
|
|
153
|
-
// in runs like this.
|
|
154
|
-
|
|
155
|
-
for (let primitiveIndex = 0; primitiveIndex < numPrimitives; primitiveIndex++) {
|
|
156
|
-
|
|
157
|
-
const orderedPrimitiveIndex = orderedPrimitiveIndexes[primitiveIndex];
|
|
158
|
-
|
|
159
|
-
const atLastPrimitive = (orderedPrimitiveIndex === (numPrimitives - 1));
|
|
160
|
-
|
|
161
|
-
const primitiveInstanceCount = primitiveInstanceCounts[orderedPrimitiveIndex];
|
|
162
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
163
|
-
|
|
164
|
-
const color = decompressColor(eachPrimitiveColor.subarray((orderedPrimitiveIndex * 4), (orderedPrimitiveIndex * 4) + 3));
|
|
165
|
-
const opacity = eachPrimitiveColor[(orderedPrimitiveIndex * 4) + 3] / 255.0;
|
|
166
|
-
|
|
167
|
-
const primitivePositions = positions.subarray(eachPrimitivePositionsAndNormalsPortion [orderedPrimitiveIndex], atLastPrimitive ? positions.length : eachPrimitivePositionsAndNormalsPortion [orderedPrimitiveIndex + 1]);
|
|
168
|
-
const primitiveNormals = normals.subarray(eachPrimitivePositionsAndNormalsPortion [orderedPrimitiveIndex], atLastPrimitive ? normals.length : eachPrimitivePositionsAndNormalsPortion [orderedPrimitiveIndex + 1]);
|
|
169
|
-
const primitiveIndices = indices.subarray(eachPrimitiveIndicesPortion [orderedPrimitiveIndex], atLastPrimitive ? indices.length : eachPrimitiveIndicesPortion [orderedPrimitiveIndex + 1]);
|
|
170
|
-
const primitiveEdgeIndices = edgeIndices.subarray(eachPrimitiveEdgeIndicesPortion [orderedPrimitiveIndex], atLastPrimitive ? edgeIndices.length : eachPrimitiveEdgeIndicesPortion [orderedPrimitiveIndex + 1]);
|
|
171
|
-
const primitiveDecodeMatrix = decodeMatrices.subarray(eachPrimitiveDecodeMatricesPortion [orderedPrimitiveIndex], eachPrimitiveDecodeMatricesPortion [orderedPrimitiveIndex] + 16);
|
|
172
|
-
|
|
173
|
-
if (isInstancedPrimitive) {
|
|
174
|
-
|
|
175
|
-
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
176
|
-
|
|
177
|
-
var geometryId = "geometry" + orderedPrimitiveIndex; // These IDs are local to the PerformanceModel
|
|
178
|
-
|
|
179
|
-
performanceModel.createGeometry({
|
|
180
|
-
id: geometryId,
|
|
181
|
-
primitive: "triangles",
|
|
182
|
-
positions: primitivePositions,
|
|
183
|
-
normals: primitiveNormals,
|
|
184
|
-
indices: primitiveIndices,
|
|
185
|
-
edgeIndices: primitiveEdgeIndices,
|
|
186
|
-
positionsDecodeMatrix: primitiveDecodeMatrix
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
countGeometries++;
|
|
190
|
-
|
|
191
|
-
} else {
|
|
192
|
-
|
|
193
|
-
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
194
|
-
|
|
195
|
-
const meshId = orderedPrimitiveIndex; // These IDs are local to the PerformanceModel
|
|
196
|
-
|
|
197
|
-
const entityIndex = batchedPrimitiveEntityIndexes[orderedPrimitiveIndex];
|
|
198
|
-
const entityId = eachEntityId[entityIndex];
|
|
199
|
-
|
|
200
|
-
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
201
|
-
|
|
202
|
-
performanceModel.createMesh(utils.apply(meshDefaults, {
|
|
203
|
-
id: meshId,
|
|
204
|
-
primitive: "triangles",
|
|
205
|
-
positions: primitivePositions,
|
|
206
|
-
normals: primitiveNormals,
|
|
207
|
-
indices: primitiveIndices,
|
|
208
|
-
edgeIndices: primitiveEdgeIndices,
|
|
209
|
-
positionsDecodeMatrix: primitiveDecodeMatrix,
|
|
210
|
-
color: color,
|
|
211
|
-
opacity: opacity
|
|
212
|
-
}));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
let countInstances = 0;
|
|
217
|
-
|
|
218
|
-
for (let entityIndex = 0; entityIndex < numEntities; entityIndex++) {
|
|
219
|
-
|
|
220
|
-
const lastEntityIndex = (numEntities - 1);
|
|
221
|
-
const atLastEntity = (entityIndex === lastEntityIndex);
|
|
222
|
-
const entityId = eachEntityId[entityIndex];
|
|
223
|
-
const firstEntityPrimitiveInstanceIndex = eachEntityPrimitiveInstancesPortion [entityIndex];
|
|
224
|
-
const lastEntityPrimitiveInstanceIndex = atLastEntity ? eachEntityPrimitiveInstancesPortion[lastEntityIndex] : eachEntityPrimitiveInstancesPortion[entityIndex + 1];
|
|
225
|
-
|
|
226
|
-
const meshIds = [];
|
|
227
|
-
|
|
228
|
-
for (let primitiveInstancesIndex = firstEntityPrimitiveInstanceIndex; primitiveInstancesIndex < lastEntityPrimitiveInstanceIndex; primitiveInstancesIndex++) {
|
|
229
|
-
|
|
230
|
-
const primitiveIndex = primitiveInstances[primitiveInstancesIndex];
|
|
231
|
-
const primitiveInstanceCount = primitiveInstanceCounts[primitiveIndex];
|
|
232
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
233
|
-
|
|
234
|
-
if (isInstancedPrimitive) {
|
|
235
|
-
|
|
236
|
-
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
237
|
-
|
|
238
|
-
const meshId = "instance." + countInstances++;
|
|
239
|
-
const geometryId = "geometry" + primitiveIndex;
|
|
240
|
-
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
241
|
-
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
242
|
-
|
|
243
|
-
performanceModel.createMesh(utils.apply(meshDefaults, {
|
|
244
|
-
id: meshId,
|
|
245
|
-
geometryId: geometryId,
|
|
246
|
-
matrix: matrix
|
|
247
|
-
}));
|
|
248
|
-
|
|
249
|
-
meshIds.push(meshId);
|
|
250
|
-
|
|
251
|
-
} else {
|
|
252
|
-
meshIds.push(primitiveIndex);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (meshIds.length > 0) {
|
|
257
|
-
|
|
258
|
-
const entityDefaults = {}; // TODO: get from lookup from entity IDs
|
|
259
|
-
|
|
260
|
-
performanceModel.createEntity(utils.apply(entityDefaults, {
|
|
261
|
-
id: entityId,
|
|
262
|
-
isObject: true, ///////////////// TODO: If metaobject exists
|
|
263
|
-
meshIds: meshIds
|
|
264
|
-
}));
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/** @private */
|
|
270
|
-
const ParserV4 = {
|
|
271
|
-
version: 4,
|
|
272
|
-
parse: function (viewer, options, elements, performanceModel) {
|
|
273
|
-
const deflatedData = extract(elements);
|
|
274
|
-
const inflatedData = inflate(deflatedData);
|
|
275
|
-
load(viewer, options, inflatedData, performanceModel);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
export {ParserV4};
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
Parser for .XKT Format V5
|
|
4
|
-
|
|
5
|
-
.XKT specifications: https://github.com/yjkkit/yjkkit-sdk/wiki/XKT-Format
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import {utils} from "../../../viewer/scene/utils.js";
|
|
10
|
-
import * as p from "./lib/pako.js";
|
|
11
|
-
|
|
12
|
-
let pako = window.pako || p;
|
|
13
|
-
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
|
14
|
-
pako = pako.default;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function extract(elements) {
|
|
18
|
-
return {
|
|
19
|
-
positions: elements[0],
|
|
20
|
-
normals: elements[1],
|
|
21
|
-
indices: elements[2],
|
|
22
|
-
edgeIndices: elements[3],
|
|
23
|
-
matrices: elements[4],
|
|
24
|
-
eachPrimitivePositionsAndNormalsPortion: elements[5],
|
|
25
|
-
eachPrimitiveIndicesPortion: elements[6],
|
|
26
|
-
eachPrimitiveEdgeIndicesPortion: elements[7],
|
|
27
|
-
eachPrimitiveColor: elements[8],
|
|
28
|
-
primitiveInstances: elements[9],
|
|
29
|
-
eachEntityId: elements[10],
|
|
30
|
-
eachEntityPrimitiveInstancesPortion: elements[11],
|
|
31
|
-
eachEntityMatricesPortion: elements[12]
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function inflate(deflatedData) {
|
|
36
|
-
return {
|
|
37
|
-
positions: new Float32Array(pako.inflate(deflatedData.positions).buffer),
|
|
38
|
-
normals: new Int8Array(pako.inflate(deflatedData.normals).buffer),
|
|
39
|
-
indices: new Uint32Array(pako.inflate(deflatedData.indices).buffer),
|
|
40
|
-
edgeIndices: new Uint32Array(pako.inflate(deflatedData.edgeIndices).buffer),
|
|
41
|
-
matrices: new Float32Array(pako.inflate(deflatedData.matrices).buffer),
|
|
42
|
-
eachPrimitivePositionsAndNormalsPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitivePositionsAndNormalsPortion).buffer),
|
|
43
|
-
eachPrimitiveIndicesPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitiveIndicesPortion).buffer),
|
|
44
|
-
eachPrimitiveEdgeIndicesPortion: new Uint32Array(pako.inflate(deflatedData.eachPrimitiveEdgeIndicesPortion).buffer),
|
|
45
|
-
eachPrimitiveColor: new Uint8Array(pako.inflate(deflatedData.eachPrimitiveColor).buffer),
|
|
46
|
-
primitiveInstances: new Uint32Array(pako.inflate(deflatedData.primitiveInstances).buffer),
|
|
47
|
-
eachEntityId: pako.inflate(deflatedData.eachEntityId, {to: 'string'}),
|
|
48
|
-
eachEntityPrimitiveInstancesPortion: new Uint32Array(pako.inflate(deflatedData.eachEntityPrimitiveInstancesPortion).buffer),
|
|
49
|
-
eachEntityMatricesPortion: new Uint32Array(pako.inflate(deflatedData.eachEntityMatricesPortion).buffer)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const decompressColor = (function () {
|
|
54
|
-
const color2 = new Float32Array(3);
|
|
55
|
-
return function (color) {
|
|
56
|
-
color2[0] = color[0] / 255.0;
|
|
57
|
-
color2[1] = color[1] / 255.0;
|
|
58
|
-
color2[2] = color[2] / 255.0;
|
|
59
|
-
return color2;
|
|
60
|
-
};
|
|
61
|
-
})();
|
|
62
|
-
|
|
63
|
-
function load(viewer, options, inflatedData, performanceModel) {
|
|
64
|
-
|
|
65
|
-
performanceModel.positionsCompression = "disabled"; // Positions in XKT V4 are floats, which we never quantize, for precision with big models
|
|
66
|
-
performanceModel.normalsCompression = "precompressed"; // Normals are oct-encoded though
|
|
67
|
-
|
|
68
|
-
const positions = inflatedData.positions;
|
|
69
|
-
const normals = inflatedData.normals;
|
|
70
|
-
const indices = inflatedData.indices;
|
|
71
|
-
const edgeIndices = inflatedData.edgeIndices;
|
|
72
|
-
const matrices = inflatedData.matrices;
|
|
73
|
-
|
|
74
|
-
const eachPrimitivePositionsAndNormalsPortion = inflatedData.eachPrimitivePositionsAndNormalsPortion;
|
|
75
|
-
const eachPrimitiveIndicesPortion = inflatedData.eachPrimitiveIndicesPortion;
|
|
76
|
-
const eachPrimitiveEdgeIndicesPortion = inflatedData.eachPrimitiveEdgeIndicesPortion;
|
|
77
|
-
const eachPrimitiveColor = inflatedData.eachPrimitiveColor;
|
|
78
|
-
|
|
79
|
-
const primitiveInstances = inflatedData.primitiveInstances;
|
|
80
|
-
|
|
81
|
-
const eachEntityId = JSON.parse(inflatedData.eachEntityId);
|
|
82
|
-
const eachEntityPrimitiveInstancesPortion = inflatedData.eachEntityPrimitiveInstancesPortion;
|
|
83
|
-
const eachEntityMatricesPortion = inflatedData.eachEntityMatricesPortion;
|
|
84
|
-
|
|
85
|
-
const numPrimitives = eachPrimitivePositionsAndNormalsPortion.length;
|
|
86
|
-
const numPrimitiveInstances = primitiveInstances.length;
|
|
87
|
-
const primitiveInstanceCounts = new Uint8Array(numPrimitives); // For each mesh, how many times it is instanced
|
|
88
|
-
|
|
89
|
-
const numEntities = eachEntityId.length;
|
|
90
|
-
|
|
91
|
-
// Count instances of each primitive
|
|
92
|
-
|
|
93
|
-
for (let primitiveInstanceIndex = 0; primitiveInstanceIndex < numPrimitiveInstances; primitiveInstanceIndex++) {
|
|
94
|
-
const primitiveIndex = primitiveInstances[primitiveInstanceIndex];
|
|
95
|
-
primitiveInstanceCounts[primitiveIndex]++;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Map batched primitives to the entities that will use them
|
|
99
|
-
|
|
100
|
-
const batchedPrimitiveEntityIndexes = {};
|
|
101
|
-
|
|
102
|
-
for (let entityIndex = 0; entityIndex < numEntities; entityIndex++) {
|
|
103
|
-
|
|
104
|
-
const lastEntityIndex = (numEntities - 1);
|
|
105
|
-
const atLastEntity = (entityIndex === lastEntityIndex);
|
|
106
|
-
const firstEntityPrimitiveInstanceIndex = eachEntityPrimitiveInstancesPortion [entityIndex];
|
|
107
|
-
const lastEntityPrimitiveInstanceIndex = atLastEntity ? eachEntityPrimitiveInstancesPortion[lastEntityIndex] : eachEntityPrimitiveInstancesPortion[entityIndex + 1];
|
|
108
|
-
|
|
109
|
-
for (let primitiveInstancesIndex = firstEntityPrimitiveInstanceIndex; primitiveInstancesIndex < lastEntityPrimitiveInstanceIndex; primitiveInstancesIndex++) {
|
|
110
|
-
|
|
111
|
-
const primitiveIndex = primitiveInstances[primitiveInstancesIndex];
|
|
112
|
-
const primitiveInstanceCount = primitiveInstanceCounts[primitiveIndex];
|
|
113
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
114
|
-
|
|
115
|
-
if (!isInstancedPrimitive) {
|
|
116
|
-
batchedPrimitiveEntityIndexes[primitiveIndex] = entityIndex;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var countGeometries = 0;
|
|
122
|
-
|
|
123
|
-
// Create geometries for instanced primitives and meshes for batched primitives.
|
|
124
|
-
|
|
125
|
-
for (let primitiveIndex = 0; primitiveIndex < numPrimitives; primitiveIndex++) {
|
|
126
|
-
|
|
127
|
-
const atLastPrimitive = (primitiveIndex === (numPrimitives - 1));
|
|
128
|
-
|
|
129
|
-
const primitiveInstanceCount = primitiveInstanceCounts[primitiveIndex];
|
|
130
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
131
|
-
|
|
132
|
-
const color = decompressColor(eachPrimitiveColor.subarray((primitiveIndex * 4), (primitiveIndex * 4) + 3));
|
|
133
|
-
const opacity = eachPrimitiveColor[(primitiveIndex * 4) + 3] / 255.0;
|
|
134
|
-
|
|
135
|
-
const primitivePositions = positions.subarray(eachPrimitivePositionsAndNormalsPortion [primitiveIndex], atLastPrimitive ? positions.length : eachPrimitivePositionsAndNormalsPortion [primitiveIndex + 1]);
|
|
136
|
-
const primitiveNormals = normals.subarray(eachPrimitivePositionsAndNormalsPortion [primitiveIndex], atLastPrimitive ? normals.length : eachPrimitivePositionsAndNormalsPortion [primitiveIndex + 1]);
|
|
137
|
-
const primitiveIndices = indices.subarray(eachPrimitiveIndicesPortion [primitiveIndex], atLastPrimitive ? indices.length : eachPrimitiveIndicesPortion [primitiveIndex + 1]);
|
|
138
|
-
const primitiveEdgeIndices = edgeIndices.subarray(eachPrimitiveEdgeIndicesPortion [primitiveIndex], atLastPrimitive ? edgeIndices.length : eachPrimitiveEdgeIndicesPortion [primitiveIndex + 1]);
|
|
139
|
-
|
|
140
|
-
if (isInstancedPrimitive) {
|
|
141
|
-
|
|
142
|
-
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
143
|
-
|
|
144
|
-
var geometryId = "geometry" + primitiveIndex; // These IDs are local to the PerformanceModel
|
|
145
|
-
|
|
146
|
-
performanceModel.createGeometry({
|
|
147
|
-
id: geometryId,
|
|
148
|
-
primitive: "triangles",
|
|
149
|
-
positions: primitivePositions,
|
|
150
|
-
normals: primitiveNormals,
|
|
151
|
-
indices: primitiveIndices,
|
|
152
|
-
edgeIndices: primitiveEdgeIndices
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
countGeometries++;
|
|
156
|
-
|
|
157
|
-
} else {
|
|
158
|
-
|
|
159
|
-
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
160
|
-
|
|
161
|
-
const meshId = primitiveIndex; // These IDs are local to the PerformanceModel
|
|
162
|
-
|
|
163
|
-
const entityIndex = batchedPrimitiveEntityIndexes[primitiveIndex];
|
|
164
|
-
const entityId = eachEntityId[entityIndex];
|
|
165
|
-
|
|
166
|
-
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
167
|
-
|
|
168
|
-
performanceModel.createMesh(utils.apply(meshDefaults, {
|
|
169
|
-
id: meshId,
|
|
170
|
-
primitive: "triangles",
|
|
171
|
-
positions: primitivePositions,
|
|
172
|
-
normals: primitiveNormals,
|
|
173
|
-
indices: primitiveIndices,
|
|
174
|
-
edgeIndices: primitiveEdgeIndices,
|
|
175
|
-
color: color,
|
|
176
|
-
opacity: opacity
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let countInstances = 0;
|
|
182
|
-
|
|
183
|
-
for (let entityIndex = 0; entityIndex < numEntities; entityIndex++) {
|
|
184
|
-
|
|
185
|
-
const lastEntityIndex = (numEntities - 1);
|
|
186
|
-
const atLastEntity = (entityIndex === lastEntityIndex);
|
|
187
|
-
const entityId = eachEntityId[entityIndex];
|
|
188
|
-
const firstEntityPrimitiveInstanceIndex = eachEntityPrimitiveInstancesPortion [entityIndex];
|
|
189
|
-
const lastEntityPrimitiveInstanceIndex = atLastEntity ? eachEntityPrimitiveInstancesPortion[lastEntityIndex] : eachEntityPrimitiveInstancesPortion[entityIndex + 1];
|
|
190
|
-
|
|
191
|
-
const meshIds = [];
|
|
192
|
-
|
|
193
|
-
for (let primitiveInstancesIndex = firstEntityPrimitiveInstanceIndex; primitiveInstancesIndex < lastEntityPrimitiveInstanceIndex; primitiveInstancesIndex++) {
|
|
194
|
-
|
|
195
|
-
const primitiveIndex = primitiveInstances[primitiveInstancesIndex];
|
|
196
|
-
const primitiveInstanceCount = primitiveInstanceCounts[primitiveIndex];
|
|
197
|
-
const isInstancedPrimitive = (primitiveInstanceCount > 1);
|
|
198
|
-
|
|
199
|
-
if (isInstancedPrimitive) {
|
|
200
|
-
|
|
201
|
-
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
202
|
-
|
|
203
|
-
const meshId = "instance." + countInstances++;
|
|
204
|
-
const geometryId = "geometry" + primitiveIndex;
|
|
205
|
-
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
206
|
-
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
207
|
-
|
|
208
|
-
performanceModel.createMesh(utils.apply(meshDefaults, {
|
|
209
|
-
id: meshId,
|
|
210
|
-
geometryId: geometryId,
|
|
211
|
-
matrix: matrix
|
|
212
|
-
}));
|
|
213
|
-
|
|
214
|
-
meshIds.push(meshId);
|
|
215
|
-
|
|
216
|
-
} else {
|
|
217
|
-
meshIds.push(primitiveIndex);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (meshIds.length > 0) {
|
|
222
|
-
|
|
223
|
-
const entityDefaults = {}; // TODO: get from lookup from entity IDs
|
|
224
|
-
|
|
225
|
-
performanceModel.createEntity(utils.apply(entityDefaults, {
|
|
226
|
-
id: entityId,
|
|
227
|
-
isObject: true, ///////////////// TODO: If metaobject exists
|
|
228
|
-
meshIds: meshIds
|
|
229
|
-
}));
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/** @private */
|
|
235
|
-
const ParserV5 = {
|
|
236
|
-
version: 5,
|
|
237
|
-
parse: function (viewer, options, elements, performanceModel) {
|
|
238
|
-
const deflatedData = extract(elements);
|
|
239
|
-
const inflatedData = inflate(deflatedData);
|
|
240
|
-
load(viewer, options, inflatedData, performanceModel);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
export {ParserV5};
|