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 @@
|
|
1
|
+
export * from "./Node.js";
|
@@ -0,0 +1,194 @@
|
|
1
|
+
import {Curve} from "./Curve.js"
|
2
|
+
import {math} from "../math/math.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @desc A {@link Curve} along which a 3D position can be animated.
|
6
|
+
*
|
7
|
+
* * As shown in the diagram below, a CubicBezierCurve is defined by four control points.
|
8
|
+
* * You can sample a {@link CubicBezierCurve#point} and a {@link CubicBezierCurve#tangent} vector on a CubicBezierCurve for any given value of {@link CubicBezierCurve#t} in the range [0..1].
|
9
|
+
* * When you set {@link CubicBezierCurve#t} on a CubicBezierCurve, its {@link CubicBezierCurve#point} and {@link CubicBezierCurve#tangent} properties will update accordingly.
|
10
|
+
* * To build a complex path, you can combine an unlimited combination of CubicBezierCurves, {@link QuadraticBezierCurve}s and {@link SplineCurve}s into a {@link Path}.
|
11
|
+
*
|
12
|
+
* <br>
|
13
|
+
* <img style="border:1px solid;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/B%C3%A9zier_3_big.gif/240px-B%C3%A9zier_3_big.gif"/>
|
14
|
+
* <br>
|
15
|
+
* [Cubic Bezier Curve from WikiPedia](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
|
16
|
+
*/
|
17
|
+
class CubicBezierCurve extends Curve {
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @constructor
|
21
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CubicBezierCurve as well.
|
22
|
+
* @param {*} [cfg] Configs
|
23
|
+
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
24
|
+
* @param {Number[]} [cfg.v0=[0,0,0]] The starting point.
|
25
|
+
* @param {Number[]} [cfg.v1=[0,0,0]] The first control point.
|
26
|
+
* @param {Number[]} [cfg.v2=[0,0,0]] The middle control point.
|
27
|
+
* @param {Number[]} [cfg.v3=[0,0,0]] The ending point.
|
28
|
+
* @param {Number} [cfg.t=0] Current position on this CubicBezierCurve, in range between 0..1.
|
29
|
+
*/
|
30
|
+
constructor(owner, cfg = {}) {
|
31
|
+
super(owner, cfg);
|
32
|
+
this.v0 = cfg.v0;
|
33
|
+
this.v1 = cfg.v1;
|
34
|
+
this.v2 = cfg.v2;
|
35
|
+
this.v3 = cfg.v3;
|
36
|
+
this.t = cfg.t;
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Sets the starting point on this CubicBezierCurve.
|
41
|
+
*
|
42
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
43
|
+
*
|
44
|
+
* @param {Number[]} value The starting point.
|
45
|
+
*/
|
46
|
+
set v0(value) {
|
47
|
+
this._v0 = value || math.vec3([0, 0, 0]);
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Gets the starting point on this CubicBezierCurve.
|
52
|
+
*
|
53
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
54
|
+
*
|
55
|
+
* @returns {Number[]} The starting point.
|
56
|
+
*/
|
57
|
+
get v0() {
|
58
|
+
return this._v0;
|
59
|
+
}
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Sets the first control point on this CubicBezierCurve.
|
63
|
+
*
|
64
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
65
|
+
*
|
66
|
+
* @param {Number[]} value The first control point.
|
67
|
+
*/
|
68
|
+
set v1(value) {
|
69
|
+
this._v1 = value || math.vec3([0, 0, 0]);
|
70
|
+
}
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Gets the first control point on this CubicBezierCurve.
|
74
|
+
*
|
75
|
+
* Fires a {@link CubicBezierCurve#v1:event} event on change.
|
76
|
+
*
|
77
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
78
|
+
*
|
79
|
+
* @returns {Number[]} The first control point.
|
80
|
+
*/
|
81
|
+
get v1() {
|
82
|
+
return this._v1;
|
83
|
+
}
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Sets the second control point on this CubicBezierCurve.
|
87
|
+
*
|
88
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
89
|
+
*
|
90
|
+
* @param {Number[]} value The second control point.
|
91
|
+
*/
|
92
|
+
set v2(value) {
|
93
|
+
this._v2 = value || math.vec3([0, 0, 0]);
|
94
|
+
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Gets the second control point on this CubicBezierCurve.
|
98
|
+
*
|
99
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
100
|
+
*
|
101
|
+
* @returns {Number[]} The second control point.
|
102
|
+
*/
|
103
|
+
get v2() {
|
104
|
+
return this._v2;
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Sets the end point on this CubicBezierCurve.
|
109
|
+
*
|
110
|
+
* Fires a {@link CubicBezierCurve#v3:event} event on change.
|
111
|
+
*
|
112
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
113
|
+
*
|
114
|
+
* @param {Number[]} value The end point.
|
115
|
+
*/
|
116
|
+
set v3(value) {
|
117
|
+
this.fire("v3", this._v3 = value || math.vec3([0, 0, 0]));
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Gets the end point on this CubicBezierCurve.
|
122
|
+
*
|
123
|
+
* Fires a {@link CubicBezierCurve#v3:event} event on change.
|
124
|
+
*
|
125
|
+
* Default value is ````[0.0, 0.0, 0.0]````
|
126
|
+
*
|
127
|
+
* @returns {Number[]} The end point.
|
128
|
+
*/
|
129
|
+
get v3() {
|
130
|
+
return this._v3;
|
131
|
+
}
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Sets the current position of progress along this CubicBezierCurve.
|
135
|
+
*
|
136
|
+
* Automatically clamps to range ````[0..1]````.
|
137
|
+
*
|
138
|
+
* @param {Number} value New progress time value.
|
139
|
+
*/
|
140
|
+
set t(value) {
|
141
|
+
value = value || 0;
|
142
|
+
this._t = value < 0.0 ? 0.0 : (value > 1.0 ? 1.0 : value);
|
143
|
+
}
|
144
|
+
|
145
|
+
/**
|
146
|
+
* Gets the current position of progress along this CubicBezierCurve.
|
147
|
+
*
|
148
|
+
* @returns {Number} Current progress time value.
|
149
|
+
*/
|
150
|
+
get t() {
|
151
|
+
return this._t;
|
152
|
+
}
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Returns point on this CubicBezierCurve at the given position.
|
156
|
+
*
|
157
|
+
* @param {Number} t Position to get point at.
|
158
|
+
*
|
159
|
+
* @returns {{Number[]}} The point at the given position.
|
160
|
+
*/
|
161
|
+
get point() {
|
162
|
+
return this.getPoint(this._t);
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Returns point on this CubicBezierCurve at the given position.
|
167
|
+
*
|
168
|
+
* @param {Number} t Position to get point at.
|
169
|
+
*
|
170
|
+
* @returns {{Number[]}} The point at the given position.
|
171
|
+
*/
|
172
|
+
getPoint(t) {
|
173
|
+
|
174
|
+
var vector = math.vec3();
|
175
|
+
|
176
|
+
vector[0] = math.b3(t, this._v0[0], this._v1[0], this._v2[0], this._v3[0]);
|
177
|
+
vector[1] = math.b3(t, this._v0[1], this._v1[1], this._v2[1], this._v3[1]);
|
178
|
+
vector[2] = math.b3(t, this._v0[2], this._v1[2], this._v2[2], this._v3[2]);
|
179
|
+
|
180
|
+
return vector;
|
181
|
+
}
|
182
|
+
|
183
|
+
getJSON() {
|
184
|
+
return {
|
185
|
+
v0: this._v0,
|
186
|
+
v1: this._v1,
|
187
|
+
v2: this._v2,
|
188
|
+
v3: this._v3,
|
189
|
+
t: this._t
|
190
|
+
};
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
export {CubicBezierCurve}
|
@@ -0,0 +1,183 @@
|
|
1
|
+
import {Component} from "../Component.js"
|
2
|
+
import {math} from "../math/math.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @desc Abstract base class for curve classes.
|
6
|
+
*/
|
7
|
+
class Curve extends Component {
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @constructor
|
11
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this Curve as well.
|
12
|
+
* @param {*} [cfg] Configs
|
13
|
+
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Curve}, generated automatically when omitted.
|
14
|
+
* @param {Object} [cfg] Configs for this Curve.
|
15
|
+
* @param {Number} [cfg.t=0] Current position on this Curve, in range between ````0..1````.
|
16
|
+
*/
|
17
|
+
constructor(owner, cfg = {}) {
|
18
|
+
super(owner, cfg);
|
19
|
+
this.t = cfg.t;
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Sets the progress along this Curve.
|
24
|
+
*
|
25
|
+
* Automatically clamps to range ````[0..1]````.
|
26
|
+
*
|
27
|
+
* Default value is ````0````.
|
28
|
+
*
|
29
|
+
* @param {Number} value The progress value.
|
30
|
+
*/
|
31
|
+
set t(value) {
|
32
|
+
value = value || 0;
|
33
|
+
this._t = value < 0.0 ? 0.0 : (value > 1.0 ? 1.0 : value);
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Gets the progress along this Curve.
|
38
|
+
*
|
39
|
+
* @returns {Number} The progress value.
|
40
|
+
*/
|
41
|
+
get t() {
|
42
|
+
return this._t;
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Gets the tangent on this Curve at position {@link Curve#t}.
|
47
|
+
*
|
48
|
+
* @returns {{Number[]}} The tangent.
|
49
|
+
*/
|
50
|
+
get tangent() {
|
51
|
+
return this.getTangent(this._t);
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Gets the length of this Curve.
|
56
|
+
*
|
57
|
+
* @returns {Number} The Curve length.
|
58
|
+
*/
|
59
|
+
get length() {
|
60
|
+
var lengths = this._getLengths();
|
61
|
+
return lengths[lengths.length - 1];
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Returns a normalized tangent vector on this Curve at the given position.
|
66
|
+
*
|
67
|
+
* @param {Number} t Position to get tangent at.
|
68
|
+
* @returns {{Number[]}} Normalized tangent vector
|
69
|
+
*/
|
70
|
+
getTangent(t) {
|
71
|
+
var delta = 0.0001;
|
72
|
+
if (t === undefined) {
|
73
|
+
t = this._t;
|
74
|
+
}
|
75
|
+
var t1 = t - delta;
|
76
|
+
var t2 = t + delta;
|
77
|
+
if (t1 < 0) {
|
78
|
+
t1 = 0;
|
79
|
+
}
|
80
|
+
if (t2 > 1) {
|
81
|
+
t2 = 1;
|
82
|
+
}
|
83
|
+
var pt1 = this.getPoint(t1);
|
84
|
+
var pt2 = this.getPoint(t2);
|
85
|
+
var vec = math.subVec3(pt2, pt1, []);
|
86
|
+
return math.normalizeVec3(vec, []);
|
87
|
+
}
|
88
|
+
|
89
|
+
getPointAt(u) {
|
90
|
+
var t = this.getUToTMapping(u);
|
91
|
+
return this.getPoint(t);
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Samples points on this Curve, at the given number of equally-spaced divisions.
|
96
|
+
*
|
97
|
+
* @param {Number} divisions The number of divisions.
|
98
|
+
* @returns {{Array of Array}} Array of sampled 3D points.
|
99
|
+
*/
|
100
|
+
getPoints(divisions) {
|
101
|
+
if (!divisions) {
|
102
|
+
divisions = 5;
|
103
|
+
}
|
104
|
+
var d, pts = [];
|
105
|
+
for (d = 0; d <= divisions; d++) {
|
106
|
+
pts.push(this.getPoint(d / divisions));
|
107
|
+
}
|
108
|
+
return pts;
|
109
|
+
}
|
110
|
+
|
111
|
+
_getLengths(divisions) {
|
112
|
+
if (!divisions) {
|
113
|
+
divisions = (this.__arcLengthDivisions) ? (this.__arcLengthDivisions) : 200;
|
114
|
+
}
|
115
|
+
if (this.cacheArcLengths && (this.cacheArcLengths.length === divisions + 1) && !this.needsUpdate) {
|
116
|
+
return this.cacheArcLengths;
|
117
|
+
|
118
|
+
}
|
119
|
+
this.needsUpdate = false;
|
120
|
+
var cache = [];
|
121
|
+
var current;
|
122
|
+
var last = this.getPoint(0);
|
123
|
+
var p;
|
124
|
+
var sum = 0;
|
125
|
+
cache.push(0);
|
126
|
+
for (p = 1; p <= divisions; p++) {
|
127
|
+
current = this.getPoint(p / divisions);
|
128
|
+
sum += math.lenVec3(math.subVec3(current, last, []));
|
129
|
+
cache.push(sum);
|
130
|
+
last = current;
|
131
|
+
}
|
132
|
+
this.cacheArcLengths = cache;
|
133
|
+
return cache; // { sums: cache, sum:sum }, Sum is in the last element.
|
134
|
+
}
|
135
|
+
|
136
|
+
_updateArcLengths() {
|
137
|
+
this.needsUpdate = true;
|
138
|
+
this._getLengths();
|
139
|
+
}
|
140
|
+
|
141
|
+
// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi distance
|
142
|
+
|
143
|
+
getUToTMapping(u, distance) {
|
144
|
+
var arcLengths = this._getLengths();
|
145
|
+
var i = 0;
|
146
|
+
var il = arcLengths.length;
|
147
|
+
var t;
|
148
|
+
var targetArcLength; // The targeted u distance value to get
|
149
|
+
if (distance) {
|
150
|
+
targetArcLength = distance;
|
151
|
+
} else {
|
152
|
+
targetArcLength = u * arcLengths[il - 1];
|
153
|
+
}
|
154
|
+
//var time = Date.now();
|
155
|
+
var low = 0, high = il - 1, comparison;
|
156
|
+
while (low <= high) {
|
157
|
+
i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats
|
158
|
+
comparison = arcLengths[i] - targetArcLength;
|
159
|
+
if (comparison < 0) {
|
160
|
+
low = i + 1;
|
161
|
+
} else if (comparison > 0) {
|
162
|
+
high = i - 1;
|
163
|
+
} else {
|
164
|
+
high = i;
|
165
|
+
break;
|
166
|
+
// DONE
|
167
|
+
}
|
168
|
+
}
|
169
|
+
i = high;
|
170
|
+
if (arcLengths[i] === targetArcLength) {
|
171
|
+
t = i / (il - 1);
|
172
|
+
return t;
|
173
|
+
}
|
174
|
+
var lengthBefore = arcLengths[i];
|
175
|
+
var lengthAfter = arcLengths[i + 1];
|
176
|
+
var segmentLength = lengthAfter - lengthBefore;
|
177
|
+
var segmentFraction = (targetArcLength - lengthBefore) / segmentLength;
|
178
|
+
t = (i + segmentFraction) / (il - 1);
|
179
|
+
return t;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
export {Curve}
|
@@ -0,0 +1,239 @@
|
|
1
|
+
import {utils} from "../utils.js";
|
2
|
+
import {Curve} from "./Curve.js"
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @desc A complex curved path constructed from various {@link Curve} subtypes.
|
6
|
+
*
|
7
|
+
* * A Path can be constructed from these {@link Curve} subtypes: {@link SplineCurve}, {@link CubicBezierCurve} and {@link QuadraticBezierCurve}.
|
8
|
+
* * You can sample a {@link Path#point} and a {@link Curve#tangent} vector on a Path for any given value of {@link Path#t} in the range ````[0..1]````.
|
9
|
+
* * When you set {@link Path#t} on a Path, its {@link Path#point} and {@link Curve#tangent} properties will update accordingly.
|
10
|
+
*/
|
11
|
+
class Path extends Curve {
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @constructor
|
15
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this SectionPlane as well.
|
16
|
+
* @param {*} [cfg] Path configuration
|
17
|
+
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
18
|
+
* @param {String []} [cfg.paths=[]] IDs or instances of {{#crossLink "path"}}{{/crossLink}} subtypes to add to this Path.
|
19
|
+
* @param {Number} [cfg.t=0] Current position on this Path, in range between 0..1.
|
20
|
+
*/
|
21
|
+
constructor(owner, cfg = {}) {
|
22
|
+
super(owner, cfg);
|
23
|
+
this._cachedLengths = [];
|
24
|
+
this._dirty = true;
|
25
|
+
this._curves = []; // Array of child Curve components
|
26
|
+
this._t = 0;
|
27
|
+
this._dirtySubs = []; // Subscriptions to "dirty" events from child Curve components
|
28
|
+
this._destroyedSubs = []; // Subscriptions to "destroyed" events from child Curve components
|
29
|
+
this.curves = cfg.curves || []; // Add initial curves
|
30
|
+
this.t = cfg.t; // Set initial progress
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Adds a {@link Curve} to this Path.
|
35
|
+
*
|
36
|
+
* @param {Curve} curve The {@link Curve} to add.
|
37
|
+
*/
|
38
|
+
addCurve(curve) {
|
39
|
+
this._curves.push(curve);
|
40
|
+
this._dirty = true;
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Sets the {@link Curve}s in this Path.
|
45
|
+
*
|
46
|
+
* Default value is ````[]````.
|
47
|
+
*
|
48
|
+
* @param {{Array of Spline, Path, QuadraticBezierCurve or CubicBezierCurve}} value.
|
49
|
+
*/
|
50
|
+
set curves(value) {
|
51
|
+
|
52
|
+
value = value || [];
|
53
|
+
|
54
|
+
var curve;
|
55
|
+
// Unsubscribe from events on old curves
|
56
|
+
var i;
|
57
|
+
var len;
|
58
|
+
for (i = 0, len = this._curves.length; i < len; i++) {
|
59
|
+
curve = this._curves[i];
|
60
|
+
curve.off(this._dirtySubs[i]);
|
61
|
+
curve.off(this._destroyedSubs[i]);
|
62
|
+
}
|
63
|
+
|
64
|
+
this._curves = [];
|
65
|
+
this._dirtySubs = [];
|
66
|
+
this._destroyedSubs = [];
|
67
|
+
|
68
|
+
var self = this;
|
69
|
+
|
70
|
+
function curveDirty() {
|
71
|
+
self._dirty = true;
|
72
|
+
}
|
73
|
+
|
74
|
+
function curveDestroyed() {
|
75
|
+
var id = this.id;
|
76
|
+
for (i = 0, len = self._curves.length; i < len; i++) {
|
77
|
+
if (self._curves[i].id === id) {
|
78
|
+
self._curves = self._curves.slice(i, i + 1);
|
79
|
+
self._dirtySubs = self._dirtySubs.slice(i, i + 1);
|
80
|
+
self._destroyedSubs = self._destroyedSubs.slice(i, i + 1);
|
81
|
+
self._dirty = true;
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
for (i = 0, len = value.length; i < len; i++) {
|
88
|
+
curve = value[i];
|
89
|
+
if (utils.isNumeric(curve) || utils.isString(curve)) {
|
90
|
+
// ID given for curve - find the curve component
|
91
|
+
var id = curve;
|
92
|
+
curve = this.scene.components[id];
|
93
|
+
if (!curve) {
|
94
|
+
this.error("Component not found: " + _inQuotes(id));
|
95
|
+
continue;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
var type = curve.type;
|
100
|
+
|
101
|
+
if (type !== "yjkkit.SplineCurve" &&
|
102
|
+
type !== "yjkkit.Path" &&
|
103
|
+
type !== "yjkkit.CubicBezierCurve" &&
|
104
|
+
type !== "yjkkit.QuadraticBezierCurve") {
|
105
|
+
|
106
|
+
this.error("Component " + _inQuotes(curve.id)
|
107
|
+
+ " is not a yjkkit.SplineCurve, yjkkit.Path or yjkkit.QuadraticBezierCurve");
|
108
|
+
|
109
|
+
continue;
|
110
|
+
}
|
111
|
+
|
112
|
+
this._curves.push(curve);
|
113
|
+
this._dirtySubs.push(curve.on("dirty", curveDirty));
|
114
|
+
this._destroyedSubs.push(curve.once("destroyed", curveDestroyed));
|
115
|
+
}
|
116
|
+
|
117
|
+
this._dirty = true;
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Gets the {@link Curve}s in this Path.
|
122
|
+
*
|
123
|
+
* @returns {{Array of Spline, Path, QuadraticBezierCurve or CubicBezierCurve}} the {@link Curve}s in this path.
|
124
|
+
*/
|
125
|
+
get curves() {
|
126
|
+
return this._curves;
|
127
|
+
}
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Sets the current point of progress along this Path.
|
131
|
+
*
|
132
|
+
* Automatically clamps to range ````[0..1]````.
|
133
|
+
*
|
134
|
+
* Default value is ````0````.
|
135
|
+
*
|
136
|
+
* @param {Number} value The current point of progress.
|
137
|
+
*/
|
138
|
+
set t(value) {
|
139
|
+
value = value || 0;
|
140
|
+
this._t = value < 0.0 ? 0.0 : (value > 1.0 ? 1.0 : value);
|
141
|
+
}
|
142
|
+
|
143
|
+
/**
|
144
|
+
* Gets the current point of progress along this Path.
|
145
|
+
*
|
146
|
+
* Default value is ````0````.
|
147
|
+
*
|
148
|
+
* @returns {Number} The current point of progress.
|
149
|
+
*/
|
150
|
+
get t() {
|
151
|
+
return this._t;
|
152
|
+
}
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Gets point on this Path corresponding to the current value of {@link Path#t}.
|
156
|
+
*
|
157
|
+
* @returns {{Number[]}} The point.
|
158
|
+
*/
|
159
|
+
get point() {
|
160
|
+
return this.getPoint(this._t);
|
161
|
+
}
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Length of this Path, which is the cumulative length of all {@link Curve}s currently in {@link Path#curves}.
|
165
|
+
*
|
166
|
+
* @return {Number} Length of this path.
|
167
|
+
*/
|
168
|
+
get length() {
|
169
|
+
var lens = this._getCurveLengths();
|
170
|
+
return lens[lens.length - 1];
|
171
|
+
}
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Gets a point on this Path corresponding to the given progress position.
|
175
|
+
*
|
176
|
+
* @param {Number} t Indicates point of progress along this curve, in the range [0..1].
|
177
|
+
* @returns {{Number[]}}
|
178
|
+
*/
|
179
|
+
getPoint(t) {
|
180
|
+
var d = t * this.length;
|
181
|
+
var curveLengths = this._getCurveLengths();
|
182
|
+
var i = 0, diff, curve;
|
183
|
+
while (i < curveLengths.length) {
|
184
|
+
if (curveLengths[i] >= d) {
|
185
|
+
diff = curveLengths[i] - d;
|
186
|
+
curve = this._curves[i];
|
187
|
+
var u = 1 - diff / curve.length;
|
188
|
+
return curve.getPointAt(u);
|
189
|
+
}
|
190
|
+
i++;
|
191
|
+
}
|
192
|
+
return null;
|
193
|
+
}
|
194
|
+
|
195
|
+
_getCurveLengths() {
|
196
|
+
if (!this._dirty) {
|
197
|
+
return this._cachedLengths;
|
198
|
+
}
|
199
|
+
var lengths = [];
|
200
|
+
var sums = 0;
|
201
|
+
var i, il = this._curves.length;
|
202
|
+
for (i = 0; i < il; i++) {
|
203
|
+
sums += this._curves[i].length;
|
204
|
+
lengths.push(sums);
|
205
|
+
|
206
|
+
}
|
207
|
+
this._cachedLengths = lengths;
|
208
|
+
this._dirty = false;
|
209
|
+
return lengths;
|
210
|
+
}
|
211
|
+
|
212
|
+
_getJSON() {
|
213
|
+
var curveIds = [];
|
214
|
+
for (var i = 0, len = this._curves.length; i < len; i++) {
|
215
|
+
curveIds.push(this._curves[i].id);
|
216
|
+
}
|
217
|
+
return {
|
218
|
+
curves: curveIds,
|
219
|
+
t: this._t
|
220
|
+
};
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Destroys this Path.
|
225
|
+
*/
|
226
|
+
destroy() {
|
227
|
+
super.destroy();
|
228
|
+
var i;
|
229
|
+
var len;
|
230
|
+
var curve;
|
231
|
+
for (i = 0, len = this._curves.length; i < len; i++) {
|
232
|
+
curve = this._curves[i];
|
233
|
+
curve.off(this._dirtySubs[i]);
|
234
|
+
curve.off(this._destroyedSubs[i]);
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
export {Path}
|