Skip to content

Commit

Permalink
fix (3tiles): the refine parameter are inherited from the parent when…
Browse files Browse the repository at this point in the history
… omited

issue #185
  • Loading branch information
NikoSaul committed Sep 18, 2017
1 parent 671cad8 commit 2242aca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/3dtiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$3dTilesLayerRequestVolume.overrideMaterials = true; // custom cesium shaders are not functional
$3dTilesLayerRequestVolume.type = 'geometry';
$3dTilesLayerRequestVolume.visible = true;
$3dTilesLayerRequestVolume.sseThreshold = 1;
$3dTilesLayerRequestVolume.sseThreshold = 1;
// add an event for have information when you move your mouse on a building
itowns.View.prototype.addLayer.call(globe, $3dTilesLayerRequestVolume).then(function _() { window.addEventListener('mousemove', picking, false); })

Expand Down
7 changes: 6 additions & 1 deletion src/Core/Scheduler/Providers/3dTiles_Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ function configureTile(tile, layer, metadata, parent) {
tile.applyMatrix(tile.transform);
tile.geometricError = metadata.geometricError;
tile.tileId = metadata.tileId;
tile.additiveRefinement = (metadata.refine === 'add');
if (metadata.refine) {
tile.additiveRefinement = (metadata.refine.toUpperCase() === 'ADD');
} else {
tile.additiveRefinement = parent ? (parent.additiveRefinement) : false;
}
tile.parentFromLocalTransform = tile.transform;
tile.worldFromLocalTransform = new THREE.Matrix4().multiplyMatrices(parent ? parent.worldFromLocalTransform : new THREE.Matrix4(), tile.parentFromLocalTransform);
const m = new THREE.Matrix4();
Expand All @@ -177,6 +181,7 @@ function configureTile(tile, layer, metadata, parent) {
tile.add(tile.boundingVolume.region);
}
tile.updateMatrixWorld();
console.log(parent);
}

const textDecoder = new TextDecoder('utf-8');
Expand Down
1 change: 0 additions & 1 deletion src/Process/3dTilesProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export function process3dTilesNode(cullingTest, subdivisionTest) {
n.visible = false;
}
}

return returnValue;
}

Expand Down

0 comments on commit 2242aca

Please sign in to comment.