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,880 +0,0 @@
|
|
1
|
-
import {math} from '../math/math.js';
|
2
|
-
import {Component} from '../Component.js';
|
3
|
-
import {RenderState} from '../webgl/RenderState.js';
|
4
|
-
import {Perspective} from './Perspective.js';
|
5
|
-
import {Ortho} from './Ortho.js';
|
6
|
-
import {Frustum} from './Frustum.js';
|
7
|
-
import {CustomProjection} from './CustomProjection.js';
|
8
|
-
|
9
|
-
const tempVec3 = math.vec3();
|
10
|
-
const tempVec3b = math.vec3();
|
11
|
-
const tempVec3c = math.vec3();
|
12
|
-
const tempVec3d = math.vec3();
|
13
|
-
const tempVec3e = math.vec3();
|
14
|
-
const tempVec3f = math.vec3();
|
15
|
-
const tempMat = math.mat4();
|
16
|
-
const tempMatb = math.mat4();
|
17
|
-
const eyeLookVec = math.vec3();
|
18
|
-
const eyeLookVecNorm = math.vec3();
|
19
|
-
const eyeLookOffset = math.vec3();
|
20
|
-
const offsetEye = math.vec3();
|
21
|
-
|
22
|
-
/**
|
23
|
-
* @desc Manages viewing and projection transforms for its {@link Scene}.
|
24
|
-
*
|
25
|
-
* * One Camera per {@link Scene}
|
26
|
-
* * Scene is located at {@link Viewer#scene} and Camera is located at {@link Scene#camera}
|
27
|
-
* * Controls viewing and projection transforms
|
28
|
-
* * Has methods to pan, zoom and orbit (or first-person rotation)
|
29
|
-
* * Dynamically configurable World-space axis
|
30
|
-
* * Has {@link Perspective}, {@link Ortho} and {@link Frustum} and {@link CustomProjection}, which you can dynamically switch it between
|
31
|
-
* * Switchable gimbal lock
|
32
|
-
* * Can be "flown" to look at targets using a {@link CameraFlightAnimation}
|
33
|
-
* * Can be animated along a path using a {@link CameraPathAnimation}
|
34
|
-
*
|
35
|
-
* ## Getting the Camera
|
36
|
-
*
|
37
|
-
* There is exactly one Camera per {@link Scene}:
|
38
|
-
*
|
39
|
-
* ````javascript
|
40
|
-
* import {Viewer} from "yjkkit-sdk.es.js";
|
41
|
-
*
|
42
|
-
* var camera = viewer.scene.camera;
|
43
|
-
*
|
44
|
-
* ````
|
45
|
-
*
|
46
|
-
* ## Setting the Camera Position
|
47
|
-
*
|
48
|
-
* Get and set the Camera's absolute position via {@link Camera#eye}, {@link Camera#look} and {@link Camera#up}:
|
49
|
-
*
|
50
|
-
* ````javascript
|
51
|
-
* camera.eye = [-10,0,0];
|
52
|
-
* camera.look = [-10,0,0];
|
53
|
-
* camera.up = [0,1,0];
|
54
|
-
* ````
|
55
|
-
*
|
56
|
-
* ## Camera View and Projection Matrices
|
57
|
-
*
|
58
|
-
* The Camera's view matrix transforms coordinates from World-space to View-space.
|
59
|
-
*
|
60
|
-
* Getting the view matrix:
|
61
|
-
*
|
62
|
-
* ````javascript
|
63
|
-
* var viewMatrix = camera.viewMatrix;
|
64
|
-
* var viewNormalMatrix = camera.normalMatrix;
|
65
|
-
* ````
|
66
|
-
*
|
67
|
-
* The Camera's view normal matrix transforms normal vectors from World-space to View-space.
|
68
|
-
*
|
69
|
-
* Getting the view normal matrix:
|
70
|
-
*
|
71
|
-
* ````javascript
|
72
|
-
* var viewNormalMatrix = camera.normalMatrix;
|
73
|
-
* ````
|
74
|
-
*
|
75
|
-
* The Camera fires a ````"viewMatrix"```` event whenever the {@link Camera#viewMatrix} and {@link Camera#viewNormalMatrix} updates.
|
76
|
-
*
|
77
|
-
* Listen for view matrix updates:
|
78
|
-
*
|
79
|
-
* ````javascript
|
80
|
-
* camera.on("viewMatrix", function(matrix) { ... });
|
81
|
-
* ````
|
82
|
-
*
|
83
|
-
* ## Rotating the Camera
|
84
|
-
*
|
85
|
-
* Orbiting the {@link Camera#look} position:
|
86
|
-
*
|
87
|
-
* ````javascript
|
88
|
-
* camera.orbitYaw(20.0);
|
89
|
-
* camera.orbitPitch(10.0);
|
90
|
-
* ````
|
91
|
-
*
|
92
|
-
* First-person rotation, rotates {@link Camera#look} and {@link Camera#up} about {@link Camera#eye}:
|
93
|
-
*
|
94
|
-
* ````javascript
|
95
|
-
* camera.yaw(5.0);
|
96
|
-
* camera.pitch(-10.0);
|
97
|
-
* ````
|
98
|
-
*
|
99
|
-
* ## Panning the Camera
|
100
|
-
*
|
101
|
-
* Panning along the Camera's local axis (ie. left/right, up/down, forward/backward):
|
102
|
-
*
|
103
|
-
* ````javascript
|
104
|
-
* camera.pan([-20, 0, 10]);
|
105
|
-
* ````
|
106
|
-
*
|
107
|
-
* ## Zooming the Camera
|
108
|
-
*
|
109
|
-
* Zoom to vary distance between {@link Camera#eye} and {@link Camera#look}:
|
110
|
-
*
|
111
|
-
* ````javascript
|
112
|
-
* camera.zoom(-5); // Move five units closer
|
113
|
-
* ````
|
114
|
-
*
|
115
|
-
* Get the current distance between {@link Camera#eye} and {@link Camera#look}:
|
116
|
-
*
|
117
|
-
* ````javascript
|
118
|
-
* var distance = camera.eyeLookDist;
|
119
|
-
* ````
|
120
|
-
*
|
121
|
-
* ## Projection
|
122
|
-
*
|
123
|
-
* The Camera has a Component to manage each projection type, which are: {@link Perspective}, {@link Ortho}
|
124
|
-
* and {@link Frustum} and {@link CustomProjection}.
|
125
|
-
*
|
126
|
-
* You can configure those components at any time, regardless of which is currently active:
|
127
|
-
*
|
128
|
-
* The Camera has a {@link Perspective} to manage perspective
|
129
|
-
* ````javascript
|
130
|
-
*
|
131
|
-
* // Set some properties on Perspective
|
132
|
-
* camera.perspective.near = 0.4;
|
133
|
-
* camera.perspective.fov = 45;
|
134
|
-
*
|
135
|
-
* // Set some properties on Ortho
|
136
|
-
* camera.ortho.near = 0.8;
|
137
|
-
* camera.ortho.far = 1000;
|
138
|
-
*
|
139
|
-
* // Set some properties on Frustum
|
140
|
-
* camera.frustum.left = -1.0;
|
141
|
-
* camera.frustum.right = 1.0;
|
142
|
-
* camera.frustum.far = 1000.0;
|
143
|
-
*
|
144
|
-
* // Set the matrix property on CustomProjection
|
145
|
-
* camera.customProjection.matrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
146
|
-
*
|
147
|
-
* // Switch between the projection types
|
148
|
-
* camera.projection = "perspective"; // Switch to perspective
|
149
|
-
* camera.projection = "frustum"; // Switch to frustum
|
150
|
-
* camera.projection = "ortho"; // Switch to ortho
|
151
|
-
* camera.projection = "customProjection"; // Switch to custom
|
152
|
-
* ````
|
153
|
-
*
|
154
|
-
* Camera provides the projection matrix for the currently active projection in {@link Camera#projMatrix}.
|
155
|
-
*
|
156
|
-
* Get the projection matrix:
|
157
|
-
*
|
158
|
-
* ````javascript
|
159
|
-
* var projMatrix = camera.projMatrix;
|
160
|
-
* ````
|
161
|
-
*
|
162
|
-
* Listen for projection matrix updates:
|
163
|
-
*
|
164
|
-
* ````javascript
|
165
|
-
* camera.on("projMatrix", function(matrix) { ... });
|
166
|
-
* ````
|
167
|
-
*
|
168
|
-
* ## Configuring World up direction
|
169
|
-
*
|
170
|
-
* We can dynamically configure the directions of the World-space coordinate system.
|
171
|
-
*
|
172
|
-
* Setting the +Y axis as World "up", +X as right and -Z as forwards (convention in some modeling software):
|
173
|
-
*
|
174
|
-
* ````javascript
|
175
|
-
* camera.worldAxis = [
|
176
|
-
* 1, 0, 0, // Right
|
177
|
-
* 0, 1, 0, // Up
|
178
|
-
* 0, 0,-1 // Forward
|
179
|
-
* ];
|
180
|
-
* ````
|
181
|
-
*
|
182
|
-
* Setting the +Z axis as World "up", +X as right and -Y as "up" (convention in most CAD and BIM viewers):
|
183
|
-
*
|
184
|
-
* ````javascript
|
185
|
-
* camera.worldAxis = [
|
186
|
-
* 1, 0, 0, // Right
|
187
|
-
* 0, 0, 1, // Up
|
188
|
-
* 0,-1, 0 // Forward
|
189
|
-
* ];
|
190
|
-
* ````
|
191
|
-
*
|
192
|
-
* The Camera has read-only convenience properties that provide each axis individually:
|
193
|
-
*
|
194
|
-
* ````javascript
|
195
|
-
* var worldRight = camera.worldRight;
|
196
|
-
* var worldForward = camera.worldForward;
|
197
|
-
* var worldUp = camera.worldUp;
|
198
|
-
* ````
|
199
|
-
*
|
200
|
-
* ### Gimbal locking
|
201
|
-
*
|
202
|
-
* By default, the Camera locks yaw rotation to pivot about the World-space "up" axis. We can dynamically lock and unlock that at any time:
|
203
|
-
*
|
204
|
-
* ````javascript
|
205
|
-
* camera.gimbalLock = false; // Yaw rotation now happens about Camera's local Y-axis
|
206
|
-
* camera.gimbalLock = true; // Yaw rotation now happens about World's "up" axis
|
207
|
-
* ````
|
208
|
-
*
|
209
|
-
* See: <a href="https://en.wikipedia.org/wiki/Gimbal_lock">https://en.wikipedia.org/wiki/Gimbal_lock</a>
|
210
|
-
*/
|
211
|
-
class Camera extends Component {
|
212
|
-
|
213
|
-
/**
|
214
|
-
@private
|
215
|
-
*/
|
216
|
-
get type() {
|
217
|
-
return "Camera";
|
218
|
-
}
|
219
|
-
|
220
|
-
/**
|
221
|
-
* @constructor
|
222
|
-
* @private
|
223
|
-
*/
|
224
|
-
constructor(owner, cfg = {}) {
|
225
|
-
|
226
|
-
super(owner, cfg);
|
227
|
-
|
228
|
-
this._state = new RenderState({
|
229
|
-
deviceMatrix: math.mat4(),
|
230
|
-
hasDeviceMatrix: false, // True when deviceMatrix set to other than identity
|
231
|
-
matrix: math.mat4(),
|
232
|
-
normalMatrix: math.mat4(),
|
233
|
-
inverseMatrix: math.mat4()
|
234
|
-
});
|
235
|
-
|
236
|
-
this._perspective = new Perspective(this);
|
237
|
-
this._ortho = new Ortho(this);
|
238
|
-
this._frustum = new Frustum(this);
|
239
|
-
this._customProjection = new CustomProjection(this);
|
240
|
-
this._project = this._perspective;
|
241
|
-
|
242
|
-
this._eye = math.vec3([0, 0, 10.0]);
|
243
|
-
this._look = math.vec3([0, 0, 0]);
|
244
|
-
this._up = math.vec3([0, 1, 0]);
|
245
|
-
|
246
|
-
this._worldUp = math.vec3([ 0, 1, 0,]);
|
247
|
-
this._worldRight = math.vec3([1, 0, 0,]);
|
248
|
-
this._worldForward = math.vec3([0, 0,-1]);
|
249
|
-
|
250
|
-
this.deviceMatrix = cfg.deviceMatrix;
|
251
|
-
this.eye = cfg.eye;
|
252
|
-
this.look = cfg.look;
|
253
|
-
this.up = cfg.up;
|
254
|
-
this.worldAxis = cfg.worldAxis;
|
255
|
-
this.gimbalLock = cfg.gimbalLock;
|
256
|
-
this.constrainPitch = cfg.constrainPitch;
|
257
|
-
|
258
|
-
this.projection = cfg.projection;
|
259
|
-
|
260
|
-
this._perspective.on("matrix", () => {
|
261
|
-
if (this._projectionType === "perspective") {
|
262
|
-
this.fire("projMatrix", this._perspective.matrix);
|
263
|
-
}
|
264
|
-
});
|
265
|
-
this._ortho.on("matrix", () => {
|
266
|
-
if (this._projectionType === "ortho") {
|
267
|
-
this.fire("projMatrix", this._ortho.matrix);
|
268
|
-
}
|
269
|
-
});
|
270
|
-
this._frustum.on("matrix", () => {
|
271
|
-
if (this._projectionType === "frustum") {
|
272
|
-
this.fire("projMatrix", this._frustum.matrix);
|
273
|
-
}
|
274
|
-
});
|
275
|
-
this._customProjection.on("matrix", () => {
|
276
|
-
if (this._projectionType === "customProjection") {
|
277
|
-
this.fire("projMatrix", this._customProjection.matrix);
|
278
|
-
}
|
279
|
-
});
|
280
|
-
}
|
281
|
-
|
282
|
-
_update() {
|
283
|
-
const state = this._state;
|
284
|
-
// In ortho mode, build the view matrix with an eye position that's translated
|
285
|
-
// well back from look, so that the front sectionPlane plane doesn't unexpectedly cut
|
286
|
-
// the front off the view (not a problem with perspective, since objects close enough
|
287
|
-
// to be clipped by the front plane are usually too big to see anything of their cross-sections).
|
288
|
-
let eye;
|
289
|
-
if (this.projection === "ortho") {
|
290
|
-
math.subVec3(this._eye, this._look, eyeLookVec);
|
291
|
-
math.normalizeVec3(eyeLookVec, eyeLookVecNorm);
|
292
|
-
math.mulVec3Scalar(eyeLookVecNorm, 1000.0, eyeLookOffset);
|
293
|
-
math.addVec3(this._look, eyeLookOffset, offsetEye);
|
294
|
-
eye = offsetEye;
|
295
|
-
} else {
|
296
|
-
eye = this._eye;
|
297
|
-
}
|
298
|
-
if (state.hasDeviceMatrix) {
|
299
|
-
math.lookAtMat4v(eye, this._look, this._up, tempMatb);
|
300
|
-
math.mulMat4(state.deviceMatrix, tempMatb, state.matrix);
|
301
|
-
//state.matrix.set(state.deviceMatrix);
|
302
|
-
} else {
|
303
|
-
math.lookAtMat4v(eye, this._look, this._up, state.matrix);
|
304
|
-
}
|
305
|
-
math.inverseMat4(this._state.matrix, this._state.inverseMatrix);
|
306
|
-
math.transposeMat4(this._state.inverseMatrix, this._state.normalMatrix);
|
307
|
-
this.glRedraw();
|
308
|
-
this.fire("matrix", this._state.matrix);
|
309
|
-
this.fire("viewMatrix", this._state.matrix);
|
310
|
-
}
|
311
|
-
|
312
|
-
/**
|
313
|
-
* Rotates {@link Camera#eye} about {@link Camera#look}, around the {@link Camera#up} vector
|
314
|
-
*
|
315
|
-
* @param {Number} angleInc Angle of rotation in degrees
|
316
|
-
*/
|
317
|
-
orbitYaw(angleInc) {
|
318
|
-
let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3);
|
319
|
-
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
320
|
-
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b);
|
321
|
-
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c); // Set eye position as 'look' plus 'eye' vector
|
322
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3d); // Rotate 'up' vector
|
323
|
-
}
|
324
|
-
|
325
|
-
/**
|
326
|
-
* Rotates {@link Camera#eye} about {@link Camera#look} around the right axis (orthogonal to {@link Camera#up} and "look").
|
327
|
-
*
|
328
|
-
* @param {Number} angleInc Angle of rotation in degrees
|
329
|
-
*/
|
330
|
-
orbitPitch(angleInc) {
|
331
|
-
if (this._constrainPitch) {
|
332
|
-
angleInc = math.dotVec3(this._up, this._worldUp) / math.DEGTORAD;
|
333
|
-
if (angleInc < 1) {
|
334
|
-
return;
|
335
|
-
}
|
336
|
-
}
|
337
|
-
let eye2 = math.subVec3(this._eye, this._look, tempVec3);
|
338
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b), math.normalizeVec3(this._up, tempVec3c));
|
339
|
-
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
340
|
-
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d);
|
341
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3e);
|
342
|
-
this.eye = math.addVec3(eye2, this._look, tempVec3f);
|
343
|
-
}
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Rotates {@link Camera#look} about {@link Camera#eye}, around the {@link Camera#up} vector.
|
347
|
-
*
|
348
|
-
* @param {Number} angleInc Angle of rotation in degrees
|
349
|
-
*/
|
350
|
-
yaw(angleInc) {
|
351
|
-
let look2 = math.subVec3(this._look, this._eye, tempVec3);
|
352
|
-
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
353
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3b);
|
354
|
-
this.look = math.addVec3(look2, this._eye, tempVec3c);
|
355
|
-
if (this._gimbalLock) {
|
356
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3d);
|
357
|
-
}
|
358
|
-
}
|
359
|
-
|
360
|
-
/**
|
361
|
-
* Rotates {@link Camera#look} about {@link Camera#eye}, around the right axis (orthogonal to {@link Camera#up} and "look").
|
362
|
-
|
363
|
-
* @param {Number} angleInc Angle of rotation in degrees
|
364
|
-
*/
|
365
|
-
pitch(angleInc) {
|
366
|
-
if (this._constrainPitch) {
|
367
|
-
angleInc = math.dotVec3(this._up, this._worldUp) / math.DEGTORAD;
|
368
|
-
if (angleInc < 1) {
|
369
|
-
return;
|
370
|
-
}
|
371
|
-
}
|
372
|
-
let look2 = math.subVec3(this._look, this._eye, tempVec3);
|
373
|
-
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b), math.normalizeVec3(this._up, tempVec3c));
|
374
|
-
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
375
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3f);
|
376
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3d);
|
377
|
-
this.look = math.addVec3(look2, this._eye, tempVec3e);
|
378
|
-
}
|
379
|
-
|
380
|
-
/**
|
381
|
-
* Pans the Camera along its local X, Y and Z axis.
|
382
|
-
*
|
383
|
-
* @param pan The pan vector
|
384
|
-
*/
|
385
|
-
pan(pan) {
|
386
|
-
const eye2 = math.subVec3(this._eye, this._look, tempVec3);
|
387
|
-
const vec = [0, 0, 0];
|
388
|
-
let v;
|
389
|
-
if (pan[0] !== 0) {
|
390
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b));
|
391
|
-
v = math.mulVec3Scalar(left, pan[0]);
|
392
|
-
vec[0] += v[0];
|
393
|
-
vec[1] += v[1];
|
394
|
-
vec[2] += v[2];
|
395
|
-
}
|
396
|
-
if (pan[1] !== 0) {
|
397
|
-
v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c), pan[1]);
|
398
|
-
vec[0] += v[0];
|
399
|
-
vec[1] += v[1];
|
400
|
-
vec[2] += v[2];
|
401
|
-
}
|
402
|
-
if (pan[2] !== 0) {
|
403
|
-
v = math.mulVec3Scalar(math.normalizeVec3(eye2, tempVec3d), pan[2]);
|
404
|
-
vec[0] += v[0];
|
405
|
-
vec[1] += v[1];
|
406
|
-
vec[2] += v[2];
|
407
|
-
}
|
408
|
-
this.eye = math.addVec3(this._eye, vec, tempVec3e);
|
409
|
-
this.look = math.addVec3(this._look, vec, tempVec3f);
|
410
|
-
}
|
411
|
-
|
412
|
-
/**
|
413
|
-
* Increments/decrements the Camera's zoom factor, which is the distance between {@link Camera#eye} and {@link Camera#look}.
|
414
|
-
*
|
415
|
-
* @param {Number} delta Zoom factor increment.
|
416
|
-
*/
|
417
|
-
zoom(delta) {
|
418
|
-
const vec = math.subVec3(this._eye, this._look, tempVec3);
|
419
|
-
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b));
|
420
|
-
const newLenLook = Math.abs(lenLook + delta);
|
421
|
-
if (newLenLook < 0.5) {
|
422
|
-
return;
|
423
|
-
}
|
424
|
-
const dir = math.normalizeVec3(vec, tempVec3c);
|
425
|
-
this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d);
|
426
|
-
}
|
427
|
-
|
428
|
-
/**
|
429
|
-
* Sets the position of the Camera's eye.
|
430
|
-
*
|
431
|
-
* Default value is ````[0,0,10]````.
|
432
|
-
*
|
433
|
-
* @emits "eye" event on change, with the value of this property.
|
434
|
-
* @type {Number[]} New eye position.
|
435
|
-
*/
|
436
|
-
set eye(eye) {
|
437
|
-
this._eye.set(eye || [0, 0, 10]);
|
438
|
-
this._needUpdate(0); // Ensure matrix built on next "tick"
|
439
|
-
this.fire("eye", this._eye);
|
440
|
-
}
|
441
|
-
|
442
|
-
/**
|
443
|
-
* Gets the position of the Camera's eye.
|
444
|
-
*
|
445
|
-
* Default vale is ````[0,0,10]````.
|
446
|
-
*
|
447
|
-
* @type {Number[]} New eye position.
|
448
|
-
*/
|
449
|
-
get eye() {
|
450
|
-
return this._eye;
|
451
|
-
}
|
452
|
-
|
453
|
-
/**
|
454
|
-
* Sets the position of this Camera's point-of-interest.
|
455
|
-
*
|
456
|
-
* Default value is ````[0,0,0]````.
|
457
|
-
*
|
458
|
-
* @emits "look" event on change, with the value of this property.
|
459
|
-
*
|
460
|
-
* @param {Number[]} look Camera look position.
|
461
|
-
*/
|
462
|
-
set look(look) {
|
463
|
-
this._look.set(look || [0, 0, 0]);
|
464
|
-
this._needUpdate(0); // Ensure matrix built on next "tick"
|
465
|
-
this.fire("look", this._look);
|
466
|
-
}
|
467
|
-
|
468
|
-
/**
|
469
|
-
* Gets the position of this Camera's point-of-interest.
|
470
|
-
*
|
471
|
-
* Default value is ````[0,0,0]````.
|
472
|
-
*
|
473
|
-
* @returns {Number[]} Camera look position.
|
474
|
-
*/
|
475
|
-
get look() {
|
476
|
-
return this._look;
|
477
|
-
}
|
478
|
-
|
479
|
-
/**
|
480
|
-
* Sets the direction of this Camera's {@link Camera#up} vector.
|
481
|
-
*
|
482
|
-
* @emits "up" event on change, with the value of this property.
|
483
|
-
*
|
484
|
-
* @param {Number[]} up Direction of "up".
|
485
|
-
*/
|
486
|
-
set up(up) {
|
487
|
-
this._up.set(up || [0, 1, 0]);
|
488
|
-
this._needUpdate(0);
|
489
|
-
this.fire("up", this._up);
|
490
|
-
}
|
491
|
-
|
492
|
-
/**
|
493
|
-
* Gets the direction of this Camera's {@link Camera#up} vector.
|
494
|
-
*
|
495
|
-
* @returns {Number[]} Direction of "up".
|
496
|
-
*/
|
497
|
-
get up() {
|
498
|
-
return this._up;
|
499
|
-
}
|
500
|
-
|
501
|
-
/**
|
502
|
-
* Sets an optional matrix to premultiply into {@link Camera#matrix} matrix.
|
503
|
-
*
|
504
|
-
* This is intended to be used for stereo rendering with WebVR etc.
|
505
|
-
*
|
506
|
-
* @param {Number[]} matrix The matrix.
|
507
|
-
*/
|
508
|
-
set deviceMatrix(matrix) {
|
509
|
-
this._state.deviceMatrix.set(matrix || [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
510
|
-
this._state.hasDeviceMatrix = !!matrix;
|
511
|
-
this._needUpdate(0);
|
512
|
-
this.fire("deviceMatrix", this._state.deviceMatrix);
|
513
|
-
}
|
514
|
-
|
515
|
-
/**
|
516
|
-
* Gets an optional matrix to premultiply into {@link Camera#matrix} matrix.
|
517
|
-
*
|
518
|
-
* @returns {Number[]} The matrix.
|
519
|
-
*/
|
520
|
-
get deviceMatrix() {
|
521
|
-
return this._state.deviceMatrix;
|
522
|
-
}
|
523
|
-
|
524
|
-
/**
|
525
|
-
* Sets the up, right and forward axis of the World coordinate system.
|
526
|
-
*
|
527
|
-
* Has format: ````[rightX, rightY, rightZ, upX, upY, upZ, forwardX, forwardY, forwardZ]````
|
528
|
-
*
|
529
|
-
* Default axis is ````[1, 0, 0, 0, 1, 0, 0, 0, 1]````
|
530
|
-
*
|
531
|
-
* @param {Number[]} axis The new Wworld coordinate axis.
|
532
|
-
*/
|
533
|
-
set worldAxis(axis) {
|
534
|
-
axis = axis || [1, 0, 0, 0, 1, 0, 0, 0, 1];
|
535
|
-
if (!this._worldAxis) {
|
536
|
-
this._worldAxis = math.vec3(axis);
|
537
|
-
} else {
|
538
|
-
this._worldAxis.set(axis);
|
539
|
-
}
|
540
|
-
this._worldRight[0] = this._worldAxis[0];
|
541
|
-
this._worldRight[1] = this._worldAxis[1];
|
542
|
-
this._worldRight[2] = this._worldAxis[2];
|
543
|
-
this._worldUp[0] = this._worldAxis[3];
|
544
|
-
this._worldUp[1] = this._worldAxis[4];
|
545
|
-
this._worldUp[2] = this._worldAxis[5];
|
546
|
-
this._worldForward[0] = this._worldAxis[6];
|
547
|
-
this._worldForward[1] = this._worldAxis[7];
|
548
|
-
this._worldForward[2] = this._worldAxis[8];
|
549
|
-
this.fire("worldAxis", this._worldAxis);
|
550
|
-
}
|
551
|
-
|
552
|
-
/**
|
553
|
-
* Gets the up, right and forward axis of the World coordinate system.
|
554
|
-
*
|
555
|
-
* Has format: ````[rightX, rightY, rightZ, upX, upY, upZ, forwardX, forwardY, forwardZ]````
|
556
|
-
*
|
557
|
-
* Default axis is ````[1, 0, 0, 0, 1, 0, 0, 0, 1]````
|
558
|
-
*
|
559
|
-
* @returns {Number[]} The current World coordinate axis.
|
560
|
-
*/
|
561
|
-
get worldAxis() {
|
562
|
-
return this._worldAxis;
|
563
|
-
}
|
564
|
-
|
565
|
-
/**
|
566
|
-
* Gets the direction of World-space "up".
|
567
|
-
*
|
568
|
-
* This is set by {@link Camera#worldAxis}.
|
569
|
-
*
|
570
|
-
* Default value is ````[0,1,0]````.
|
571
|
-
*
|
572
|
-
* @returns {Number[]} The "up" vector.
|
573
|
-
*/
|
574
|
-
get worldUp() {
|
575
|
-
return this._worldUp;
|
576
|
-
}
|
577
|
-
|
578
|
-
/**
|
579
|
-
* Gets if the World-space X-axis is "up".
|
580
|
-
* @returns {boolean}
|
581
|
-
*/
|
582
|
-
get xUp() {
|
583
|
-
return this._worldUp[0] > this._worldUp[1] && this._worldUp[0] > this._worldUp[2];
|
584
|
-
}
|
585
|
-
|
586
|
-
/**
|
587
|
-
* Gets if the World-space Y-axis is "up".
|
588
|
-
* @returns {boolean}
|
589
|
-
*/
|
590
|
-
get yUp() {
|
591
|
-
return this._worldUp[1] > this._worldUp[0] && this._worldUp[1] > this._worldUp[2];
|
592
|
-
}
|
593
|
-
|
594
|
-
/**
|
595
|
-
* Gets if the World-space Z-axis is "up".
|
596
|
-
* @returns {boolean}
|
597
|
-
*/
|
598
|
-
get zUp() {
|
599
|
-
return this._worldUp[2] > this._worldUp[0] && this._worldUp[2] > this._worldUp[1];
|
600
|
-
}
|
601
|
-
|
602
|
-
/**
|
603
|
-
* Gets the direction of World-space "right".
|
604
|
-
*
|
605
|
-
* This is set by {@link Camera#worldAxis}.
|
606
|
-
*
|
607
|
-
* Default value is ````[1,0,0]````.
|
608
|
-
*
|
609
|
-
* @returns {Number[]} The "up" vector.
|
610
|
-
*/
|
611
|
-
get worldRight() {
|
612
|
-
return this._worldRight;
|
613
|
-
}
|
614
|
-
|
615
|
-
/**
|
616
|
-
* Gets the direction of World-space "forwards".
|
617
|
-
*
|
618
|
-
* This is set by {@link Camera#worldAxis}.
|
619
|
-
*
|
620
|
-
* Default value is ````[0,0,1]````.
|
621
|
-
*
|
622
|
-
* @returns {Number[]} The "up" vector.
|
623
|
-
*/
|
624
|
-
get worldForward() {
|
625
|
-
return this._worldForward;
|
626
|
-
}
|
627
|
-
|
628
|
-
/**
|
629
|
-
* Sets whether to lock yaw rotation to pivot about the World-space "up" axis.
|
630
|
-
*
|
631
|
-
* Fires a {@link Camera#gimbalLock:event} event on change.
|
632
|
-
*
|
633
|
-
* @params {Boolean} gimbalLock Set true to lock gimbal.
|
634
|
-
*/
|
635
|
-
set gimbalLock(value) {
|
636
|
-
this._gimbalLock = value !== false;
|
637
|
-
this.fire("gimbalLock", this._gimbalLock);
|
638
|
-
}
|
639
|
-
|
640
|
-
/**
|
641
|
-
* Gets whether to lock yaw rotation to pivot about the World-space "up" axis.
|
642
|
-
*
|
643
|
-
* @returns {Boolean} Returns ````true```` if gimbal is locked.
|
644
|
-
*/
|
645
|
-
get gimbalLock() {
|
646
|
-
return this._gimbalLock;
|
647
|
-
}
|
648
|
-
|
649
|
-
/**
|
650
|
-
* Sets whether to prevent camera from being pitched upside down.
|
651
|
-
*
|
652
|
-
* The camera is upside down when the angle between {@link Camera#up} and {@link Camera#worldUp} is less than one degree.
|
653
|
-
*
|
654
|
-
* Fires a {@link Camera#constrainPitch:event} event on change.
|
655
|
-
*
|
656
|
-
* Default value is ````false````.
|
657
|
-
*
|
658
|
-
* @param {Boolean} value Set ````true```` to contrain pitch rotation.
|
659
|
-
*/
|
660
|
-
set constrainPitch(value) {
|
661
|
-
this._constrainPitch = !!value;
|
662
|
-
this.fire("constrainPitch", this._constrainPitch);
|
663
|
-
}
|
664
|
-
|
665
|
-
/**
|
666
|
-
* Gets whether to prevent camera from being pitched upside down.
|
667
|
-
*
|
668
|
-
* The camera is upside down when the angle between {@link Camera#up} and {@link Camera#worldUp} is less than one degree.
|
669
|
-
*
|
670
|
-
* Default value is ````false````.
|
671
|
-
*
|
672
|
-
* @returns {Boolean} ````true```` if pitch rotation is currently constrained.
|
673
|
-
get constrainPitch() {
|
674
|
-
return this._constrainPitch;
|
675
|
-
}
|
676
|
-
|
677
|
-
/**
|
678
|
-
* Gets distance from {@link Camera#look} to {@link Camera#eye}.
|
679
|
-
*
|
680
|
-
* @returns {Number} The distance.
|
681
|
-
*/
|
682
|
-
get eyeLookDist() {
|
683
|
-
return math.lenVec3(math.subVec3(this._look, this._eye, tempVec3));
|
684
|
-
}
|
685
|
-
|
686
|
-
/**
|
687
|
-
* Gets the Camera's viewing transformation matrix.
|
688
|
-
*
|
689
|
-
* Fires a {@link Camera#matrix:event} event on change.
|
690
|
-
*
|
691
|
-
* @returns {Number[]} The viewing transform matrix.
|
692
|
-
*/
|
693
|
-
get matrix() {
|
694
|
-
if (this._updateScheduled) {
|
695
|
-
this._doUpdate();
|
696
|
-
}
|
697
|
-
return this._state.matrix;
|
698
|
-
}
|
699
|
-
|
700
|
-
/**
|
701
|
-
* Gets the Camera's viewing transformation matrix.
|
702
|
-
*
|
703
|
-
* Fires a {@link Camera#matrix:event} event on change.
|
704
|
-
*
|
705
|
-
* @returns {Number[]} The viewing transform matrix.
|
706
|
-
*/
|
707
|
-
get viewMatrix() {
|
708
|
-
if (this._updateScheduled) {
|
709
|
-
this._doUpdate();
|
710
|
-
}
|
711
|
-
return this._state.matrix;
|
712
|
-
}
|
713
|
-
|
714
|
-
/**
|
715
|
-
* The Camera's viewing normal transformation matrix.
|
716
|
-
*
|
717
|
-
* Fires a {@link Camera#matrix:event} event on change.
|
718
|
-
*
|
719
|
-
* @returns {Number[]} The viewing normal transform matrix.
|
720
|
-
*/
|
721
|
-
get normalMatrix() {
|
722
|
-
if (this._updateScheduled) {
|
723
|
-
this._doUpdate();
|
724
|
-
}
|
725
|
-
return this._state.normalMatrix;
|
726
|
-
}
|
727
|
-
|
728
|
-
/**
|
729
|
-
* The Camera's viewing normal transformation matrix.
|
730
|
-
*
|
731
|
-
* Fires a {@link Camera#matrix:event} event on change.
|
732
|
-
*
|
733
|
-
* @returns {Number[]} The viewing normal transform matrix.
|
734
|
-
*/
|
735
|
-
get viewNormalMatrix() {
|
736
|
-
if (this._updateScheduled) {
|
737
|
-
this._doUpdate();
|
738
|
-
}
|
739
|
-
return this._state.normalMatrix;
|
740
|
-
}
|
741
|
-
|
742
|
-
/**
|
743
|
-
* Gets the inverse of the Camera's viewing transform matrix.
|
744
|
-
*
|
745
|
-
* This has the same value as {@link Camera#normalMatrix}.
|
746
|
-
*
|
747
|
-
* @returns {Number[]} The inverse viewing transform matrix.
|
748
|
-
*/
|
749
|
-
get inverseViewMatrix() {
|
750
|
-
if (this._updateScheduled) {
|
751
|
-
this._doUpdate();
|
752
|
-
}
|
753
|
-
return this._state.inverseMatrix;
|
754
|
-
}
|
755
|
-
|
756
|
-
/**
|
757
|
-
* Gets the Camera's projection transformation projMatrix.
|
758
|
-
*
|
759
|
-
* Fires a {@link Camera#projMatrix:event} event on change.
|
760
|
-
*
|
761
|
-
* @returns {Number[]} The projection matrix.
|
762
|
-
*/
|
763
|
-
get projMatrix() {
|
764
|
-
return this[this.projection].matrix;
|
765
|
-
}
|
766
|
-
|
767
|
-
/**
|
768
|
-
* Gets the Camera's perspective projection.
|
769
|
-
*
|
770
|
-
* The Camera uses this while {@link Camera#projection} equals ````perspective````.
|
771
|
-
*
|
772
|
-
* @returns {Perspective} The Perspective component.
|
773
|
-
*/
|
774
|
-
get perspective() {
|
775
|
-
return this._perspective;
|
776
|
-
}
|
777
|
-
|
778
|
-
/**
|
779
|
-
* Gets the Camera's orthographic projection.
|
780
|
-
*
|
781
|
-
* The Camera uses this while {@link Camera#projection} equals ````ortho````.
|
782
|
-
*
|
783
|
-
* @returns {Ortho} The Ortho component.
|
784
|
-
*/
|
785
|
-
get ortho() {
|
786
|
-
return this._ortho;
|
787
|
-
}
|
788
|
-
|
789
|
-
/**
|
790
|
-
* Gets the Camera's frustum projection.
|
791
|
-
*
|
792
|
-
* The Camera uses this while {@link Camera#projection} equals ````frustum````.
|
793
|
-
*
|
794
|
-
* @returns {Frustum} The Ortho component.
|
795
|
-
*/
|
796
|
-
get frustum() {
|
797
|
-
return this._frustum;
|
798
|
-
}
|
799
|
-
|
800
|
-
/**
|
801
|
-
* Gets the Camera's custom projection.
|
802
|
-
*
|
803
|
-
* This is used while {@link Camera#projection} equals "customProjection".
|
804
|
-
*
|
805
|
-
* @returns {CustomProjection} The custom projection.
|
806
|
-
*/
|
807
|
-
get customProjection() {
|
808
|
-
return this._customProjection;
|
809
|
-
}
|
810
|
-
|
811
|
-
/**
|
812
|
-
* Sets the active projection type.
|
813
|
-
*
|
814
|
-
* Accepted values are ````"perspective"````, ````"ortho"````, ````"frustum"```` and ````"customProjection"````.
|
815
|
-
*
|
816
|
-
* Default value is ````"perspective"````.
|
817
|
-
*
|
818
|
-
* @param {String} value Identifies the active projection type.
|
819
|
-
*/
|
820
|
-
set projection(value) {
|
821
|
-
value = value || "perspective";
|
822
|
-
if (this._projectionType === value) {
|
823
|
-
return;
|
824
|
-
}
|
825
|
-
if (value === "perspective") {
|
826
|
-
this._project = this._perspective;
|
827
|
-
} else if (value === "ortho") {
|
828
|
-
this._project = this._ortho;
|
829
|
-
} else if (value === "frustum") {
|
830
|
-
this._project = this._frustum;
|
831
|
-
} else if (value === "customProjection") {
|
832
|
-
this._project = this._customProjection;
|
833
|
-
} else {
|
834
|
-
this.error("Unsupported value for 'projection': " + value + " defaulting to 'perspective'");
|
835
|
-
this._project = this._perspective;
|
836
|
-
value = "perspective";
|
837
|
-
}
|
838
|
-
this._project._update();
|
839
|
-
this._projectionType = value;
|
840
|
-
this.glRedraw();
|
841
|
-
this._update(); // Need to rebuild lookat matrix with full eye, look & up
|
842
|
-
this.fire("dirty");
|
843
|
-
this.fire("projection", this._projectionType);
|
844
|
-
this.fire("projMatrix", this._project.matrix);
|
845
|
-
}
|
846
|
-
|
847
|
-
/**
|
848
|
-
* Gets the active projection type.
|
849
|
-
*
|
850
|
-
* Possible values are ````"perspective"````, ````"ortho"````, ````"frustum"```` and ````"customProjection"````.
|
851
|
-
*
|
852
|
-
* Default value is ````"perspective"````.
|
853
|
-
*
|
854
|
-
* @returns {String} Identifies the active projection type.
|
855
|
-
*/
|
856
|
-
get projection() {
|
857
|
-
return this._projectionType;
|
858
|
-
}
|
859
|
-
|
860
|
-
/**
|
861
|
-
* Gets the currently active projection for this Camera.
|
862
|
-
*
|
863
|
-
* The currently active project is selected with {@link Camera#projection}.
|
864
|
-
*
|
865
|
-
* @returns {Perspective|Ortho|Frustum|CustomProjection} The currently active projection is active.
|
866
|
-
*/
|
867
|
-
get project() {
|
868
|
-
return this._project;
|
869
|
-
}
|
870
|
-
|
871
|
-
/**
|
872
|
-
* Destroys this Camera.
|
873
|
-
*/
|
874
|
-
destroy() {
|
875
|
-
super.destroy();
|
876
|
-
this._state.destroy();
|
877
|
-
}
|
878
|
-
}
|
879
|
-
|
880
|
-
export {Camera};
|