csyjk 1.2.2 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- 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,289 +0,0 @@
|
|
1
|
-
import {math} from "../../../math/math.js";
|
2
|
-
|
3
|
-
const tempVec3a = math.vec3();
|
4
|
-
const tempVec3b = math.vec3();
|
5
|
-
const tempVec3c = math.vec3();
|
6
|
-
|
7
|
-
const tempVec4a = math.vec4();
|
8
|
-
const tempVec4b = math.vec4();
|
9
|
-
const tempVec4c = math.vec4();
|
10
|
-
|
11
|
-
|
12
|
-
/** @private */
|
13
|
-
class PivotController {
|
14
|
-
|
15
|
-
/**
|
16
|
-
* @private
|
17
|
-
*/
|
18
|
-
constructor(scene, configs) {
|
19
|
-
|
20
|
-
// Pivot math by: http://www.derschmale.com/
|
21
|
-
|
22
|
-
this._scene = scene;
|
23
|
-
this._configs = configs;
|
24
|
-
this._pivotWorldPos = math.vec3();
|
25
|
-
this._cameraOffset = math.vec3();
|
26
|
-
this._azimuth = 0;
|
27
|
-
this._polar = 0;
|
28
|
-
this._radius = 0;
|
29
|
-
this._pivotPosSet = false; // Initially false, true as soon as _pivotWorldPos has been set to some value
|
30
|
-
this._pivoting = false; // True while pivoting
|
31
|
-
this._shown = false;
|
32
|
-
|
33
|
-
this._pivotViewPos = math.vec4();
|
34
|
-
this._pivotProjPos = math.vec4();
|
35
|
-
this._pivotCanvasPos = math.vec2();
|
36
|
-
this._cameraDirty = true;
|
37
|
-
|
38
|
-
this._onViewMatrix = this._scene.camera.on("viewMatrix", () => {
|
39
|
-
this._cameraDirty = true;
|
40
|
-
});
|
41
|
-
|
42
|
-
this._onProjMatrix = this._scene.camera.on("projMatrix", () => {
|
43
|
-
this._cameraDirty = true;
|
44
|
-
});
|
45
|
-
|
46
|
-
this._onTick = this._scene.on("tick", () => {
|
47
|
-
this.updatePivotElement();
|
48
|
-
});
|
49
|
-
}
|
50
|
-
|
51
|
-
updatePivotElement() {
|
52
|
-
|
53
|
-
const camera = this._scene.camera;
|
54
|
-
const canvas = this._scene.canvas;
|
55
|
-
|
56
|
-
if (this._pivoting && this._cameraDirty) {
|
57
|
-
|
58
|
-
math.transformPoint3(camera.viewMatrix, this.getPivotPos(), this._pivotViewPos);
|
59
|
-
this._pivotViewPos[3] = 1;
|
60
|
-
math.transformPoint4(camera.projMatrix, this._pivotViewPos, this._pivotProjPos);
|
61
|
-
|
62
|
-
const canvasAABB = canvas.boundary;
|
63
|
-
const canvasWidth = canvasAABB[2];
|
64
|
-
const canvasHeight = canvasAABB[3];
|
65
|
-
|
66
|
-
this._pivotCanvasPos[0] = Math.floor((1 + this._pivotProjPos[0] / this._pivotProjPos[3]) * canvasWidth / 2);
|
67
|
-
this._pivotCanvasPos[1] = Math.floor((1 - this._pivotProjPos[1] / this._pivotProjPos[3]) * canvasHeight / 2);
|
68
|
-
|
69
|
-
const canvasElem = canvas.canvas;
|
70
|
-
const canvasBoundingRect = canvasElem.getBoundingClientRect();
|
71
|
-
|
72
|
-
if (this._pivotElement) {
|
73
|
-
this._pivotElement.style.left = (Math.floor(canvasBoundingRect.left + this._pivotCanvasPos[0]) - (this._pivotElement.clientWidth / 2) + window.scrollX) + "px";
|
74
|
-
this._pivotElement.style.top = (Math.floor(canvasBoundingRect.top + this._pivotCanvasPos[1]) - (this._pivotElement.clientHeight / 2) + window.scrollY) + "px";
|
75
|
-
}
|
76
|
-
this._cameraDirty = false;
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
/**
|
81
|
-
* Sets the HTML DOM element that will represent the pivot position.
|
82
|
-
*
|
83
|
-
* @param pivotElement
|
84
|
-
*/
|
85
|
-
setPivotElement(pivotElement) {
|
86
|
-
this._pivotElement = pivotElement;
|
87
|
-
}
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Begins pivoting.
|
91
|
-
*/
|
92
|
-
startPivot() {
|
93
|
-
|
94
|
-
if (this._cameraLookingDownwards()) {
|
95
|
-
this._pivoting = false;
|
96
|
-
return false;
|
97
|
-
}
|
98
|
-
|
99
|
-
const camera = this._scene.camera;
|
100
|
-
|
101
|
-
let lookat = math.lookAtMat4v(camera.eye, camera.look, camera.worldUp);
|
102
|
-
math.transformPoint3(lookat, this.getPivotPos(), this._cameraOffset);
|
103
|
-
|
104
|
-
const pivotPos = this.getPivotPos();
|
105
|
-
this._cameraOffset[2] += math.distVec3(camera.eye, pivotPos);
|
106
|
-
|
107
|
-
lookat = math.inverseMat4(lookat);
|
108
|
-
|
109
|
-
const offset = math.transformVec3(lookat, this._cameraOffset);
|
110
|
-
const diff = math.vec3();
|
111
|
-
|
112
|
-
math.subVec3(camera.eye, pivotPos, diff);
|
113
|
-
math.addVec3(diff, offset);
|
114
|
-
|
115
|
-
if (camera.zUp) {
|
116
|
-
const t = diff[1];
|
117
|
-
diff[1] = diff[2];
|
118
|
-
diff[2] = t;
|
119
|
-
}
|
120
|
-
|
121
|
-
this._radius = math.lenVec3(diff);
|
122
|
-
this._polar = Math.acos(diff[1] / this._radius);
|
123
|
-
this._azimuth = Math.atan2(diff[0], diff[2]);
|
124
|
-
this._pivoting = true;
|
125
|
-
}
|
126
|
-
|
127
|
-
_cameraLookingDownwards() { // Returns true if angle between camera viewing direction and World-space "up" axis is too small
|
128
|
-
const camera = this._scene.camera;
|
129
|
-
const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a));
|
130
|
-
const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b);
|
131
|
-
let rightAxisLen = math.sqLenVec3(rightAxis);
|
132
|
-
return (rightAxisLen <= 0.0001);
|
133
|
-
}
|
134
|
-
|
135
|
-
/**
|
136
|
-
* Returns true if we are currently pivoting.
|
137
|
-
*
|
138
|
-
* @returns {boolean}
|
139
|
-
*/
|
140
|
-
getPivoting() {
|
141
|
-
return this._pivoting;
|
142
|
-
}
|
143
|
-
|
144
|
-
/**
|
145
|
-
* Sets a 3D World-space position to pivot about.
|
146
|
-
*
|
147
|
-
* @param {Number[]} worldPos The new World-space pivot position.
|
148
|
-
*/
|
149
|
-
setPivotPos(worldPos) {
|
150
|
-
this._pivotWorldPos.set(worldPos);
|
151
|
-
this._pivotPosSet = true;
|
152
|
-
}
|
153
|
-
|
154
|
-
/**
|
155
|
-
* Sets the pivot position to the 3D projection of the given 2D canvas coordinates on a sphere centered
|
156
|
-
* at the viewpoint. The radius of the sphere is configured via {@link CameraControl#smartPivot}.
|
157
|
-
*
|
158
|
-
* @param canvasPos
|
159
|
-
*/
|
160
|
-
setCanvasPivotPos(canvasPos) {
|
161
|
-
const camera = this._scene.camera;
|
162
|
-
const pivotShereRadius = Math.abs(math.distVec3(this._scene.center, camera.eye));
|
163
|
-
const transposedProjectMat = camera.project.transposedMatrix;
|
164
|
-
const Pt3 = transposedProjectMat.subarray(8, 12);
|
165
|
-
const Pt4 = transposedProjectMat.subarray(12);
|
166
|
-
const D = [0, 0, -1.0, 1];
|
167
|
-
const screenZ = math.dotVec4(D, Pt3) / math.dotVec4(D, Pt4);
|
168
|
-
const worldPos = tempVec4a;
|
169
|
-
camera.project.unproject(canvasPos, screenZ, tempVec4b, tempVec4c, worldPos);
|
170
|
-
const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a));
|
171
|
-
const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b), tempVec3c);
|
172
|
-
this.setPivotPos(posOnSphere);
|
173
|
-
}
|
174
|
-
|
175
|
-
/**
|
176
|
-
* Gets the current position we're pivoting about.
|
177
|
-
* @returns {Number[]} The current World-space pivot position.
|
178
|
-
*/
|
179
|
-
getPivotPos() {
|
180
|
-
return (this._pivotPosSet) ? this._pivotWorldPos : this._scene.camera.look; // Avoid pivoting about [0,0,0] by default
|
181
|
-
}
|
182
|
-
|
183
|
-
/**
|
184
|
-
* Continues to pivot.
|
185
|
-
*
|
186
|
-
* @param {Number} yawInc Yaw rotation increment.
|
187
|
-
* @param {Number} pitchInc Pitch rotation increment.
|
188
|
-
*/
|
189
|
-
continuePivot(yawInc, pitchInc) {
|
190
|
-
if (!this._pivoting) {
|
191
|
-
return;
|
192
|
-
}
|
193
|
-
if (yawInc === 0 && pitchInc === 0) {
|
194
|
-
return;
|
195
|
-
}
|
196
|
-
const camera = this._scene.camera;
|
197
|
-
var dx = -yawInc;
|
198
|
-
const dy = -pitchInc;
|
199
|
-
if (camera.worldUp[2] === 1) {
|
200
|
-
dx = -dx;
|
201
|
-
}
|
202
|
-
this._azimuth += -dx * .01;
|
203
|
-
this._polar += dy * .01;
|
204
|
-
this._polar = math.clamp(this._polar, .001, Math.PI - .001);
|
205
|
-
const pos = [
|
206
|
-
this._radius * Math.sin(this._polar) * Math.sin(this._azimuth),
|
207
|
-
this._radius * Math.cos(this._polar),
|
208
|
-
this._radius * Math.sin(this._polar) * Math.cos(this._azimuth)
|
209
|
-
];
|
210
|
-
if (camera.worldUp[2] === 1) {
|
211
|
-
const t = pos[1];
|
212
|
-
pos[1] = pos[2];
|
213
|
-
pos[2] = t;
|
214
|
-
}
|
215
|
-
// Preserve the eye->look distance, since in yjkkit "look" is the point-of-interest, not the direction vector.
|
216
|
-
const eyeLookLen = math.lenVec3(math.subVec3(camera.look, camera.eye, math.vec3()));
|
217
|
-
const pivotPos = this.getPivotPos();
|
218
|
-
math.addVec3(pos, pivotPos);
|
219
|
-
let lookat = math.lookAtMat4v(pos, pivotPos, camera.worldUp);
|
220
|
-
lookat = math.inverseMat4(lookat);
|
221
|
-
const offset = math.transformVec3(lookat, this._cameraOffset);
|
222
|
-
lookat[12] -= offset[0];
|
223
|
-
lookat[13] -= offset[1];
|
224
|
-
lookat[14] -= offset[2];
|
225
|
-
const zAxis = [lookat[8], lookat[9], lookat[10]];
|
226
|
-
camera.eye = [lookat[12], lookat[13], lookat[14]];
|
227
|
-
math.subVec3(camera.eye, math.mulVec3Scalar(zAxis, eyeLookLen), camera.look);
|
228
|
-
camera.up = [lookat[4], lookat[5], lookat[6]];
|
229
|
-
this.showPivot();
|
230
|
-
}
|
231
|
-
|
232
|
-
/**
|
233
|
-
* Shows the pivot position.
|
234
|
-
*
|
235
|
-
* Only works if we set an HTML DOM element to represent the pivot position.
|
236
|
-
*/
|
237
|
-
showPivot() {
|
238
|
-
if (this._shown) {
|
239
|
-
return;
|
240
|
-
}
|
241
|
-
if (this._hideTimeout !== null) {
|
242
|
-
window.clearTimeout(this._hideTimeout);
|
243
|
-
this._hideTimeout = null;
|
244
|
-
}
|
245
|
-
if (this._pivotElement) {
|
246
|
-
this.updatePivotElement();
|
247
|
-
this._pivotElement.style.visibility = "visible";
|
248
|
-
this._shown = true;
|
249
|
-
this._hideTimeout = window.setTimeout(() => {
|
250
|
-
this.hidePivot();
|
251
|
-
}, 1000);
|
252
|
-
}
|
253
|
-
}
|
254
|
-
|
255
|
-
/**
|
256
|
-
* Hides the pivot position.
|
257
|
-
*
|
258
|
-
* Only works if we set an HTML DOM element to represent the pivot position.
|
259
|
-
*/
|
260
|
-
hidePivot() {
|
261
|
-
if (!this._shown) {
|
262
|
-
return;
|
263
|
-
}
|
264
|
-
if (this._hideTimeout !== null) {
|
265
|
-
window.clearTimeout(this._hideTimeout);
|
266
|
-
this._hideTimeout = null;
|
267
|
-
}
|
268
|
-
if (this._pivotElement) {
|
269
|
-
this._pivotElement.style.visibility = "hidden";
|
270
|
-
}
|
271
|
-
this._shown = false;
|
272
|
-
}
|
273
|
-
|
274
|
-
/**
|
275
|
-
* Finishes pivoting.
|
276
|
-
*/
|
277
|
-
endPivot() {
|
278
|
-
this._pivoting = false;
|
279
|
-
}
|
280
|
-
|
281
|
-
destroy() {
|
282
|
-
this._scene.camera.off(this._onViewMatrix);
|
283
|
-
this._scene.camera.off(this._onProjMatrix);
|
284
|
-
this._scene.off(this._onTick);
|
285
|
-
}
|
286
|
-
}
|
287
|
-
|
288
|
-
|
289
|
-
export {PivotController};
|
File without changes
|
@@ -1,122 +0,0 @@
|
|
1
|
-
import {math} from "../../../math/math.js";
|
2
|
-
|
3
|
-
const center = math.vec3();
|
4
|
-
const tempVec3a = math.vec3();
|
5
|
-
const tempVec3b = math.vec3();
|
6
|
-
const tempVec3c = math.vec3();
|
7
|
-
const tempVec3d = math.vec3();
|
8
|
-
|
9
|
-
const tempCameraTarget = {
|
10
|
-
eye: math.vec3(),
|
11
|
-
look: math.vec3(),
|
12
|
-
up: math.vec3()
|
13
|
-
};
|
14
|
-
|
15
|
-
/**
|
16
|
-
* @private
|
17
|
-
*/
|
18
|
-
class KeyboardAxisViewHandler {
|
19
|
-
|
20
|
-
constructor(scene, controllers, configs, states, updates) {
|
21
|
-
|
22
|
-
this._scene = scene;
|
23
|
-
const cameraControl = controllers.cameraControl;
|
24
|
-
const camera = scene.camera;
|
25
|
-
|
26
|
-
scene.input.on("keydown", this._documentKeyDownHandler = (e) => {
|
27
|
-
|
28
|
-
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
|
32
|
-
if (!states.mouseover) {
|
33
|
-
return;
|
34
|
-
}
|
35
|
-
|
36
|
-
const axisViewRight = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_RIGHT);
|
37
|
-
const axisViewBack = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BACK);
|
38
|
-
const axisViewLeft = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_LEFT);
|
39
|
-
const axisViewFront = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_FRONT);
|
40
|
-
const axisViewTop = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_TOP);
|
41
|
-
const axisViewBottom = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BOTTOM);
|
42
|
-
|
43
|
-
if ((!axisViewRight) && (!axisViewBack) && (!axisViewLeft) && (!axisViewFront) && (!axisViewTop) && (!axisViewBottom)) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
|
47
|
-
const aabb = scene.aabb;
|
48
|
-
const diag = math.getAABB3Diag(aabb);
|
49
|
-
|
50
|
-
math.getAABB3Center(aabb, center);
|
51
|
-
|
52
|
-
const perspectiveDist = Math.abs(diag / Math.tan(controllers.cameraFlight.fitFOV * math.DEGTORAD));
|
53
|
-
const orthoScale = diag * 1.1;
|
54
|
-
|
55
|
-
tempCameraTarget.orthoScale = orthoScale;
|
56
|
-
|
57
|
-
if (axisViewRight) {
|
58
|
-
|
59
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a), tempVec3d));
|
60
|
-
tempCameraTarget.look.set(center);
|
61
|
-
tempCameraTarget.up.set(camera.worldUp);
|
62
|
-
|
63
|
-
} else if (axisViewBack) {
|
64
|
-
|
65
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a), tempVec3d));
|
66
|
-
tempCameraTarget.look.set(center);
|
67
|
-
tempCameraTarget.up.set(camera.worldUp);
|
68
|
-
|
69
|
-
} else if (axisViewLeft) {
|
70
|
-
|
71
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a), tempVec3d));
|
72
|
-
tempCameraTarget.look.set(center);
|
73
|
-
tempCameraTarget.up.set(camera.worldUp);
|
74
|
-
|
75
|
-
} else if (axisViewFront) {
|
76
|
-
|
77
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a), tempVec3d));
|
78
|
-
tempCameraTarget.look.set(center);
|
79
|
-
tempCameraTarget.up.set(camera.worldUp);
|
80
|
-
|
81
|
-
} else if (axisViewTop) {
|
82
|
-
|
83
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a), tempVec3d));
|
84
|
-
tempCameraTarget.look.set(center);
|
85
|
-
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b), tempVec3c));
|
86
|
-
|
87
|
-
} else if (axisViewBottom) {
|
88
|
-
|
89
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a), tempVec3d));
|
90
|
-
tempCameraTarget.look.set(center);
|
91
|
-
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b)));
|
92
|
-
}
|
93
|
-
|
94
|
-
if ((!configs.firstPerson) && configs.followPointer) {
|
95
|
-
controllers.pivotController.setPivotPos(center);
|
96
|
-
}
|
97
|
-
|
98
|
-
if (controllers.cameraFlight.duration > 0) {
|
99
|
-
controllers.cameraFlight.flyTo(tempCameraTarget, () => {
|
100
|
-
if (controllers.pivotController.getPivoting() && configs.followPointer) {
|
101
|
-
controllers.pivotController.showPivot();
|
102
|
-
}
|
103
|
-
});
|
104
|
-
|
105
|
-
} else {
|
106
|
-
controllers.cameraFlight.jumpTo(tempCameraTarget);
|
107
|
-
if (controllers.pivotController.getPivoting() && configs.followPointer) {
|
108
|
-
controllers.pivotController.showPivot();
|
109
|
-
}
|
110
|
-
}
|
111
|
-
});
|
112
|
-
}
|
113
|
-
|
114
|
-
reset() {
|
115
|
-
}
|
116
|
-
|
117
|
-
destroy() {
|
118
|
-
document.removeEventListener("keydown", this._documentKeyDownHandler);
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
export {KeyboardAxisViewHandler};
|
@@ -1,186 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @private
|
3
|
-
*/
|
4
|
-
class KeyboardPanRotateDollyHandler {
|
5
|
-
|
6
|
-
constructor(scene, controllers, configs, states, updates) {
|
7
|
-
|
8
|
-
this._scene = scene;
|
9
|
-
const input = scene.input;
|
10
|
-
|
11
|
-
const keyDownMap = [];
|
12
|
-
|
13
|
-
const canvas = scene.canvas.canvas;
|
14
|
-
|
15
|
-
const pickController = controllers.pickController;
|
16
|
-
|
17
|
-
let mouseMovedSinceLastKeyboardDolly = true;
|
18
|
-
|
19
|
-
document.addEventListener("mousemove", this._documentMouseMoveHandler = () => {
|
20
|
-
mouseMovedSinceLastKeyboardDolly = true;
|
21
|
-
});
|
22
|
-
|
23
|
-
document.addEventListener("keydown", this._documentKeyDownHandler = (e) => {
|
24
|
-
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
25
|
-
return;
|
26
|
-
}
|
27
|
-
if (!states.mouseover) {
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
const keyCode = e.keyCode;
|
31
|
-
keyDownMap[keyCode] = true;
|
32
|
-
|
33
|
-
if (keyCode === input.KEY_SHIFT) {
|
34
|
-
canvas.style.cursor = "move";
|
35
|
-
}
|
36
|
-
});
|
37
|
-
|
38
|
-
document.addEventListener("keyup", this._documentKeyUpHandler = (e) => {
|
39
|
-
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
if (!states.mouseover) {
|
43
|
-
return;
|
44
|
-
}
|
45
|
-
const keyCode = e.keyCode;
|
46
|
-
keyDownMap[keyCode] = false;
|
47
|
-
|
48
|
-
if (keyCode === input.KEY_SHIFT) {
|
49
|
-
canvas.style.cursor = null;
|
50
|
-
}
|
51
|
-
});
|
52
|
-
|
53
|
-
this._onTick = scene.on("tick", (e) => {
|
54
|
-
|
55
|
-
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
56
|
-
return;
|
57
|
-
}
|
58
|
-
|
59
|
-
if (!states.mouseover) {
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
|
63
|
-
const cameraControl = controllers.cameraControl;
|
64
|
-
const elapsedSecs = (e.deltaTime / 1000.0);
|
65
|
-
|
66
|
-
//-------------------------------------------------------------------------------------------------
|
67
|
-
// Keyboard rotation
|
68
|
-
//-------------------------------------------------------------------------------------------------
|
69
|
-
|
70
|
-
if (!configs.planView) {
|
71
|
-
|
72
|
-
const rotateYPos = cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_POS, keyDownMap);
|
73
|
-
const rotateYNeg = cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_NEG, keyDownMap);
|
74
|
-
const rotateXPos = cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_POS, keyDownMap);
|
75
|
-
const rotateXNeg = cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_NEG, keyDownMap);
|
76
|
-
|
77
|
-
const orbitDelta = elapsedSecs * configs.keyboardRotationRate;
|
78
|
-
|
79
|
-
if (rotateYPos || rotateYNeg || rotateXPos || rotateXNeg) {
|
80
|
-
|
81
|
-
if ((!configs.firstPerson) && configs.followPointer) {
|
82
|
-
controllers.pivotController.startPivot();
|
83
|
-
}
|
84
|
-
|
85
|
-
if (rotateYPos) {
|
86
|
-
updates.rotateDeltaY += orbitDelta;
|
87
|
-
|
88
|
-
} else if (rotateYNeg) {
|
89
|
-
updates.rotateDeltaY -= orbitDelta;
|
90
|
-
}
|
91
|
-
|
92
|
-
if (rotateXPos) {
|
93
|
-
updates.rotateDeltaX += orbitDelta;
|
94
|
-
|
95
|
-
} else if (rotateXNeg) {
|
96
|
-
updates.rotateDeltaX -= orbitDelta;
|
97
|
-
}
|
98
|
-
|
99
|
-
if ((!configs.firstPerson) && configs.followPointer) {
|
100
|
-
controllers.pivotController.startPivot();
|
101
|
-
}
|
102
|
-
}
|
103
|
-
}
|
104
|
-
|
105
|
-
//-------------------------------------------------------------------------------------------------
|
106
|
-
// Keyboard panning
|
107
|
-
//-------------------------------------------------------------------------------------------------
|
108
|
-
|
109
|
-
if (!keyDownMap[input.KEY_CTRL] && !keyDownMap[input.KEY_ALT]) {
|
110
|
-
|
111
|
-
const dollyBackwards = cameraControl._isKeyDownForAction(cameraControl.DOLLY_BACKWARDS, keyDownMap);
|
112
|
-
const dollyForwards = cameraControl._isKeyDownForAction(cameraControl.DOLLY_FORWARDS, keyDownMap);
|
113
|
-
|
114
|
-
if (dollyBackwards || dollyForwards) {
|
115
|
-
|
116
|
-
const dollyDelta = elapsedSecs * configs.keyboardDollyRate;
|
117
|
-
|
118
|
-
if ((!configs.firstPerson) && configs.followPointer) {
|
119
|
-
controllers.pivotController.startPivot();
|
120
|
-
}
|
121
|
-
if (dollyForwards) {
|
122
|
-
updates.dollyDelta -= dollyDelta;
|
123
|
-
} else if (dollyBackwards) {
|
124
|
-
updates.dollyDelta += dollyDelta;
|
125
|
-
}
|
126
|
-
|
127
|
-
if (mouseMovedSinceLastKeyboardDolly) {
|
128
|
-
states.followPointerDirty = true;
|
129
|
-
mouseMovedSinceLastKeyboardDolly = false;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
const panForwards = cameraControl._isKeyDownForAction(cameraControl.PAN_FORWARDS, keyDownMap);
|
135
|
-
const panBackwards = cameraControl._isKeyDownForAction(cameraControl.PAN_BACKWARDS, keyDownMap);
|
136
|
-
const panLeft = cameraControl._isKeyDownForAction(cameraControl.PAN_LEFT, keyDownMap);
|
137
|
-
const panRight = cameraControl._isKeyDownForAction(cameraControl.PAN_RIGHT, keyDownMap);
|
138
|
-
const panUp = cameraControl._isKeyDownForAction(cameraControl.PAN_UP, keyDownMap);
|
139
|
-
const panDown = cameraControl._isKeyDownForAction(cameraControl.PAN_DOWN, keyDownMap);
|
140
|
-
|
141
|
-
const panDelta = (keyDownMap[input.KEY_ALT] ? 0.3 : 1.0) * elapsedSecs * configs.keyboardPanRate; // ALT for slower pan rate
|
142
|
-
|
143
|
-
if (panForwards || panBackwards || panLeft || panRight || panUp || panDown) {
|
144
|
-
|
145
|
-
if ((!configs.firstPerson) && configs.followPointer) {
|
146
|
-
controllers.pivotController.startPivot();
|
147
|
-
}
|
148
|
-
|
149
|
-
if (panDown) {
|
150
|
-
updates.panDeltaY += panDelta;
|
151
|
-
|
152
|
-
} else if (panUp) {
|
153
|
-
updates.panDeltaY += -panDelta;
|
154
|
-
}
|
155
|
-
|
156
|
-
if (panRight) {
|
157
|
-
updates.panDeltaX += -panDelta;
|
158
|
-
|
159
|
-
} else if (panLeft) {
|
160
|
-
updates.panDeltaX += panDelta;
|
161
|
-
}
|
162
|
-
|
163
|
-
if (panBackwards) {
|
164
|
-
updates.panDeltaZ += panDelta;
|
165
|
-
|
166
|
-
} else if (panForwards) {
|
167
|
-
updates.panDeltaZ += -panDelta;
|
168
|
-
}
|
169
|
-
}
|
170
|
-
});
|
171
|
-
}
|
172
|
-
|
173
|
-
reset() {
|
174
|
-
}
|
175
|
-
|
176
|
-
destroy() {
|
177
|
-
|
178
|
-
this._scene.off(this._onTick);
|
179
|
-
|
180
|
-
document.removeEventListener("mousemove", this._documentMouseMoveHandler);
|
181
|
-
document.removeEventListener("keydown", this._documentKeyDownHandler);
|
182
|
-
document.removeEventListener("keyup", this._documentKeyUpHandler);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
|
186
|
-
export {KeyboardPanRotateDollyHandler};
|
@@ -1,68 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @private
|
3
|
-
*/
|
4
|
-
class MouseMiscHandler {
|
5
|
-
|
6
|
-
constructor(scene, controllers, configs, states, updates) {
|
7
|
-
|
8
|
-
this._scene = scene;
|
9
|
-
|
10
|
-
const canvas = this._scene.canvas.canvas;
|
11
|
-
|
12
|
-
canvas.addEventListener("mouseenter", this._mouseEnterHandler = () => {
|
13
|
-
states.mouseover = true;
|
14
|
-
});
|
15
|
-
|
16
|
-
canvas.addEventListener("mouseleave", this._mouseLeaveHandler = () => {
|
17
|
-
states.mouseover = false;
|
18
|
-
canvas.style.cursor = null;
|
19
|
-
});
|
20
|
-
|
21
|
-
document.addEventListener("mousemove", this._mouseMoveHandler = (e) => {
|
22
|
-
getCanvasPosFromEvent(e, canvas, states.pointerCanvasPos);
|
23
|
-
});
|
24
|
-
|
25
|
-
canvas.addEventListener("mousedown", this._mouseDownHandler = (e) => {
|
26
|
-
if (!(configs.active && configs.pointerEnabled)) {
|
27
|
-
return;
|
28
|
-
}
|
29
|
-
getCanvasPosFromEvent(e, canvas, states.pointerCanvasPos);
|
30
|
-
states.mouseover = true;
|
31
|
-
});
|
32
|
-
|
33
|
-
canvas.addEventListener("mouseup", this._mouseUpHandler = (e) => {
|
34
|
-
if (!(configs.active && configs.pointerEnabled)) {
|
35
|
-
return;
|
36
|
-
}
|
37
|
-
});
|
38
|
-
}
|
39
|
-
|
40
|
-
reset() {
|
41
|
-
}
|
42
|
-
|
43
|
-
destroy() {
|
44
|
-
|
45
|
-
const canvas = this._scene.canvas.canvas;
|
46
|
-
|
47
|
-
document.removeEventListener("mousemove", this._mouseMoveHandler);
|
48
|
-
canvas.removeEventListener("mouseenter", this._mouseEnterHandler);
|
49
|
-
canvas.removeEventListener("mouseleave", this._mouseLeaveHandler);
|
50
|
-
canvas.removeEventListener("mousedown", this._mouseDownHandler);
|
51
|
-
canvas.removeEventListener("mouseup", this._mouseUpHandler);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
function getCanvasPosFromEvent(event, canvas, canvasPos) {
|
56
|
-
if (!event) {
|
57
|
-
event = window.event;
|
58
|
-
canvasPos[0] = event.x;
|
59
|
-
canvasPos[1] = event.y;
|
60
|
-
} else {
|
61
|
-
const { x, y } = canvas.getBoundingClientRect();
|
62
|
-
canvasPos[0] = event.clientX - x;
|
63
|
-
canvasPos[1] = event.clientY - y;
|
64
|
-
}
|
65
|
-
return canvasPos;
|
66
|
-
}
|
67
|
-
|
68
|
-
export {MouseMiscHandler};
|