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,145 @@
|
|
1
|
+
import {Plugin} from "../../viewer/Plugin.js";
|
2
|
+
import {Node} from "../../viewer/scene/nodes/Node.js";
|
3
|
+
import {utils} from "../../viewer/scene/utils.js";
|
4
|
+
import {OBJSceneGraphLoader} from "./OBJSceneGraphLoader.js";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* {@link Viewer} plugin that loads models from [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) files.
|
8
|
+
*
|
9
|
+
* * Creates an {@link Entity} representing each model it loads, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
10
|
+
* * Creates an {@link Entity} for each object within the model, which will have {@link Entity#isObject} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#objects}.
|
11
|
+
* * When loading, can set the World-space position, scale and rotation of each model within World space, along with initial properties for all the model's {@link Entity}s.
|
12
|
+
*
|
13
|
+
* ## Metadata
|
14
|
+
*
|
15
|
+
* OBJLoaderPlugin can also load an accompanying JSON metadata file with each model, which creates a {@link MetaModel} corresponding
|
16
|
+
* to the model {@link Entity} and a {@link MetaObject} corresponding to each object {@link Entity}.
|
17
|
+
*
|
18
|
+
* Each {@link MetaObject} has a {@link MetaObject#type}, which indicates the classification of its corresponding {@link Entity}. When loading
|
19
|
+
* metadata, we can also provide GLTFModelLoaderPlugin with a custom lookup table of initial values to set on the properties of each type of {@link Entity}. By default, OBJLoaderPlugin
|
20
|
+
* uses its own map of standard default colors, visibilities and opacities for IFC element types.
|
21
|
+
|
22
|
+
*
|
23
|
+
* ## Usage
|
24
|
+
*
|
25
|
+
* [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#loading_OBJ_SportsCar)]
|
26
|
+
*
|
27
|
+
* ````javascript
|
28
|
+
* import {Viewer, OBJLoaderPlugin} from "yjkkit-sdk.es.js";
|
29
|
+
*
|
30
|
+
* // Create a yjkkit Viewer and arrange the camera
|
31
|
+
* const viewer = new Viewer({
|
32
|
+
* canvasId: "myCanvas",
|
33
|
+
* transparent: true
|
34
|
+
* });
|
35
|
+
*
|
36
|
+
* viewer.camera.orbitPitch(20);
|
37
|
+
*
|
38
|
+
* // Add an OBJLoaderPlugin to the Viewer
|
39
|
+
* const objLoader = new OBJLoaderPlugin(viewer);
|
40
|
+
*
|
41
|
+
* // Load an OBJ model
|
42
|
+
* var model = objLoader.load({ // Model is an Entity
|
43
|
+
* id: "myModel",
|
44
|
+
* src: "./models/obj/sportsCar/sportsCar.obj",
|
45
|
+
* edges: true
|
46
|
+
* });
|
47
|
+
*
|
48
|
+
* // When the model has loaded, fit it to view
|
49
|
+
* model.on("loaded", () => {
|
50
|
+
* viewer.cameraFlight.flyTo(model);
|
51
|
+
* })
|
52
|
+
*
|
53
|
+
* // Find the model Entity by ID
|
54
|
+
* model = viewer.scene.models["myModel"];
|
55
|
+
*
|
56
|
+
* // Update properties of the model Entity
|
57
|
+
* model.highlight = [1,0,0];
|
58
|
+
*
|
59
|
+
* // Destroy the model
|
60
|
+
* model.destroy();
|
61
|
+
* ````
|
62
|
+
* @class OBJLoaderPlugin
|
63
|
+
*/
|
64
|
+
class OBJLoaderPlugin extends Plugin {
|
65
|
+
|
66
|
+
/**
|
67
|
+
* @constructor
|
68
|
+
*
|
69
|
+
* @param {Viewer} viewer The Viewer.
|
70
|
+
* @param {Object} cfg Plugin configuration.
|
71
|
+
* @param {String} [cfg.id="OBJLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
72
|
+
*/
|
73
|
+
constructor(viewer, cfg) {
|
74
|
+
|
75
|
+
super("OBJLoader", viewer, cfg);
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @private
|
79
|
+
*/
|
80
|
+
this._sceneGraphLoader = new OBJSceneGraphLoader();
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Loads an OBJ model from a file into this OBJLoader's {@link Viewer}.
|
85
|
+
*
|
86
|
+
* @param {*} params Loading parameters.
|
87
|
+
* @param {String} params.id ID to assign to the model's root {@link Entity}, unique among all components in the Viewer's {@link Scene}.
|
88
|
+
* @param {String} params.src Path to an OBJ file.
|
89
|
+
* @param {String} [params.metaModelSrc] Path to an optional metadata file.
|
90
|
+
* @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
|
91
|
+
* @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
|
92
|
+
* @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
|
93
|
+
* @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
|
94
|
+
* @param {Number} [params.edgeThreshold=20] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
|
95
|
+
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
|
96
|
+
*/
|
97
|
+
load(params = {}) {
|
98
|
+
|
99
|
+
if (params.id && this.viewer.scene.components[params.id]) {
|
100
|
+
this.error("Component with this ID already exists in viewer: " + params.id + " - will autogenerate this ID");
|
101
|
+
delete params.id;
|
102
|
+
}
|
103
|
+
|
104
|
+
var modelNode = new Node(this.viewer.scene, utils.apply(params, {
|
105
|
+
isModel: true
|
106
|
+
}));
|
107
|
+
|
108
|
+
const modelId = modelNode.id; // In case ID was auto-generated
|
109
|
+
const src = params.src;
|
110
|
+
|
111
|
+
if (!src) {
|
112
|
+
this.error("load() param expected: src");
|
113
|
+
return modelNode;
|
114
|
+
}
|
115
|
+
|
116
|
+
if (params.metaModelSrc) {
|
117
|
+
const metaModelSrc = params.metaModelSrc;
|
118
|
+
utils.loadJSON(metaModelSrc,
|
119
|
+
(modelMetadata) => {
|
120
|
+
this.viewer.metaScene.createMetaModel(modelId, modelMetadata);
|
121
|
+
this._sceneGraphLoader.load(modelNode, src, params);
|
122
|
+
},
|
123
|
+
(errMsg) => {
|
124
|
+
this.error(`load(): Failed to load model modelMetadata for model '${modelId} from '${metaModelSrc}' - ${errMsg}`);
|
125
|
+
});
|
126
|
+
} else {
|
127
|
+
this._sceneGraphLoader.load(modelNode, src, params);
|
128
|
+
}
|
129
|
+
|
130
|
+
modelNode.once("destroyed", () => {
|
131
|
+
this.viewer.metaScene.destroyMetaModel(modelId);
|
132
|
+
});
|
133
|
+
|
134
|
+
return modelNode;
|
135
|
+
}
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Destroys this OBJLoaderPlugin.
|
139
|
+
*/
|
140
|
+
destroy() {
|
141
|
+
super.destroy();
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
export {OBJLoaderPlugin}
|