csyjk 1.1.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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,570 @@
|
|
1
|
+
import {Component} from '../Component.js';
|
2
|
+
import {Node} from "../nodes/Node.js";
|
3
|
+
import {Mesh} from "../mesh/Mesh.js";
|
4
|
+
import {PhongMaterial} from "../materials/PhongMaterial.js";
|
5
|
+
import {buildPlaneGeometry} from "../geometry/builders/buildPlaneGeometry.js";
|
6
|
+
import {Texture} from "../materials/Texture.js";
|
7
|
+
import {buildGridGeometry} from "../geometry/builders/buildGridGeometry.js";
|
8
|
+
import {ReadableGeometry} from "../geometry/ReadableGeometry.js";
|
9
|
+
import {math} from "../math/math.js";
|
10
|
+
import {worldToRTCPos} from "../math/rtcCoords.js";
|
11
|
+
|
12
|
+
const tempVec3 = math.vec3();
|
13
|
+
const tempVec3b = math.vec3();
|
14
|
+
const tempVec3c = math.vec3();
|
15
|
+
const zeroVec = math.vec3([0, -1, 0]);
|
16
|
+
const tempQuat = math.vec4([0, 0, 0, 1]);
|
17
|
+
|
18
|
+
/**
|
19
|
+
* @desc A plane-shaped 3D object containing a bitmap image.
|
20
|
+
*
|
21
|
+
* Use ````ImagePlane```` to embed bitmap images in your scenes.
|
22
|
+
*
|
23
|
+
* As shown in the examples below, ````ImagePlane```` is useful for creating ground planes from satellite maps and embedding 2D plan
|
24
|
+
* view images in cross-section slicing planes.
|
25
|
+
*
|
26
|
+
* # Example 1: Create a ground plane from a satellite image
|
27
|
+
*
|
28
|
+
* In our first example, we'll load the Schependomlaan model, then use
|
29
|
+
* an ````ImagePlane```` to create a ground plane, which will contain
|
30
|
+
* a satellite image sourced from Google Maps.
|
31
|
+
*
|
32
|
+
* <img src="http://yjkkit.io/img/docs/ImagePlane/schependomlaanGoogleSatMapMed.png">
|
33
|
+
*
|
34
|
+
* [<img src="http://yjkkit.io/img/docs/ImagePlane/ImagePlane.png">](http://yjkkit.github.io/yjkkit-sdk/examples/#ImagePlane_groundPlane)
|
35
|
+
*
|
36
|
+
* [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#ImagePlane_groundPlane)]
|
37
|
+
*
|
38
|
+
* ````javascript
|
39
|
+
* import {Viewer, ImagePlane, XKTLoaderPlugin} from "yjkkit-sdk.es.js";
|
40
|
+
*
|
41
|
+
* const viewer = new Viewer({
|
42
|
+
* canvasId: "myCanvas",
|
43
|
+
* transparent: true
|
44
|
+
* });
|
45
|
+
*
|
46
|
+
* viewer.camera.eye = [-8.31, 42.21, 54.30];
|
47
|
+
* viewer.camera.look = [-0.86, 15.40, 14.90];
|
48
|
+
* viewer.camera.up = [0.10, 0.83, -0.54];
|
49
|
+
*
|
50
|
+
* const xktLoader = new XKTLoaderPlugin(viewer);
|
51
|
+
*
|
52
|
+
* xktLoader.load({ // Load IFC model
|
53
|
+
* id: "myModel",
|
54
|
+
* src: "./models/xkt/Schependomlaan.xkt",
|
55
|
+
* edges: true,
|
56
|
+
*
|
57
|
+
* rotation: [0, 22, 0], // Rotate, position and scale the model to align it correctly with the ImagePlane
|
58
|
+
* position: [-8, 0, 15],
|
59
|
+
* scale: [1.1, 1.1, 1.1]
|
60
|
+
* });
|
61
|
+
*
|
62
|
+
* new ImagePlane(viewer.scene, {
|
63
|
+
* src: "./images/schependomlaanSatMap.png", // Google satellite image; accepted file types are PNG and JPEG
|
64
|
+
* visible: true, // Show the ImagePlane
|
65
|
+
* gridVisible: true, // Show the grid - grid is only visible when ImagePlane is also visible
|
66
|
+
* size: 190, // Size of ImagePlane's longest edge
|
67
|
+
* position: [0, -1, 0], // World-space position of ImagePlane's center
|
68
|
+
* rotation: [0, 0, 0], // Euler angles for X, Y and Z
|
69
|
+
* opacity: 1.0, // Fully opaque
|
70
|
+
* collidable: false, // ImagePlane does not contribute to Scene boundary
|
71
|
+
* clippable: true, // ImagePlane can be clipped by SectionPlanes
|
72
|
+
* pickable: true // Allow the ground plane to be picked
|
73
|
+
* });
|
74
|
+
* ````
|
75
|
+
*<br>
|
76
|
+
*
|
77
|
+
* # Example 2: Embed an image in a cross-section plane
|
78
|
+
*
|
79
|
+
* In our second example, we'll load the Schependomlaan model again, then slice it in half with
|
80
|
+
* a {@link SectionPlanesPlugin}, then use an ````ImagePlane```` to embed a 2D plan view image in the slicing plane.
|
81
|
+
*
|
82
|
+
* <img src="http://yjkkit.io/img/docs/ImagePlane/schependomlaanPlanViewMed.png">
|
83
|
+
*
|
84
|
+
* [<img src="http://yjkkit.io/img/docs/ImagePlane/ImagePlane_planView.png">](http://yjkkit.github.io/yjkkit-sdk/examples/#ImagePlane_imageInSectionPlane)
|
85
|
+
*
|
86
|
+
* [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#ImagePlane_imageInSectionPlane)]
|
87
|
+
*
|
88
|
+
* ````javascript
|
89
|
+
* import {Viewer, XKTLoaderPlugin, SectionPlanesPlugin, ImagePlane} from "yjkkit-sdk.es.js";
|
90
|
+
*
|
91
|
+
* const viewer = new Viewer({
|
92
|
+
* canvasId: "myCanvas",
|
93
|
+
* transparent: true
|
94
|
+
* });
|
95
|
+
*
|
96
|
+
* viewer.camera.eye = [-9.11, 20.01, 5.13];
|
97
|
+
* viewer.camera.look = [9.07, 0.77, -9.78];
|
98
|
+
* viewer.camera.up = [0.47, 0.76, -0.38];
|
99
|
+
*
|
100
|
+
* const xktLoader = new XKTLoaderPlugin(viewer);
|
101
|
+
*
|
102
|
+
* const sectionPlanes = new SectionPlanesPlugin(viewer, {
|
103
|
+
* overviewVisible: false
|
104
|
+
* });
|
105
|
+
*
|
106
|
+
* model = xktLoader.load({
|
107
|
+
* id: "myModel",
|
108
|
+
* src: "./models/xkt/schependomlaan/schependomlaan.xkt",
|
109
|
+
* metaModelSrc: "./metaModels/schependomlaan/metaModel.json",
|
110
|
+
* edges: true,
|
111
|
+
* });
|
112
|
+
*
|
113
|
+
* const sectionPlane = sectionPlanes.createSectionPlane({
|
114
|
+
* id: "mySectionPlane",
|
115
|
+
* pos: [10.95, 1.95, -10.35],
|
116
|
+
* dir: [0.0, -1.0, 0.0]
|
117
|
+
* });
|
118
|
+
*
|
119
|
+
* const imagePlane = new ImagePlane(viewer.scene, {
|
120
|
+
* src: "./images/schependomlaanPlanView.png", // Plan view image; accepted file types are PNG and JPEG
|
121
|
+
* visible: true,
|
122
|
+
* gridVisible: true,
|
123
|
+
* size: 23.95,
|
124
|
+
* position: sectionPlane.pos,
|
125
|
+
* dir: sectionPlane.dir,
|
126
|
+
* collidable: false,
|
127
|
+
* opacity: 0.75,
|
128
|
+
* clippable: false, // Don't allow ImagePlane to be clipped by the SectionPlane
|
129
|
+
* pickable: false // Don't allow ImagePlane to be picked
|
130
|
+
* });
|
131
|
+
* ````
|
132
|
+
*/
|
133
|
+
class ImagePlane extends Component {
|
134
|
+
|
135
|
+
/**
|
136
|
+
* @constructor
|
137
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this ````ImagePlane```` as well.
|
138
|
+
* @param {*} [cfg] ````ImagePlane```` configuration
|
139
|
+
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
140
|
+
* @param {Boolean} [cfg.visible=true] Indicates whether or not this ````ImagePlane```` is visible.
|
141
|
+
* @param {Boolean} [cfg.gridVisible=true] Indicates whether or not the grid is visible. Grid is only visible when ````ImagePlane```` is also visible.
|
142
|
+
* @param {Number[]} [cfg.position=[0,0,0]] World-space position of the ````ImagePlane````.
|
143
|
+
* @param {Number[]} [cfg.size=1] World-space size of the longest edge of the ````ImagePlane````. Note that
|
144
|
+
* ````ImagePlane```` sets its aspect ratio to match its image. If we set a value of ````1000````, and the image
|
145
|
+
* has size ````400x300````, then the ````ImagePlane```` will then have size ````1000 x 750````.
|
146
|
+
* @param {Number[]} [cfg.rotation=[0,0,0]] Local rotation of the ````ImagePlane````, as Euler angles given in degrees, for each of the X, Y and Z axis.
|
147
|
+
* @param {Number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] Modelling transform matrix for the ````ImagePlane````. Overrides the ````position````, ````size```, ````rotation```` and ````dir```` parameters.
|
148
|
+
* @param {Boolean} [cfg.collidable=true] Indicates if the ````ImagePlane```` is initially included in boundary calculations.
|
149
|
+
* @param {Boolean} [cfg.clippable=true] Indicates if the ````ImagePlane```` is initially clippable.
|
150
|
+
* @param {Boolean} [cfg.pickable=true] Indicates if the ````ImagePlane```` is initially pickable.
|
151
|
+
* @param {Number} [cfg.opacity=1.0] ````ImagePlane````'s initial opacity factor, multiplies by the rendered fragment alpha.
|
152
|
+
* @param {String} [cfg.src] URL of image. Accepted file types are PNG and JPEG.
|
153
|
+
* @param {HTMLImageElement} [cfg.image] An ````HTMLImageElement```` to source the image from. Overrides ````src````.
|
154
|
+
*/
|
155
|
+
constructor(owner, cfg = {}) {
|
156
|
+
|
157
|
+
super(owner, cfg);
|
158
|
+
|
159
|
+
this._src = null;
|
160
|
+
this._image = null;
|
161
|
+
this._pos = math.vec3();
|
162
|
+
this._rtcCenter = math.vec3();
|
163
|
+
this._rtcPos = math.vec3();
|
164
|
+
this._dir = math.vec3();
|
165
|
+
this._size = 1.0;
|
166
|
+
this._imageSize = math.vec2();
|
167
|
+
|
168
|
+
this._texture = new Texture(this);
|
169
|
+
|
170
|
+
this._plane = new Mesh(this, {
|
171
|
+
|
172
|
+
geometry: new ReadableGeometry(this, buildPlaneGeometry({
|
173
|
+
center: [0, 0, 0],
|
174
|
+
xSize: 1,
|
175
|
+
zSize: 1,
|
176
|
+
xSegments: 10,
|
177
|
+
zSegments: 10
|
178
|
+
})),
|
179
|
+
|
180
|
+
material: new PhongMaterial(this, {
|
181
|
+
diffuse: [0, 0, 0],
|
182
|
+
ambient: [0, 0, 0],
|
183
|
+
specular: [0, 0, 0],
|
184
|
+
diffuseMap: this._texture,
|
185
|
+
emissiveMap: this._texture,
|
186
|
+
backfaces: true
|
187
|
+
}),
|
188
|
+
clippable: cfg.clippable
|
189
|
+
});
|
190
|
+
|
191
|
+
this._grid = new Mesh(this, {
|
192
|
+
geometry: new ReadableGeometry(this, buildGridGeometry({
|
193
|
+
size: 1,
|
194
|
+
divisions: 10
|
195
|
+
})),
|
196
|
+
material: new PhongMaterial(this, {
|
197
|
+
diffuse: [0.0, 0.0, 0.0],
|
198
|
+
ambient: [0.0, 0.0, 0.0],
|
199
|
+
emissive: [0.2, 0.8, 0.2]
|
200
|
+
}),
|
201
|
+
position: [0, 0.001, 0.0],
|
202
|
+
clippable: cfg.clippable
|
203
|
+
});
|
204
|
+
|
205
|
+
this._node = new Node(this, {
|
206
|
+
rotation: [0, 0, 0],
|
207
|
+
position: [0, 0, 0],
|
208
|
+
scale: [1, 1, 1],
|
209
|
+
clippable: false,
|
210
|
+
children: [
|
211
|
+
this._plane,
|
212
|
+
this._grid
|
213
|
+
]
|
214
|
+
});
|
215
|
+
|
216
|
+
this._gridVisible = false;
|
217
|
+
|
218
|
+
this.visible = true;
|
219
|
+
this.gridVisible = cfg.gridVisible;
|
220
|
+
this.position = cfg.position;
|
221
|
+
this.rotation = cfg.rotation;
|
222
|
+
this.dir = cfg.dir;
|
223
|
+
this.size = cfg.size;
|
224
|
+
this.collidable = cfg.collidable;
|
225
|
+
this.clippable = cfg.clippable;
|
226
|
+
this.pickable = cfg.pickable;
|
227
|
+
this.opacity = cfg.opacity;
|
228
|
+
|
229
|
+
if (cfg.image) {
|
230
|
+
this.image = cfg.image;
|
231
|
+
} else {
|
232
|
+
this.src = cfg.src;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
* Sets if this ````ImagePlane```` is visible or not.
|
238
|
+
*
|
239
|
+
* Default value is ````true````.
|
240
|
+
*
|
241
|
+
* @param {Boolean} visible Set ````true```` to make this ````ImagePlane```` visible.
|
242
|
+
*/
|
243
|
+
set visible(visible) {
|
244
|
+
this._plane.visible = visible;
|
245
|
+
this._grid.visible = (this._gridVisible && visible);
|
246
|
+
}
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Gets if this ````ImagePlane```` is visible or not.
|
250
|
+
*
|
251
|
+
* Default value is ````true````.
|
252
|
+
*
|
253
|
+
* @returns {Boolean} Returns ````true```` if visible.
|
254
|
+
*/
|
255
|
+
get visible() {
|
256
|
+
return this._plane.visible;
|
257
|
+
}
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Sets if this ````ImagePlane````'s grid is visible or not.
|
261
|
+
*
|
262
|
+
* Default value is ````false````.
|
263
|
+
*
|
264
|
+
* Grid is only visible when ````ImagePlane```` is also visible.
|
265
|
+
*
|
266
|
+
* @param {Boolean} visible Set ````true```` to make this ````ImagePlane````'s grid visible.
|
267
|
+
*/
|
268
|
+
set gridVisible(visible) {
|
269
|
+
visible = (visible !== false);
|
270
|
+
this._gridVisible = visible;
|
271
|
+
this._grid.visible = (this._gridVisible && this.visible);
|
272
|
+
}
|
273
|
+
|
274
|
+
/**
|
275
|
+
* Gets if this ````ImagePlane````'s grid is visible or not.
|
276
|
+
*
|
277
|
+
* Default value is ````false````.
|
278
|
+
*
|
279
|
+
* @returns {Boolean} Returns ````true```` if visible.
|
280
|
+
*/
|
281
|
+
get gridVisible() {
|
282
|
+
return this._gridVisible;
|
283
|
+
}
|
284
|
+
|
285
|
+
/**
|
286
|
+
* Sets an ````HTMLImageElement```` to source the image from.
|
287
|
+
*
|
288
|
+
* Sets {@link Texture#src} null.
|
289
|
+
*
|
290
|
+
* @type {HTMLImageElement}
|
291
|
+
*/
|
292
|
+
set image(image) {
|
293
|
+
this._image = image;
|
294
|
+
if (this._image) {
|
295
|
+
this._imageSize[0] = image.width;
|
296
|
+
this._imageSize[1] = image.height;
|
297
|
+
this._updatePlaneSizeFromImage();
|
298
|
+
this._src = null;
|
299
|
+
this._texture.image = this._image;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Gets the ````HTMLImageElement```` the ````ImagePlane````'s image is sourced from, if set.
|
305
|
+
*
|
306
|
+
* Returns null if not set.
|
307
|
+
*
|
308
|
+
* @type {HTMLImageElement}
|
309
|
+
*/
|
310
|
+
get image() {
|
311
|
+
return this._image;
|
312
|
+
}
|
313
|
+
|
314
|
+
/**
|
315
|
+
* Sets an image file path that the ````ImagePlane````'s image is sourced from.
|
316
|
+
*
|
317
|
+
* Accepted file types are PNG and JPEG.
|
318
|
+
*
|
319
|
+
* Sets {@link Texture#image} null.
|
320
|
+
*
|
321
|
+
* @type {String}
|
322
|
+
*/
|
323
|
+
set src(src) {
|
324
|
+
this._src = src;
|
325
|
+
if (this._src) {
|
326
|
+
this._image = null;
|
327
|
+
const image = new Image();
|
328
|
+
image.onload = () => {
|
329
|
+
this._texture.image = image;
|
330
|
+
this._imageSize[0] = image.width;
|
331
|
+
this._imageSize[1] = image.height;
|
332
|
+
this._updatePlaneSizeFromImage();
|
333
|
+
};
|
334
|
+
image.src = this._src;
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
/**
|
339
|
+
* Gets the image file path that the ````ImagePlane````'s image is sourced from, if set.
|
340
|
+
*
|
341
|
+
* Returns null if not set.
|
342
|
+
*
|
343
|
+
* @type {String}
|
344
|
+
*/
|
345
|
+
get src() {
|
346
|
+
return this._src;
|
347
|
+
}
|
348
|
+
|
349
|
+
/**
|
350
|
+
* Sets the World-space position of this ````ImagePlane````.
|
351
|
+
*
|
352
|
+
* Default value is ````[0, 0, 0]````.
|
353
|
+
*
|
354
|
+
* @param {Number[]} value New position.
|
355
|
+
*/
|
356
|
+
set position(value) {
|
357
|
+
this._pos.set(value || [0, 0, 0]);
|
358
|
+
worldToRTCPos(this._pos, this._rtcCenter, this._rtcPos);
|
359
|
+
this._node.rtcCenter = this._rtcCenter;
|
360
|
+
this._node.position = this._rtcPos;
|
361
|
+
}
|
362
|
+
|
363
|
+
/**
|
364
|
+
* Gets the World-space position of this ````ImagePlane````.
|
365
|
+
*
|
366
|
+
* Default value is ````[0, 0, 0]````.
|
367
|
+
*
|
368
|
+
* @returns {Number[]} Current position.
|
369
|
+
*/
|
370
|
+
get position() {
|
371
|
+
return this._pos;
|
372
|
+
}
|
373
|
+
|
374
|
+
/**
|
375
|
+
* Sets the direction of this ````ImagePlane```` using Euler angles.
|
376
|
+
*
|
377
|
+
* Default value is ````[0, 0, 0]````.
|
378
|
+
*
|
379
|
+
* @param {Number[]} value Euler angles for ````X````, ````Y```` and ````Z```` axis rotations.
|
380
|
+
*/
|
381
|
+
set rotation(value) {
|
382
|
+
this._node.rotation = value;
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Gets the direction of this ````ImagePlane```` as Euler angles.
|
387
|
+
*
|
388
|
+
* @returns {Number[]} Euler angles for ````X````, ````Y```` and ````Z```` axis rotations.
|
389
|
+
*/
|
390
|
+
get rotation() {
|
391
|
+
return this._node.rotation;
|
392
|
+
}
|
393
|
+
|
394
|
+
/**
|
395
|
+
* Sets the World-space size of the longest edge of the ````ImagePlane````.
|
396
|
+
*
|
397
|
+
* Note that ````ImagePlane```` sets its aspect ratio to match its image. If we set a value of ````1000````, and
|
398
|
+
* the image has size ````400x300````, then the ````ImagePlane```` will then have size ````1000 x 750````.
|
399
|
+
*
|
400
|
+
* Default value is ````1.0````.
|
401
|
+
*
|
402
|
+
* @param {Number} size New World-space size of the ````ImagePlane````.
|
403
|
+
*/
|
404
|
+
set size(size) {
|
405
|
+
this._size = (size === undefined || size === null) ? 1.0 : size;
|
406
|
+
if (this._image) {
|
407
|
+
this._updatePlaneSizeFromImage()
|
408
|
+
}
|
409
|
+
}
|
410
|
+
|
411
|
+
/**
|
412
|
+
* Gets the World-space size of the longest edge of the ````ImagePlane````.
|
413
|
+
*
|
414
|
+
* Returns {Number} World-space size of the ````ImagePlane````.
|
415
|
+
*/
|
416
|
+
get size() {
|
417
|
+
return this._size;
|
418
|
+
}
|
419
|
+
|
420
|
+
/**
|
421
|
+
* Sets the direction of this ````ImagePlane```` as a direction vector.
|
422
|
+
*
|
423
|
+
* Default value is ````[0, 0, -1]````.
|
424
|
+
*
|
425
|
+
* @param {Number[]} dir New direction vector.
|
426
|
+
*/
|
427
|
+
set dir(dir) {
|
428
|
+
|
429
|
+
this._dir.set(dir || [0, 0, -1]);
|
430
|
+
|
431
|
+
if (dir) {
|
432
|
+
|
433
|
+
const origin = this.scene.center;
|
434
|
+
const negDir = [-this._dir[0], -this._dir[1], -this._dir[2]];
|
435
|
+
|
436
|
+
math.subVec3(origin, this.position, tempVec3);
|
437
|
+
|
438
|
+
const dist = -math.dotVec3(negDir, tempVec3);
|
439
|
+
|
440
|
+
math.normalizeVec3(negDir);
|
441
|
+
math.mulVec3Scalar(negDir, dist, tempVec3b);
|
442
|
+
math.vec3PairToQuaternion(zeroVec, dir, tempQuat);
|
443
|
+
|
444
|
+
this._node.quaternion = tempQuat;
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
/**
|
449
|
+
* Gets the direction of this ````ImagePlane```` as a direction vector.
|
450
|
+
*
|
451
|
+
* @returns {Number[]} value Current direction.
|
452
|
+
*/
|
453
|
+
get dir() {
|
454
|
+
return this._dir;
|
455
|
+
}
|
456
|
+
|
457
|
+
/**
|
458
|
+
* Sets if this ````ImagePlane```` is included in boundary calculations.
|
459
|
+
*
|
460
|
+
* Default is ````true````.
|
461
|
+
*
|
462
|
+
* @type {Boolean}
|
463
|
+
*/
|
464
|
+
set collidable(value) {
|
465
|
+
this._node.collidable = (value !== false);
|
466
|
+
}
|
467
|
+
|
468
|
+
/**
|
469
|
+
* Gets if this ````ImagePlane```` is included in boundary calculations.
|
470
|
+
*
|
471
|
+
* Default is ````true````.
|
472
|
+
*
|
473
|
+
* @type {Boolean}
|
474
|
+
*/
|
475
|
+
get collidable() {
|
476
|
+
return this._node.collidable;
|
477
|
+
}
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Sets if this ````ImagePlane```` is clippable.
|
481
|
+
*
|
482
|
+
* Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
|
483
|
+
*
|
484
|
+
* Default is ````true````.
|
485
|
+
*
|
486
|
+
* @type {Boolean}
|
487
|
+
*/
|
488
|
+
set clippable(value) {
|
489
|
+
this._node.clippable = (value !== false);
|
490
|
+
}
|
491
|
+
|
492
|
+
/**
|
493
|
+
* Gets if this ````ImagePlane```` is clippable.
|
494
|
+
*
|
495
|
+
* Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
|
496
|
+
*
|
497
|
+
* Default is ````true````.
|
498
|
+
*
|
499
|
+
* @type {Boolean}
|
500
|
+
*/
|
501
|
+
get clippable() {
|
502
|
+
return this._node.clippable;
|
503
|
+
}
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Sets if this ````ImagePlane```` is pickable.
|
507
|
+
*
|
508
|
+
* Default is ````true````.
|
509
|
+
*
|
510
|
+
* @type {Boolean}
|
511
|
+
*/
|
512
|
+
set pickable(value) {
|
513
|
+
this._node.pickable = (value !== false);
|
514
|
+
}
|
515
|
+
|
516
|
+
/**
|
517
|
+
* Gets if this ````ImagePlane```` is pickable.
|
518
|
+
*
|
519
|
+
* Default is ````true````.
|
520
|
+
*
|
521
|
+
* @type {Boolean}
|
522
|
+
*/
|
523
|
+
get pickable() {
|
524
|
+
return this._node.pickable;
|
525
|
+
}
|
526
|
+
|
527
|
+
/**
|
528
|
+
* Sets the opacity factor for this ````ImagePlane````.
|
529
|
+
*
|
530
|
+
* This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
|
531
|
+
*
|
532
|
+
* @type {Number}
|
533
|
+
*/
|
534
|
+
set opacity(opacity) {
|
535
|
+
this._node.opacity = opacity;
|
536
|
+
}
|
537
|
+
|
538
|
+
/**
|
539
|
+
* Gets this ````ImagePlane````'s opacity factor.
|
540
|
+
*
|
541
|
+
* This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
|
542
|
+
*
|
543
|
+
* @type {Number}
|
544
|
+
*/
|
545
|
+
get opacity() {
|
546
|
+
return this._node.opacity;
|
547
|
+
}
|
548
|
+
|
549
|
+
/**
|
550
|
+
* @destroy
|
551
|
+
*/
|
552
|
+
destroy() {
|
553
|
+
this._state.destroy();
|
554
|
+
super.destroy();
|
555
|
+
}
|
556
|
+
|
557
|
+
_updatePlaneSizeFromImage() {
|
558
|
+
const size = this._size;
|
559
|
+
const width = this._imageSize[0];
|
560
|
+
const height = this._imageSize[1];
|
561
|
+
const aspect = height / width;
|
562
|
+
if (width > height) {
|
563
|
+
this._node.scale = [size, 1.0, size * aspect];
|
564
|
+
} else {
|
565
|
+
this._node.scale = [size * aspect, 1.0, size];
|
566
|
+
}
|
567
|
+
}
|
568
|
+
}
|
569
|
+
|
570
|
+
export {ImagePlane};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./ImagePlane.js";
|