@xeokit/xeokit-sdk 2.4.0-alpha-81 → 2.4.0-alpha-83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xeokit-sdk.cjs.js +5 -1
- package/dist/xeokit-sdk.es.js +5 -1
- package/dist/xeokit-sdk.es5.js +1 -1
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +2 -1
- package/src/extras/ContextMenu/ContextMenu.js +907 -0
- package/src/extras/ContextMenu/index.js +1 -0
- package/src/extras/index.js +1 -0
- package/src/index.js +3 -0
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +658 -0
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +418 -0
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +400 -0
- package/src/plugins/AngleMeasurementsPlugin/index.js +1 -0
- package/src/plugins/AnnotationsPlugin/Annotation.js +368 -0
- package/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +583 -0
- package/src/plugins/AnnotationsPlugin/index.js +1 -0
- package/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +333 -0
- package/src/plugins/AxisGizmoPlugin/index.js +1 -0
- package/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +955 -0
- package/src/plugins/BCFViewpointsPlugin/index.js +1 -0
- package/src/plugins/CityJSONLoaderPlugin/CityJSONDefaultDataSource.js +29 -0
- package/src/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.js +751 -0
- package/src/plugins/CityJSONLoaderPlugin/index.js +1 -0
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +870 -0
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +376 -0
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +454 -0
- package/src/plugins/DistanceMeasurementsPlugin/index.js +1 -0
- package/src/plugins/FaceAlignedSectionPlanesPlugin/FaceAlignedSectionPlanesControl.js +639 -0
- package/src/plugins/FaceAlignedSectionPlanesPlugin/FaceAlignedSectionPlanesPlugin.js +436 -0
- package/src/plugins/FaceAlignedSectionPlanesPlugin/Overview.js +247 -0
- package/src/plugins/FaceAlignedSectionPlanesPlugin/Plane.js +167 -0
- package/src/plugins/FaceAlignedSectionPlanesPlugin/index.js +1 -0
- package/src/plugins/FastNavPlugin/FastNavPlugin.js +429 -0
- package/src/plugins/FastNavPlugin/index.js +1 -0
- package/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +139 -0
- package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +421 -0
- package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +669 -0
- package/src/plugins/GLTFLoaderPlugin/index.js +2 -0
- package/src/plugins/LASLoaderPlugin/LASDefaultDataSource.js +58 -0
- package/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js +518 -0
- package/src/plugins/LASLoaderPlugin/index.js +1 -0
- package/src/plugins/LASLoaderPlugin/loadLASHeader.js +183 -0
- package/src/plugins/NavCubePlugin/CubeTextureCanvas.js +289 -0
- package/src/plugins/NavCubePlugin/NavCubePlugin.js +752 -0
- package/src/plugins/NavCubePlugin/index.js +1 -0
- package/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +145 -0
- package/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +777 -0
- package/src/plugins/OBJLoaderPlugin/index.js +1 -0
- package/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +33 -0
- package/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +274 -0
- package/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +313 -0
- package/src/plugins/STLLoaderPlugin/index.js +2 -0
- package/src/plugins/SectionPlanesPlugin/Control.js +1328 -0
- package/src/plugins/SectionPlanesPlugin/Overview.js +249 -0
- package/src/plugins/SectionPlanesPlugin/Plane.js +169 -0
- package/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +404 -0
- package/src/plugins/SectionPlanesPlugin/index.js +1 -0
- package/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +134 -0
- package/src/plugins/SkyboxesPlugin/index.js +1 -0
- package/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +77 -0
- package/src/plugins/StoreyViewsPlugin/Storey.js +61 -0
- package/src/plugins/StoreyViewsPlugin/StoreyMap.js +57 -0
- package/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +825 -0
- package/src/plugins/StoreyViewsPlugin/index.js +1 -0
- package/src/plugins/TreeViewPlugin/TreeViewNode.js +97 -0
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +1424 -0
- package/src/plugins/TreeViewPlugin/index.js +1 -0
- package/src/plugins/ViewCullPlugin/ViewCullPlugin.js +295 -0
- package/src/plugins/ViewCullPlugin/index.js +1 -0
- package/src/plugins/WebIFCLoaderPlugin/WebIFCDefaultDataSource.js +58 -0
- package/src/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.js +942 -0
- package/src/plugins/WebIFCLoaderPlugin/index.js +1 -0
- package/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +95 -0
- package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +1107 -0
- package/src/plugins/XKTLoaderPlugin/index.js +2 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +169 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV10.js +656 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +230 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +223 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +283 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +246 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +301 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +439 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +563 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV9.js +518 -0
- package/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +2 -0
- package/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +238 -0
- package/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +1279 -0
- package/src/plugins/XML3DLoaderPlugin/index.js +1 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +11 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +2060 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +2155 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +1002 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +64 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +153 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +267 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +553 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +991 -0
- package/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +49 -0
- package/src/plugins/index.js +21 -0
- package/src/plugins/lib/culling/ObjectCullStates.js +208 -0
- package/src/plugins/lib/earcut.js +677 -0
- package/src/plugins/lib/html/Dot.js +145 -0
- package/src/plugins/lib/html/Label.js +156 -0
- package/src/plugins/lib/html/Wire.js +191 -0
- package/src/viewer/Configs.js +79 -0
- package/src/viewer/Plugin.js +224 -0
- package/src/viewer/Viewer.js +535 -0
- package/src/viewer/index.js +5 -0
- package/src/viewer/localization/LocaleService.js +475 -0
- package/src/viewer/metadata/IFCObjectDefaultColors.js +162 -0
- package/src/viewer/metadata/IFCObjectDefaults.js +17 -0
- package/src/viewer/metadata/MetaModel.js +389 -0
- package/src/viewer/metadata/MetaObject.js +218 -0
- package/src/viewer/metadata/MetaScene.js +336 -0
- package/src/viewer/metadata/Property.js +55 -0
- package/src/viewer/metadata/PropertySet.js +77 -0
- package/src/viewer/scene/Bitmap/Bitmap.js +470 -0
- package/src/viewer/scene/Bitmap/index.js +1 -0
- package/src/viewer/scene/CameraControl/CameraControl.js +1737 -0
- package/src/viewer/scene/CameraControl/lib/CameraUpdater.js +312 -0
- package/src/viewer/scene/CameraControl/lib/controllers/PanController.js +112 -0
- package/src/viewer/scene/CameraControl/lib/controllers/PickController.js +264 -0
- package/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +384 -0
- package/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +122 -0
- package/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +183 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +68 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +345 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +372 -0
- package/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +269 -0
- package/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +235 -0
- package/src/viewer/scene/Component.js +907 -0
- package/src/viewer/scene/Entity.js +502 -0
- package/src/viewer/scene/ImagePlane/ImagePlane.js +570 -0
- package/src/viewer/scene/ImagePlane/index.js +1 -0
- package/src/viewer/scene/LineSet/LineSet.js +164 -0
- package/src/viewer/scene/LineSet/index.js +1 -0
- package/src/viewer/scene/camera/Camera.js +912 -0
- package/src/viewer/scene/camera/CameraFlightAnimation.js +669 -0
- package/src/viewer/scene/camera/CameraPath.js +194 -0
- package/src/viewer/scene/camera/CameraPathAnimation.js +326 -0
- package/src/viewer/scene/camera/CustomProjection.js +149 -0
- package/src/viewer/scene/camera/Frustum.js +316 -0
- package/src/viewer/scene/camera/Ortho.js +286 -0
- package/src/viewer/scene/camera/Perspective.js +304 -0
- package/src/viewer/scene/camera/index.js +2 -0
- package/src/viewer/scene/canvas/Canvas.js +492 -0
- package/src/viewer/scene/canvas/Spinner.js +323 -0
- package/src/viewer/scene/constants/constants.js +371 -0
- package/src/viewer/scene/core.js +233 -0
- package/src/viewer/scene/geometry/Geometry.js +33 -0
- package/src/viewer/scene/geometry/ReadableGeometry.js +682 -0
- package/src/viewer/scene/geometry/VBOGeometry.js +319 -0
- package/src/viewer/scene/geometry/builders/buildBoxGeometry.js +238 -0
- package/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +106 -0
- package/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +271 -0
- package/src/viewer/scene/geometry/builders/buildGridGeometry.js +102 -0
- package/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +168 -0
- package/src/viewer/scene/geometry/builders/buildSphereGeometry.js +161 -0
- package/src/viewer/scene/geometry/builders/buildTorusGeometry.js +172 -0
- package/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +1721 -0
- package/src/viewer/scene/geometry/builders/index.js +8 -0
- package/src/viewer/scene/geometry/index.js +4 -0
- package/src/viewer/scene/geometry/loaders/index.js +2 -0
- package/src/viewer/scene/geometry/loaders/load3DSGeometry.js +103 -0
- package/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +130 -0
- package/src/viewer/scene/index.js +23 -0
- package/src/viewer/scene/input/Input.js +1325 -0
- package/src/viewer/scene/libs/k3d.js +1032 -0
- package/src/viewer/scene/lights/AmbientLight.js +175 -0
- package/src/viewer/scene/lights/CubeTexture.js +156 -0
- package/src/viewer/scene/lights/DirLight.js +314 -0
- package/src/viewer/scene/lights/Light.js +29 -0
- package/src/viewer/scene/lights/LightMap.js +77 -0
- package/src/viewer/scene/lights/PointLight.js +395 -0
- package/src/viewer/scene/lights/ReflectionMap.js +79 -0
- package/src/viewer/scene/lights/Shadow.js +138 -0
- package/src/viewer/scene/lights/index.js +5 -0
- package/src/viewer/scene/lod/LOD.js +162 -0
- package/src/viewer/scene/lod/LODCullingManager.js +83 -0
- package/src/viewer/scene/lod/LODState.js +125 -0
- package/src/viewer/scene/lod/index.js +1 -0
- package/src/viewer/scene/marker/Marker.js +383 -0
- package/src/viewer/scene/marker/SpriteMarker.js +356 -0
- package/src/viewer/scene/marker/index.js +2 -0
- package/src/viewer/scene/materials/EdgeMaterial.js +359 -0
- package/src/viewer/scene/materials/EmphasisMaterial.js +613 -0
- package/src/viewer/scene/materials/Fresnel.js +222 -0
- package/src/viewer/scene/materials/LambertMaterial.js +378 -0
- package/src/viewer/scene/materials/LinesMaterial.js +169 -0
- package/src/viewer/scene/materials/Material.js +39 -0
- package/src/viewer/scene/materials/MetallicMaterial.js +820 -0
- package/src/viewer/scene/materials/PhongMaterial.js +860 -0
- package/src/viewer/scene/materials/PointsMaterial.js +409 -0
- package/src/viewer/scene/materials/SpecularMaterial.js +807 -0
- package/src/viewer/scene/materials/Texture.js +513 -0
- package/src/viewer/scene/materials/index.js +8 -0
- package/src/viewer/scene/math/Frustum.js +118 -0
- package/src/viewer/scene/math/buildEdgeIndices.js +162 -0
- package/src/viewer/scene/math/geometryCompressionUtils.js +365 -0
- package/src/viewer/scene/math/index.js +3 -0
- package/src/viewer/scene/math/math.js +5363 -0
- package/src/viewer/scene/math/rtcCoords.js +139 -0
- package/src/viewer/scene/mementos/CameraMemento.js +200 -0
- package/src/viewer/scene/mementos/ModelMemento.js +263 -0
- package/src/viewer/scene/mementos/ObjectsMemento.js +259 -0
- package/src/viewer/scene/mementos/index.js +3 -0
- package/src/viewer/scene/mesh/Mesh.js +2202 -0
- package/src/viewer/scene/mesh/draw/DrawRenderer.js +986 -0
- package/src/viewer/scene/mesh/draw/DrawShaderSource.js +1570 -0
- package/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +249 -0
- package/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +158 -0
- package/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +276 -0
- package/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +261 -0
- package/src/viewer/scene/mesh/index.js +1 -0
- package/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +207 -0
- package/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +156 -0
- package/src/viewer/scene/mesh/pick/PickMeshRenderer.js +210 -0
- package/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +142 -0
- package/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +186 -0
- package/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +116 -0
- package/src/viewer/scene/mesh/shadow/ShadowRenderer.js +214 -0
- package/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +98 -0
- package/src/viewer/scene/metriqs/Metriqs.js +259 -0
- package/src/viewer/scene/model/ENTITY_FLAGS.js +21 -0
- package/src/viewer/scene/model/PerformanceModel.js +26 -0
- package/src/viewer/scene/model/RENDER_PASSES.js +34 -0
- package/src/viewer/scene/model/SceneModel.js +3817 -0
- package/src/viewer/scene/model/SceneModelEntity.js +478 -0
- package/src/viewer/scene/model/SceneModelMesh.js +160 -0
- package/src/viewer/scene/model/SceneModelTexture.js +17 -0
- package/src/viewer/scene/model/SceneModelTextureSet.js +17 -0
- package/src/viewer/scene/model/VBOSceneModel.js +26 -0
- package/src/viewer/scene/model/compression.js +227 -0
- package/src/viewer/scene/model/dtx/triangles/BindableDataTexture.js +31 -0
- package/src/viewer/scene/model/dtx/triangles/DataTextureGenerator.js +631 -0
- package/src/viewer/scene/model/dtx/triangles/DataTextureState.js +288 -0
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureBuffer.js +31 -0
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js +1329 -0
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureRenderers.js +278 -0
- package/src/viewer/scene/model/dtx/triangles/calculateUniquePositions.js +126 -0
- package/src/viewer/scene/model/dtx/triangles/dataTextureRamStats.js +54 -0
- package/src/viewer/scene/model/dtx/triangles/rebucketPositions.js +347 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureColorRenderer.js +633 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureDepthRenderer.js +475 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureEdgesColorRenderer.js +426 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureEdgesRenderer.js +430 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureNormalsRenderer.js +341 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureOcclusionRenderer.js +442 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTexturePickDepthRenderer.js +451 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTexturePickMeshRenderer.js +436 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTexturePickNormalsFlatRenderer.js +502 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTexturePickNormalsRenderer.js +430 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSilhouetteRenderer.js +469 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js +451 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthRenderer.js +424 -0
- package/src/viewer/scene/model/index.js +3 -0
- package/src/viewer/scene/model/vbo/ScratchMemory.js +63 -0
- package/src/viewer/scene/model/vbo/VBOSceneModelRenderers.js +805 -0
- package/src/viewer/scene/model/vbo/float16.js +760 -0
- package/src/viewer/scene/model/vbo/linesBatching/LinesBatchingBuffer.js +21 -0
- package/src/viewer/scene/model/vbo/linesBatching/LinesBatchingLayer.js +744 -0
- package/src/viewer/scene/model/vbo/linesBatching/LinesBatchingRenderers.js +71 -0
- package/src/viewer/scene/model/vbo/linesBatching/renderers/LinesBatchingColorRenderer.js +116 -0
- package/src/viewer/scene/model/vbo/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +126 -0
- package/src/viewer/scene/model/vbo/linesInstancing/LinesInstancingLayer.js +653 -0
- package/src/viewer/scene/model/vbo/linesInstancing/LinesInstancingRenderers.js +71 -0
- package/src/viewer/scene/model/vbo/linesInstancing/renderers/LinesInstancingColorRenderer.js +150 -0
- package/src/viewer/scene/model/vbo/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +128 -0
- package/src/viewer/scene/model/vbo/pointsBatching/PointsBatchingBuffer.js +22 -0
- package/src/viewer/scene/model/vbo/pointsBatching/PointsBatchingLayer.js +753 -0
- package/src/viewer/scene/model/vbo/pointsBatching/PointsBatchingRenderers.js +116 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingColorRenderer.js +167 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +135 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +154 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +146 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingShadowRenderer.js +108 -0
- package/src/viewer/scene/model/vbo/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +147 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/PointsInstancingLayer.js +684 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/PointsInstancingRenderers.js +146 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingColorRenderer.js +174 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +156 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +151 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +167 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +151 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +121 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +156 -0
- package/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthBufInitRenderer.js +351 -0
- package/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthRenderer.js +365 -0
- package/src/viewer/scene/model/vbo/snapBatching/SnapBatchingRenderers.js +71 -0
- package/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js +381 -0
- package/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthRenderer.js +374 -0
- package/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingRenderers.js +71 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingBuffer.js +26 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js +1322 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingRenderers.js +322 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +240 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingColorTextureRenderer.js +271 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +127 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +129 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +134 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingFlatColorRenderer.js +237 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +139 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +127 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingPBRRenderer.js +563 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +143 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +130 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingPickNormalsFlatRenderer.js +119 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +129 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +108 -0
- package/src/viewer/scene/model/vbo/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +137 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js +1167 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingRenderers.js +322 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +253 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingColorTextureRenderer.js +278 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +125 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +131 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +134 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingFlatColorRenderer.js +244 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingFlatNormalsRenderer.js +130 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +140 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +130 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingPBRRenderer.js +563 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +148 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +135 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingPickNormalsFlatRenderer.js +130 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +144 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +113 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +141 -0
- package/src/viewer/scene/nodes/Node.js +1383 -0
- package/src/viewer/scene/nodes/index.js +1 -0
- package/src/viewer/scene/paths/CubicBezierCurve.js +194 -0
- package/src/viewer/scene/paths/Curve.js +183 -0
- package/src/viewer/scene/paths/Path.js +239 -0
- package/src/viewer/scene/paths/QuadraticBezierCurve.js +161 -0
- package/src/viewer/scene/paths/SplineCurve.js +133 -0
- package/src/viewer/scene/paths/index.js +5 -0
- package/src/viewer/scene/postfx/SAO.js +543 -0
- package/src/viewer/scene/scene/Scene.js +2627 -0
- package/src/viewer/scene/sectionPlane/SectionPlane.js +194 -0
- package/src/viewer/scene/sectionPlane/index.js +1 -0
- package/src/viewer/scene/skybox/Skybox.js +123 -0
- package/src/viewer/scene/skybox/index.js +1 -0
- package/src/viewer/scene/stats.js +44 -0
- package/src/viewer/scene/utils/Cache.js +29 -0
- package/src/viewer/scene/utils/FileLoader.js +160 -0
- package/src/viewer/scene/utils/Loader.js +55 -0
- package/src/viewer/scene/utils/LoadingManager.js +86 -0
- package/src/viewer/scene/utils/Map.js +45 -0
- package/src/viewer/scene/utils/Queue.js +56 -0
- package/src/viewer/scene/utils/WorkerPool.js +73 -0
- package/src/viewer/scene/utils/index.js +6 -0
- package/src/viewer/scene/utils/textureTranscoders/KTX2TextureTranscoder/KTX2TextureTranscoder.js +650 -0
- package/src/viewer/scene/utils/textureTranscoders/KTX2TextureTranscoder/index.js +1 -0
- package/src/viewer/scene/utils/textureTranscoders/TextureTranscoder.js +31 -0
- package/src/viewer/scene/utils/textureTranscoders/index.js +2 -0
- package/src/viewer/scene/utils.js +452 -0
- package/src/viewer/scene/vfc/VFC.js +82 -0
- package/src/viewer/scene/vfc/VFCManager.js +54 -0
- package/src/viewer/scene/vfc/VFCState.js +391 -0
- package/src/viewer/scene/vfc/cluster-helper.js +134 -0
- package/src/viewer/scene/vfc/index.js +1 -0
- package/src/viewer/scene/vfc/rbush3d.js +848 -0
- package/src/viewer/scene/vfc/xeokit-cluster.js +418 -0
- package/src/viewer/scene/viewport/Viewport.js +212 -0
- package/src/viewer/scene/webgl/ArrayBuf.js +121 -0
- package/src/viewer/scene/webgl/Attribute.js +23 -0
- package/src/viewer/scene/webgl/Drawable.js +270 -0
- package/src/viewer/scene/webgl/FrameContext.js +313 -0
- package/src/viewer/scene/webgl/PickResult.js +339 -0
- package/src/viewer/scene/webgl/Pickable.js +69 -0
- package/src/viewer/scene/webgl/Program.js +181 -0
- package/src/viewer/scene/webgl/RenderBuffer.js +350 -0
- package/src/viewer/scene/webgl/RenderBufferManager.js +34 -0
- package/src/viewer/scene/webgl/RenderFlags.js +203 -0
- package/src/viewer/scene/webgl/RenderState.js +40 -0
- package/src/viewer/scene/webgl/Renderer.js +1654 -0
- package/src/viewer/scene/webgl/Sampler.js +18 -0
- package/src/viewer/scene/webgl/Shader.js +49 -0
- package/src/viewer/scene/webgl/Texture2D.js +442 -0
- package/src/viewer/scene/webgl/convertConstant.js +244 -0
- package/src/viewer/scene/webgl/getExtension.js +32 -0
- package/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +214 -0
- package/src/viewer/scene/webgl/occlusion/OcclusionTester.js +426 -0
- package/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +324 -0
- package/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +376 -0
- package/src/viewer/scene/webgl/webglEnums.js +61 -0
- package/src/viewer/scene/webglInfo.js +47 -0
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
import {ENTITY_FLAGS} from '../../ENTITY_FLAGS.js';
|
|
2
|
+
import {RENDER_PASSES} from '../../RENDER_PASSES.js';
|
|
3
|
+
|
|
4
|
+
import {math} from "../../../math/math.js";
|
|
5
|
+
import {RenderState} from "../../../webgl/RenderState.js";
|
|
6
|
+
import {ArrayBuf} from "../../../webgl/ArrayBuf.js";
|
|
7
|
+
import {geometryCompressionUtils} from "../../../math/geometryCompressionUtils.js";
|
|
8
|
+
import {getBatchingRenderers} from "./LinesBatchingRenderers.js";
|
|
9
|
+
import {LinesBatchingBuffer} from "./LinesBatchingBuffer.js";
|
|
10
|
+
import {quantizePositions} from "../../compression.js";
|
|
11
|
+
|
|
12
|
+
const tempVec4a = math.vec4([0, 0, 0, 1]);
|
|
13
|
+
const tempVec4b = math.vec4([0, 0, 0, 1]);
|
|
14
|
+
const tempVec4c = math.vec4([0, 0, 0, 1]);
|
|
15
|
+
const tempOBB3 = math.OBB3();
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
class LinesBatchingLayer {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param model
|
|
24
|
+
* @param cfg
|
|
25
|
+
* @param cfg.layerIndex
|
|
26
|
+
* @param cfg.positionsDecodeMatrix
|
|
27
|
+
* @param cfg.maxGeometryBatchSize
|
|
28
|
+
* @param cfg.origin
|
|
29
|
+
* @param cfg.scratchMemory
|
|
30
|
+
*/
|
|
31
|
+
constructor(cfg) {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Index of this LinesBatchingLayer in {@link VBOSceneModel#_layerList}.
|
|
35
|
+
* @type {Number}
|
|
36
|
+
*/
|
|
37
|
+
this.layerIndex = cfg.layerIndex;
|
|
38
|
+
|
|
39
|
+
this._batchingRenderers = getBatchingRenderers(cfg.model.scene);
|
|
40
|
+
this.model = cfg.model;
|
|
41
|
+
this._buffer = new LinesBatchingBuffer(cfg.maxGeometryBatchSize);
|
|
42
|
+
this._scratchMemory = cfg.scratchMemory;
|
|
43
|
+
|
|
44
|
+
this._state = new RenderState({
|
|
45
|
+
positionsBuf: null,
|
|
46
|
+
offsetsBuf: null,
|
|
47
|
+
colorsBuf: null,
|
|
48
|
+
flagsBuf: null,
|
|
49
|
+
indicesBuf: null,
|
|
50
|
+
positionsDecodeMatrix: math.mat4(),
|
|
51
|
+
origin: null
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// These counts are used to avoid unnecessary render passes
|
|
55
|
+
this._numPortions = 0;
|
|
56
|
+
this._numVisibleLayerPortions = 0;
|
|
57
|
+
this._numTransparentLayerPortions = 0;
|
|
58
|
+
this._numXRayedLayerPortions = 0;
|
|
59
|
+
this._numSelectedLayerPortions = 0;
|
|
60
|
+
this._numHighlightedLayerPortions = 0;
|
|
61
|
+
this._numClippableLayerPortions = 0;
|
|
62
|
+
this._numEdgesLayerPortions = 0;
|
|
63
|
+
this._numPickableLayerPortions = 0;
|
|
64
|
+
this._numCulledLayerPortions = 0;
|
|
65
|
+
|
|
66
|
+
this._modelAABB = math.collapseAABB3(); // Model-space AABB
|
|
67
|
+
this._portions = [];
|
|
68
|
+
|
|
69
|
+
this._numVerts = 0;
|
|
70
|
+
|
|
71
|
+
this._finalized = false;
|
|
72
|
+
|
|
73
|
+
if (cfg.positionsDecodeMatrix) {
|
|
74
|
+
this._state.positionsDecodeMatrix.set(cfg.positionsDecodeMatrix);
|
|
75
|
+
this._preCompressedPositionsExpected = true;
|
|
76
|
+
} else {
|
|
77
|
+
this._preCompressedPositionsExpected = false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (cfg.origin) {
|
|
81
|
+
this._state.origin = math.vec3(cfg.origin);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The axis-aligned World-space boundary of this LinesBatchingLayer's positions.
|
|
86
|
+
* @type {*|Float64Array}
|
|
87
|
+
*/
|
|
88
|
+
this.aabb = math.collapseAABB3();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Tests if there is room for another portion in this LinesBatchingLayer.
|
|
93
|
+
*
|
|
94
|
+
* @param lenPositions Number of positions we'd like to create in the portion.
|
|
95
|
+
* @param lenIndices Number of indices we'd like to create in this portion.
|
|
96
|
+
* @returns {Boolean} True if OK to create another portion.
|
|
97
|
+
*/
|
|
98
|
+
canCreatePortion(lenPositions, lenIndices) {
|
|
99
|
+
if (this._finalized) {
|
|
100
|
+
throw "Already finalized";
|
|
101
|
+
}
|
|
102
|
+
return ((this._buffer.positions.length + lenPositions) < (this._buffer.maxVerts * 3) && (this._buffer.indices.length + lenIndices) < (this._buffer.maxIndices));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Creates a new portion within this LinesBatchingLayer, returns the new portion ID.
|
|
107
|
+
*
|
|
108
|
+
* Gives the portion the specified geometry, color and matrix.
|
|
109
|
+
*
|
|
110
|
+
* @param cfg.positions Flat float Local-space positions array.
|
|
111
|
+
* @param cfg.positionsCompressed Flat quantized positions array - decompressed with TrianglesBatchingLayer positionsDecodeMatrix
|
|
112
|
+
* @param cfg.indices Flat int indices array.
|
|
113
|
+
* @param cfg.color Quantized RGB color [0..255,0..255,0..255,0..255]
|
|
114
|
+
* @param cfg.opacity Opacity [0..255]
|
|
115
|
+
* @param [cfg.meshMatrix] Flat float 4x4 matrix
|
|
116
|
+
* @param cfg.worldAABB Flat float AABB World-space AABB
|
|
117
|
+
* @param cfg.pickColor Quantized pick color
|
|
118
|
+
* @returns {number} Portion ID
|
|
119
|
+
*/
|
|
120
|
+
createPortion(cfg) {
|
|
121
|
+
|
|
122
|
+
if (this._finalized) {
|
|
123
|
+
throw "Already finalized";
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const positions = cfg.positions;
|
|
127
|
+
const positionsCompressed = cfg.positionsCompressed;
|
|
128
|
+
const indices = cfg.indices;
|
|
129
|
+
const color = cfg.color;
|
|
130
|
+
const opacity = cfg.opacity;
|
|
131
|
+
const meshMatrix = cfg.meshMatrix;
|
|
132
|
+
const worldAABB = cfg.worldAABB;
|
|
133
|
+
const pickColor = cfg.pickColor;
|
|
134
|
+
|
|
135
|
+
const buffer = this._buffer;
|
|
136
|
+
const positionsIndex = buffer.positions.length;
|
|
137
|
+
const vertsIndex = positionsIndex / 3;
|
|
138
|
+
|
|
139
|
+
let numVerts;
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
if (this._preCompressedPositionsExpected) {
|
|
143
|
+
|
|
144
|
+
if (!positionsCompressed) {
|
|
145
|
+
throw "positionsCompressed expected";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
numVerts = positionsCompressed.length / 3;
|
|
149
|
+
|
|
150
|
+
for (let i = 0, len = positionsCompressed.length; i < len; i++) {
|
|
151
|
+
buffer.positions.push(positionsCompressed[i]);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const bounds = geometryCompressionUtils.getPositionsBounds(positionsCompressed);
|
|
155
|
+
|
|
156
|
+
const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, []);
|
|
157
|
+
const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, []);
|
|
158
|
+
|
|
159
|
+
worldAABB[0] = min[0];
|
|
160
|
+
worldAABB[1] = min[1];
|
|
161
|
+
worldAABB[2] = min[2];
|
|
162
|
+
worldAABB[3] = max[0];
|
|
163
|
+
worldAABB[4] = max[1];
|
|
164
|
+
worldAABB[5] = max[2];
|
|
165
|
+
|
|
166
|
+
} else {
|
|
167
|
+
|
|
168
|
+
if (!positions) {
|
|
169
|
+
throw "positions expected";
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
numVerts = positions.length / 3;
|
|
173
|
+
|
|
174
|
+
const lenPositions = positions.length;
|
|
175
|
+
|
|
176
|
+
const positionsBase = buffer.positions.length;
|
|
177
|
+
|
|
178
|
+
for (let i = 0, len = positions.length; i < len; i++) {
|
|
179
|
+
buffer.positions.push(positions[i]);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (meshMatrix) {
|
|
183
|
+
|
|
184
|
+
for (let i = positionsBase, len = positionsBase + lenPositions; i < len; i += 3) {
|
|
185
|
+
|
|
186
|
+
tempVec4a[0] = buffer.positions[i + 0];
|
|
187
|
+
tempVec4a[1] = buffer.positions[i + 1];
|
|
188
|
+
tempVec4a[2] = buffer.positions[i + 2];
|
|
189
|
+
|
|
190
|
+
math.transformPoint4(meshMatrix, tempVec4a, tempVec4b);
|
|
191
|
+
|
|
192
|
+
buffer.positions[i + 0] = tempVec4b[0];
|
|
193
|
+
buffer.positions[i + 1] = tempVec4b[1];
|
|
194
|
+
buffer.positions[i + 2] = tempVec4b[2];
|
|
195
|
+
|
|
196
|
+
math.expandAABB3Point3(this._modelAABB, tempVec4b);
|
|
197
|
+
math.expandAABB3Point3(worldAABB, tempVec4b);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
} else {
|
|
201
|
+
|
|
202
|
+
for (let i = positionsBase, len = positionsBase + lenPositions; i < len; i += 3) {
|
|
203
|
+
|
|
204
|
+
tempVec4a[0] = buffer.positions[i + 0];
|
|
205
|
+
tempVec4a[1] = buffer.positions[i + 1];
|
|
206
|
+
tempVec4a[2] = buffer.positions[i + 2];
|
|
207
|
+
|
|
208
|
+
math.expandAABB3Point3(this._modelAABB, tempVec4a);
|
|
209
|
+
math.expandAABB3Point3(worldAABB, tempVec4a);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (this._state.origin) {
|
|
215
|
+
const origin = this._state.origin;
|
|
216
|
+
worldAABB[0] += origin[0];
|
|
217
|
+
worldAABB[1] += origin[1];
|
|
218
|
+
worldAABB[2] += origin[2];
|
|
219
|
+
worldAABB[3] += origin[0];
|
|
220
|
+
worldAABB[4] += origin[1];
|
|
221
|
+
worldAABB[5] += origin[2];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
math.expandAABB3(this.aabb, worldAABB);
|
|
225
|
+
|
|
226
|
+
if (color) {
|
|
227
|
+
|
|
228
|
+
const r = color[0]; // Color is pre-quantized by VBOSceneModel
|
|
229
|
+
const g = color[1];
|
|
230
|
+
const b = color[2];
|
|
231
|
+
const a = opacity;
|
|
232
|
+
|
|
233
|
+
for (let i = 0; i < numVerts; i++) {
|
|
234
|
+
buffer.colors.push(r);
|
|
235
|
+
buffer.colors.push(g);
|
|
236
|
+
buffer.colors.push(b);
|
|
237
|
+
buffer.colors.push(a);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (indices) {
|
|
242
|
+
for (let i = 0, len = indices.length; i < len; i++) {
|
|
243
|
+
buffer.indices.push(indices[i] + vertsIndex);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (this.model.scene.entityOffsetsEnabled) {
|
|
248
|
+
for (let i = 0; i < numVerts; i++) {
|
|
249
|
+
buffer.offsets.push(0);
|
|
250
|
+
buffer.offsets.push(0);
|
|
251
|
+
buffer.offsets.push(0);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const portionId = this._portions.length / 2;
|
|
256
|
+
|
|
257
|
+
this._portions.push(vertsIndex);
|
|
258
|
+
this._portions.push(numVerts);
|
|
259
|
+
|
|
260
|
+
this._numPortions++;
|
|
261
|
+
this.model.numPortions++;
|
|
262
|
+
|
|
263
|
+
this._numVerts += numVerts;
|
|
264
|
+
|
|
265
|
+
return portionId;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Builds batch VBOs from appended geometries.
|
|
270
|
+
* No more portions can then be created.
|
|
271
|
+
*/
|
|
272
|
+
finalize() {
|
|
273
|
+
|
|
274
|
+
if (this._finalized) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const state = this._state;
|
|
279
|
+
const gl = this.model.scene.canvas.gl;
|
|
280
|
+
const buffer = this._buffer;
|
|
281
|
+
|
|
282
|
+
if (buffer.positions.length > 0) {
|
|
283
|
+
if (this._preCompressedPositionsExpected) {
|
|
284
|
+
const positions = new Uint16Array(buffer.positions);
|
|
285
|
+
state.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, positions, buffer.positions.length, 3, gl.STATIC_DRAW);
|
|
286
|
+
} else {
|
|
287
|
+
const positions = new Float32Array(buffer.positions);
|
|
288
|
+
const quantizedPositions = quantizePositions(positions, this._modelAABB, state.positionsDecodeMatrix);
|
|
289
|
+
state.positionsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, quantizedPositions, buffer.positions.length, 3, gl.STATIC_DRAW);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (buffer.colors.length > 0) {
|
|
294
|
+
const colors = new Uint8Array(buffer.colors);
|
|
295
|
+
let normalized = false;
|
|
296
|
+
state.colorsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, colors, buffer.colors.length, 4, gl.DYNAMIC_DRAW, normalized);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (buffer.colors.length > 0) { // Because we build flags arrays here, get their length from the colors array
|
|
300
|
+
const flagsLength = buffer.colors.length / 4;
|
|
301
|
+
const flags = new Float32Array(flagsLength);
|
|
302
|
+
let notNormalized = false;
|
|
303
|
+
state.flagsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, flags, flags.length, 1, gl.DYNAMIC_DRAW, notNormalized);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (this.model.scene.entityOffsetsEnabled) {
|
|
307
|
+
if (buffer.offsets.length > 0) {
|
|
308
|
+
const offsets = new Float32Array(buffer.offsets);
|
|
309
|
+
state.offsetsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, offsets, buffer.offsets.length, 3, gl.DYNAMIC_DRAW);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (buffer.indices.length > 0) {
|
|
314
|
+
const indices = new Uint32Array(buffer.indices);
|
|
315
|
+
state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, indices, buffer.indices.length, 1, gl.STATIC_DRAW);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
this._buffer = null;
|
|
319
|
+
this._finalized = true;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
initFlags(portionId, flags, meshTransparent) {
|
|
323
|
+
if (flags & ENTITY_FLAGS.VISIBLE) {
|
|
324
|
+
this._numVisibleLayerPortions++;
|
|
325
|
+
this.model.numVisibleLayerPortions++;
|
|
326
|
+
}
|
|
327
|
+
if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
|
|
328
|
+
this._numHighlightedLayerPortions++;
|
|
329
|
+
this.model.numHighlightedLayerPortions++;
|
|
330
|
+
}
|
|
331
|
+
if (flags & ENTITY_FLAGS.XRAYED) {
|
|
332
|
+
this._numXRayedLayerPortions++;
|
|
333
|
+
this.model.numXRayedLayerPortions++;
|
|
334
|
+
}
|
|
335
|
+
if (flags & ENTITY_FLAGS.SELECTED) {
|
|
336
|
+
this._numSelectedLayerPortions++;
|
|
337
|
+
this.model.numSelectedLayerPortions++;
|
|
338
|
+
}
|
|
339
|
+
if (flags & ENTITY_FLAGS.CLIPPABLE) {
|
|
340
|
+
this._numClippableLayerPortions++;
|
|
341
|
+
this.model.numClippableLayerPortions++;
|
|
342
|
+
}
|
|
343
|
+
if (flags & ENTITY_FLAGS.EDGES) {
|
|
344
|
+
this._numEdgesLayerPortions++;
|
|
345
|
+
this.model.numEdgesLayerPortions++;
|
|
346
|
+
}
|
|
347
|
+
if (flags & ENTITY_FLAGS.PICKABLE) {
|
|
348
|
+
this._numPickableLayerPortions++;
|
|
349
|
+
this.model.numPickableLayerPortions++;
|
|
350
|
+
}
|
|
351
|
+
if (flags & ENTITY_FLAGS.CULLED) {
|
|
352
|
+
this._numCulledLayerPortions++;
|
|
353
|
+
this.model.numCulledLayerPortions++;
|
|
354
|
+
}
|
|
355
|
+
if (meshTransparent) {
|
|
356
|
+
this._numTransparentLayerPortions++;
|
|
357
|
+
this.model.numTransparentLayerPortions++;
|
|
358
|
+
}
|
|
359
|
+
const deferred = true;
|
|
360
|
+
this._setFlags(portionId, flags, meshTransparent, deferred);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
flushInitFlags() {
|
|
364
|
+
this._setDeferredFlags();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
setVisible(portionId, flags, transparent) {
|
|
368
|
+
if (!this._finalized) {
|
|
369
|
+
throw "Not finalized";
|
|
370
|
+
}
|
|
371
|
+
if (flags & ENTITY_FLAGS.VISIBLE) {
|
|
372
|
+
this._numVisibleLayerPortions++;
|
|
373
|
+
this.model.numVisibleLayerPortions++;
|
|
374
|
+
} else {
|
|
375
|
+
this._numVisibleLayerPortions--;
|
|
376
|
+
this.model.numVisibleLayerPortions--;
|
|
377
|
+
}
|
|
378
|
+
this._setFlags(portionId, flags, transparent);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
setHighlighted(portionId, flags, transparent) {
|
|
382
|
+
if (!this._finalized) {
|
|
383
|
+
throw "Not finalized";
|
|
384
|
+
}
|
|
385
|
+
if (flags & ENTITY_FLAGS.HIGHLIGHTED) {
|
|
386
|
+
this._numHighlightedLayerPortions++;
|
|
387
|
+
this.model.numHighlightedLayerPortions++;
|
|
388
|
+
} else {
|
|
389
|
+
this._numHighlightedLayerPortions--;
|
|
390
|
+
this.model.numHighlightedLayerPortions--;
|
|
391
|
+
}
|
|
392
|
+
this._setFlags(portionId, flags, transparent);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
setXRayed(portionId, flags, transparent) {
|
|
396
|
+
if (!this._finalized) {
|
|
397
|
+
throw "Not finalized";
|
|
398
|
+
}
|
|
399
|
+
if (flags & ENTITY_FLAGS.XRAYED) {
|
|
400
|
+
this._numXRayedLayerPortions++;
|
|
401
|
+
this.model.numXRayedLayerPortions++;
|
|
402
|
+
} else {
|
|
403
|
+
this._numXRayedLayerPortions--;
|
|
404
|
+
this.model.numXRayedLayerPortions--;
|
|
405
|
+
}
|
|
406
|
+
this._setFlags(portionId, flags, transparent);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
setSelected(portionId, flags, transparent) {
|
|
410
|
+
if (!this._finalized) {
|
|
411
|
+
throw "Not finalized";
|
|
412
|
+
}
|
|
413
|
+
if (flags & ENTITY_FLAGS.SELECTED) {
|
|
414
|
+
this._numSelectedLayerPortions++;
|
|
415
|
+
this.model.numSelectedLayerPortions++;
|
|
416
|
+
} else {
|
|
417
|
+
this._numSelectedLayerPortions--;
|
|
418
|
+
this.model.numSelectedLayerPortions--;
|
|
419
|
+
}
|
|
420
|
+
this._setFlags(portionId, flags, transparent);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
setEdges(portionId, flags, transparent) {
|
|
424
|
+
if (!this._finalized) {
|
|
425
|
+
throw "Not finalized";
|
|
426
|
+
}
|
|
427
|
+
if (flags & ENTITY_FLAGS.EDGES) {
|
|
428
|
+
this._numEdgesLayerPortions++;
|
|
429
|
+
this.model.numEdgesLayerPortions++;
|
|
430
|
+
} else {
|
|
431
|
+
this._numEdgesLayerPortions--;
|
|
432
|
+
this.model.numEdgesLayerPortions--;
|
|
433
|
+
}
|
|
434
|
+
this._setFlags(portionId, flags, transparent);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
setClippable(portionId, flags) {
|
|
438
|
+
if (!this._finalized) {
|
|
439
|
+
throw "Not finalized";
|
|
440
|
+
}
|
|
441
|
+
if (flags & ENTITY_FLAGS.CLIPPABLE) {
|
|
442
|
+
this._numClippableLayerPortions++;
|
|
443
|
+
this.model.numClippableLayerPortions++;
|
|
444
|
+
} else {
|
|
445
|
+
this._numClippableLayerPortions--;
|
|
446
|
+
this.model.numClippableLayerPortions--;
|
|
447
|
+
}
|
|
448
|
+
this._setFlags(portionId, flags);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
setCulled(portionId, flags, transparent) {
|
|
452
|
+
if (!this._finalized) {
|
|
453
|
+
throw "Not finalized";
|
|
454
|
+
}
|
|
455
|
+
if (flags & ENTITY_FLAGS.CULLED) {
|
|
456
|
+
this._numCulledLayerPortions++;
|
|
457
|
+
this.model.numCulledLayerPortions++;
|
|
458
|
+
} else {
|
|
459
|
+
this._numCulledLayerPortions--;
|
|
460
|
+
this.model.numCulledLayerPortions--;
|
|
461
|
+
}
|
|
462
|
+
this._setFlags(portionId, flags, transparent);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
setCollidable(portionId, flags) {
|
|
466
|
+
if (!this._finalized) {
|
|
467
|
+
throw "Not finalized";
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
setPickable(portionId, flags, transparent) {
|
|
472
|
+
if (!this._finalized) {
|
|
473
|
+
throw "Not finalized";
|
|
474
|
+
}
|
|
475
|
+
if (flags & ENTITY_FLAGS.PICKABLE) {
|
|
476
|
+
this._numPickableLayerPortions++;
|
|
477
|
+
this.model.numPickableLayerPortions++;
|
|
478
|
+
} else {
|
|
479
|
+
this._numPickableLayerPortions--;
|
|
480
|
+
this.model.numPickableLayerPortions--;
|
|
481
|
+
}
|
|
482
|
+
this._setFlags(portionId, flags, transparent);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
setColor(portionId, color) {
|
|
486
|
+
if (!this._finalized) {
|
|
487
|
+
throw "Not finalized";
|
|
488
|
+
}
|
|
489
|
+
const portionsIdx = portionId * 2;
|
|
490
|
+
const vertexBase = this._portions[portionsIdx];
|
|
491
|
+
const numVerts = this._portions[portionsIdx + 1];
|
|
492
|
+
const firstColor = vertexBase * 4;
|
|
493
|
+
const lenColor = numVerts * 4;
|
|
494
|
+
const tempArray = this._scratchMemory.getUInt8Array(lenColor);
|
|
495
|
+
const r = color[0];
|
|
496
|
+
const g = color[1];
|
|
497
|
+
const b = color[2];
|
|
498
|
+
const a = color[3];
|
|
499
|
+
for (let i = 0; i < lenColor; i += 4) {
|
|
500
|
+
tempArray[i + 0] = r;
|
|
501
|
+
tempArray[i + 1] = g;
|
|
502
|
+
tempArray[i + 2] = b;
|
|
503
|
+
tempArray[i + 3] = a;
|
|
504
|
+
}
|
|
505
|
+
this._state.colorsBuf.setData(tempArray, firstColor, lenColor);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
setTransparent(portionId, flags, transparent) {
|
|
509
|
+
if (transparent) {
|
|
510
|
+
this._numTransparentLayerPortions++;
|
|
511
|
+
this.model.numTransparentLayerPortions++;
|
|
512
|
+
} else {
|
|
513
|
+
this._numTransparentLayerPortions--;
|
|
514
|
+
this.model.numTransparentLayerPortions--;
|
|
515
|
+
}
|
|
516
|
+
this._setFlags(portionId, flags, transparent);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* flags are 4bits values encoded on a 32bit base. color flag on the first 4 bits, silhouette flag on the next 4 bits and so on for edge, pick and clippable.
|
|
521
|
+
*/
|
|
522
|
+
_setFlags(portionId, flags, transparent, deferred = false) {
|
|
523
|
+
|
|
524
|
+
if (!this._finalized) {
|
|
525
|
+
throw "Not finalized";
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const portionsIdx = portionId * 2;
|
|
529
|
+
const vertexBase = this._portions[portionsIdx];
|
|
530
|
+
const numVerts = this._portions[portionsIdx + 1];
|
|
531
|
+
const firstFlag = vertexBase;
|
|
532
|
+
const lenFlags = numVerts;
|
|
533
|
+
|
|
534
|
+
const visible = !!(flags & ENTITY_FLAGS.VISIBLE);
|
|
535
|
+
const xrayed = !!(flags & ENTITY_FLAGS.XRAYED);
|
|
536
|
+
const highlighted = !!(flags & ENTITY_FLAGS.HIGHLIGHTED);
|
|
537
|
+
const selected = !!(flags & ENTITY_FLAGS.SELECTED);
|
|
538
|
+
// no edges
|
|
539
|
+
const pickable = !!(flags & ENTITY_FLAGS.PICKABLE);
|
|
540
|
+
const culled = !!(flags & ENTITY_FLAGS.CULLED);
|
|
541
|
+
|
|
542
|
+
let colorFlag;
|
|
543
|
+
if (!visible || culled || xrayed
|
|
544
|
+
|| (highlighted && !this.model.scene.highlightMaterial.glowThrough)
|
|
545
|
+
|| (selected && !this.model.scene.selectedMaterial.glowThrough)) {
|
|
546
|
+
colorFlag = RENDER_PASSES.NOT_RENDERED;
|
|
547
|
+
} else {
|
|
548
|
+
if (transparent) {
|
|
549
|
+
colorFlag = RENDER_PASSES.COLOR_TRANSPARENT;
|
|
550
|
+
} else {
|
|
551
|
+
colorFlag = RENDER_PASSES.COLOR_OPAQUE;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
let silhouetteFlag;
|
|
556
|
+
if (!visible || culled) {
|
|
557
|
+
silhouetteFlag = RENDER_PASSES.NOT_RENDERED;
|
|
558
|
+
} else if (selected) {
|
|
559
|
+
silhouetteFlag = RENDER_PASSES.SILHOUETTE_SELECTED;
|
|
560
|
+
} else if (highlighted) {
|
|
561
|
+
silhouetteFlag = RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;
|
|
562
|
+
} else if (xrayed) {
|
|
563
|
+
silhouetteFlag = RENDER_PASSES.SILHOUETTE_XRAYED;
|
|
564
|
+
} else {
|
|
565
|
+
silhouetteFlag = RENDER_PASSES.NOT_RENDERED;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
let pickFlag = (visible && !culled && pickable) ? RENDER_PASSES.PICK : RENDER_PASSES.NOT_RENDERED;
|
|
569
|
+
|
|
570
|
+
const clippableFlag = !!(flags & ENTITY_FLAGS.CLIPPABLE) ? 1 : 0;
|
|
571
|
+
|
|
572
|
+
if (deferred) {
|
|
573
|
+
// Avoid zillions of individual WebGL bufferSubData calls - buffer them to apply in one shot
|
|
574
|
+
if (!this._deferredFlagValues) {
|
|
575
|
+
this._deferredFlagValues = new Float32Array(this._numVerts);
|
|
576
|
+
}
|
|
577
|
+
for (let i = firstFlag, len = (firstFlag + lenFlags); i < len; i++) {
|
|
578
|
+
let vertFlag = 0;
|
|
579
|
+
vertFlag |= colorFlag;
|
|
580
|
+
vertFlag |= silhouetteFlag << 4;
|
|
581
|
+
// no edges
|
|
582
|
+
vertFlag |= pickFlag << 12;
|
|
583
|
+
vertFlag |= clippableFlag << 16;
|
|
584
|
+
|
|
585
|
+
this._deferredFlagValues[i] = vertFlag;
|
|
586
|
+
}
|
|
587
|
+
} else if (this._state.flagsBuf) {
|
|
588
|
+
const tempArray = this._scratchMemory.getFloat32Array(lenFlags);
|
|
589
|
+
for (let i = 0; i < lenFlags; i++) {
|
|
590
|
+
let vertFlag = 0;
|
|
591
|
+
vertFlag |= colorFlag;
|
|
592
|
+
vertFlag |= silhouetteFlag << 4;
|
|
593
|
+
// no edges
|
|
594
|
+
vertFlag |= pickFlag << 12;
|
|
595
|
+
vertFlag |= clippableFlag << 16;
|
|
596
|
+
|
|
597
|
+
tempArray[i] = vertFlag;
|
|
598
|
+
}
|
|
599
|
+
this._state.flagsBuf.setData(tempArray, firstFlag, lenFlags);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
_setDeferredFlags() {
|
|
604
|
+
if (this._deferredFlagValues) {
|
|
605
|
+
this._state.flagsBuf.setData(this._deferredFlagValues);
|
|
606
|
+
this._deferredFlagValues = null;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
setOffset(portionId, offset) {
|
|
611
|
+
if (!this._finalized) {
|
|
612
|
+
throw "Not finalized";
|
|
613
|
+
}
|
|
614
|
+
if (!this.model.scene.entityOffsetsEnabled) {
|
|
615
|
+
this.model.error("Entity#offset not enabled for this Viewer"); // See Viewer entityOffsetsEnabled
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const portionsIdx = portionId * 2;
|
|
619
|
+
const vertexBase = this._portions[portionsIdx];
|
|
620
|
+
const numVerts = this._portions[portionsIdx + 1];
|
|
621
|
+
const firstOffset = vertexBase * 3;
|
|
622
|
+
const lenOffsets = numVerts * 3;
|
|
623
|
+
const tempArray = this._scratchMemory.getFloat32Array(lenOffsets);
|
|
624
|
+
const x = offset[0];
|
|
625
|
+
const y = offset[1];
|
|
626
|
+
const z = offset[2];
|
|
627
|
+
for (let i = 0; i < lenOffsets; i += 3) {
|
|
628
|
+
tempArray[i + 0] = x;
|
|
629
|
+
tempArray[i + 1] = y;
|
|
630
|
+
tempArray[i + 2] = z;
|
|
631
|
+
}
|
|
632
|
+
this._state.offsetsBuf.setData(tempArray, firstOffset, lenOffsets);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
//-- RENDERING ----------------------------------------------------------------------------------------------
|
|
636
|
+
|
|
637
|
+
drawColorOpaque(renderFlags, frameCtx) {
|
|
638
|
+
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === this._numPortions || this._numXRayedLayerPortions === this._numPortions) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
if (this._batchingRenderers.colorRenderer) {
|
|
642
|
+
this._batchingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_OPAQUE);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
drawColorTransparent(renderFlags, frameCtx) {
|
|
647
|
+
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numTransparentLayerPortions === 0 || this._numXRayedLayerPortions === this._numPortions) {
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
if (this._batchingRenderers.colorRenderer) {
|
|
651
|
+
this._batchingRenderers.colorRenderer.drawLayer(frameCtx, this, RENDER_PASSES.COLOR_TRANSPARENT);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
drawDepth(renderFlags, frameCtx) {
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
drawNormals(renderFlags, frameCtx) {
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
drawSilhouetteXRayed(renderFlags, frameCtx) {
|
|
662
|
+
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numXRayedLayerPortions === 0) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
if (this._batchingRenderers.silhouetteRenderer) {
|
|
666
|
+
this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_XRAYED);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
drawSilhouetteHighlighted(renderFlags, frameCtx) {
|
|
671
|
+
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numHighlightedLayerPortions === 0) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (this._batchingRenderers.silhouetteRenderer) {
|
|
675
|
+
this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_HIGHLIGHTED);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
drawSilhouetteSelected(renderFlags, frameCtx) {
|
|
680
|
+
if (this._numCulledLayerPortions === this._numPortions || this._numVisibleLayerPortions === 0 || this._numSelectedLayerPortions === 0) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
if (this._batchingRenderers.silhouetteRenderer) {
|
|
684
|
+
this._batchingRenderers.silhouetteRenderer.drawLayer(frameCtx, this, RENDER_PASSES.SILHOUETTE_SELECTED);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
drawEdgesColorOpaque(renderFlags, frameCtx) {
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
drawEdgesColorTransparent(renderFlags, frameCtx) {
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
drawEdgesHighlighted(renderFlags, frameCtx) {
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
drawEdgesSelected(renderFlags, frameCtx) {
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
drawEdgesXRayed(renderFlags, frameCtx) {
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
drawPickMesh(frameCtx) {
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
drawPickDepths(frameCtx) {
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
drawPickNormals(frameCtx) {
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
drawOcclusion(frameCtx) {
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
drawShadow(frameCtx) {
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
destroy() {
|
|
719
|
+
const state = this._state;
|
|
720
|
+
if (state.positionsBuf) {
|
|
721
|
+
state.positionsBuf.destroy();
|
|
722
|
+
state.positionsBuf = null;
|
|
723
|
+
}
|
|
724
|
+
if (state.offsetsBuf) {
|
|
725
|
+
state.offsetsBuf.destroy();
|
|
726
|
+
state.offsetsBuf = null;
|
|
727
|
+
}
|
|
728
|
+
if (state.colorsBuf) {
|
|
729
|
+
state.colorsBuf.destroy();
|
|
730
|
+
state.colorsBuf = null;
|
|
731
|
+
}
|
|
732
|
+
if (state.flagsBuf) {
|
|
733
|
+
state.flagsBuf.destroy();
|
|
734
|
+
state.flagsBuf = null;
|
|
735
|
+
}
|
|
736
|
+
if (state.indicesBuf) {
|
|
737
|
+
state.indicesBuf.destroy();
|
|
738
|
+
state.indicesBuf = null;
|
|
739
|
+
}
|
|
740
|
+
state.destroy();
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export {LinesBatchingLayer};
|