From c25830228cacf1cdf107e2563d6a24956e7a5566 Mon Sep 17 00:00:00 2001 From: GAETAN LAGIER Date: Wed, 4 Oct 2023 23:13:42 +0200 Subject: [PATCH] update node.js import to make them es compatible --- src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js | 2 +- src/viewer/metadata/MetaModel.js | 6 +++--- src/viewer/scene/index.js | 4 ++-- src/viewer/scene/lod/LOD.js | 4 ++-- src/viewer/scene/lod/LODCullingManager.js | 2 +- src/viewer/scene/lod/LODState.js | 2 +- src/viewer/scene/marker/Marker.js | 2 +- src/viewer/scene/model/SceneModel.js | 10 +++++----- .../scene/model/dtx/triangles/DataTextureGenerator.js | 6 +++--- .../model/dtx/triangles/TrianglesDataTextureLayer.js | 4 ++-- .../TrianglesDataTextureSnapDepthBufInitRenderer.js | 2 +- .../vbo/trianglesBatching/TrianglesBatchingLayer.js | 2 +- .../trianglesInstancing/TrianglesInstancingLayer.js | 2 +- src/viewer/scene/scene/Scene.js | 2 +- src/viewer/scene/vfc/VFC.js | 4 ++-- src/viewer/scene/vfc/VFCManager.js | 2 +- src/viewer/scene/vfc/VFCState.js | 4 ++-- 17 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js b/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js index e11eeca7a5..d9c6234d34 100644 --- a/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +++ b/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js @@ -2,7 +2,7 @@ import {Plugin, SceneModel, utils} from "../../viewer/index.js" import {GLTFSceneModelLoader} from "./GLTFSceneModelLoader.js"; import {GLTFDefaultDataSource} from "./GLTFDefaultDataSource.js"; -import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults"; +import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults.js"; /** * {@link Viewer} plugin that loads models from [glTF](https://www.khronos.org/gltf/). diff --git a/src/viewer/metadata/MetaModel.js b/src/viewer/metadata/MetaModel.js index ec8bc6a840..dc97af6284 100644 --- a/src/viewer/metadata/MetaModel.js +++ b/src/viewer/metadata/MetaModel.js @@ -1,6 +1,6 @@ -import {PropertySet} from "./PropertySet"; -import {MetaObject} from "./MetaObject"; -import {math} from "../scene"; +import {PropertySet} from "./PropertySet.js"; +import {MetaObject} from "./MetaObject.js"; +import {math} from "../scene/math/math.js"; /** * @desc Metadata corresponding to an {@link Entity} that represents a model. diff --git a/src/viewer/scene/index.js b/src/viewer/scene/index.js index 6ed99703d5..3cd392b273 100644 --- a/src/viewer/scene/index.js +++ b/src/viewer/scene/index.js @@ -19,5 +19,5 @@ export * from "./Component.js"; export * from "./utils.js"; export * from "./stats.js"; export * from "./constants/constants.js"; -export * from "./lod"; -export * from "./vfc"; \ No newline at end of file +export * from "./lod/index.js"; +export * from "./vfc/index.js"; \ No newline at end of file diff --git a/src/viewer/scene/lod/LOD.js b/src/viewer/scene/lod/LOD.js index b7d8de76e8..d8a2e47705 100644 --- a/src/viewer/scene/lod/LOD.js +++ b/src/viewer/scene/lod/LOD.js @@ -1,5 +1,5 @@ -import {Component} from "../Component"; -import {LODCullingManager} from "./LODCullingManager"; +import {Component} from "../Component.js"; +import {LODCullingManager} from "./LODCullingManager.js"; /** * Manages LOD culling for {@link SceneModel} implementations. diff --git a/src/viewer/scene/lod/LODCullingManager.js b/src/viewer/scene/lod/LODCullingManager.js index 9bcde1202c..9abcb13eb4 100644 --- a/src/viewer/scene/lod/LODCullingManager.js +++ b/src/viewer/scene/lod/LODCullingManager.js @@ -1,4 +1,4 @@ -import {LODState} from "./LODState"; +import {LODState} from "./LODState.js"; /** * @private diff --git a/src/viewer/scene/lod/LODState.js b/src/viewer/scene/lod/LODState.js index f2be4c50e6..c1037ce4b0 100644 --- a/src/viewer/scene/lod/LODState.js +++ b/src/viewer/scene/lod/LODState.js @@ -5,7 +5,7 @@ * * @private */ -import {math} from "../math"; +import {math} from "../math/math.js"; export class LODState { diff --git a/src/viewer/scene/marker/Marker.js b/src/viewer/scene/marker/Marker.js index 5a57b47155..4ee7e32060 100644 --- a/src/viewer/scene/marker/Marker.js +++ b/src/viewer/scene/marker/Marker.js @@ -1,7 +1,7 @@ import {math} from '../math/math.js'; import {Component} from '../Component.js'; import {worldToRTCPos} from "../math/rtcCoords.js"; -import {SceneModelEntity} from "../model/SceneModelEntity"; +import {SceneModelEntity} from "../model/SceneModelEntity.js"; const tempVec4a = math.vec4(); const tempVec4b = math.vec4(); diff --git a/src/viewer/scene/model/SceneModel.js b/src/viewer/scene/model/SceneModel.js index 82bf288208..4b331814c3 100644 --- a/src/viewer/scene/model/SceneModel.js +++ b/src/viewer/scene/model/SceneModel.js @@ -31,11 +31,11 @@ import { sRGBEncoding } from "../constants/constants.js"; import {createPositionsDecodeMatrix, quantizePositions} from "./compression.js"; -import {uniquifyPositions} from "./dtx/triangles/calculateUniquePositions"; -import {rebucketPositions} from "./dtx/triangles/rebucketPositions"; -import {TrianglesDataTextureLayer} from "./dtx/triangles/TrianglesDataTextureLayer"; -import {SceneModelEntity} from "./SceneModelEntity"; -import {geometryCompressionUtils} from "../math/geometryCompressionUtils"; +import {uniquifyPositions} from "./dtx/triangles/calculateUniquePositions.js"; +import {rebucketPositions} from "./dtx/triangles/rebucketPositions.js"; +import {TrianglesDataTextureLayer} from "./dtx/triangles/TrianglesDataTextureLayer.js"; +import {SceneModelEntity} from "./SceneModelEntity.js"; +import {geometryCompressionUtils} from "../math/geometryCompressionUtils.js"; const tempVec3a = math.vec3(); const tempMat4 = math.mat4(); diff --git a/src/viewer/scene/model/dtx/triangles/DataTextureGenerator.js b/src/viewer/scene/model/dtx/triangles/DataTextureGenerator.js index 660b9e22dc..5e524c11dd 100644 --- a/src/viewer/scene/model/dtx/triangles/DataTextureGenerator.js +++ b/src/viewer/scene/model/dtx/triangles/DataTextureGenerator.js @@ -1,6 +1,6 @@ -import {createRTCViewMat, math} from "../../../math"; -import {BindableDataTexture} from "./BindableDataTexture"; -import {dataTextureRamStats} from "./dataTextureRamStats"; +import {createRTCViewMat, math} from "../../../math/index.js"; +import {BindableDataTexture} from "./BindableDataTexture.js"; +import {dataTextureRamStats} from "./dataTextureRamStats.js"; /** * @private diff --git a/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js b/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js index d758fa235f..696dd2d816 100644 --- a/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js +++ b/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js @@ -6,8 +6,8 @@ import {geometryCompressionUtils} from "../../../math/geometryCompressionUtils.j import {getDataTextureRenderers} from "./TrianglesDataTextureRenderers.js"; import {TrianglesDataTextureBuffer} from "./TrianglesDataTextureBuffer.js"; import {DataTextureState} from "./DataTextureState.js" -import {DataTextureGenerator} from "./DataTextureGenerator"; -import {dataTextureRamStats} from "./dataTextureRamStats"; +import {DataTextureGenerator} from "./DataTextureGenerator.js"; +import {dataTextureRamStats} from "./dataTextureRamStats.js"; /** * 12-bits allowed for object ids. diff --git a/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js b/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js index 8aedca4fb9..a728770975 100644 --- a/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js +++ b/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js @@ -1,6 +1,6 @@ import {Program} from "../../../../webgl/Program.js"; import {math} from "../../../../math/math.js"; -import {createRTCViewMat, getPlaneRTCPos} from "../../../../math"; +import {createRTCViewMat, getPlaneRTCPos} from "../../../../math/index.js"; const tempVec3a = math.vec3(); const tempVec3b = math.vec3(); diff --git a/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js b/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js index 17bc3f9d64..301c07936c 100644 --- a/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js +++ b/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js @@ -8,7 +8,7 @@ import {geometryCompressionUtils} from "../../../math/geometryCompressionUtils.j import {getBatchingRenderers} from "./TrianglesBatchingRenderers.js"; import {TrianglesBatchingBuffer} from "./TrianglesBatchingBuffer.js"; import {quantizePositions, transformAndOctEncodeNormals} from "../../compression.js"; -import {getSnapBatchingRenderers} from "../snapBatching/SnapBatchingRenderers"; +import {getSnapBatchingRenderers} from "../snapBatching/SnapBatchingRenderers.js"; const tempMat4 = math.mat4(); const tempMat4b = math.mat4(); diff --git a/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js b/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js index fbcf515ee7..82c1c0a68c 100644 --- a/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js +++ b/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js @@ -5,7 +5,7 @@ import {math} from "../../../math/math.js"; import {RenderState} from "../../../webgl/RenderState.js"; import {ArrayBuf} from "../../../webgl/ArrayBuf.js"; import {getInstancingRenderers} from "./TrianglesInstancingRenderers.js"; -import {getSnapInstancingRenderers} from "../snapInstancing/SnapInstancingRenderers"; +import {getSnapInstancingRenderers} from "../snapInstancing/SnapInstancingRenderers.js"; const tempUint8Vec4 = new Uint8Array(4); const tempFloat32 = new Float32Array(1); diff --git a/src/viewer/scene/scene/Scene.js b/src/viewer/scene/scene/Scene.js index 13c7d8aeb2..5d0f5b0da7 100644 --- a/src/viewer/scene/scene/Scene.js +++ b/src/viewer/scene/scene/Scene.js @@ -19,7 +19,7 @@ import {SAO} from "../postfx/SAO.js"; import {PointsMaterial} from "../materials/PointsMaterial.js"; import {LinesMaterial} from "../materials/LinesMaterial.js"; import {LOD} from "../lod/LOD.js"; -import {VFC} from "../vfc/VFC"; +import {VFC} from "../vfc/VFC.js"; // Enables runtime check for redundant calls to object state update methods, eg. Scene#_objectVisibilityUpdated const ASSERT_OBJECT_STATE_UPDATE = false; diff --git a/src/viewer/scene/vfc/VFC.js b/src/viewer/scene/vfc/VFC.js index 15a3a71136..902576b677 100644 --- a/src/viewer/scene/vfc/VFC.js +++ b/src/viewer/scene/vfc/VFC.js @@ -1,5 +1,5 @@ -import {Component} from "../Component"; -import {VFCManager} from "./VFCManager"; +import {Component} from "../Component.js"; +import {VFCManager} from "./VFCManager.js"; /** * Manages view frustum culling (VFC) for {@link SceneModel} implementations. diff --git a/src/viewer/scene/vfc/VFCManager.js b/src/viewer/scene/vfc/VFCManager.js index d7841f640d..93aaec689a 100644 --- a/src/viewer/scene/vfc/VFCManager.js +++ b/src/viewer/scene/vfc/VFCManager.js @@ -1,4 +1,4 @@ -import {VFCState} from "./VFCState"; +import {VFCState} from "./VFCState.js"; /** * @private diff --git a/src/viewer/scene/vfc/VFCState.js b/src/viewer/scene/vfc/VFCState.js index c8940fe290..4f2a8f2a82 100644 --- a/src/viewer/scene/vfc/VFCState.js +++ b/src/viewer/scene/vfc/VFCState.js @@ -1,5 +1,5 @@ -import {clusterizeV2} from "./cluster-helper"; -import {math} from "../math"; +import {clusterizeV2} from "./cluster-helper.js"; +import {math} from "../math/math.js"; const tempVec3 = math.vec3();