Skip to content

Commit

Permalink
Apply transform to content bounding volume
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Nov 23, 2024
1 parent c0d4f5a commit c82c882
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions specs/TilesetValidationSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,13 @@ describe("Tileset validation", function () {
expect(result.get(0).type).toEqual("BOUNDING_VOLUMES_INCONSISTENT");
});

it("detects no issues in tileContentBoundingVolumeWithTransform", async function () {
const result = await Validators.validateTilesetFile(
"specs/data/tilesets/tileContentBoundingVolumeWithTransform.json"
);
expect(result.length).toEqual(0);
});

it("detects issues in tileContentGroupInvalidIndex", async function () {
const result = await Validators.validateTilesetFile(
"specs/data/tilesets/tileContentGroupInvalidIndex.json"
Expand Down
25 changes: 25 additions & 0 deletions specs/data/tilesets/tileContentBoundingVolumeWithTransform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"asset" : {
"version" : "1.1"
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
"geometricError" : 1.0,
"transform": [
2.0, 0.0, 0.0, 0.0,
0.0, 3.0, 0.0, 0.0,
0.0, 0.0, 4.0, 0.0,
5.0, 6.0, 7.0, 1.0
],
"content": {
"uri": "tiles/glTF/Triangle/Triangle.gltf",
"boundingVolume": {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
}
}
}
}
2 changes: 1 addition & 1 deletion src/validation/TileContentValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class TileContentValidator {
}
const tileBoundingVolume = tile.boundingVolume;
const outerTransform = tile.transform;
const innerTransform = undefined;
const innerTransform = tile.transform;
const errorMessage = BoundingVolumeChecks.checkBoundingVolume(
contentBoundingVolume,
tileBoundingVolume,
Expand Down

0 comments on commit c82c882

Please sign in to comment.