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,121 @@
|
|
1
|
+
/**
|
2
|
+
* @desc Represents a WebGL ArrayBuffer.
|
3
|
+
*
|
4
|
+
* @private
|
5
|
+
*/
|
6
|
+
class ArrayBuf {
|
7
|
+
|
8
|
+
constructor(gl, type, data, numItems, itemSize, usage, normalized, stride, offset) {
|
9
|
+
|
10
|
+
this._gl = gl;
|
11
|
+
this.type = type;
|
12
|
+
this.allocated = false;
|
13
|
+
|
14
|
+
switch (data.constructor) {
|
15
|
+
|
16
|
+
case Uint8Array:
|
17
|
+
this.itemType = gl.UNSIGNED_BYTE;
|
18
|
+
this.itemByteSize = 1;
|
19
|
+
break;
|
20
|
+
|
21
|
+
case Int8Array:
|
22
|
+
this.itemType = gl.BYTE;
|
23
|
+
this.itemByteSize = 1;
|
24
|
+
break;
|
25
|
+
|
26
|
+
case Uint16Array:
|
27
|
+
this.itemType = gl.UNSIGNED_SHORT;
|
28
|
+
this.itemByteSize = 2;
|
29
|
+
break;
|
30
|
+
|
31
|
+
case Int16Array:
|
32
|
+
this.itemType = gl.SHORT;
|
33
|
+
this.itemByteSize = 2;
|
34
|
+
break;
|
35
|
+
|
36
|
+
case Uint32Array:
|
37
|
+
this.itemType = gl.UNSIGNED_INT;
|
38
|
+
this.itemByteSize = 4;
|
39
|
+
break;
|
40
|
+
|
41
|
+
case Int32Array:
|
42
|
+
this.itemType = gl.INT;
|
43
|
+
this.itemByteSize = 4;
|
44
|
+
break;
|
45
|
+
|
46
|
+
default:
|
47
|
+
this.itemType = gl.FLOAT;
|
48
|
+
this.itemByteSize = 4;
|
49
|
+
}
|
50
|
+
|
51
|
+
this.usage = usage;
|
52
|
+
this.length = 0;
|
53
|
+
this.dataLength = numItems;
|
54
|
+
this.numItems = 0;
|
55
|
+
this.itemSize = itemSize;
|
56
|
+
this.normalized = !!normalized;
|
57
|
+
this.stride = stride || 0;
|
58
|
+
this.offset = offset || 0;
|
59
|
+
|
60
|
+
this._allocate(data);
|
61
|
+
}
|
62
|
+
|
63
|
+
_allocate(data) {
|
64
|
+
this.allocated = false;
|
65
|
+
this._handle = this._gl.createBuffer();
|
66
|
+
if (!this._handle) {
|
67
|
+
throw "Failed to allocate WebGL ArrayBuffer";
|
68
|
+
}
|
69
|
+
if (this._handle) {
|
70
|
+
this._gl.bindBuffer(this.type, this._handle);
|
71
|
+
this._gl.bufferData(this.type, data.length > this.dataLength ? data.slice(0, this.dataLength) : data, this.usage);
|
72
|
+
this._gl.bindBuffer(this.type, null);
|
73
|
+
this.length = data.length;
|
74
|
+
this.numItems = this.length / this.itemSize;
|
75
|
+
this.allocated = true;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
setData(data, offset) {
|
80
|
+
if (!this.allocated) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
if (data.length + (offset || 0) > this.length) { // Needs reallocation
|
84
|
+
this.destroy();
|
85
|
+
this._allocate(data);
|
86
|
+
} else { // No reallocation needed
|
87
|
+
this._gl.bindBuffer(this.type, this._handle);
|
88
|
+
if (offset || offset === 0) {
|
89
|
+
this._gl.bufferSubData(this.type, offset * this.itemByteSize, data);
|
90
|
+
} else {
|
91
|
+
this._gl.bufferData(this.type, data, this.usage);
|
92
|
+
}
|
93
|
+
this._gl.bindBuffer(this.type, null);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
bind() {
|
98
|
+
if (!this.allocated) {
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
this._gl.bindBuffer(this.type, this._handle);
|
102
|
+
}
|
103
|
+
|
104
|
+
unbind() {
|
105
|
+
if (!this.allocated) {
|
106
|
+
return;
|
107
|
+
}
|
108
|
+
this._gl.bindBuffer(this.type, null);
|
109
|
+
}
|
110
|
+
|
111
|
+
destroy() {
|
112
|
+
if (!this.allocated) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
this._gl.deleteBuffer(this._handle);
|
116
|
+
this._handle = null;
|
117
|
+
this.allocated = false;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
export {ArrayBuf};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* @desc Represents a WebGL vertex attribute buffer (VBO).
|
3
|
+
* @private
|
4
|
+
* @param gl {WebGLRenderingContext} The WebGL rendering context.
|
5
|
+
*/
|
6
|
+
class Attribute {
|
7
|
+
|
8
|
+
constructor(gl, location) {
|
9
|
+
this._gl = gl;
|
10
|
+
this.location = location;
|
11
|
+
}
|
12
|
+
|
13
|
+
bindArrayBuffer(arrayBuf) {
|
14
|
+
if (!arrayBuf) {
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
arrayBuf.bind();
|
18
|
+
this._gl.enableVertexAttribArray(this.location);
|
19
|
+
this._gl.vertexAttribPointer(this.location, arrayBuf.itemSize, arrayBuf.itemType, arrayBuf.normalized, arrayBuf.stride, arrayBuf.offset);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
export {Attribute};
|
@@ -0,0 +1,270 @@
|
|
1
|
+
/**
|
2
|
+
* @desc A drawable {@link Scene} element.
|
3
|
+
*
|
4
|
+
* @interface
|
5
|
+
* @abstract
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
class Drawable {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Returns true to indicate that this is a Drawable.
|
12
|
+
* @type {Boolean}
|
13
|
+
* @abstract
|
14
|
+
*/
|
15
|
+
get isDrawable() {
|
16
|
+
}
|
17
|
+
|
18
|
+
//------------------------------------------------------------------------------------------------------------------
|
19
|
+
// Emphasis materials
|
20
|
+
//------------------------------------------------------------------------------------------------------------------
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Configures the appearance of this Drawable when x-rayed.
|
24
|
+
*
|
25
|
+
* Set to {@link Scene#xrayMaterial} by default.
|
26
|
+
*
|
27
|
+
* @type {EmphasisMaterial}
|
28
|
+
* @abstract
|
29
|
+
*/
|
30
|
+
get xrayMaterial() {
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Configures the appearance of this Drawable when highlighted.
|
35
|
+
*
|
36
|
+
* Set to {@link Scene#highlightMaterial} by default.
|
37
|
+
*
|
38
|
+
* @type {EmphasisMaterial}
|
39
|
+
* @abstract
|
40
|
+
*/
|
41
|
+
get highlightMaterial() {
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Configures the appearance of this Drawable when selected.
|
46
|
+
*
|
47
|
+
* Set to {@link Scene#selectedMaterial} by default.
|
48
|
+
*
|
49
|
+
* @type {EmphasisMaterial}
|
50
|
+
* @abstract
|
51
|
+
*/
|
52
|
+
get selectedMaterial() {
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Configures the appearance of this Drawable when edges are enhanced.
|
57
|
+
*
|
58
|
+
* @type {EdgeMaterial}
|
59
|
+
* @abstract
|
60
|
+
*/
|
61
|
+
get edgeMaterial() {
|
62
|
+
}
|
63
|
+
|
64
|
+
//------------------------------------------------------------------------------------------------------------------
|
65
|
+
// Rendering
|
66
|
+
//------------------------------------------------------------------------------------------------------------------
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Property with final value ````true```` to indicate that yjkkit should render this Drawable in sorted order, relative to other Drawable of the same class.
|
70
|
+
*
|
71
|
+
* The sort order is determined by {@link Drawable#stateSortCompare}.
|
72
|
+
*
|
73
|
+
* Sorting is essential for rendering performance, so that yjkkit is able to avoid applying runs of the same state changes to the GPU, ie. can collapse them.
|
74
|
+
*
|
75
|
+
* @type {boolean}
|
76
|
+
* @abstract
|
77
|
+
*/
|
78
|
+
get isStateSortable() {
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Comparison function used by the renderer to determine the order in which yjkkit should render the Drawable, relative to to other Drawablees.
|
83
|
+
*
|
84
|
+
* Sorting is essential for rendering performance, so that yjkkit is able to avoid needlessly applying runs of the same rendering state changes to the GPU, ie. can collapse them.
|
85
|
+
*
|
86
|
+
* @param {Drawable} drawable1
|
87
|
+
* @param {Drawable} drawable2
|
88
|
+
* @returns {number}
|
89
|
+
* @abstract
|
90
|
+
*/
|
91
|
+
stateSortCompare(drawable1, drawable2) {
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Called by yjkkit when about to render this Drawable, to generate {@link Drawable#renderFlags}.
|
96
|
+
*
|
97
|
+
* @abstract
|
98
|
+
*/
|
99
|
+
rebuildRenderFlags(renderFlags) {
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Called by yjkkit when about to render this Drawable, to get flags indicating what rendering effects to apply for it.
|
104
|
+
* @type {RenderFlags}
|
105
|
+
* @abstract
|
106
|
+
*/
|
107
|
+
get renderFlags() {
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
// ---------------------- NORMAL RENDERING -----------------------------------
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Renders opaque edges using {@link Drawable#edgeMaterial}.
|
115
|
+
*
|
116
|
+
* See {@link RenderFlags#colorOpaque}.
|
117
|
+
*
|
118
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
119
|
+
* @abstract
|
120
|
+
*/
|
121
|
+
drawColorOpaque(renderFlags, frameCtx) {
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Renders transparent filled surfaces using normal appearance attributes.
|
126
|
+
*
|
127
|
+
* See {@link RenderFlags#colorTransparent}.
|
128
|
+
*
|
129
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
130
|
+
* @abstract
|
131
|
+
*/
|
132
|
+
drawColorTransparent(renderFlags, frameCtx) {
|
133
|
+
}
|
134
|
+
|
135
|
+
// ---------------------- RENDERING SAO POST EFFECT TARGETS --------------
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Renders pixel depths to an internally-managed depth target, for use in post-effects (eg. SAO).
|
139
|
+
*
|
140
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
141
|
+
* @abstract
|
142
|
+
*/
|
143
|
+
drawDepth(renderFlags, frameCtx) {
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Renders pixel normals to an internally-managed target, for use in post-effects (eg. SAO).
|
148
|
+
*
|
149
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
150
|
+
* @abstract
|
151
|
+
*/
|
152
|
+
drawNormals(renderFlags, frameCtx) {
|
153
|
+
}
|
154
|
+
|
155
|
+
// ---------------------- EMPHASIS RENDERING -----------------------------------
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Renders x-ray fill using {@link Drawable#xrayMaterial}.
|
159
|
+
*
|
160
|
+
* See {@link RenderFlags#xrayedSilhouetteOpaque} and {@link RenderFlags#xrayedSilhouetteTransparent}.
|
161
|
+
*
|
162
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
163
|
+
* @abstract
|
164
|
+
*/
|
165
|
+
drawSilhouetteXRayed(renderFlags, frameCtx) {
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Renders highlighted transparent fill using {@link Drawable#highlightMaterial}.
|
170
|
+
*
|
171
|
+
* See {@link RenderFlags#highlightedSilhouetteOpaque} and {@link RenderFlags#highlightedSilhouetteTransparent}.
|
172
|
+
*
|
173
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
174
|
+
* @abstract
|
175
|
+
*/
|
176
|
+
drawSilhouetteHighlighted(renderFlags, frameCtx) {
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Renders selected fill using {@link Drawable#selectedMaterial}.
|
181
|
+
*
|
182
|
+
* See {@link RenderFlags#selectedSilhouetteOpaque} and {@link RenderFlags#selectedSilhouetteTransparent}.
|
183
|
+
*
|
184
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
185
|
+
* @abstract
|
186
|
+
*/
|
187
|
+
drawSilhouetteSelected(renderFlags, frameCtx) {
|
188
|
+
}
|
189
|
+
|
190
|
+
// ---------------------- EDGES RENDERING -----------------------------------
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Renders opaque normal edges using {@link Drawable#edgeMaterial}.
|
194
|
+
*
|
195
|
+
* See {@link RenderFlags#edgesOpaque}.
|
196
|
+
*
|
197
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
198
|
+
* @abstract
|
199
|
+
*/
|
200
|
+
drawEdgesColorOpaque(renderFlags, frameCtx) {
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Renders transparent normal edges using {@link Drawable#edgeMaterial}.
|
205
|
+
*
|
206
|
+
* See {@link RenderFlags#edgesTransparent}.
|
207
|
+
*
|
208
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
209
|
+
* @abstract
|
210
|
+
*/
|
211
|
+
drawEdgesColorTransparent(renderFlags, frameCtx) {
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Renders x-rayed edges using {@link Drawable#xrayMaterial}.
|
216
|
+
*
|
217
|
+
* See {@link RenderFlags#xrayedEdgesOpaque}.
|
218
|
+
*
|
219
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
220
|
+
* @abstract
|
221
|
+
*/
|
222
|
+
drawEdgesXRayed(renderFlags, frameCtx) {
|
223
|
+
}
|
224
|
+
|
225
|
+
/**
|
226
|
+
* Renders highlighted edges using {@link Drawable#highlightMaterial}.
|
227
|
+
*
|
228
|
+
* See {@link RenderFlags#highlightedEdgesOpaque}.
|
229
|
+
*
|
230
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
231
|
+
* @abstract
|
232
|
+
*/
|
233
|
+
drawEdgesHighlighted(renderFlags, frameCtx) {
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
* Renders selected edges using {@link Drawable#selectedMaterial}.
|
238
|
+
*
|
239
|
+
* See {@link RenderFlags#selectedEdgesOpaque}.
|
240
|
+
*
|
241
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
242
|
+
* @abstract
|
243
|
+
*/
|
244
|
+
drawEdgesSelected(renderFlags, frameCtx) {
|
245
|
+
}
|
246
|
+
|
247
|
+
// ---------------------- OCCLUSION CULL RENDERING -----------------------------------
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Renders occludable elements to a frame buffer where they will be tested to see if they occlude any occlusion probe markers.
|
251
|
+
*
|
252
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
253
|
+
* @abstract
|
254
|
+
*/
|
255
|
+
drawOcclusion(renderFlags, frameCtx) {
|
256
|
+
}
|
257
|
+
|
258
|
+
// ---------------------- SHADOW BUFFER RENDERING -----------------------------------
|
259
|
+
|
260
|
+
/**
|
261
|
+
* Renders depths to a shadow map buffer..
|
262
|
+
*
|
263
|
+
* @param {FrameContext} frameCtx Renderer frame context.
|
264
|
+
* @abstract
|
265
|
+
*/
|
266
|
+
drawShadow(renderFlags, frameCtx) {
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
export {Drawable};
|
@@ -0,0 +1,259 @@
|
|
1
|
+
import {math} from "../math/math.js";
|
2
|
+
import {createRTCViewMat} from "../math/rtcCoords.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @desc Provides rendering context to {@link Drawable"}s as yjkkit renders them for a frame.
|
6
|
+
*
|
7
|
+
* Also creates RTC viewing and picking matrices, caching and reusing matrices within each frame.
|
8
|
+
*
|
9
|
+
* @private
|
10
|
+
*/
|
11
|
+
class FrameContext {
|
12
|
+
|
13
|
+
constructor(scene) {
|
14
|
+
|
15
|
+
this._scene = scene;
|
16
|
+
|
17
|
+
this._matPool = [];
|
18
|
+
this._matPoolNextFreeIndex = 0;
|
19
|
+
|
20
|
+
this._rtcViewMats = {};
|
21
|
+
this._rtcPickViewMats = {};
|
22
|
+
|
23
|
+
this.reset();
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Called by the renderer before each frame.
|
28
|
+
* @private
|
29
|
+
*/
|
30
|
+
reset() {
|
31
|
+
|
32
|
+
this._matPoolNextFreeIndex = 0;
|
33
|
+
this._rtcViewMats = {};
|
34
|
+
this._rtcPickViewMats = {};
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The WebGL rendering context.
|
38
|
+
* @type {WebGLRenderingContext}
|
39
|
+
*/
|
40
|
+
this.gl = this._scene.canvas.gl;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* ID of the last {@link WebGLProgram} that was bound during the current frame.
|
44
|
+
* @property lastProgramId
|
45
|
+
* @type {Number}
|
46
|
+
*/
|
47
|
+
this.lastProgramId = null;
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Whether to render a quality representation for triangle surfaces.
|
51
|
+
*
|
52
|
+
* When ````false````, we'll render them with a fast vertex-shaded Gouraud-shaded representation, which
|
53
|
+
* is great for zillions of objects.
|
54
|
+
*
|
55
|
+
* When ````true````, we'll render them at a better visual quality, using smooth, per-fragment shading
|
56
|
+
* and a more realistic lighting model.
|
57
|
+
*
|
58
|
+
* @property quality
|
59
|
+
* @default false
|
60
|
+
* @type {Boolean}
|
61
|
+
*/
|
62
|
+
this.pbrEnabled = false;
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Whether SAO is currently enabled during the current frame.
|
66
|
+
* @property withSAO
|
67
|
+
* @default false
|
68
|
+
* @type {Boolean}
|
69
|
+
*/
|
70
|
+
this.withSAO = false;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Whether backfaces are currently enabled during the current frame.
|
74
|
+
* @property backfaces
|
75
|
+
* @default false
|
76
|
+
* @type {Boolean}
|
77
|
+
*/
|
78
|
+
this.backfaces = false;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* The vertex winding order for what we currently consider to be a backface during current
|
82
|
+
* frame: true == "cw", false == "ccw".
|
83
|
+
* @property frontFace
|
84
|
+
* @default true
|
85
|
+
* @type {Boolean}
|
86
|
+
*/
|
87
|
+
this.frontface = true;
|
88
|
+
|
89
|
+
/**
|
90
|
+
* The next available texture unit to bind a {@link Texture} to.
|
91
|
+
* @defauilt 0
|
92
|
+
* @property textureUnit
|
93
|
+
* @type {number}
|
94
|
+
*/
|
95
|
+
this.textureUnit = 0;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Performance statistic that counts how many times the renderer has called ````gl.drawElements()```` has been
|
99
|
+
* called so far within the current frame.
|
100
|
+
* @default 0
|
101
|
+
* @property drawElements
|
102
|
+
* @type {number}
|
103
|
+
*/
|
104
|
+
this.drawElements = 0;
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Performance statistic that counts how many times ````gl.drawArrays()```` has been called so far within
|
108
|
+
* the current frame.
|
109
|
+
* @default 0
|
110
|
+
* @property drawArrays
|
111
|
+
* @type {number}
|
112
|
+
*/
|
113
|
+
this.drawArrays = 0;
|
114
|
+
|
115
|
+
/**
|
116
|
+
* Performance statistic that counts how many times ````gl.useProgram()```` has been called so far within
|
117
|
+
* the current frame.
|
118
|
+
* @default 0
|
119
|
+
* @property useProgram
|
120
|
+
* @type {number}
|
121
|
+
*/
|
122
|
+
this.useProgram = 0;
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Statistic that counts how many times ````gl.bindTexture()```` has been called so far within the current frame.
|
126
|
+
* @default 0
|
127
|
+
* @property bindTexture
|
128
|
+
* @type {number}
|
129
|
+
*/
|
130
|
+
this.bindTexture = 0;
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Counts how many times the renderer has called ````gl.bindArray()```` so far within the current frame.
|
134
|
+
* @defaulr 0
|
135
|
+
* @property bindArray
|
136
|
+
* @type {number}
|
137
|
+
*/
|
138
|
+
this.bindArray = 0;
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Indicates which pass the renderer is currently rendering.
|
142
|
+
*
|
143
|
+
* See {@link Scene/passes:property"}}Scene#passes{{/crossLink}}, which configures how many passes we render
|
144
|
+
* per frame, which typically set to ````2```` when rendering a stereo view.
|
145
|
+
*
|
146
|
+
* @property pass
|
147
|
+
* @type {number}
|
148
|
+
*/
|
149
|
+
this.pass = 0;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* The 4x4 viewing transform matrix the renderer is currently using when rendering castsShadows.
|
153
|
+
*
|
154
|
+
* This sets the viewpoint to look from the point of view of each {@link DirLight}
|
155
|
+
* or {@link PointLight} that casts a shadow.
|
156
|
+
*
|
157
|
+
* @property shadowViewMatrix
|
158
|
+
* @type {Number[]}
|
159
|
+
*/
|
160
|
+
this.shadowViewMatrix = null;
|
161
|
+
|
162
|
+
/**
|
163
|
+
* The 4x4 viewing projection matrix the renderer is currently using when rendering shadows.
|
164
|
+
*
|
165
|
+
* @property shadowProjMatrix
|
166
|
+
* @type {Number[]}
|
167
|
+
*/
|
168
|
+
this.shadowProjMatrix = null;
|
169
|
+
|
170
|
+
/**
|
171
|
+
* The 4x4 viewing transform matrix the renderer is currently using when rendering a ray-pick.
|
172
|
+
*
|
173
|
+
* This sets the viewpoint to look along the ray given to {@link Scene/pick:method"}}Scene#pick(){{/crossLink}}
|
174
|
+
* when picking with a ray.
|
175
|
+
*
|
176
|
+
* @property pickViewMatrix
|
177
|
+
* @type {Number[]}
|
178
|
+
*/
|
179
|
+
this.pickViewMatrix = null;
|
180
|
+
|
181
|
+
/**
|
182
|
+
* The 4x4 orthographic projection transform matrix the renderer is currently using when rendering a ray-pick.
|
183
|
+
*
|
184
|
+
* @property pickProjMatrix
|
185
|
+
* @type {Number[]}
|
186
|
+
*/
|
187
|
+
this.pickProjMatrix = null;
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Distance to the near clipping plane when rendering depth fragments for GPU-accelerated 3D picking.
|
191
|
+
*
|
192
|
+
* @property pickZNear
|
193
|
+
* @type {Number|*}
|
194
|
+
*/
|
195
|
+
this.pickZNear = 0.01;
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Distance to the far clipping plane when rendering depth fragments for GPU-accelerated 3D picking.
|
199
|
+
*
|
200
|
+
* @property pickZFar
|
201
|
+
* @type {Number|*}
|
202
|
+
*/
|
203
|
+
this.pickZFar = 5000;
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Whether or not the renderer is currently picking invisible objects.
|
207
|
+
*
|
208
|
+
* @property pickInvisible
|
209
|
+
* @type {Number}
|
210
|
+
*/
|
211
|
+
this.pickInvisible = false;
|
212
|
+
|
213
|
+
/** The current line width.
|
214
|
+
*
|
215
|
+
* @property lineWidth
|
216
|
+
* @type Number
|
217
|
+
*/
|
218
|
+
this.lineWidth = 1;
|
219
|
+
}
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Get View matrix for the given RTC center.
|
223
|
+
*/
|
224
|
+
getRTCViewMatrix(rtcCenterHash, rtcCenter) {
|
225
|
+
let rtcViewMat = this._rtcViewMats[rtcCenterHash];
|
226
|
+
if (!rtcViewMat) {
|
227
|
+
rtcViewMat = this._getNewMat();
|
228
|
+
createRTCViewMat(this._scene.camera.viewMatrix, rtcCenter, rtcViewMat);
|
229
|
+
this._rtcViewMats[rtcCenterHash] = rtcViewMat;
|
230
|
+
}
|
231
|
+
return rtcViewMat;
|
232
|
+
}
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Get picking View RTC matrix for the given RTC center.
|
236
|
+
*/
|
237
|
+
getRTCPickViewMatrix(rtcCenterHash, rtcCenter) {
|
238
|
+
let rtcPickViewMat = this._rtcPickViewMats[rtcCenterHash];
|
239
|
+
if (!rtcPickViewMat) {
|
240
|
+
rtcPickViewMat = this._getNewMat();
|
241
|
+
const pickViewMat = this.pickViewMatrix || this._scene.camera.viewMatrix;
|
242
|
+
createRTCViewMat(pickViewMat, rtcCenter, rtcPickViewMat);
|
243
|
+
this._rtcPickViewMats[rtcCenterHash] = rtcPickViewMat;
|
244
|
+
}
|
245
|
+
return rtcPickViewMat;
|
246
|
+
}
|
247
|
+
|
248
|
+
_getNewMat() {
|
249
|
+
let mat = this._matPool[this._matPoolNextFreeIndex];
|
250
|
+
if (!mat) {
|
251
|
+
mat = math.mat4();
|
252
|
+
this._matPool[this._matPoolNextFreeIndex] = mat;
|
253
|
+
}
|
254
|
+
this._matPoolNextFreeIndex++;
|
255
|
+
return mat;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
export {FrameContext};
|