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,77 +0,0 @@
|
|
1
|
-
import {CubeTexture} from './CubeTexture.js';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @desc A **LightMap** specifies a cube texture light map.
|
5
|
-
*
|
6
|
-
* ## Usage
|
7
|
-
*
|
8
|
-
* ````javascript
|
9
|
-
* import {Viewer, Mesh, buildSphereGeometry,
|
10
|
-
* ReadableGeometry, MetallicMaterial, LightMap} from "yjkkit-sdk.es.js";
|
11
|
-
*
|
12
|
-
* // Create a Viewer and arrange the camera
|
13
|
-
*
|
14
|
-
* const viewer = new Viewer({
|
15
|
-
* canvasId: "myCanvas"
|
16
|
-
* });
|
17
|
-
*
|
18
|
-
* viewer.scene.camera.eye = [0, 0, 5];
|
19
|
-
* viewer.scene.camera.look = [0, 0, 0];
|
20
|
-
* viewer.scene.camera.up = [0, 1, 0];
|
21
|
-
*
|
22
|
-
* new LightMap(viewer.scene, {
|
23
|
-
* src: [
|
24
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PX.png",
|
25
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NX.png",
|
26
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PY.png",
|
27
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NY.png",
|
28
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PZ.png",
|
29
|
-
* "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NZ.png"
|
30
|
-
* ]
|
31
|
-
* });
|
32
|
-
*
|
33
|
-
* // Create a sphere and ground plane
|
34
|
-
*
|
35
|
-
* new Mesh(viewer.scene, {
|
36
|
-
* geometry: new ReadableGeometry(viewer.scene, buildSphereGeometry({
|
37
|
-
* radius: 2.0
|
38
|
-
* }),
|
39
|
-
* new MetallicMaterial(viewer.scene, {
|
40
|
-
* baseColor: [1, 1, 1],
|
41
|
-
* metallic: 1.0,
|
42
|
-
* roughness: 1.0
|
43
|
-
* })
|
44
|
-
* });
|
45
|
-
* ````
|
46
|
-
*/
|
47
|
-
class LightMap extends CubeTexture {
|
48
|
-
|
49
|
-
/**
|
50
|
-
@private
|
51
|
-
*/
|
52
|
-
get type() {
|
53
|
-
return "LightMap";
|
54
|
-
}
|
55
|
-
|
56
|
-
/**
|
57
|
-
* @constructor
|
58
|
-
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
59
|
-
* @param {*} [cfg] Configs
|
60
|
-
* @param {String} [cfg.id] Optional ID for this LightMap, unique among all components in the parent scene, generated automatically when omitted.
|
61
|
-
* @param {String:Object} [cfg.meta] Optional map of user-defined metadata to attach to this LightMap.
|
62
|
-
* @param {String[]} [cfg.src=null] Paths to six image files to load into this LightMap.
|
63
|
-
* @param {Boolean} [cfg.flipY=false] Flips this LightMap's source data along its vertical axis when true.
|
64
|
-
* @param {String} [cfg.encoding="linear"] Encoding format. See the {@link LightMap#encoding} property for more info.
|
65
|
-
*/
|
66
|
-
constructor(owner, cfg = {}) {
|
67
|
-
super(owner, cfg);
|
68
|
-
this.scene._lightMapCreated(this);
|
69
|
-
}
|
70
|
-
|
71
|
-
destroy() {
|
72
|
-
super.destroy();
|
73
|
-
this.scene._lightMapDestroyed(this);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
export {LightMap};
|
@@ -1,395 +0,0 @@
|
|
1
|
-
import {Light} from './Light.js';
|
2
|
-
import {RenderState} from '../webgl/RenderState.js';
|
3
|
-
import {RenderBuffer} from '../webgl/RenderBuffer.js';
|
4
|
-
import {math} from '../math/math.js';
|
5
|
-
|
6
|
-
/**
|
7
|
-
* A positional light source that originates from a single point and spreads outward in all directions, with optional attenuation over distance.
|
8
|
-
*
|
9
|
-
* * Has a position in {@link PointLight#pos}, but no direction.
|
10
|
-
* * Defined in either *World* or *View* coordinate space. When in World-space, {@link PointLight#pos} is relative to
|
11
|
-
* the World coordinate system, and will appear to move as the {@link Camera} moves. When in View-space,
|
12
|
-
* {@link PointLight#pos} is relative to the View coordinate system, and will behave as if fixed to the viewer's head.
|
13
|
-
* * Has {@link PointLight#constantAttenuation}, {@link PointLight#linearAttenuation} and {@link PointLight#quadraticAttenuation}
|
14
|
-
* factors, which indicate how intensity attenuates over distance.
|
15
|
-
* * {@link AmbientLight}s, {@link PointLight}s and {@link PointLight}s are registered by their {@link Component#id} on {@link Scene#lights}.
|
16
|
-
*
|
17
|
-
* ## Usage
|
18
|
-
*
|
19
|
-
* In the example below we'll replace the {@link Scene}'s default light sources with three World-space PointLights.
|
20
|
-
*
|
21
|
-
* [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#lights_PointLight_world)]
|
22
|
-
*
|
23
|
-
* ````javascript
|
24
|
-
* import {Viewer, Mesh, buildSphereGeometry, buildPlaneGeometry,
|
25
|
-
* ReadableGeometry, PhongMaterial, Texture, PointLight} from "yjkkit-sdk.es.js";
|
26
|
-
*
|
27
|
-
* // Create a Viewer and arrange the camera
|
28
|
-
*
|
29
|
-
* const viewer = new Viewer({
|
30
|
-
* canvasId: "myCanvas"
|
31
|
-
* });
|
32
|
-
*
|
33
|
-
* viewer.scene.camera.eye = [0, 0, 5];
|
34
|
-
* viewer.scene.camera.look = [0, 0, 0];
|
35
|
-
* viewer.scene.camera.up = [0, 1, 0];
|
36
|
-
*
|
37
|
-
* // Replace the Scene's default lights with three custom world-space PointLights
|
38
|
-
*
|
39
|
-
* viewer.scene.clearLights();
|
40
|
-
*
|
41
|
-
* new PointLight(viewer.scene,{
|
42
|
-
* id: "keyLight",
|
43
|
-
* pos: [-80, 60, 80],
|
44
|
-
* color: [1.0, 0.3, 0.3],
|
45
|
-
* intensity: 1.0,
|
46
|
-
* space: "world"
|
47
|
-
* });
|
48
|
-
*
|
49
|
-
* new PointLight(viewer.scene,{
|
50
|
-
* id: "fillLight",
|
51
|
-
* pos: [80, 40, 40],
|
52
|
-
* color: [0.3, 1.0, 0.3],
|
53
|
-
* intensity: 1.0,
|
54
|
-
* space: "world"
|
55
|
-
* });
|
56
|
-
*
|
57
|
-
* new PointLight(viewer.scene,{
|
58
|
-
* id: "rimLight",
|
59
|
-
* pos: [-20, 80, -80],
|
60
|
-
* color: [0.6, 0.6, 0.6],
|
61
|
-
* intensity: 1.0,
|
62
|
-
* space: "world"
|
63
|
-
* });
|
64
|
-
*
|
65
|
-
* // Create a sphere and ground plane
|
66
|
-
*
|
67
|
-
* new Mesh(viewer.scene, {
|
68
|
-
* geometry: new ReadableGeometry(viewer.scene, buildSphereGeometry({
|
69
|
-
* radius: 1.3
|
70
|
-
* }),
|
71
|
-
* material: new PhongMaterial(viewer.scene, {
|
72
|
-
* diffuse: [0.7, 0.7, 0.7],
|
73
|
-
* specular: [1.0, 1.0, 1.0],
|
74
|
-
* emissive: [0, 0, 0],
|
75
|
-
* alpha: 1.0,
|
76
|
-
* ambient: [1, 1, 0],
|
77
|
-
* diffuseMap: new Texture(viewer.scene, {
|
78
|
-
* src: "textures/diffuse/uvGrid2.jpg"
|
79
|
-
* })
|
80
|
-
* })
|
81
|
-
* });
|
82
|
-
*
|
83
|
-
* new Mesh(viewer.scene, {
|
84
|
-
* geometry: buildPlaneGeometry(ReadableGeometry, viewer.scene, {
|
85
|
-
* xSize: 30,
|
86
|
-
* zSize: 30
|
87
|
-
* }),
|
88
|
-
* material: new PhongMaterial(viewer.scene, {
|
89
|
-
* diffuseMap: new Texture(viewer.scene, {
|
90
|
-
* src: "textures/diffuse/uvGrid2.jpg"
|
91
|
-
* }),
|
92
|
-
* backfaces: true
|
93
|
-
* }),
|
94
|
-
* position: [0, -2.1, 0]
|
95
|
-
* });
|
96
|
-
* ````
|
97
|
-
*/
|
98
|
-
class PointLight extends Light {
|
99
|
-
|
100
|
-
/**
|
101
|
-
@private
|
102
|
-
*/
|
103
|
-
get type() {
|
104
|
-
return "PointLight";
|
105
|
-
}
|
106
|
-
|
107
|
-
/**
|
108
|
-
* @param {Component} owner Owner component. When destroyed, the owner will destroy this PointLight as well.
|
109
|
-
* @param {*} [cfg] The PointLight configuration
|
110
|
-
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
111
|
-
* @param {Number[]} [cfg.pos=[ 1.0, 1.0, 1.0 ]] Position, in either World or View space, depending on the value of the **space** parameter.
|
112
|
-
* @param {Number[]} [cfg.color=[0.7, 0.7, 0.8 ]] Color of this PointLight.
|
113
|
-
* @param {Number} [cfg.intensity=1.0] Intensity of this PointLight, as a factor in range ````[0..1]````.
|
114
|
-
* @param {Number} [cfg.constantAttenuation=0] Constant attenuation factor.
|
115
|
-
* @param {Number} [cfg.linearAttenuation=0] Linear attenuation factor.
|
116
|
-
* @param {Number} [cfg.quadraticAttenuation=0]Quadratic attenuation factor.
|
117
|
-
* @param {String} [cfg.space="view"]The coordinate system this PointLight is defined in - "view" or "world".
|
118
|
-
* @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this PointLight casts a castsShadow.
|
119
|
-
*/
|
120
|
-
constructor(owner, cfg = {}) {
|
121
|
-
|
122
|
-
super(owner, cfg);
|
123
|
-
|
124
|
-
const self = this;
|
125
|
-
|
126
|
-
this._shadowRenderBuf = null;
|
127
|
-
this._shadowViewMatrix = null;
|
128
|
-
this._shadowProjMatrix = null;
|
129
|
-
this._shadowViewMatrixDirty = true;
|
130
|
-
this._shadowProjMatrixDirty = true;
|
131
|
-
|
132
|
-
const camera = this.scene.camera;
|
133
|
-
const canvas = this.scene.canvas;
|
134
|
-
|
135
|
-
this._onCameraViewMatrix = camera.on("viewMatrix", () => {
|
136
|
-
this._shadowViewMatrixDirty = true;
|
137
|
-
});
|
138
|
-
|
139
|
-
this._onCameraProjMatrix = camera.on("projMatrix", () => {
|
140
|
-
this._shadowProjMatrixDirty = true;
|
141
|
-
});
|
142
|
-
|
143
|
-
this._onCanvasBoundary = canvas.on("boundary", () => {
|
144
|
-
this._shadowProjMatrixDirty = true;
|
145
|
-
});
|
146
|
-
|
147
|
-
this._state = new RenderState({
|
148
|
-
|
149
|
-
type: "point",
|
150
|
-
pos: math.vec3([1.0, 1.0, 1.0]),
|
151
|
-
color: math.vec3([0.7, 0.7, 0.8]),
|
152
|
-
intensity: 1.0, attenuation: [0.0, 0.0, 0.0],
|
153
|
-
space: cfg.space || "view",
|
154
|
-
castsShadow: false,
|
155
|
-
|
156
|
-
getShadowViewMatrix: () => {
|
157
|
-
if (self._shadowViewMatrixDirty) {
|
158
|
-
if (!self._shadowViewMatrix) {
|
159
|
-
self._shadowViewMatrix = math.identityMat4();
|
160
|
-
}
|
161
|
-
const eye = self._state.pos;
|
162
|
-
const look = camera.look;
|
163
|
-
const up = camera.up;
|
164
|
-
math.lookAtMat4v(eye, look, up, self._shadowViewMatrix);
|
165
|
-
self._shadowViewMatrixDirty = false;
|
166
|
-
}
|
167
|
-
return self._shadowViewMatrix;
|
168
|
-
},
|
169
|
-
|
170
|
-
getShadowProjMatrix: () => {
|
171
|
-
if (self._shadowProjMatrixDirty) { // TODO: Set when canvas resizes
|
172
|
-
if (!self._shadowProjMatrix) {
|
173
|
-
self._shadowProjMatrix = math.identityMat4();
|
174
|
-
}
|
175
|
-
const canvas = self.scene.canvas.canvas;
|
176
|
-
math.perspectiveMat4(70 * (Math.PI / 180.0), canvas.clientWidth / canvas.clientHeight, 0.1, 500.0, self._shadowProjMatrix);
|
177
|
-
self._shadowProjMatrixDirty = false;
|
178
|
-
}
|
179
|
-
return self._shadowProjMatrix;
|
180
|
-
},
|
181
|
-
|
182
|
-
getShadowRenderBuf: () => {
|
183
|
-
if (!self._shadowRenderBuf) {
|
184
|
-
self._shadowRenderBuf = new RenderBuffer(self.scene.canvas.canvas, self.scene.canvas.gl, {size: [1024, 1024]}); // Super old mobile devices have a limit of 1024x1024 textures
|
185
|
-
}
|
186
|
-
return self._shadowRenderBuf;
|
187
|
-
}
|
188
|
-
});
|
189
|
-
|
190
|
-
this.pos = cfg.pos;
|
191
|
-
this.color = cfg.color;
|
192
|
-
this.intensity = cfg.intensity;
|
193
|
-
this.constantAttenuation = cfg.constantAttenuation;
|
194
|
-
this.linearAttenuation = cfg.linearAttenuation;
|
195
|
-
this.quadraticAttenuation = cfg.quadraticAttenuation;
|
196
|
-
this.castsShadow = cfg.castsShadow;
|
197
|
-
|
198
|
-
this.scene._lightCreated(this);
|
199
|
-
}
|
200
|
-
|
201
|
-
/**
|
202
|
-
* Sets the position of this PointLight.
|
203
|
-
*
|
204
|
-
* This will be either World- or View-space, depending on the value of {@link PointLight#space}.
|
205
|
-
*
|
206
|
-
* Default value is ````[1.0, 1.0, 1.0]````.
|
207
|
-
*
|
208
|
-
* @param {Number[]} pos The position.
|
209
|
-
*/
|
210
|
-
set pos(pos) {
|
211
|
-
this._state.pos.set(pos || [1.0, 1.0, 1.0]);
|
212
|
-
this._shadowViewMatrixDirty = true;
|
213
|
-
this.glRedraw();
|
214
|
-
}
|
215
|
-
|
216
|
-
/**
|
217
|
-
* Gets the position of this PointLight.
|
218
|
-
*
|
219
|
-
* This will be either World- or View-space, depending on the value of {@link PointLight#space}.
|
220
|
-
*
|
221
|
-
* Default value is ````[1.0, 1.0, 1.0]````.
|
222
|
-
*
|
223
|
-
* @returns {Number[]} The position.
|
224
|
-
*/
|
225
|
-
get pos() {
|
226
|
-
return this._state.pos;
|
227
|
-
}
|
228
|
-
|
229
|
-
/**
|
230
|
-
* Sets the RGB color of this PointLight.
|
231
|
-
*
|
232
|
-
* Default value is ````[0.7, 0.7, 0.8]````.
|
233
|
-
*
|
234
|
-
* @param {Number[]} color The PointLight's RGB color.
|
235
|
-
*/
|
236
|
-
set color(color) {
|
237
|
-
this._state.color.set(color || [0.7, 0.7, 0.8]);
|
238
|
-
this.glRedraw();
|
239
|
-
}
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Gets the RGB color of this PointLight.
|
243
|
-
*
|
244
|
-
* Default value is ````[0.7, 0.7, 0.8]````.
|
245
|
-
*
|
246
|
-
* @returns {Number[]} The PointLight's RGB color.
|
247
|
-
*/
|
248
|
-
get color() {
|
249
|
-
return this._state.color;
|
250
|
-
}
|
251
|
-
|
252
|
-
/**
|
253
|
-
* Sets the intensity of this PointLight.
|
254
|
-
*
|
255
|
-
* Default intensity is ````1.0```` for maximum intensity.
|
256
|
-
*
|
257
|
-
* @param {Number} intensity The PointLight's intensity
|
258
|
-
*/
|
259
|
-
set intensity(intensity) {
|
260
|
-
intensity = intensity !== undefined ? intensity : 1.0;
|
261
|
-
this._state.intensity = intensity;
|
262
|
-
this.glRedraw();
|
263
|
-
}
|
264
|
-
|
265
|
-
/**
|
266
|
-
* Gets the intensity of this PointLight.
|
267
|
-
*
|
268
|
-
* Default value is ````1.0```` for maximum intensity.
|
269
|
-
*
|
270
|
-
* @returns {Number} The PointLight's intensity.
|
271
|
-
*/
|
272
|
-
get intensity() {
|
273
|
-
return this._state.intensity;
|
274
|
-
}
|
275
|
-
|
276
|
-
/**
|
277
|
-
* Sets the constant attenuation factor for this PointLight.
|
278
|
-
*
|
279
|
-
* Default value is ````0````.
|
280
|
-
*
|
281
|
-
* @param {Number} value The constant attenuation factor.
|
282
|
-
*/
|
283
|
-
set constantAttenuation(value) {
|
284
|
-
this._state.attenuation[0] = value || 0.0;
|
285
|
-
this.glRedraw();
|
286
|
-
}
|
287
|
-
|
288
|
-
/**
|
289
|
-
* Gets the constant attenuation factor for this PointLight.
|
290
|
-
*
|
291
|
-
* Default value is ````0````.
|
292
|
-
*
|
293
|
-
* @returns {Number} The constant attenuation factor.
|
294
|
-
*/
|
295
|
-
get constantAttenuation() {
|
296
|
-
return this._state.attenuation[0];
|
297
|
-
}
|
298
|
-
|
299
|
-
/**
|
300
|
-
* Sets the linear attenuation factor for this PointLight.
|
301
|
-
*
|
302
|
-
* Default value is ````0````.
|
303
|
-
*
|
304
|
-
* @param {Number} value The linear attenuation factor.
|
305
|
-
*/
|
306
|
-
set linearAttenuation(value) {
|
307
|
-
this._state.attenuation[1] = value || 0.0;
|
308
|
-
this.glRedraw();
|
309
|
-
}
|
310
|
-
|
311
|
-
/**
|
312
|
-
* Gets the linear attenuation factor for this PointLight.
|
313
|
-
*
|
314
|
-
* Default value is ````0````.
|
315
|
-
*
|
316
|
-
* @returns {Number} The linear attenuation factor.
|
317
|
-
*/
|
318
|
-
get linearAttenuation() {
|
319
|
-
return this._state.attenuation[1];
|
320
|
-
}
|
321
|
-
|
322
|
-
/**
|
323
|
-
* Sets the quadratic attenuation factor for this PointLight.
|
324
|
-
*
|
325
|
-
* Default value is ````0````.
|
326
|
-
*
|
327
|
-
* @param {Number} value The quadratic attenuation factor.
|
328
|
-
*/
|
329
|
-
set quadraticAttenuation(value) {
|
330
|
-
this._state.attenuation[2] = value || 0.0;
|
331
|
-
this.glRedraw();
|
332
|
-
}
|
333
|
-
|
334
|
-
/**
|
335
|
-
* Gets the quadratic attenuation factor for this PointLight.
|
336
|
-
*
|
337
|
-
* Default value is ````0````.
|
338
|
-
*
|
339
|
-
* @returns {Number} The quadratic attenuation factor.
|
340
|
-
*/
|
341
|
-
get quadraticAttenuation() {
|
342
|
-
return this._state.attenuation[2];
|
343
|
-
}
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Sets if this PointLight casts a shadow.
|
347
|
-
*
|
348
|
-
* Default value is ````false````.
|
349
|
-
*
|
350
|
-
* @param {Boolean} castsShadow Set ````true```` to cast shadows.
|
351
|
-
*/
|
352
|
-
set castsShadow(castsShadow) {
|
353
|
-
castsShadow = !!castsShadow;
|
354
|
-
if (this._state.castsShadow === castsShadow) {
|
355
|
-
return;
|
356
|
-
}
|
357
|
-
this._state.castsShadow = castsShadow;
|
358
|
-
this._shadowViewMatrixDirty = true;
|
359
|
-
this.glRedraw();
|
360
|
-
}
|
361
|
-
|
362
|
-
/**
|
363
|
-
* Gets if this PointLight casts a shadow.
|
364
|
-
*
|
365
|
-
* Default value is ````false````.
|
366
|
-
*
|
367
|
-
* @returns {Boolean} ````true```` if this PointLight casts shadows.
|
368
|
-
*/
|
369
|
-
get castsShadow() {
|
370
|
-
return this._state.castsShadow;
|
371
|
-
}
|
372
|
-
|
373
|
-
/**
|
374
|
-
* Destroys this PointLight.
|
375
|
-
*/
|
376
|
-
destroy() {
|
377
|
-
|
378
|
-
const camera = this.scene.camera;
|
379
|
-
const canvas = this.scene.canvas;
|
380
|
-
camera.off(this._onCameraViewMatrix);
|
381
|
-
camera.off(this._onCameraProjMatrix);
|
382
|
-
canvas.off(this._onCanvasBoundary);
|
383
|
-
|
384
|
-
super.destroy();
|
385
|
-
|
386
|
-
this._state.destroy();
|
387
|
-
if (this._shadowRenderBuf) {
|
388
|
-
this._shadowRenderBuf.destroy();
|
389
|
-
}
|
390
|
-
this.scene._lightDestroyed(this);
|
391
|
-
this.glRedraw();
|
392
|
-
}
|
393
|
-
}
|
394
|
-
|
395
|
-
export {PointLight};
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import {CubeTexture} from './CubeTexture.js';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @desc A reflection cube map.
|
5
|
-
*
|
6
|
-
* ## Usage
|
7
|
-
*
|
8
|
-
* ````javascript
|
9
|
-
* import {Viewer, Mesh, buildSphereGeometry,
|
10
|
-
* ReadableGeometry, MetallicMaterial, ReflectionMap} from "yjkkit-sdk.es.js";
|
11
|
-
*
|
12
|
-
* // Create a Viewer and arrange the camera
|
13
|
-
*
|
14
|
-
* const viewer = new Viewer({
|
15
|
-
* canvasId: "myCanvas"
|
16
|
-
* });
|
17
|
-
*
|
18
|
-
* viewer.scene.camera.eye = [0, 0, 5];
|
19
|
-
* viewer.scene.camera.look = [0, 0, 0];
|
20
|
-
* viewer.scene.camera.up = [0, 1, 0];
|
21
|
-
*
|
22
|
-
* new ReflectionMap(viewer.scene, {
|
23
|
-
* src: [
|
24
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PX.png",
|
25
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NX.png",
|
26
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PY.png",
|
27
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NY.png",
|
28
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PZ.png",
|
29
|
-
* "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NZ.png"
|
30
|
-
* ]
|
31
|
-
* });
|
32
|
-
*
|
33
|
-
* // Create a sphere and ground plane
|
34
|
-
*
|
35
|
-
* new Mesh(viewer.scene, {
|
36
|
-
* geometry: new ReadableGeometry(viewer.scene, buildSphereGeometry({
|
37
|
-
* radius: 2.0
|
38
|
-
* }),
|
39
|
-
* new MetallicMaterial(viewer.scene, {
|
40
|
-
* baseColor: [1, 1, 1],
|
41
|
-
* metallic: 1.0,
|
42
|
-
* roughness: 1.0
|
43
|
-
* })
|
44
|
-
* });
|
45
|
-
* ````
|
46
|
-
*/
|
47
|
-
class ReflectionMap extends CubeTexture {
|
48
|
-
|
49
|
-
/**
|
50
|
-
@private
|
51
|
-
*/
|
52
|
-
get type() {
|
53
|
-
return "ReflectionMap";
|
54
|
-
}
|
55
|
-
|
56
|
-
/**
|
57
|
-
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
58
|
-
* @param {*} [cfg] Configs
|
59
|
-
* @param {String} [cfg.id] Optional ID for this ReflectionMap, unique among all components in the parent scene, generated automatically when omitted.
|
60
|
-
* @param {String[]} [cfg.src=null] Paths to six image files to load into this ReflectionMap.
|
61
|
-
* @param {Boolean} [cfg.flipY=false] Flips this ReflectionMap's source data along its vertical axis when true.
|
62
|
-
* @param {String} [cfg.encoding="linear"] Encoding format. See the {@link ReflectionMap/encoding} property for more info.
|
63
|
-
*/
|
64
|
-
constructor(owner, cfg = {}) {
|
65
|
-
super(owner, cfg);
|
66
|
-
this.scene._lightsState.addReflectionMap(this._state);
|
67
|
-
this.scene._reflectionMapCreated(this);
|
68
|
-
}
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Destroys this ReflectionMap.
|
72
|
-
*/
|
73
|
-
destroy() {
|
74
|
-
super.destroy();
|
75
|
-
this.scene._reflectionMapDestroyed(this);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
export {ReflectionMap};
|
@@ -1,138 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
A **Shadow** defines a shadow cast by a {@link DirLight} or a {@link SpotLight}.
|
3
|
-
|
4
|
-
Work in progress!
|
5
|
-
|
6
|
-
## Overview
|
7
|
-
|
8
|
-
* Shadows are attached to {@link DirLight} and {@link SpotLight} components.
|
9
|
-
|
10
|
-
TODO
|
11
|
-
|
12
|
-
## Examples
|
13
|
-
|
14
|
-
TODO
|
15
|
-
|
16
|
-
## Usage
|
17
|
-
|
18
|
-
```` javascript
|
19
|
-
var mesh = new yjkkit.Mesh(scene, {
|
20
|
-
|
21
|
-
lights: new yjkkit.Lights({
|
22
|
-
lights: [
|
23
|
-
|
24
|
-
new yjkkit.SpotLight({
|
25
|
-
pos: [0, 100, 100],
|
26
|
-
dir: [0, -1, 0],
|
27
|
-
color: [0.5, 0.7, 0.5],
|
28
|
-
intensity: 1
|
29
|
-
constantAttenuation: 0,
|
30
|
-
linearAttenuation: 0,
|
31
|
-
quadraticAttenuation: 0,
|
32
|
-
space: "view",
|
33
|
-
|
34
|
-
shadow: new yjkkit.Shadow({
|
35
|
-
resolution: [1000, 1000],
|
36
|
-
intensity: 0.7,
|
37
|
-
sampling: "stratified" // "stratified" | "poisson" | "basic"
|
38
|
-
});
|
39
|
-
})
|
40
|
-
]
|
41
|
-
}),
|
42
|
-
,
|
43
|
-
material: new yjkkit.PhongMaterial({
|
44
|
-
diffuse: [0.5, 0.5, 0.0]
|
45
|
-
}),
|
46
|
-
|
47
|
-
geometry: new yjkkit.BoxGeometry()
|
48
|
-
});
|
49
|
-
````
|
50
|
-
|
51
|
-
@class Shadow
|
52
|
-
@module yjkkit
|
53
|
-
@submodule lighting
|
54
|
-
@constructor
|
55
|
-
@extends Component
|
56
|
-
@param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
57
|
-
@param {*} [cfg] The Shadow configuration
|
58
|
-
@param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
59
|
-
@param {String:Object} [cfg.meta] Optional map of user-defined metadata to attach to this Shadow.
|
60
|
-
@param [cfg.resolution=[1000,1000]] {Uint16Array} Resolution of the texture map for this Shadow.
|
61
|
-
@param [cfg.intensity=1.0] {Number} Intensity of this Shadow.
|
62
|
-
*/
|
63
|
-
import {Component} from '../Component.js';
|
64
|
-
import {math} from '../math/math.js';
|
65
|
-
|
66
|
-
class Shadow extends Component {
|
67
|
-
|
68
|
-
/**
|
69
|
-
@private
|
70
|
-
*/
|
71
|
-
get type() {
|
72
|
-
return "Shadow";
|
73
|
-
}
|
74
|
-
|
75
|
-
constructor(owner, cfg={}) {
|
76
|
-
|
77
|
-
super(owner, cfg);
|
78
|
-
|
79
|
-
this._state = {
|
80
|
-
resolution: math.vec3([1000, 1000]),
|
81
|
-
intensity: 1.0
|
82
|
-
};
|
83
|
-
|
84
|
-
this.resolution = cfg.resolution;
|
85
|
-
this.intensity = cfg.intensity;
|
86
|
-
}
|
87
|
-
|
88
|
-
/**
|
89
|
-
The resolution of the texture map for this Shadow.
|
90
|
-
|
91
|
-
This will be either World- or View-space, depending on the value of {@link Shadow/space}.
|
92
|
-
|
93
|
-
Fires a {@link Shadow/resolution:event} event on change.
|
94
|
-
|
95
|
-
@property resolution
|
96
|
-
@default [1000, 1000]
|
97
|
-
@type Uint16Array
|
98
|
-
*/
|
99
|
-
set resolution(value) {
|
100
|
-
|
101
|
-
this._state.resolution.set(value || [1000.0, 1000.0]);
|
102
|
-
|
103
|
-
this.glRedraw();
|
104
|
-
}
|
105
|
-
|
106
|
-
get resolution() {
|
107
|
-
return this._state.resolution;
|
108
|
-
}
|
109
|
-
|
110
|
-
/**
|
111
|
-
The intensity of this Shadow.
|
112
|
-
|
113
|
-
Fires a {@link Shadow/intensity:event} event on change.
|
114
|
-
|
115
|
-
@property intensity
|
116
|
-
@default 1.0
|
117
|
-
@type {Number}
|
118
|
-
*/
|
119
|
-
set intensity(value) {
|
120
|
-
|
121
|
-
value = value !== undefined ? value : 1.0;
|
122
|
-
|
123
|
-
this._state.intensity = value;
|
124
|
-
|
125
|
-
this.glRedraw();
|
126
|
-
}
|
127
|
-
|
128
|
-
get intensity() {
|
129
|
-
return this._state.intensity;
|
130
|
-
}
|
131
|
-
|
132
|
-
destroy() {
|
133
|
-
super.destroy();
|
134
|
-
//this._state.destroy();
|
135
|
-
}
|
136
|
-
}
|
137
|
-
|
138
|
-
export {Shadow};
|