csyjk 1.1.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/xx.iml +12 -0
- package/dist/app.js +43 -0
- package/{index.html → dist/index.html} +0 -0
- package/{style.css → dist/style.css} +1 -1
- package/package.json +40 -5
- package/public/gltf.js +2241 -0
- package/public/index.html +10 -0
- package/src/index.js +3 -0
- package/src/lib/gltf/assets/check.jpg +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.css +358 -0
- package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.js +1 -0
- package/src/lib/gltf/assets/iconfont/iconfont.json +604 -0
- package/src/lib/gltf/assets/iconfont/iconfont.svg +189 -0
- 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 +15 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +863 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +462 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +262 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +362 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +575 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +333 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +777 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +525 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +297 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +345 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +122 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +462 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +508 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +922 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +273 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +687 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +145 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +777 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +273 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +313 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +1328 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +249 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +169 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +403 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +134 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +77 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +61 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +57 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +822 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +888 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +88 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +624 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +87 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +295 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +78 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +847 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +167 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +228 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +220 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +244 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +301 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +426 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +479 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +6818 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +238 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +1279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +11 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +2060 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +2155 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +1002 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +64 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +153 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +267 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +553 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +991 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +49 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +17 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +205 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +78 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +97 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +95 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +112 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +372 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +162 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +39 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +145 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +215 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +311 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +1669 -0
- 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 +312 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +112 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +193 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +289 -0
- 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 +122 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +186 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +439 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +361 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +258 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +197 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +498 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +908 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +475 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +570 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +2623 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +21 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +262 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +697 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +34 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +63 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +183 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +736 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +295 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +327 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +698 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +364 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +776 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +113 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +340 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +312 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +343 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +331 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +348 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +737 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +143 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +373 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +366 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +370 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +386 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +376 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +293 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +382 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +37 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +1017 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +246 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +809 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +504 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +297 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +322 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +311 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +291 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +319 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +305 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +323 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +969 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +246 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +859 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +557 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +341 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +338 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +354 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +329 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +358 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +349 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +363 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +284 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +354 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +880 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +669 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +326 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +149 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +316 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +286 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +302 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +464 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +323 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +234 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +689 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +327 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +238 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +106 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +271 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +102 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +168 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +161 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +172 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +1721 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +8 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +4 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +103 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +130 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +18 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +1475 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +218 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +1032 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +175 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +156 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +314 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +29 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +77 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +395 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +79 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +138 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +5 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +382 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +359 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +577 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +222 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +378 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +169 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +39 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +820 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +860 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +320 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +807 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +522 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +8 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +118 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +162 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +353 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +5302 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +132 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +200 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +272 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +2165 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +978 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +1566 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +249 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +163 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +276 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +269 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +207 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +156 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +210 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +146 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +186 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +120 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +214 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +96 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +1356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +183 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +239 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +161 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +133 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +5 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +547 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +2481 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +119 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +45 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +45 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +56 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +452 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +212 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +121 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +23 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +270 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +317 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +69 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +179 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +315 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +203 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +40 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +1300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +18 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +49 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +217 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +214 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +432 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +326 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +375 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +61 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +48 -0
- package/src/lib/gltf/gltf.css +392 -0
- package/src/lib/gltf/gltf.js +2241 -0
- package/webpack.config.js +70 -0
- package/app.js +0 -43
@@ -0,0 +1,167 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Parser for .XKT Format V1
|
4
|
+
|
5
|
+
.XKT specifications: https://github.com/yjkkit/yjkkit-sdk/wiki/XKT-Format
|
6
|
+
|
7
|
+
DEPRECATED
|
8
|
+
|
9
|
+
*/
|
10
|
+
|
11
|
+
import {utils} from "../../../viewer/scene/utils.js";
|
12
|
+
import * as p from "./lib/pako.js";
|
13
|
+
import {math} from "../../../viewer/scene/math/math.js";
|
14
|
+
|
15
|
+
let pako = window.pako || p;
|
16
|
+
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
17
|
+
pako = pako.default;
|
18
|
+
}
|
19
|
+
|
20
|
+
const decompressColor = (function () {
|
21
|
+
const color2 = new Float32Array(3);
|
22
|
+
return function (color) {
|
23
|
+
color2[0] = color[0] / 255.0;
|
24
|
+
color2[1] = color[1] / 255.0;
|
25
|
+
color2[2] = color[2] / 255.0;
|
26
|
+
return color2;
|
27
|
+
};
|
28
|
+
})();
|
29
|
+
|
30
|
+
function extract(elements) {
|
31
|
+
return {
|
32
|
+
positions: elements[0],
|
33
|
+
normals: elements[1],
|
34
|
+
indices: elements[2],
|
35
|
+
edgeIndices: elements[3],
|
36
|
+
meshPositions: elements[4],
|
37
|
+
meshIndices: elements[5],
|
38
|
+
meshEdgesIndices: elements[6],
|
39
|
+
meshColors: elements[7],
|
40
|
+
entityIDs: elements[8],
|
41
|
+
entityMeshes: elements[9],
|
42
|
+
entityIsObjects: elements[10],
|
43
|
+
positionsDecodeMatrix: elements[11]
|
44
|
+
};
|
45
|
+
}
|
46
|
+
|
47
|
+
function inflate(deflatedData) {
|
48
|
+
return {
|
49
|
+
positions: new Uint16Array(pako.inflate(deflatedData.positions).buffer),
|
50
|
+
normals: new Int8Array(pako.inflate(deflatedData.normals).buffer),
|
51
|
+
indices: new Uint32Array(pako.inflate(deflatedData.indices).buffer),
|
52
|
+
edgeIndices: new Uint32Array(pako.inflate(deflatedData.edgeIndices).buffer),
|
53
|
+
meshPositions: new Uint32Array(pako.inflate(deflatedData.meshPositions).buffer),
|
54
|
+
meshIndices: new Uint32Array(pako.inflate(deflatedData.meshIndices).buffer),
|
55
|
+
meshEdgesIndices: new Uint32Array(pako.inflate(deflatedData.meshEdgesIndices).buffer),
|
56
|
+
meshColors: new Uint8Array(pako.inflate(deflatedData.meshColors).buffer),
|
57
|
+
entityIDs: pako.inflate(deflatedData.entityIDs, {to: 'string'}),
|
58
|
+
entityMeshes: new Uint32Array(pako.inflate(deflatedData.entityMeshes).buffer),
|
59
|
+
entityIsObjects: new Uint8Array(pako.inflate(deflatedData.entityIsObjects).buffer),
|
60
|
+
positionsDecodeMatrix: new Float32Array(pako.inflate(deflatedData.positionsDecodeMatrix).buffer)
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
function load(viewer, options, inflatedData, performanceModel) {
|
65
|
+
|
66
|
+
performanceModel.positionsCompression = "precompressed";
|
67
|
+
performanceModel.normalsCompression = "precompressed";
|
68
|
+
|
69
|
+
const positions = inflatedData.positions;
|
70
|
+
const normals = inflatedData.normals;
|
71
|
+
const indices = inflatedData.indices;
|
72
|
+
const edgeIndices = inflatedData.edgeIndices;
|
73
|
+
const meshPositions = inflatedData.meshPositions;
|
74
|
+
const meshIndices = inflatedData.meshIndices;
|
75
|
+
const meshEdgesIndices = inflatedData.meshEdgesIndices;
|
76
|
+
const meshColors = inflatedData.meshColors;
|
77
|
+
const entityIDs = JSON.parse(inflatedData.entityIDs);
|
78
|
+
const entityMeshes = inflatedData.entityMeshes;
|
79
|
+
const entityIsObjects = inflatedData.entityIsObjects;
|
80
|
+
const numMeshes = meshPositions.length;
|
81
|
+
const numEntities = entityMeshes.length;
|
82
|
+
|
83
|
+
for (let i = 0; i < numEntities; i++) {
|
84
|
+
|
85
|
+
const xktEntityId = entityIDs [i];
|
86
|
+
const entityId = options.globalizeObjectIds ? math.globalizeObjectId(performanceModel.id, xktEntityId) : xktEntityId;
|
87
|
+
const metaObject = viewer.metaScene.metaObjects[entityId];
|
88
|
+
const entityDefaults = {};
|
89
|
+
const meshDefaults = {};
|
90
|
+
|
91
|
+
if (metaObject) {
|
92
|
+
|
93
|
+
if (options.excludeTypesMap && metaObject.type && options.excludeTypesMap[metaObject.type]) {
|
94
|
+
continue;
|
95
|
+
}
|
96
|
+
|
97
|
+
if (options.includeTypesMap && metaObject.type && (!options.includeTypesMap[metaObject.type])) {
|
98
|
+
continue;
|
99
|
+
}
|
100
|
+
|
101
|
+
const props = options.objectDefaults ? options.objectDefaults[metaObject.type] || options.objectDefaults["DEFAULT"] : null;
|
102
|
+
|
103
|
+
if (props) {
|
104
|
+
if (props.visible === false) {
|
105
|
+
entityDefaults.visible = false;
|
106
|
+
}
|
107
|
+
if (props.pickable === false) {
|
108
|
+
entityDefaults.pickable = false;
|
109
|
+
}
|
110
|
+
if (props.colorize) {
|
111
|
+
meshDefaults.color = props.colorize;
|
112
|
+
}
|
113
|
+
if (props.opacity !== undefined && props.opacity !== null) {
|
114
|
+
meshDefaults.opacity = props.opacity;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
} else {
|
118
|
+
if (options.excludeUnclassifiedObjects) {
|
119
|
+
continue;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
const lastEntity = (i === numEntities - 1);
|
124
|
+
const meshIds = [];
|
125
|
+
|
126
|
+
for (let j = entityMeshes [i], jlen = lastEntity ? entityMeshes.length : entityMeshes [i + 1]; j < jlen; j++) {
|
127
|
+
|
128
|
+
const lastMesh = (j === (numMeshes - 1));
|
129
|
+
const meshId = entityId + ".mesh." + j;
|
130
|
+
|
131
|
+
const color = decompressColor(meshColors.subarray((j * 4), (j * 4) + 3));
|
132
|
+
const opacity = meshColors[(j * 4) + 3] / 255.0;
|
133
|
+
|
134
|
+
performanceModel.createMesh(utils.apply(meshDefaults, {
|
135
|
+
id: meshId,
|
136
|
+
primitive: "triangles",
|
137
|
+
positions: positions.subarray(meshPositions [j], lastMesh ? positions.length : meshPositions [j + 1]),
|
138
|
+
normals: normals.subarray(meshPositions [j], lastMesh ? positions.length : meshPositions [j + 1]),
|
139
|
+
indices: indices.subarray(meshIndices [j], lastMesh ? indices.length : meshIndices [j + 1]),
|
140
|
+
edgeIndices: edgeIndices.subarray(meshEdgesIndices [j], lastMesh ? edgeIndices.length : meshEdgesIndices [j + 1]),
|
141
|
+
positionsDecodeMatrix: inflatedData.positionsDecodeMatrix,
|
142
|
+
color: color,
|
143
|
+
opacity: opacity
|
144
|
+
}));
|
145
|
+
|
146
|
+
meshIds.push(meshId);
|
147
|
+
}
|
148
|
+
|
149
|
+
performanceModel.createEntity(utils.apply(entityDefaults, {
|
150
|
+
id: entityId,
|
151
|
+
isObject: (entityIsObjects [i] === 1),
|
152
|
+
meshIds: meshIds
|
153
|
+
}));
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
/** @private */
|
158
|
+
const ParserV1 = {
|
159
|
+
version: 1,
|
160
|
+
parse: function (viewer, options, elements, performanceModel) {
|
161
|
+
const deflatedData = extract(elements);
|
162
|
+
const inflatedData = inflate(deflatedData);
|
163
|
+
load(viewer, options, inflatedData, performanceModel);
|
164
|
+
}
|
165
|
+
};
|
166
|
+
|
167
|
+
export {ParserV1};
|
@@ -0,0 +1,228 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Parser for .XKT Format V2
|
4
|
+
|
5
|
+
DEPRECATED
|
6
|
+
|
7
|
+
.XKT specifications: https://github.com/yjkkit/yjkkit-sdk/wiki/XKT-Format
|
8
|
+
|
9
|
+
*/
|
10
|
+
|
11
|
+
import {utils} from "../../../viewer/scene/utils.js";
|
12
|
+
import * as p from "./lib/pako.js";
|
13
|
+
import {math} from "../../../viewer/scene/math/math.js";
|
14
|
+
|
15
|
+
let pako = window.pako || p;
|
16
|
+
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
17
|
+
pako = pako.default;
|
18
|
+
}
|
19
|
+
|
20
|
+
function extract(elements) {
|
21
|
+
return {
|
22
|
+
|
23
|
+
positions: elements[0],
|
24
|
+
normals: elements[1],
|
25
|
+
indices: elements[2],
|
26
|
+
edgeIndices: elements[3],
|
27
|
+
|
28
|
+
meshPositions: elements[4],
|
29
|
+
meshIndices: elements[5],
|
30
|
+
meshEdgesIndices: elements[6],
|
31
|
+
meshColors: elements[7],
|
32
|
+
|
33
|
+
entityIDs: elements[8],
|
34
|
+
entityMeshes: elements[9],
|
35
|
+
entityIsObjects: elements[10],
|
36
|
+
|
37
|
+
positionsDecodeMatrix: elements[11],
|
38
|
+
|
39
|
+
entityMeshIds: elements[12],
|
40
|
+
entityMatrices: elements[13],
|
41
|
+
entityUsesInstancing: elements[14]
|
42
|
+
};
|
43
|
+
}
|
44
|
+
|
45
|
+
function inflate(deflatedData) {
|
46
|
+
return {
|
47
|
+
positions: new Uint16Array(pako.inflate(deflatedData.positions).buffer),
|
48
|
+
normals: new Int8Array(pako.inflate(deflatedData.normals).buffer),
|
49
|
+
indices: new Uint32Array(pako.inflate(deflatedData.indices).buffer),
|
50
|
+
edgeIndices: new Uint32Array(pako.inflate(deflatedData.edgeIndices).buffer),
|
51
|
+
|
52
|
+
meshPositions: new Uint32Array(pako.inflate(deflatedData.meshPositions).buffer),
|
53
|
+
meshIndices: new Uint32Array(pako.inflate(deflatedData.meshIndices).buffer),
|
54
|
+
meshEdgesIndices: new Uint32Array(pako.inflate(deflatedData.meshEdgesIndices).buffer),
|
55
|
+
meshColors: new Uint8Array(pako.inflate(deflatedData.meshColors).buffer),
|
56
|
+
|
57
|
+
entityIDs: pako.inflate(deflatedData.entityIDs, {to: 'string'}),
|
58
|
+
entityMeshes: new Uint32Array(pako.inflate(deflatedData.entityMeshes).buffer),
|
59
|
+
entityIsObjects: new Uint8Array(pako.inflate(deflatedData.entityIsObjects).buffer),
|
60
|
+
|
61
|
+
positionsDecodeMatrix: new Float32Array(pako.inflate(deflatedData.positionsDecodeMatrix).buffer),
|
62
|
+
|
63
|
+
entityMeshIds: new Uint32Array(pako.inflate(deflatedData.entityMeshIds).buffer),
|
64
|
+
entityMatrices: new Float32Array(pako.inflate(deflatedData.entityMatrices).buffer),
|
65
|
+
entityUsesInstancing: new Uint8Array(pako.inflate(deflatedData.entityUsesInstancing).buffer)
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
const decompressColor = (function () {
|
70
|
+
const color2 = new Float32Array(3);
|
71
|
+
return function (color) {
|
72
|
+
color2[0] = color[0] / 255.0;
|
73
|
+
color2[1] = color[1] / 255.0;
|
74
|
+
color2[2] = color[2] / 255.0;
|
75
|
+
return color2;
|
76
|
+
};
|
77
|
+
})();
|
78
|
+
|
79
|
+
function load(viewer, options, inflatedData, performanceModel) {
|
80
|
+
|
81
|
+
performanceModel.positionsCompression = "precompressed";
|
82
|
+
performanceModel.normalsCompression = "precompressed";
|
83
|
+
|
84
|
+
const positions = inflatedData.positions;
|
85
|
+
const normals = inflatedData.normals;
|
86
|
+
const indices = inflatedData.indices;
|
87
|
+
const edgeIndices = inflatedData.edgeIndices;
|
88
|
+
const meshPositions = inflatedData.meshPositions;
|
89
|
+
const meshIndices = inflatedData.meshIndices;
|
90
|
+
const meshEdgesIndices = inflatedData.meshEdgesIndices;
|
91
|
+
const meshColors = inflatedData.meshColors;
|
92
|
+
const entityIDs = JSON.parse(inflatedData.entityIDs);
|
93
|
+
const entityMeshes = inflatedData.entityMeshes;
|
94
|
+
const entityIsObjects = inflatedData.entityIsObjects;
|
95
|
+
const entityMeshIds = inflatedData.entityMeshIds;
|
96
|
+
const entityMatrices = inflatedData.entityMatrices;
|
97
|
+
const entityUsesInstancing = inflatedData.entityUsesInstancing;
|
98
|
+
|
99
|
+
const numMeshes = meshPositions.length;
|
100
|
+
const numEntities = entityMeshes.length;
|
101
|
+
|
102
|
+
const alreadyCreatedGeometries = {};
|
103
|
+
|
104
|
+
for (let i = 0; i < numEntities; i++) {
|
105
|
+
|
106
|
+
const xktEntityId = entityIDs [i];
|
107
|
+
const entityId = options.globalizeObjectIds ? math.globalizeObjectId(performanceModel.id, xktEntityId) : xktEntityId;
|
108
|
+
const metaObject = viewer.metaScene.metaObjects[entityId];
|
109
|
+
const entityDefaults = {};
|
110
|
+
const meshDefaults = {};
|
111
|
+
const entityMatrix = entityMatrices.subarray((i * 16), (i * 16) + 16);
|
112
|
+
|
113
|
+
if (metaObject) {
|
114
|
+
if (options.excludeTypesMap && metaObject.type && options.excludeTypesMap[metaObject.type]) {
|
115
|
+
continue;
|
116
|
+
}
|
117
|
+
if (options.includeTypesMap && metaObject.type && (!options.includeTypesMap[metaObject.type])) {
|
118
|
+
continue;
|
119
|
+
}
|
120
|
+
const props = options.objectDefaults ? options.objectDefaults[metaObject.type] || options.objectDefaults["DEFAULT"] : null;
|
121
|
+
if (props) {
|
122
|
+
if (props.visible === false) {
|
123
|
+
entityDefaults.visible = false;
|
124
|
+
}
|
125
|
+
if (props.pickable === false) {
|
126
|
+
entityDefaults.pickable = false;
|
127
|
+
}
|
128
|
+
if (props.colorize) {
|
129
|
+
meshDefaults.color = props.colorize;
|
130
|
+
}
|
131
|
+
if (props.opacity !== undefined && props.opacity !== null) {
|
132
|
+
meshDefaults.opacity = props.opacity;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
} else {
|
136
|
+
if (options.excludeUnclassifiedObjects) {
|
137
|
+
continue;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
const lastEntity = (i === numEntities - 1);
|
142
|
+
|
143
|
+
const meshIds = [];
|
144
|
+
|
145
|
+
for (let j = entityMeshes [i], jlen = lastEntity ? entityMeshIds.length : entityMeshes [i + 1]; j < jlen; j++) {
|
146
|
+
|
147
|
+
const jj = entityMeshIds [j];
|
148
|
+
|
149
|
+
const lastMesh = (jj === (numMeshes - 1));
|
150
|
+
const meshId = entityId + ".mesh." + jj;
|
151
|
+
|
152
|
+
const color = decompressColor(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
153
|
+
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
154
|
+
|
155
|
+
const tmpPositions = positions.subarray(meshPositions [jj], lastMesh ? positions.length : meshPositions [jj + 1]);
|
156
|
+
const tmpNormals = normals.subarray(meshPositions [jj], lastMesh ? positions.length : meshPositions [jj + 1]);
|
157
|
+
const tmpIndices = indices.subarray(meshIndices [jj], lastMesh ? indices.length : meshIndices [jj + 1]);
|
158
|
+
const tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
159
|
+
|
160
|
+
if (entityUsesInstancing [i] === 1) {
|
161
|
+
|
162
|
+
const geometryId = "geometry." + jj;
|
163
|
+
|
164
|
+
if (!(geometryId in alreadyCreatedGeometries)) {
|
165
|
+
|
166
|
+
performanceModel.createGeometry({
|
167
|
+
id: geometryId,
|
168
|
+
positions: tmpPositions,
|
169
|
+
normals: tmpNormals,
|
170
|
+
indices: tmpIndices,
|
171
|
+
edgeIndices: tmpEdgeIndices,
|
172
|
+
primitive: "triangles",
|
173
|
+
positionsDecodeMatrix: inflatedData.positionsDecodeMatrix,
|
174
|
+
});
|
175
|
+
|
176
|
+
alreadyCreatedGeometries [geometryId] = true;
|
177
|
+
}
|
178
|
+
|
179
|
+
performanceModel.createMesh(utils.apply(meshDefaults, {
|
180
|
+
id: meshId,
|
181
|
+
color: color,
|
182
|
+
opacity: opacity,
|
183
|
+
matrix: entityMatrix,
|
184
|
+
geometryId: geometryId,
|
185
|
+
}));
|
186
|
+
|
187
|
+
meshIds.push(meshId);
|
188
|
+
|
189
|
+
} else {
|
190
|
+
|
191
|
+
performanceModel.createMesh(utils.apply(meshDefaults, {
|
192
|
+
id: meshId,
|
193
|
+
primitive: "triangles",
|
194
|
+
positions: tmpPositions,
|
195
|
+
normals: tmpNormals,
|
196
|
+
indices: tmpIndices,
|
197
|
+
edgeIndices: tmpEdgeIndices,
|
198
|
+
positionsDecodeMatrix: inflatedData.positionsDecodeMatrix,
|
199
|
+
color: color,
|
200
|
+
opacity: opacity
|
201
|
+
}));
|
202
|
+
|
203
|
+
meshIds.push(meshId);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
if (meshIds.length) {
|
208
|
+
|
209
|
+
performanceModel.createEntity(utils.apply(entityDefaults, {
|
210
|
+
id: entityId,
|
211
|
+
isObject: (entityIsObjects [i] === 1),
|
212
|
+
meshIds: meshIds
|
213
|
+
}));
|
214
|
+
}
|
215
|
+
}
|
216
|
+
}
|
217
|
+
|
218
|
+
/** @private */
|
219
|
+
const ParserV2 = {
|
220
|
+
version: 2,
|
221
|
+
parse: function (viewer, options, elements, performanceModel) {
|
222
|
+
const deflatedData = extract(elements);
|
223
|
+
const inflatedData = inflate(deflatedData);
|
224
|
+
load(viewer, options, inflatedData, performanceModel);
|
225
|
+
}
|
226
|
+
};
|
227
|
+
|
228
|
+
export {ParserV2};
|
@@ -0,0 +1,220 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Parser for .XKT Format V3
|
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
|
+
import {math} from "../../../viewer/scene/math/math.js";
|
12
|
+
|
13
|
+
let pako = window.pako || p;
|
14
|
+
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
15
|
+
pako = pako.default;
|
16
|
+
}
|
17
|
+
|
18
|
+
function extract(elements) {
|
19
|
+
return {
|
20
|
+
positions: elements[0],
|
21
|
+
normals: elements[1],
|
22
|
+
indices: elements[2],
|
23
|
+
edgeIndices: elements[3],
|
24
|
+
meshPositions: elements[4],
|
25
|
+
meshIndices: elements[5],
|
26
|
+
meshEdgesIndices: elements[6],
|
27
|
+
meshColors: elements[7],
|
28
|
+
entityIDs: elements[8],
|
29
|
+
entityMeshes: elements[9],
|
30
|
+
entityIsObjects: elements[10],
|
31
|
+
instancedPositionsDecodeMatrix: elements[11],
|
32
|
+
batchedPositionsDecodeMatrix: elements[12],
|
33
|
+
entityMeshIds: elements[13],
|
34
|
+
entityMatrices: elements[14],
|
35
|
+
entityUsesInstancing: elements[15]
|
36
|
+
};
|
37
|
+
}
|
38
|
+
|
39
|
+
function inflate(deflatedData) {
|
40
|
+
return {
|
41
|
+
positions: new Uint16Array(pako.inflate(deflatedData.positions).buffer),
|
42
|
+
normals: new Int8Array(pako.inflate(deflatedData.normals).buffer),
|
43
|
+
indices: new Uint32Array(pako.inflate(deflatedData.indices).buffer),
|
44
|
+
edgeIndices: new Uint32Array(pako.inflate(deflatedData.edgeIndices).buffer),
|
45
|
+
meshPositions: new Uint32Array(pako.inflate(deflatedData.meshPositions).buffer),
|
46
|
+
meshIndices: new Uint32Array(pako.inflate(deflatedData.meshIndices).buffer),
|
47
|
+
meshEdgesIndices: new Uint32Array(pako.inflate(deflatedData.meshEdgesIndices).buffer),
|
48
|
+
meshColors: new Uint8Array(pako.inflate(deflatedData.meshColors).buffer),
|
49
|
+
entityIDs: pako.inflate(deflatedData.entityIDs, {to: 'string'}),
|
50
|
+
entityMeshes: new Uint32Array(pako.inflate(deflatedData.entityMeshes).buffer),
|
51
|
+
entityIsObjects: new Uint8Array(pako.inflate(deflatedData.entityIsObjects).buffer),
|
52
|
+
instancedPositionsDecodeMatrix: new Float32Array(pako.inflate(deflatedData.instancedPositionsDecodeMatrix).buffer),
|
53
|
+
batchedPositionsDecodeMatrix: new Float32Array(pako.inflate(deflatedData.batchedPositionsDecodeMatrix).buffer),
|
54
|
+
entityMeshIds: new Uint32Array(pako.inflate(deflatedData.entityMeshIds).buffer),
|
55
|
+
entityMatrices: new Float32Array(pako.inflate(deflatedData.entityMatrices).buffer),
|
56
|
+
entityUsesInstancing: new Uint8Array(pako.inflate(deflatedData.entityUsesInstancing).buffer)
|
57
|
+
};
|
58
|
+
}
|
59
|
+
|
60
|
+
const decompressColor = (function () {
|
61
|
+
const color2 = new Float32Array(3);
|
62
|
+
return function (color) {
|
63
|
+
color2[0] = color[0] / 255.0;
|
64
|
+
color2[1] = color[1] / 255.0;
|
65
|
+
color2[2] = color[2] / 255.0;
|
66
|
+
return color2;
|
67
|
+
};
|
68
|
+
})();
|
69
|
+
|
70
|
+
function load(viewer, options, inflatedData, performanceModel) {
|
71
|
+
|
72
|
+
performanceModel.positionsCompression = "precompressed";
|
73
|
+
performanceModel.normalsCompression = "precompressed";
|
74
|
+
|
75
|
+
const positions = inflatedData.positions;
|
76
|
+
const normals = inflatedData.normals;
|
77
|
+
const indices = inflatedData.indices;
|
78
|
+
const edgeIndices = inflatedData.edgeIndices;
|
79
|
+
const meshPositions = inflatedData.meshPositions;
|
80
|
+
const meshIndices = inflatedData.meshIndices;
|
81
|
+
const meshEdgesIndices = inflatedData.meshEdgesIndices;
|
82
|
+
const meshColors = inflatedData.meshColors;
|
83
|
+
const entityIDs = JSON.parse(inflatedData.entityIDs);
|
84
|
+
const entityMeshes = inflatedData.entityMeshes;
|
85
|
+
const entityIsObjects = inflatedData.entityIsObjects;
|
86
|
+
const entityMeshIds = inflatedData.entityMeshIds;
|
87
|
+
const entityMatrices = inflatedData.entityMatrices;
|
88
|
+
const entityUsesInstancing = inflatedData.entityUsesInstancing;
|
89
|
+
|
90
|
+
const numMeshes = meshPositions.length;
|
91
|
+
const numEntities = entityMeshes.length;
|
92
|
+
|
93
|
+
const _alreadyCreatedGeometries = {};
|
94
|
+
|
95
|
+
for (let i = 0; i < numEntities; i++) {
|
96
|
+
|
97
|
+
const xktEntityId = entityIDs [i];
|
98
|
+
const entityId = options.globalizeObjectIds ? math.globalizeObjectId(performanceModel.id, xktEntityId) : xktEntityId;
|
99
|
+
const metaObject = viewer.metaScene.metaObjects[entityId];
|
100
|
+
const entityDefaults = {};
|
101
|
+
const meshDefaults = {};
|
102
|
+
const entityMatrix = entityMatrices.subarray((i * 16), (i * 16) + 16);
|
103
|
+
|
104
|
+
if (metaObject) {
|
105
|
+
|
106
|
+
if (options.excludeTypesMap && metaObject.type && options.excludeTypesMap[metaObject.type]) {
|
107
|
+
continue;
|
108
|
+
}
|
109
|
+
|
110
|
+
if (options.includeTypesMap && metaObject.type && (!options.includeTypesMap[metaObject.type])) {
|
111
|
+
continue;
|
112
|
+
}
|
113
|
+
|
114
|
+
const props = options.objectDefaults ? options.objectDefaults[metaObject.type] || options.objectDefaults["DEFAULT"] : null;
|
115
|
+
|
116
|
+
if (props) {
|
117
|
+
if (props.visible === false) {
|
118
|
+
entityDefaults.visible = false;
|
119
|
+
}
|
120
|
+
if (props.pickable === false) {
|
121
|
+
entityDefaults.pickable = false;
|
122
|
+
}
|
123
|
+
if (props.colorize) {
|
124
|
+
meshDefaults.color = props.colorize;
|
125
|
+
}
|
126
|
+
if (props.opacity !== undefined && props.opacity !== null) {
|
127
|
+
meshDefaults.opacity = props.opacity;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
} else {
|
131
|
+
if (options.excludeUnclassifiedObjects) {
|
132
|
+
continue;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
const lastEntity = (i === numEntities - 1);
|
137
|
+
|
138
|
+
const meshIds = [];
|
139
|
+
|
140
|
+
for (let j = entityMeshes [i], jlen = lastEntity ? entityMeshIds.length : entityMeshes [i + 1]; j < jlen; j++) {
|
141
|
+
var jj = entityMeshIds [j];
|
142
|
+
|
143
|
+
const lastMesh = (jj === (numMeshes - 1));
|
144
|
+
const meshId = entityId + ".mesh." + jj;
|
145
|
+
|
146
|
+
const color = decompressColor(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
147
|
+
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
148
|
+
|
149
|
+
var tmpPositions = positions.subarray(meshPositions [jj], lastMesh ? positions.length : meshPositions [jj + 1]);
|
150
|
+
var tmpNormals = normals.subarray(meshPositions [jj], lastMesh ? positions.length : meshPositions [jj + 1]);
|
151
|
+
var tmpIndices = indices.subarray(meshIndices [jj], lastMesh ? indices.length : meshIndices [jj + 1]);
|
152
|
+
var tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
153
|
+
|
154
|
+
if (entityUsesInstancing [i] === 1) {
|
155
|
+
var geometryId = "geometry." + jj;
|
156
|
+
|
157
|
+
if (!(geometryId in _alreadyCreatedGeometries)) {
|
158
|
+
|
159
|
+
performanceModel.createGeometry({
|
160
|
+
id: geometryId,
|
161
|
+
positions: tmpPositions,
|
162
|
+
normals: tmpNormals,
|
163
|
+
indices: tmpIndices,
|
164
|
+
edgeIndices: tmpEdgeIndices,
|
165
|
+
primitive: "triangles",
|
166
|
+
positionsDecodeMatrix: inflatedData.instancedPositionsDecodeMatrix
|
167
|
+
});
|
168
|
+
|
169
|
+
_alreadyCreatedGeometries [geometryId] = true;
|
170
|
+
}
|
171
|
+
|
172
|
+
performanceModel.createMesh(utils.apply(meshDefaults, {
|
173
|
+
id: meshId,
|
174
|
+
color: color,
|
175
|
+
opacity: opacity,
|
176
|
+
matrix: entityMatrix,
|
177
|
+
geometryId: geometryId,
|
178
|
+
}));
|
179
|
+
|
180
|
+
meshIds.push(meshId);
|
181
|
+
|
182
|
+
} else {
|
183
|
+
|
184
|
+
performanceModel.createMesh(utils.apply(meshDefaults, {
|
185
|
+
id: meshId,
|
186
|
+
primitive: "triangles",
|
187
|
+
positions: tmpPositions,
|
188
|
+
normals: tmpNormals,
|
189
|
+
indices: tmpIndices,
|
190
|
+
edgeIndices: tmpEdgeIndices,
|
191
|
+
positionsDecodeMatrix: inflatedData.batchedPositionsDecodeMatrix,
|
192
|
+
color: color,
|
193
|
+
opacity: opacity
|
194
|
+
}));
|
195
|
+
|
196
|
+
meshIds.push(meshId);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
if (meshIds.length) {
|
201
|
+
performanceModel.createEntity(utils.apply(entityDefaults, {
|
202
|
+
id: entityId,
|
203
|
+
isObject: (entityIsObjects [i] === 1),
|
204
|
+
meshIds: meshIds
|
205
|
+
}));
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
/** @private */
|
211
|
+
const ParserV3 = {
|
212
|
+
version: 3,
|
213
|
+
parse: function (viewer, options, elements, performanceModel) {
|
214
|
+
const deflatedData = extract(elements);
|
215
|
+
const inflatedData = inflate(deflatedData);
|
216
|
+
load(viewer, options, inflatedData, performanceModel);
|
217
|
+
}
|
218
|
+
};
|
219
|
+
|
220
|
+
export {ParserV3};
|