csyjk 1.2.2 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/app.js → app.js} +0 -0
- package/{dist/index.html → index.html} +0 -0
- package/package.json +5 -40
- package/{dist/style.css → style.css} +0 -0
- package/.babelrc +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/xx.iml +0 -12
- package/public/gltf.js +0 -2241
- package/public/index.html +0 -10
- package/src/index.js +0 -3
- package/src/lib/gltf/assets/check.jpg +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
- package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
- package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
- package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
- 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 +0 -15
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
- 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 +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
- 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 +0 -122
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
- package/src/lib/gltf/gltf.css +0 -392
- package/src/lib/gltf/gltf.js +0 -2241
- package/webpack.config.js +0 -70
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import {Component} from "../Component.js"
|
|
2
|
-
import {SplineCurve} from "../paths/SplineCurve.js"
|
|
3
|
-
import {math} from "../math/math.js";
|
|
4
|
-
|
|
5
|
-
const tempVec3a = math.vec3();
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
|
|
9
|
-
*
|
|
10
|
-
* See {@link CameraPathAnimation} for usage.
|
|
11
|
-
*/
|
|
12
|
-
class CameraPath extends Component {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Returns "CameraPath".
|
|
16
|
-
*
|
|
17
|
-
* @private
|
|
18
|
-
*
|
|
19
|
-
* @returns {string} "CameraPath"
|
|
20
|
-
*/
|
|
21
|
-
get type() {
|
|
22
|
-
return "CameraPath"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @constructor
|
|
27
|
-
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPath as well.
|
|
28
|
-
* @param [cfg] {*} Configuration
|
|
29
|
-
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
30
|
-
* @param {{t:Number, eye:Object, look:Object, up: Object}[]} [cfg.frames] Initial sequence of frames.
|
|
31
|
-
*/
|
|
32
|
-
constructor(owner, cfg = {}) {
|
|
33
|
-
|
|
34
|
-
super(owner, cfg);
|
|
35
|
-
|
|
36
|
-
this._frames = [];
|
|
37
|
-
|
|
38
|
-
this._eyeCurve = new SplineCurve(this);
|
|
39
|
-
this._lookCurve = new SplineCurve(this);
|
|
40
|
-
this._upCurve = new SplineCurve(this);
|
|
41
|
-
|
|
42
|
-
if (cfg.frames) {
|
|
43
|
-
this.addFrames(cfg.frames);
|
|
44
|
-
this.smoothFrameTimes(1);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Gets the camera frames in this CameraPath.
|
|
50
|
-
*
|
|
51
|
-
* @returns {{t:Number, eye:Object, look:Object, up: Object}[]} The frames on this CameraPath.
|
|
52
|
-
*/
|
|
53
|
-
get frames() {
|
|
54
|
-
return this._frames;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Gets the {@link SplineCurve} along which {@link Camera#eye} travels.
|
|
59
|
-
* @returns {SplineCurve} The SplineCurve for {@link Camera#eye}.
|
|
60
|
-
*/
|
|
61
|
-
get eyeCurve() {
|
|
62
|
-
return this._eyeCurve;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Gets the {@link SplineCurve} along which {@link Camera#look} travels.
|
|
67
|
-
* @returns {SplineCurve} The SplineCurve for {@link Camera#look}.
|
|
68
|
-
*/
|
|
69
|
-
get lookCurve() {
|
|
70
|
-
return this._lookCurve;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Gets the {@link SplineCurve} along which {@link Camera#up} travels.
|
|
75
|
-
* @returns {SplineCurve} The SplineCurve for {@link Camera#up}.
|
|
76
|
-
*/
|
|
77
|
-
get upCurve() {
|
|
78
|
-
return this._upCurve;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Adds a frame to this CameraPath, given as the current position of the {@link Camera}.
|
|
83
|
-
*
|
|
84
|
-
* @param {Number} t Time instant for the new frame.
|
|
85
|
-
*/
|
|
86
|
-
saveFrame(t) {
|
|
87
|
-
const camera = this.scene.camera;
|
|
88
|
-
this.addFrame(t, camera.eye, camera.look, camera.up);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Adds a frame to this CameraPath, specified as values for eye, look and up vectors at a given time instant.
|
|
93
|
-
*
|
|
94
|
-
* @param {Number} t Time instant for the new frame.
|
|
95
|
-
* @param {Number[]} eye A three-element vector specifying the eye position for the new frame.
|
|
96
|
-
* @param {Number[]} look A three-element vector specifying the look position for the new frame.
|
|
97
|
-
* @param {Number[]} up A three-element vector specifying the up vector for the new frame.
|
|
98
|
-
*/
|
|
99
|
-
addFrame(t, eye, look, up) {
|
|
100
|
-
const frame = {
|
|
101
|
-
t: t,
|
|
102
|
-
eye: eye.slice(0),
|
|
103
|
-
look: look.slice(0),
|
|
104
|
-
up: up.slice(0)
|
|
105
|
-
};
|
|
106
|
-
this._frames.push(frame);
|
|
107
|
-
this._eyeCurve.points.push(frame.eye);
|
|
108
|
-
this._lookCurve.points.push(frame.look);
|
|
109
|
-
this._upCurve.points.push(frame.up);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Adds multiple frames to this CameraPath, each frame specified as a set of values for eye, look and up vectors at a given time instant.
|
|
114
|
-
*
|
|
115
|
-
* @param {{t:Number, eye:Object, look:Object, up: Object}[]} frames Frames to add to this CameraPath.
|
|
116
|
-
*/
|
|
117
|
-
addFrames(frames) {
|
|
118
|
-
let frame;
|
|
119
|
-
for (let i = 0, len = frames.length; i < len; i++) {
|
|
120
|
-
frame = frames[i];
|
|
121
|
-
this.addFrame(frame.t || 0, frame.eye, frame.look, frame.up);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Sets the position of the {@link Camera} to a position interpolated within this CameraPath at the given time instant.
|
|
127
|
-
*
|
|
128
|
-
* @param {Number} t Time instant.
|
|
129
|
-
*/
|
|
130
|
-
loadFrame(t) {
|
|
131
|
-
|
|
132
|
-
const camera = this.scene.camera;
|
|
133
|
-
|
|
134
|
-
t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
|
|
135
|
-
t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
|
|
136
|
-
|
|
137
|
-
camera.eye = this._eyeCurve.getPoint(t, tempVec3a);
|
|
138
|
-
camera.look = this._lookCurve.getPoint(t, tempVec3a);
|
|
139
|
-
camera.up = this._upCurve.getPoint(t, tempVec3a);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Gets eye, look and up vectors on this CameraPath at a given instant.
|
|
144
|
-
*
|
|
145
|
-
* @param {Number} t Time instant.
|
|
146
|
-
* @param {Number[]} eye The eye position to update.
|
|
147
|
-
* @param {Number[]} look The look position to update.
|
|
148
|
-
* @param {Number[]} up The up vector to update.
|
|
149
|
-
*/
|
|
150
|
-
sampleFrame(t, eye, look, up) {
|
|
151
|
-
t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
|
|
152
|
-
this._eyeCurve.getPoint(t, eye);
|
|
153
|
-
this._lookCurve.getPoint(t, look);
|
|
154
|
-
this._upCurve.getPoint(t, up);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Given a total duration (in seconds) for this CameraPath, recomputes the time instant at each frame so that,
|
|
159
|
-
* when animated by {@link CameraPathAnimation}, the {@link Camera} will move along the path at a constant rate.
|
|
160
|
-
*
|
|
161
|
-
* @param {Number} duration The total duration for this CameraPath.
|
|
162
|
-
*/
|
|
163
|
-
smoothFrameTimes(duration) {
|
|
164
|
-
const numFrames = this._frames.length;
|
|
165
|
-
if (numFrames === 0) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const vec = math.vec3();
|
|
169
|
-
var totalLen = 0;
|
|
170
|
-
this._frames[0].t = 0;
|
|
171
|
-
const lens = [];
|
|
172
|
-
for (let i = 1, len = this._frames.length; i < len; i++) {
|
|
173
|
-
var lenVec = math.lenVec3(math.subVec3(this._frames[i].eye, this._frames[i - 1].eye, vec));
|
|
174
|
-
lens[i] = lenVec;
|
|
175
|
-
totalLen += lenVec;
|
|
176
|
-
}
|
|
177
|
-
for (let i = 1, len = this._frames.length; i < len; i++) {
|
|
178
|
-
const interFrameRate = (lens[i] / totalLen) * duration;
|
|
179
|
-
this._frames[i].t = this._frames[i-1].t + interFrameRate;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Removes all frames from this CameraPath.
|
|
185
|
-
*/
|
|
186
|
-
clearFrames() {
|
|
187
|
-
this._frames = [];
|
|
188
|
-
this._eyeCurve.points = [];
|
|
189
|
-
this._lookCurve.points = [];
|
|
190
|
-
this._upCurve.points = [];
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export {CameraPath}
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import {Component} from "../Component.js"
|
|
2
|
-
import {CameraFlightAnimation} from "./CameraFlightAnimation.js"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @desc Animates the {@link Scene}'s's {@link Camera} along a {@link CameraPath}.
|
|
7
|
-
*
|
|
8
|
-
* ## Usage
|
|
9
|
-
*
|
|
10
|
-
* In the example below, we'll load a model using a {@link GLTFLoaderPlugin}, then animate a {@link Camera}
|
|
11
|
-
* through the frames in a {@link CameraPath}.
|
|
12
|
-
*
|
|
13
|
-
* * [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#camera_CameraPathAnimation)]
|
|
14
|
-
*
|
|
15
|
-
* ````Javascript
|
|
16
|
-
* import {Viewer, GLTFLoaderPlugin, CameraPath, CameraPathAnimation} from "yjkkit-sdk.es.js";
|
|
17
|
-
*
|
|
18
|
-
* // Create a Viewer and arrange camera
|
|
19
|
-
*
|
|
20
|
-
* const viewer = new Viewer({
|
|
21
|
-
* canvasId: "myCanvas",
|
|
22
|
-
* transparent: true
|
|
23
|
-
* });
|
|
24
|
-
*
|
|
25
|
-
* viewer.camera.eye = [124.86756896972656, -93.50288391113281, 173.2632598876953];
|
|
26
|
-
* viewer.camera.look = [102.14186096191406, -90.24193572998047, 173.4224395751953];
|
|
27
|
-
* viewer.camera.up = [0.23516440391540527, 0.9719591736793518, -0.0016466031083837152];
|
|
28
|
-
*
|
|
29
|
-
* // Load model
|
|
30
|
-
*
|
|
31
|
-
* const gltfLoader = new GLTFLoaderPlugin(viewer);
|
|
32
|
-
*
|
|
33
|
-
* const model = gltfLoader.load({
|
|
34
|
-
* id: "myModel",
|
|
35
|
-
* src: "./models/gltf/modern_office/scene.gltf",
|
|
36
|
-
* edges: true,
|
|
37
|
-
* edgeThreshold: 20,
|
|
38
|
-
* xrayed: false
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* // Create a CameraPath
|
|
42
|
-
*
|
|
43
|
-
* var cameraPath = new CameraPath(viewer.scene, {
|
|
44
|
-
* frames: [
|
|
45
|
-
* {
|
|
46
|
-
* t: 0,
|
|
47
|
-
* eye: [124.86, -93.50, 173.26],
|
|
48
|
-
* look: [102.14, -90.24, 173.42],
|
|
49
|
-
* up: [0.23, 0.97, -0.00]
|
|
50
|
-
* },
|
|
51
|
-
* {
|
|
52
|
-
* t: 1,
|
|
53
|
-
* eye: [79.75, -85.98, 226.57],
|
|
54
|
-
* look: [99.24, -84.11, 238.56],
|
|
55
|
-
* up: [-0.14, 0.98, -0.09]
|
|
56
|
-
* },
|
|
57
|
-
* // Rest of the frames omitted for brevity
|
|
58
|
-
* ]
|
|
59
|
-
* });
|
|
60
|
-
*
|
|
61
|
-
* // Create a CameraPathAnimation to play our CameraPath
|
|
62
|
-
*
|
|
63
|
-
* var cameraPathAnimation = new CameraPathAnimation(viewer.scene, {
|
|
64
|
-
* cameraPath: cameraPath,
|
|
65
|
-
* playingRate: 0.2 // Playing 0.2 time units per second
|
|
66
|
-
* });
|
|
67
|
-
*
|
|
68
|
-
* // Once model loaded, start playing after a couple of seconds delay
|
|
69
|
-
*
|
|
70
|
-
* model.on("loaded", function () {
|
|
71
|
-
* setTimeout(function () {
|
|
72
|
-
* cameraPathAnimation.play(0); // Play from the beginning of the CameraPath
|
|
73
|
-
* }, 2000);
|
|
74
|
-
* });
|
|
75
|
-
* ````
|
|
76
|
-
*/
|
|
77
|
-
class CameraPathAnimation extends Component {
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Returns "CameraPathAnimation".
|
|
81
|
-
*
|
|
82
|
-
* @private
|
|
83
|
-
* @returns {string} "CameraPathAnimation"
|
|
84
|
-
*/
|
|
85
|
-
get type() {
|
|
86
|
-
return "CameraPathAnimation"
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @constructor
|
|
91
|
-
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPathAnimation as well.
|
|
92
|
-
* @param {*} [cfg] Configuration
|
|
93
|
-
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
94
|
-
* @param {CameraPath} [cfg.eyeCurve] A {@link CameraPath} that defines the path of a {@link Camera}.
|
|
95
|
-
*/
|
|
96
|
-
constructor(owner, cfg = {}) {
|
|
97
|
-
|
|
98
|
-
super(owner, cfg);
|
|
99
|
-
|
|
100
|
-
this._cameraFlightAnimation = new CameraFlightAnimation(this);
|
|
101
|
-
this._t = 0;
|
|
102
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
103
|
-
this._playingFromT = 0;
|
|
104
|
-
this._playingToT = 0;
|
|
105
|
-
this._playingRate = cfg.playingRate || 1.0;
|
|
106
|
-
this._playingDir = 1.0;
|
|
107
|
-
this._lastTime = null;
|
|
108
|
-
|
|
109
|
-
this.cameraPath = cfg.cameraPath;
|
|
110
|
-
|
|
111
|
-
this._tick = this.scene.on("tick", this._updateT, this);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
_updateT() {
|
|
115
|
-
const cameraPath = this._cameraPath;
|
|
116
|
-
if (!cameraPath) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const f = 0.002;
|
|
120
|
-
let numFrames;
|
|
121
|
-
let t;
|
|
122
|
-
const time = performance.now();
|
|
123
|
-
const elapsedSecs = (this._lastTime) ? (time - this._lastTime) * 0.001 : 0;
|
|
124
|
-
this._lastTime = time;
|
|
125
|
-
if (elapsedSecs === 0) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
switch (this.state) {
|
|
129
|
-
case CameraPathAnimation.SCRUBBING:
|
|
130
|
-
return;
|
|
131
|
-
case CameraPathAnimation.PLAYING:
|
|
132
|
-
this._t += this._playingRate * elapsedSecs;
|
|
133
|
-
numFrames = this._cameraPath.frames.length;
|
|
134
|
-
if (numFrames === 0 || (this._playingDir < 0 && this._t <= 0) || (this._playingDir > 0 && this._t >= this._cameraPath.frames[numFrames - 1].t)) {
|
|
135
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
136
|
-
this._t = this._cameraPath.frames[numFrames - 1].t;
|
|
137
|
-
this.fire("stopped");
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
cameraPath.loadFrame(this._t);
|
|
141
|
-
break;
|
|
142
|
-
case CameraPathAnimation.PLAYING_TO:
|
|
143
|
-
t = this._t + (this._playingRate * elapsedSecs * this._playingDir);
|
|
144
|
-
if ((this._playingDir < 0 && t <= this._playingToT) || (this._playingDir > 0 && t >= this._playingToT)) {
|
|
145
|
-
t = this._playingToT;
|
|
146
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
147
|
-
this.fire("stopped");
|
|
148
|
-
}
|
|
149
|
-
this._t = t;
|
|
150
|
-
cameraPath.loadFrame(this._t);
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/*
|
|
156
|
-
* @private
|
|
157
|
-
*/
|
|
158
|
-
_ease(t, b, c, d) {
|
|
159
|
-
t /= d;
|
|
160
|
-
return -c * t * (t - 2) + b;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Sets the {@link CameraPath} animated by this CameraPathAnimation.
|
|
165
|
-
*
|
|
166
|
-
@param {CameraPath} value The new CameraPath.
|
|
167
|
-
*/
|
|
168
|
-
set cameraPath(value) {
|
|
169
|
-
this._cameraPath = value;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Gets the {@link CameraPath} animated by this CameraPathAnimation.
|
|
174
|
-
*
|
|
175
|
-
@returns {CameraPath} The CameraPath.
|
|
176
|
-
*/
|
|
177
|
-
get cameraPath() {
|
|
178
|
-
return this._cameraPath;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Sets the rate at which the CameraPathAnimation animates the {@link Camera} along the {@link CameraPath}.
|
|
183
|
-
*
|
|
184
|
-
* @param {Number} value The amount of progress per second.
|
|
185
|
-
*/
|
|
186
|
-
set rate(value) {
|
|
187
|
-
this._playingRate = value;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Gets the rate at which the CameraPathAnimation animates the {@link Camera} along the {@link CameraPath}.
|
|
192
|
-
*
|
|
193
|
-
* @returns {*|number} The current playing rate.
|
|
194
|
-
*/
|
|
195
|
-
get rate() {
|
|
196
|
-
return this._playingRate;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Begins animating the {@link Camera} along CameraPathAnimation's {@link CameraPath} from the beginning.
|
|
201
|
-
*/
|
|
202
|
-
play() {
|
|
203
|
-
if (!this._cameraPath) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
this._lastTime = null;
|
|
207
|
-
this.state = CameraPathAnimation.PLAYING;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Begins animating the {@link Camera} along CameraPathAnimation's {@link CameraPath} from the given time.
|
|
212
|
-
*
|
|
213
|
-
* @param {Number} t Time instant.
|
|
214
|
-
*/
|
|
215
|
-
playToT(t) {
|
|
216
|
-
const cameraPath = this._cameraPath;
|
|
217
|
-
if (!cameraPath) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
this._playingFromT = this._t;
|
|
221
|
-
this._playingToT = t;
|
|
222
|
-
this._playingDir = (this._playingToT - this._playingFromT) < 0 ? -1 : 1;
|
|
223
|
-
this._lastTime = null;
|
|
224
|
-
this.state = CameraPathAnimation.PLAYING_TO;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Animates the {@link Camera} along CameraPathAnimation's {@link CameraPath} to the given frame.
|
|
229
|
-
*
|
|
230
|
-
* @param {Number} frameIdx Index of the frame to play to.
|
|
231
|
-
*/
|
|
232
|
-
playToFrame(frameIdx) {
|
|
233
|
-
const cameraPath = this._cameraPath;
|
|
234
|
-
if (!cameraPath) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const frame = cameraPath.frames[frameIdx];
|
|
238
|
-
if (!frame) {
|
|
239
|
-
this.error("playToFrame - frame index out of range: " + frameIdx);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
this.playToT(frame.t);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Flies the {@link Camera} directly to the given frame on the CameraPathAnimation's {@link CameraPath}.
|
|
247
|
-
*
|
|
248
|
-
* @param {Number} frameIdx Index of the frame to play to.
|
|
249
|
-
* @param {Function} [ok] Callback to fire when playing is complete.
|
|
250
|
-
*/
|
|
251
|
-
flyToFrame(frameIdx, ok) {
|
|
252
|
-
const cameraPath = this._cameraPath;
|
|
253
|
-
if (!cameraPath) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
const frame = cameraPath.frames[frameIdx];
|
|
257
|
-
if (!frame) {
|
|
258
|
-
this.error("flyToFrame - frame index out of range: " + frameIdx);
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
262
|
-
this._cameraFlightAnimation.flyTo(frame, ok);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Scrubs the {@link Camera} to the given time on the CameraPathAnimation's {@link CameraPath}.
|
|
267
|
-
*
|
|
268
|
-
* @param {Number} t Time instant.
|
|
269
|
-
*/
|
|
270
|
-
scrubToT(t) {
|
|
271
|
-
const cameraPath = this._cameraPath;
|
|
272
|
-
if (!cameraPath) {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
const camera = this.scene.camera;
|
|
276
|
-
if (!camera) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
this._t = t;
|
|
280
|
-
cameraPath.loadFrame(this._t);
|
|
281
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Scrubs the {@link Camera} to the given frame on the CameraPathAnimation's {@link CameraPath}.
|
|
286
|
-
*
|
|
287
|
-
* @param {Number} frameIdx Index of the frame to scrub to.
|
|
288
|
-
*/
|
|
289
|
-
scrubToFrame(frameIdx) {
|
|
290
|
-
const cameraPath = this._cameraPath;
|
|
291
|
-
if (!cameraPath) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
const camera = this.scene.camera;
|
|
295
|
-
if (!camera) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
const frame = cameraPath.frames[frameIdx];
|
|
299
|
-
if (!frame) {
|
|
300
|
-
this.error("playToFrame - frame index out of range: " + frameIdx);
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
cameraPath.loadFrame(this._t);
|
|
304
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Stops playing this CameraPathAnimation.
|
|
309
|
-
*/
|
|
310
|
-
stop() {
|
|
311
|
-
this.state = CameraPathAnimation.SCRUBBING;
|
|
312
|
-
this.fire("stopped");
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
destroy() {
|
|
316
|
-
super.destroy();
|
|
317
|
-
this.scene.off(this._tick);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
CameraPathAnimation.STOPPED = 0;
|
|
322
|
-
CameraPathAnimation.SCRUBBING = 1;
|
|
323
|
-
CameraPathAnimation.PLAYING = 2;
|
|
324
|
-
CameraPathAnimation.PLAYING_TO = 3;
|
|
325
|
-
|
|
326
|
-
export {CameraPathAnimation}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {math} from '../math/math.js';
|
|
2
|
-
import {Component} from '../Component.js';
|
|
3
|
-
import {RenderState} from '../webgl/RenderState.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @desc Defines a custom projection for a {@link Camera} as a custom 4x4 matrix..
|
|
7
|
-
*
|
|
8
|
-
* Located at {@link Camera#customProjection}.
|
|
9
|
-
*/
|
|
10
|
-
class CustomProjection extends Component {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
get type() {
|
|
16
|
-
return "CustomProjection";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @constructor
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
constructor(camera, cfg = {}) {
|
|
24
|
-
|
|
25
|
-
super(camera, cfg);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The Camera this CustomProjection belongs to.
|
|
29
|
-
*
|
|
30
|
-
* @property camera
|
|
31
|
-
* @type {Camera}
|
|
32
|
-
* @final
|
|
33
|
-
*/
|
|
34
|
-
this.camera = camera;
|
|
35
|
-
|
|
36
|
-
this._state = new RenderState({
|
|
37
|
-
matrix: math.mat4(),
|
|
38
|
-
inverseMatrix: math.mat4(),
|
|
39
|
-
transposedMatrix: math.mat4()
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
this._inverseMatrixDirty = true;
|
|
43
|
-
this._transposedMatrixDirty = false;
|
|
44
|
-
|
|
45
|
-
this.matrix = cfg.matrix;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Sets the CustomProjection's projection transform matrix.
|
|
50
|
-
*
|
|
51
|
-
* Fires a "matrix" event on change.
|
|
52
|
-
|
|
53
|
-
* Default value is ````[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]````.
|
|
54
|
-
*
|
|
55
|
-
* @param {Number[]} matrix New value for the CustomProjection's matrix.
|
|
56
|
-
*/
|
|
57
|
-
set matrix(matrix) {
|
|
58
|
-
this._state.matrix.set(matrix || [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
59
|
-
this._inverseMatrixDirty = true;
|
|
60
|
-
this._transposedMatrixDirty = true;
|
|
61
|
-
this.glRedraw();
|
|
62
|
-
this.fire("far", this._state.matrix);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Gets the CustomProjection's projection transform matrix.
|
|
67
|
-
*
|
|
68
|
-
* Default value is ````[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]````.
|
|
69
|
-
*
|
|
70
|
-
* @return {Number[]} New value for the CustomProjection's matrix.
|
|
71
|
-
*/
|
|
72
|
-
get matrix() {
|
|
73
|
-
return this._state.matrix;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Gets the inverse of {@link CustomProjection#matrix}.
|
|
78
|
-
*
|
|
79
|
-
* @returns {Number[]} The inverse of {@link CustomProjection#matrix}.
|
|
80
|
-
*/
|
|
81
|
-
get inverseMatrix() {
|
|
82
|
-
if (this._updateScheduled) {
|
|
83
|
-
this._doUpdate();
|
|
84
|
-
}
|
|
85
|
-
if (this._inverseMatrixDirty) {
|
|
86
|
-
math.inverseMat4(this._state.matrix, this._state.inverseMatrix);
|
|
87
|
-
this._inverseMatrixDirty = false;
|
|
88
|
-
}
|
|
89
|
-
return this._state.inverseMatrix;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Gets the transpose of {@link CustomProjection#matrix}.
|
|
94
|
-
*
|
|
95
|
-
* @returns {Number[]} The transpose of {@link CustomProjection#matrix}.
|
|
96
|
-
*/
|
|
97
|
-
get transposedMatrix() {
|
|
98
|
-
if (this._updateScheduled) {
|
|
99
|
-
this._doUpdate();
|
|
100
|
-
}
|
|
101
|
-
if (this._transposedMatrixDirty) {
|
|
102
|
-
math.transposeMat4(this._state.matrix, this._state.transposedMatrix);
|
|
103
|
-
this._transposedMatrixDirty = false;
|
|
104
|
-
}
|
|
105
|
-
return this._state.transposedMatrix;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Un-projects the given Canvas-space coordinates, using this CustomProjection.
|
|
110
|
-
*
|
|
111
|
-
* @param {Number[]} canvasPos Inputs 2D Canvas-space coordinates.
|
|
112
|
-
* @param {Number} screenZ Inputs Screen-space Z coordinate.
|
|
113
|
-
* @param {Number[]} screenPos Outputs 3D Screen/Clip-space coordinates.
|
|
114
|
-
* @param {Number[]} viewPos Outputs un-projected 3D View-space coordinates.
|
|
115
|
-
* @param {Number[]} worldPos Outputs un-projected 3D World-space coordinates.
|
|
116
|
-
*/
|
|
117
|
-
unproject(canvasPos, screenZ, screenPos, viewPos, worldPos) {
|
|
118
|
-
|
|
119
|
-
const canvas = this.scene.canvas.canvas;
|
|
120
|
-
|
|
121
|
-
const halfCanvasWidth = canvas.offsetWidth / 2.0;
|
|
122
|
-
const halfCanvasHeight = canvas.offsetHeight / 2.0;
|
|
123
|
-
|
|
124
|
-
screenPos[0] = (canvasPos[0] - halfCanvasWidth) / halfCanvasWidth;
|
|
125
|
-
screenPos[1] = (canvasPos[1] - halfCanvasHeight) / halfCanvasHeight;
|
|
126
|
-
screenPos[2] = screenZ;
|
|
127
|
-
screenPos[3] = 1.0;
|
|
128
|
-
|
|
129
|
-
math.mulMat4v4(this.inverseMatrix, screenPos, viewPos);
|
|
130
|
-
math.mulVec3Scalar(viewPos, 1.0 / viewPos[3]);
|
|
131
|
-
|
|
132
|
-
viewPos[3] = 1.0;
|
|
133
|
-
viewPos[1] *= -1;
|
|
134
|
-
|
|
135
|
-
math.mulMat4v4(this.camera.inverseViewMatrix, viewPos, worldPos);
|
|
136
|
-
|
|
137
|
-
return worldPos;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** @private
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
destroy() {
|
|
144
|
-
super.destroy();
|
|
145
|
-
this._state.destroy();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export {CustomProjection};
|