Skip to content

Commit

Permalink
fix(3dtiles): support point cloud attenuated mode in OGC3DTiles layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jailln committed Sep 11, 2024
1 parent 2019826 commit afcb250
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Layer/OGC3DTilesLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class OGC3DTilesLayer extends GeometryLayer {
* @param {String} [config.pntsSizeMode= PNTS_SIZE_MODE.VALUE] {@link PointsMaterial} Point cloud size mode (passed to {@link PointsMaterial}).
* Only 'VALUE' or 'ATTENUATED' are possible. VALUE use constant size, ATTENUATED compute size depending on distance
* from point to camera.
* @param {Number} [config.pntsMinAttenuatedSize=3] Minimum scale used by 'ATTENUATED' size mode.
* @param {Number} [config.pntsMaxAttenuatedSize=10] Maximum scale used by 'ATTENUATED' size mode.
* @param {Number} [config.pntsMinAttenuatedSize=1] Minimum scale used by 'ATTENUATED' size mode.
* @param {Number} [config.pntsMaxAttenuatedSize=7] Maximum scale used by 'ATTENUATED' size mode.
*/
constructor(id, config) {
super(id, new THREE.Group(), { source: config.source });
Expand Down Expand Up @@ -186,8 +186,8 @@ class OGC3DTilesLayer extends GeometryLayer {
this.pntsShape = config.pntsShape ?? PNTS_SHAPE.CIRCLE;
this.classification = config.classification ?? ClassificationScheme.DEFAULT;
this.pntsSizeMode = config.pntsSizeMode ?? PNTS_SIZE_MODE.VALUE;
this.pntsMinAttenuatedSize = config.pntsMinAttenuatedSize || 3;
this.pntsMaxAttenuatedSize = config.pntsMaxAttenuatedSize || 10;
this.pntsMinAttenuatedSize = config.pntsMinAttenuatedSize || 1;
this.pntsMaxAttenuatedSize = config.pntsMaxAttenuatedSize || 7;
}

/**
Expand Down Expand Up @@ -303,7 +303,8 @@ class OGC3DTilesLayer extends GeometryLayer {
}
}

preUpdate() {
preUpdate(context) {
this.scale = context.camera._preSSE;
this.tilesRenderer.update();
return null; // don't return any element because 3d-tiles-renderer already updates them
}
Expand Down

0 comments on commit afcb250

Please sign in to comment.