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,577 @@
|
|
1
|
+
import {Material} from './Material.js';
|
2
|
+
import {RenderState} from '../webgl/RenderState.js';
|
3
|
+
|
4
|
+
const PRESETS = {
|
5
|
+
"default": {
|
6
|
+
fill: true,
|
7
|
+
fillColor: [0.4, 0.4, 0.4],
|
8
|
+
fillAlpha: 0.2,
|
9
|
+
edges: true,
|
10
|
+
edgeColor: [0.2, 0.2, 0.2],
|
11
|
+
edgeAlpha: 0.5,
|
12
|
+
edgeWidth: 1
|
13
|
+
},
|
14
|
+
"defaultWhiteBG": {
|
15
|
+
fill: true,
|
16
|
+
fillColor: [1, 1, 1],
|
17
|
+
fillAlpha: 0.6,
|
18
|
+
edgeColor: [0.2, 0.2, 0.2],
|
19
|
+
edgeAlpha: 1.0,
|
20
|
+
edgeWidth: 1
|
21
|
+
},
|
22
|
+
"defaultLightBG": {
|
23
|
+
fill: true,
|
24
|
+
fillColor: [0.4, 0.4, 0.4],
|
25
|
+
fillAlpha: 0.2,
|
26
|
+
edges: true,
|
27
|
+
edgeColor: [0.2, 0.2, 0.2],
|
28
|
+
edgeAlpha: 0.5,
|
29
|
+
edgeWidth: 1
|
30
|
+
},
|
31
|
+
"defaultDarkBG": {
|
32
|
+
fill: true,
|
33
|
+
fillColor: [0.4, 0.4, 0.4],
|
34
|
+
fillAlpha: 0.2,
|
35
|
+
edges: true,
|
36
|
+
edgeColor: [0.5, 0.5, 0.5],
|
37
|
+
edgeAlpha: 0.5,
|
38
|
+
edgeWidth: 1
|
39
|
+
},
|
40
|
+
"phosphorous": {
|
41
|
+
fill: true,
|
42
|
+
fillColor: [0.0, 0.0, 0.0],
|
43
|
+
fillAlpha: 0.4,
|
44
|
+
edges: true,
|
45
|
+
edgeColor: [0.9, 0.9, 0.9],
|
46
|
+
edgeAlpha: 0.5,
|
47
|
+
edgeWidth: 2
|
48
|
+
},
|
49
|
+
"sunset": {
|
50
|
+
fill: true,
|
51
|
+
fillColor: [0.9, 0.9, 0.6],
|
52
|
+
fillAlpha: 0.2,
|
53
|
+
edges: true,
|
54
|
+
edgeColor: [0.9, 0.9, 0.9],
|
55
|
+
edgeAlpha: 0.5,
|
56
|
+
edgeWidth: 1
|
57
|
+
},
|
58
|
+
"vectorscope": {
|
59
|
+
fill: true,
|
60
|
+
fillColor: [0.0, 0.0, 0.0],
|
61
|
+
fillAlpha: 0.7,
|
62
|
+
edges: true,
|
63
|
+
edgeColor: [0.2, 1.0, 0.2],
|
64
|
+
edgeAlpha: 1,
|
65
|
+
edgeWidth: 2
|
66
|
+
},
|
67
|
+
"battlezone": {
|
68
|
+
fill: true,
|
69
|
+
fillColor: [0.0, 0.0, 0.0],
|
70
|
+
fillAlpha: 1.0,
|
71
|
+
edges: true,
|
72
|
+
edgeColor: [0.2, 1.0, 0.2],
|
73
|
+
edgeAlpha: 1,
|
74
|
+
edgeWidth: 3
|
75
|
+
},
|
76
|
+
"sepia": {
|
77
|
+
fill: true,
|
78
|
+
fillColor: [0.970588207244873, 0.7965892553329468, 0.6660899519920349],
|
79
|
+
fillAlpha: 0.4,
|
80
|
+
edges: true,
|
81
|
+
edgeColor: [0.529411792755127, 0.4577854573726654, 0.4100345969200134],
|
82
|
+
edgeAlpha: 1.0,
|
83
|
+
edgeWidth: 1
|
84
|
+
},
|
85
|
+
"yellowHighlight": {
|
86
|
+
fill: true,
|
87
|
+
fillColor: [1.0, 1.0, 0.0],
|
88
|
+
fillAlpha: 0.5,
|
89
|
+
edges: true,
|
90
|
+
edgeColor: [0.529411792755127, 0.4577854573726654, 0.4100345969200134],
|
91
|
+
edgeAlpha: 1.0,
|
92
|
+
edgeWidth: 1
|
93
|
+
},
|
94
|
+
"greenSelected": {
|
95
|
+
fill: true,
|
96
|
+
fillColor: [0.0, 1.0, 0.0],
|
97
|
+
fillAlpha: 0.5,
|
98
|
+
edges: true,
|
99
|
+
edgeColor: [0.4577854573726654, 0.529411792755127, 0.4100345969200134],
|
100
|
+
edgeAlpha: 1.0,
|
101
|
+
edgeWidth: 1
|
102
|
+
},
|
103
|
+
"gamegrid": {
|
104
|
+
fill: true,
|
105
|
+
fillColor: [0.2, 0.2, 0.7],
|
106
|
+
fillAlpha: 0.9,
|
107
|
+
edges: true,
|
108
|
+
edgeColor: [0.4, 0.4, 1.6],
|
109
|
+
edgeAlpha: 0.8,
|
110
|
+
edgeWidth: 3
|
111
|
+
}
|
112
|
+
};
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Configures the appearance of {@link Entity}s when they are xrayed, highlighted or selected.
|
116
|
+
*
|
117
|
+
* * XRay an {@link Entity} by setting {@link Entity#xrayed} ````true````.
|
118
|
+
* * Highlight an {@link Entity} by setting {@link Entity#highlighted} ````true````.
|
119
|
+
* * Select an {@link Entity} by setting {@link Entity#selected} ````true````.
|
120
|
+
* * When {@link Entity}s are within the subtree of a root {@link Entity}, then setting {@link Entity#xrayed}, {@link Entity#highlighted} or {@link Entity#selected}
|
121
|
+
* on the root will collectively set those properties on all sub-{@link Entity}s.
|
122
|
+
* * EmphasisMaterial provides several presets. Select a preset by setting {@link EmphasisMaterial#preset} to the ID of a preset in {@link EmphasisMaterial#presets}.
|
123
|
+
* * By default, a {@link Mesh} uses the default EmphasisMaterials in {@link Scene#xrayMaterial}, {@link Scene#highlightMaterial} and {@link Scene#selectedMaterial}
|
124
|
+
* but you can assign each {@link Mesh#xrayMaterial}, {@link Mesh#highlightMaterial} or {@link Mesh#selectedMaterial} to a custom EmphasisMaterial, if required.
|
125
|
+
*
|
126
|
+
* ## Usage
|
127
|
+
*
|
128
|
+
* In the example below, we'll create a {@link Mesh} with its own XRayMaterial and set {@link Mesh#xrayed} ````true```` to xray it.
|
129
|
+
*
|
130
|
+
* Recall that {@link Mesh} is a concrete subtype of the abstract {@link Entity} base class.
|
131
|
+
*
|
132
|
+
* ````javascript
|
133
|
+
* new Mesh(viewer.scene, {
|
134
|
+
* geometry: new BoxGeometry(viewer.scene, {
|
135
|
+
* edgeThreshold: 1
|
136
|
+
* }),
|
137
|
+
* material: new PhongMaterial(viewer.scene, {
|
138
|
+
* diffuse: [0.2, 0.2, 1.0]
|
139
|
+
* }),
|
140
|
+
* xrayMaterial: new EmphasisMaterial(viewer.scene, {
|
141
|
+
* fill: true,
|
142
|
+
* fillColor: [0, 0, 0],
|
143
|
+
* fillAlpha: 0.7,
|
144
|
+
* edges: true,
|
145
|
+
* edgeColor: [0.2, 1.0, 0.2],
|
146
|
+
* edgeAlpha: 1.0,
|
147
|
+
* edgeWidth: 2
|
148
|
+
* }),
|
149
|
+
* xrayed: true
|
150
|
+
* });
|
151
|
+
* ````
|
152
|
+
*
|
153
|
+
* Note the ````edgeThreshold```` configuration for the {@link ReadableGeometry} on our {@link Mesh}. EmphasisMaterial configures
|
154
|
+
* a wireframe representation of the {@link ReadableGeometry} for the selected emphasis mode, which will have inner edges (those edges between
|
155
|
+
* adjacent co-planar triangles) removed for visual clarity. The ````edgeThreshold```` indicates that, for
|
156
|
+
* this particular {@link ReadableGeometry}, an inner edge is one where the angle between the surface normals of adjacent triangles
|
157
|
+
* is not greater than ````5```` degrees. That's set to ````2```` by default, but we can override it to tweak the effect
|
158
|
+
* as needed for particular Geometries.
|
159
|
+
*
|
160
|
+
* Here's the example again, this time implicitly defaulting to the {@link Scene#edgeMaterial}. We'll also modify that EdgeMaterial
|
161
|
+
* to customize the effect.
|
162
|
+
*
|
163
|
+
* ````javascript
|
164
|
+
* new Mesh({
|
165
|
+
* geometry: new TeapotGeometry(viewer.scene, {
|
166
|
+
* edgeThreshold: 5
|
167
|
+
* }),
|
168
|
+
* material: new PhongMaterial(viewer.scene, {
|
169
|
+
* diffuse: [0.2, 0.2, 1.0]
|
170
|
+
* }),
|
171
|
+
* xrayed: true
|
172
|
+
* });
|
173
|
+
*
|
174
|
+
* var xrayMaterial = viewer.scene.xrayMaterial;
|
175
|
+
*
|
176
|
+
* xrayMaterial.fillColor = [0.2, 1.0, 0.2];
|
177
|
+
* xrayMaterial.fillAlpha = 1.0;
|
178
|
+
* ````
|
179
|
+
*
|
180
|
+
* ## Presets
|
181
|
+
*
|
182
|
+
* Let's switch the {@link Scene#xrayMaterial} to one of the presets in {@link EmphasisMaterial#presets}:
|
183
|
+
*
|
184
|
+
* ````javascript
|
185
|
+
* viewer.xrayMaterial.preset = EmphasisMaterial.presets["sepia"];
|
186
|
+
* ````
|
187
|
+
*
|
188
|
+
* We can also create an EmphasisMaterial from a preset, while overriding properties of the preset as required:
|
189
|
+
*
|
190
|
+
* ````javascript
|
191
|
+
* var myEmphasisMaterial = new EMphasisMaterial(viewer.scene, {
|
192
|
+
* preset: "sepia",
|
193
|
+
* fillColor = [1.0, 0.5, 0.5]
|
194
|
+
* });
|
195
|
+
* ````
|
196
|
+
*/
|
197
|
+
class EmphasisMaterial extends Material {
|
198
|
+
|
199
|
+
/**
|
200
|
+
@private
|
201
|
+
*/
|
202
|
+
get type() {
|
203
|
+
return "EmphasisMaterial";
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* Gets available EmphasisMaterial presets.
|
208
|
+
*
|
209
|
+
* @type {Object}
|
210
|
+
*/
|
211
|
+
get presets() {
|
212
|
+
return PRESETS;
|
213
|
+
};
|
214
|
+
|
215
|
+
/**
|
216
|
+
* @constructor
|
217
|
+
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
218
|
+
* @param {*} [cfg] The EmphasisMaterial configuration
|
219
|
+
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
220
|
+
* @param {Boolean} [cfg.fill=true] Indicates if xray surfaces are filled with color.
|
221
|
+
* @param {Number[]} [cfg.fillColor=[0.4,0.4,0.4]] EmphasisMaterial fill color.
|
222
|
+
* @param {Number} [cfg.fillAlpha=0.2] Transparency of filled xray faces. A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
223
|
+
* @param {Boolean} [cfg.edges=true] Indicates if xray edges are visible.
|
224
|
+
* @param {Number[]} [cfg.edgeColor=[0.2,0.2,0.2]] RGB color of xray edges.
|
225
|
+
* @param {Number} [cfg.edgeAlpha=0.5] Transparency of xray edges. A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
226
|
+
* @param {Number} [cfg.edgeWidth=1] Width of xray edges, in pixels.
|
227
|
+
* @param {String} [cfg.preset] Selects a preset EmphasisMaterial configuration - see {@link EmphasisMaterial#presets}.
|
228
|
+
* @param {Boolean} [cfg.backfaces=false] Whether to render geometry backfaces when emphasising.
|
229
|
+
*/
|
230
|
+
constructor(owner, cfg = {}) {
|
231
|
+
|
232
|
+
super(owner, cfg);
|
233
|
+
|
234
|
+
this._state = new RenderState({
|
235
|
+
type: "EmphasisMaterial",
|
236
|
+
fill: null,
|
237
|
+
fillColor: null,
|
238
|
+
fillAlpha: null,
|
239
|
+
edges: null,
|
240
|
+
edgeColor: null,
|
241
|
+
edgeAlpha: null,
|
242
|
+
edgeWidth: null,
|
243
|
+
backfaces: true
|
244
|
+
});
|
245
|
+
|
246
|
+
this._preset = "default";
|
247
|
+
|
248
|
+
if (cfg.preset) { // Apply preset then override with configs where provided
|
249
|
+
this.preset = cfg.preset;
|
250
|
+
if (cfg.fill !== undefined) {
|
251
|
+
this.fill = cfg.fill;
|
252
|
+
}
|
253
|
+
if (cfg.fillColor) {
|
254
|
+
this.fillColor = cfg.fillColor;
|
255
|
+
}
|
256
|
+
if (cfg.fillAlpha !== undefined) {
|
257
|
+
this.fillAlpha = cfg.fillAlpha;
|
258
|
+
}
|
259
|
+
if (cfg.edges !== undefined) {
|
260
|
+
this.edges = cfg.edges;
|
261
|
+
}
|
262
|
+
if (cfg.edgeColor) {
|
263
|
+
this.edgeColor = cfg.edgeColor;
|
264
|
+
}
|
265
|
+
if (cfg.edgeAlpha !== undefined) {
|
266
|
+
this.edgeAlpha = cfg.edgeAlpha;
|
267
|
+
}
|
268
|
+
if (cfg.edgeWidth !== undefined) {
|
269
|
+
this.edgeWidth = cfg.edgeWidth;
|
270
|
+
}
|
271
|
+
if (cfg.backfaces !== undefined) {
|
272
|
+
this.backfaces = cfg.backfaces;
|
273
|
+
}
|
274
|
+
} else {
|
275
|
+
this.fill = cfg.fill;
|
276
|
+
this.fillColor = cfg.fillColor;
|
277
|
+
this.fillAlpha = cfg.fillAlpha;
|
278
|
+
this.edges = cfg.edges;
|
279
|
+
this.edgeColor = cfg.edgeColor;
|
280
|
+
this.edgeAlpha = cfg.edgeAlpha;
|
281
|
+
this.edgeWidth = cfg.edgeWidth;
|
282
|
+
this.backfaces = cfg.backfaces;
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
/**
|
287
|
+
* Sets if surfaces are filled with color.
|
288
|
+
*
|
289
|
+
* Default is ````true````.
|
290
|
+
*
|
291
|
+
* @type {Boolean}
|
292
|
+
*/
|
293
|
+
set fill(value) {
|
294
|
+
value = value !== false;
|
295
|
+
if (this._state.fill === value) {
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
this._state.fill = value;
|
299
|
+
this.glRedraw();
|
300
|
+
}
|
301
|
+
|
302
|
+
/**
|
303
|
+
* Gets if surfaces are filled with color.
|
304
|
+
*
|
305
|
+
* Default is ````true````.
|
306
|
+
*
|
307
|
+
* @type {Boolean}
|
308
|
+
*/
|
309
|
+
get fill() {
|
310
|
+
return this._state.fill;
|
311
|
+
}
|
312
|
+
|
313
|
+
/**
|
314
|
+
* Sets the RGB color of filled faces.
|
315
|
+
*
|
316
|
+
* Default is ````[0.4, 0.4, 0.4]````.
|
317
|
+
*
|
318
|
+
* @type {Number[]}
|
319
|
+
*/
|
320
|
+
set fillColor(value) {
|
321
|
+
let fillColor = this._state.fillColor;
|
322
|
+
if (!fillColor) {
|
323
|
+
fillColor = this._state.fillColor = new Float32Array(3);
|
324
|
+
} else if (value && fillColor[0] === value[0] && fillColor[1] === value[1] && fillColor[2] === value[2]) {
|
325
|
+
return;
|
326
|
+
}
|
327
|
+
if (value) {
|
328
|
+
fillColor[0] = value[0];
|
329
|
+
fillColor[1] = value[1];
|
330
|
+
fillColor[2] = value[2];
|
331
|
+
} else {
|
332
|
+
fillColor[0] = 0.4;
|
333
|
+
fillColor[1] = 0.4;
|
334
|
+
fillColor[2] = 0.4;
|
335
|
+
}
|
336
|
+
this.glRedraw();
|
337
|
+
}
|
338
|
+
|
339
|
+
/**
|
340
|
+
* Gets the RGB color of filled faces.
|
341
|
+
*
|
342
|
+
* Default is ````[0.4, 0.4, 0.4]````.
|
343
|
+
*
|
344
|
+
* @type {Number[]}
|
345
|
+
*/
|
346
|
+
get fillColor() {
|
347
|
+
return this._state.fillColor;
|
348
|
+
}
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Sets the transparency of filled faces.
|
352
|
+
*
|
353
|
+
* A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
354
|
+
*
|
355
|
+
* Default is ````0.2````.
|
356
|
+
*
|
357
|
+
* @type {Number}
|
358
|
+
*/
|
359
|
+
set fillAlpha(value) {
|
360
|
+
value = (value !== undefined && value !== null) ? value : 0.2;
|
361
|
+
if (this._state.fillAlpha === value) {
|
362
|
+
return;
|
363
|
+
}
|
364
|
+
this._state.fillAlpha = value;
|
365
|
+
this.glRedraw();
|
366
|
+
}
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Gets the transparency of filled faces.
|
370
|
+
*
|
371
|
+
* A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
372
|
+
*
|
373
|
+
* Default is ````0.2````.
|
374
|
+
*
|
375
|
+
* @type {Number}
|
376
|
+
*/
|
377
|
+
get fillAlpha() {
|
378
|
+
return this._state.fillAlpha;
|
379
|
+
}
|
380
|
+
|
381
|
+
/**
|
382
|
+
* Sets if edges are visible.
|
383
|
+
*
|
384
|
+
* Default is ````true````.
|
385
|
+
*
|
386
|
+
* @type {Boolean}
|
387
|
+
*/
|
388
|
+
set edges(value) {
|
389
|
+
value = value !== false;
|
390
|
+
if (this._state.edges === value) {
|
391
|
+
return;
|
392
|
+
}
|
393
|
+
this._state.edges = value;
|
394
|
+
this.glRedraw();
|
395
|
+
}
|
396
|
+
|
397
|
+
/**
|
398
|
+
* Gets if edges are visible.
|
399
|
+
*
|
400
|
+
* Default is ````true````.
|
401
|
+
*
|
402
|
+
* @type {Boolean}
|
403
|
+
*/
|
404
|
+
get edges() {
|
405
|
+
return this._state.edges;
|
406
|
+
}
|
407
|
+
|
408
|
+
/**
|
409
|
+
* Sets the RGB color of edges.
|
410
|
+
*
|
411
|
+
* Default is ```` [0.2, 0.2, 0.2]````.
|
412
|
+
*
|
413
|
+
* @type {Number[]}
|
414
|
+
*/
|
415
|
+
set edgeColor(value) {
|
416
|
+
let edgeColor = this._state.edgeColor;
|
417
|
+
if (!edgeColor) {
|
418
|
+
edgeColor = this._state.edgeColor = new Float32Array(3);
|
419
|
+
} else if (value && edgeColor[0] === value[0] && edgeColor[1] === value[1] && edgeColor[2] === value[2]) {
|
420
|
+
return;
|
421
|
+
}
|
422
|
+
if (value) {
|
423
|
+
edgeColor[0] = value[0];
|
424
|
+
edgeColor[1] = value[1];
|
425
|
+
edgeColor[2] = value[2];
|
426
|
+
} else {
|
427
|
+
edgeColor[0] = 0.2;
|
428
|
+
edgeColor[1] = 0.2;
|
429
|
+
edgeColor[2] = 0.2;
|
430
|
+
}
|
431
|
+
this.glRedraw();
|
432
|
+
}
|
433
|
+
|
434
|
+
/**
|
435
|
+
* Gets the RGB color of edges.
|
436
|
+
*
|
437
|
+
* Default is ```` [0.2, 0.2, 0.2]````.
|
438
|
+
*
|
439
|
+
* @type {Number[]}
|
440
|
+
*/
|
441
|
+
get edgeColor() {
|
442
|
+
return this._state.edgeColor;
|
443
|
+
}
|
444
|
+
|
445
|
+
/**
|
446
|
+
* Sets the transparency of edges.
|
447
|
+
*
|
448
|
+
* A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
449
|
+
*
|
450
|
+
* Default is ````0.2````.
|
451
|
+
*
|
452
|
+
* @type {Number}
|
453
|
+
*/
|
454
|
+
set edgeAlpha(value) {
|
455
|
+
value = (value !== undefined && value !== null) ? value : 0.5;
|
456
|
+
if (this._state.edgeAlpha === value) {
|
457
|
+
return;
|
458
|
+
}
|
459
|
+
this._state.edgeAlpha = value;
|
460
|
+
this.glRedraw();
|
461
|
+
}
|
462
|
+
|
463
|
+
/**
|
464
|
+
* Gets the transparency of edges.
|
465
|
+
*
|
466
|
+
* A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
|
467
|
+
*
|
468
|
+
* Default is ````0.2````.
|
469
|
+
*
|
470
|
+
* @type {Number}
|
471
|
+
*/
|
472
|
+
get edgeAlpha() {
|
473
|
+
return this._state.edgeAlpha;
|
474
|
+
}
|
475
|
+
|
476
|
+
/**
|
477
|
+
* Sets edge width.
|
478
|
+
*
|
479
|
+
* This is not supported by WebGL implementations based on DirectX [2019].
|
480
|
+
*
|
481
|
+
* Default value is ````1.0```` pixels.
|
482
|
+
*
|
483
|
+
* @type {Number}
|
484
|
+
*/
|
485
|
+
set edgeWidth(value) {
|
486
|
+
this._state.edgeWidth = value || 1.0;
|
487
|
+
this.glRedraw();
|
488
|
+
}
|
489
|
+
|
490
|
+
/**
|
491
|
+
* Gets edge width.
|
492
|
+
*
|
493
|
+
* This is not supported by WebGL implementations based on DirectX [2019].
|
494
|
+
*
|
495
|
+
* Default value is ````1.0```` pixels.
|
496
|
+
*
|
497
|
+
* @type {Number}
|
498
|
+
*/
|
499
|
+
get edgeWidth() {
|
500
|
+
return this._state.edgeWidth;
|
501
|
+
}
|
502
|
+
|
503
|
+
/**
|
504
|
+
* Sets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````..
|
505
|
+
*
|
506
|
+
* Default is ````false````.
|
507
|
+
*
|
508
|
+
* @type {Boolean}
|
509
|
+
*/
|
510
|
+
set backfaces(value) {
|
511
|
+
value = !!value;
|
512
|
+
if (this._state.backfaces === value) {
|
513
|
+
return;
|
514
|
+
}
|
515
|
+
this._state.backfaces = value;
|
516
|
+
this.glRedraw();
|
517
|
+
}
|
518
|
+
|
519
|
+
/**
|
520
|
+
* Gets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````..
|
521
|
+
*
|
522
|
+
* Default is ````false````.
|
523
|
+
*
|
524
|
+
* @type {Boolean}
|
525
|
+
*/
|
526
|
+
get backfaces() {
|
527
|
+
return this._state.backfaces;
|
528
|
+
}
|
529
|
+
|
530
|
+
/**
|
531
|
+
* Selects a preset EmphasisMaterial configuration.
|
532
|
+
*
|
533
|
+
* Default value is "default".
|
534
|
+
*
|
535
|
+
* @type {String}
|
536
|
+
*/
|
537
|
+
set preset(value) {
|
538
|
+
value = value || "default";
|
539
|
+
if (this._preset === value) {
|
540
|
+
return;
|
541
|
+
}
|
542
|
+
const preset = PRESETS[value];
|
543
|
+
if (!preset) {
|
544
|
+
this.error("unsupported preset: '" + value + "' - supported values are " + Object.keys(PRESETS).join(", "));
|
545
|
+
return;
|
546
|
+
}
|
547
|
+
this.fill = preset.fill;
|
548
|
+
this.fillColor = preset.fillColor;
|
549
|
+
this.fillAlpha = preset.fillAlpha;
|
550
|
+
this.edges = preset.edges;
|
551
|
+
this.edgeColor = preset.edgeColor;
|
552
|
+
this.edgeAlpha = preset.edgeAlpha;
|
553
|
+
this.edgeWidth = preset.edgeWidth;
|
554
|
+
this._preset = value;
|
555
|
+
}
|
556
|
+
|
557
|
+
/**
|
558
|
+
* Gets the current preset EmphasisMaterial configuration.
|
559
|
+
*
|
560
|
+
* Default value is "default".
|
561
|
+
*
|
562
|
+
* @type {String}
|
563
|
+
*/
|
564
|
+
get preset() {
|
565
|
+
return this._preset;
|
566
|
+
}
|
567
|
+
|
568
|
+
/**
|
569
|
+
* Destroys this EmphasisMaterial.
|
570
|
+
*/
|
571
|
+
destroy() {
|
572
|
+
super.destroy();
|
573
|
+
this._state.destroy();
|
574
|
+
}
|
575
|
+
}
|
576
|
+
|
577
|
+
export {EmphasisMaterial};
|