diff --git a/specs/data/createTilesetJson/golden/batchedColors.json b/specs/data/createTilesetJson/golden/batchedColors.json index da276ede..ce832b80 100644 --- a/specs/data/createTilesetJson/golden/batchedColors.json +++ b/specs/data/createTilesetJson/golden/batchedColors.json @@ -6,18 +6,18 @@ "root": { "boundingVolume": { "box": [ - 1215021.7983257836, - -4736318.68538002, - 4081598.138913876, - 99.7920150756836, - 0, - 0, - 0, - -80.52151489257812, - 0, - 0, - 0, - 72.69114303588867 + 1215017.1239874638, + -4736316.080057698, + 4081603.1264158455, + -1.2755385681689153, + 4.9722508120558055, + -4.3138044394725314, + 23.12108928345635, + -52.382444478338165, + -67.21456600138885, + -82.75933184818228, + -27.40170140970006, + -7.11330633281961 ] }, "geometricError": 512, diff --git a/specs/data/createTilesetJson/golden/compositeOfComposite.json b/specs/data/createTilesetJson/golden/compositeOfComposite.json index adf00b32..71cc33a3 100644 --- a/specs/data/createTilesetJson/golden/compositeOfComposite.json +++ b/specs/data/createTilesetJson/golden/compositeOfComposite.json @@ -6,18 +6,18 @@ "root": { "boundingVolume": { "box": [ - 1215015.9515952666, - -4736316.7498844, - 4081604.643510364, - 105.63874559267424, - 0, - 0, - 0, - -85.88219007663429, - 0, - 0, - 0, - 79.19573952420615 + 1215015.740633026, + -4736317.709331602, + 4081606.5029129568, + 91.34493746005317, + 25.73468456069652, + 2.891651051729513, + -3.4712154541846187, + 13.441215114981711, + -9.969208596733905, + -17.541319642226654, + 53.4750698059166, + 78.20677126109172 ] }, "geometricError": 512, diff --git a/specs/data/createTilesetJson/golden/instancedOrientation.json b/specs/data/createTilesetJson/golden/instancedOrientation.json index 1bf09b35..586d151f 100644 --- a/specs/data/createTilesetJson/golden/instancedOrientation.json +++ b/specs/data/createTilesetJson/golden/instancedOrientation.json @@ -6,18 +6,18 @@ "root": { "boundingVolume": { "box": [ - 1215013.369315262, - -4736318.923572363, - 4081608.292171861, - 105.34341248765122, - 0, - 0, - 0, - -84.88524048496038, - 0, - 0, - 0, - 77.50599225633778 + 1215013.9553057784, + -4736317.401766716, + 4081608.2583208485, + 94.07233924993119, + 23.409417534178772, + -0.09196835302048761, + 3.2299425139499625, + -12.935366781680294, + 11.295689722145568, + 15.006058393340421, + -60.592329156800474, + -73.67878617799873 ] }, "geometricError": 512, diff --git a/specs/data/createTilesetJson/golden/plane-ds-p-n-32x32.json b/specs/data/createTilesetJson/golden/plane-ds-p-n-32x32.json new file mode 100644 index 00000000..32d43d44 --- /dev/null +++ b/specs/data/createTilesetJson/golden/plane-ds-p-n-32x32.json @@ -0,0 +1,29 @@ +{ + "asset": { + "version": "1.1" + }, + "geometricError": 4096, + "root": { + "boundingVolume": { + "box": [ + 0.5, + -0.5, + 0.02373488247394555, + 0.5, + 0, + 0, + 0, + 0.5, + 0, + 0, + 0, + 0.12459570169448853 + ] + }, + "geometricError": 512, + "content": { + "uri": "plane-ds-p-n-32x32.glb" + }, + "refine": "ADD" + } +} \ No newline at end of file diff --git a/specs/data/createTilesetJson/golden/pointCloudQuantized.json b/specs/data/createTilesetJson/golden/pointCloudQuantized.json index 3da7a94e..07a4a645 100644 --- a/specs/data/createTilesetJson/golden/pointCloudQuantized.json +++ b/specs/data/createTilesetJson/golden/pointCloudQuantized.json @@ -6,18 +6,18 @@ "root": { "boundingVolume": { "box": [ - 1215012.8828113787, + 1215012.8828113785, -4736313.051275888, 4081605.221184125, - 3.29686427093111, - 0, - 0, - 0, - -4.033112077508122, - 0, - 0, - 0, - 3.5222400242928416 + -0.47557162645481443, + 1.8539892637377, + -1.6084590904482619, + 0.39970621248826527, + -1.5579853508384909, + -1.9139915123575475, + -2.421716515841628, + -0.6212415655677035, + -0.000046958296472575216 ] }, "geometricError": 512, diff --git a/specs/data/createTilesetJson/golden/pointCloudRGB.json b/specs/data/createTilesetJson/golden/pointCloudRGB.json index b256a58c..49ce3d7f 100644 --- a/specs/data/createTilesetJson/golden/pointCloudRGB.json +++ b/specs/data/createTilesetJson/golden/pointCloudRGB.json @@ -7,17 +7,17 @@ "boundingVolume": { "box": [ 1215012.8828876738, - -4736313.051199594, - 4081605.22126042, - 3.2968313694000244, - 0, - 0, - 0, - -4.033046722412109, - 0, - 0, - 0, - 3.522307872772217 + -4736313.051199592, + 4081605.2212604196, + -0.3996615097143036, + 1.557944050844271, + 1.9139178584858318, + -0.4755807147866653, + 1.8538890346388044, + -1.608390185218802, + -2.4215894236642006, + -0.6212136606916396, + 2.19486466616894e-8 ] }, "geometricError": 512, diff --git a/specs/tilesetProcessing/TilesetJsonCreatorSpec.ts b/specs/tilesetProcessing/TilesetJsonCreatorSpec.ts index 442c9c66..59b1de81 100644 --- a/specs/tilesetProcessing/TilesetJsonCreatorSpec.ts +++ b/specs/tilesetProcessing/TilesetJsonCreatorSpec.ts @@ -10,7 +10,7 @@ const goldenDir = "./specs/data/createTilesetJson/golden/"; describe("TilesetJsonCreator", function () { afterEach(function () { - //SpecHelpers.forceDeleteDirectory(targetDir); + SpecHelpers.forceDeleteDirectory(targetDir); }); it("creates correct tileset JSON for batchedColors", async function () { diff --git a/specs/tilesetProcessing/TilesetMergerSpec.ts b/specs/tilesetProcessing/TilesetMergerSpec.ts index dba3644a..c7baa359 100644 --- a/specs/tilesetProcessing/TilesetMergerSpec.ts +++ b/specs/tilesetProcessing/TilesetMergerSpec.ts @@ -15,7 +15,7 @@ const overwrite = true; describe("TilesetMerger", function () { afterEach(function () { - //SpecHelpers.forceDeleteDirectory("./specs/data/output/mergeTilesets"); + SpecHelpers.forceDeleteDirectory("./specs/data/output/mergeTilesets"); }); it("merges tilesets into a single tileset", async function () { diff --git a/src/tilesetProcessing/OrientedBoundingBoxes.ts b/src/tilesetProcessing/OrientedBoundingBoxes.ts index 145ec0b8..18c91f3f 100644 --- a/src/tilesetProcessing/OrientedBoundingBoxes.ts +++ b/src/tilesetProcessing/OrientedBoundingBoxes.ts @@ -22,33 +22,16 @@ export class OrientedBoundingBoxes { * @returns The bounding volume box */ static fromPoints(points: number[][]): number[] { - //return OrientedBoundingBoxes.fromPointsCesium(points); return OrientedBoundingBoxes.fromPointsDitoTs(points); } - /** - * Implementation of 'fromPoints' based on CesiumJS - * - * @param points - The points, as 3-element arrays - * @returns The bounding volume box - */ - static fromPointsCesium(points: number[][]): number[] { - const positions = points.map( - (p: number[]) => new Cartesian3(p[0], p[1], p[2]) - ); - const obb = OrientedBoundingBox.fromPoints(positions, undefined); - const result = Array(12); - OrientedBoundingBox.pack(obb, result, 0); - return result; - } - /** * Implementation of 'fromPoints' based on dito.ts * * @param points - The points, as 3-element arrays * @returns The bounding volume box */ - static fromPointsDitoTs(points: number[][]): number[] { + private static fromPointsDitoTs(points: number[][]): number[] { const attribute = { data: points.flat(), size: 3,