Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Jun 12, 2019
1 parent a25eee9 commit 30126bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
13 changes: 7 additions & 6 deletions modules/3d-tiles/src/tileset/helpers/bounding-volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const scratchTransform = new Matrix4();
* @returns {TileBoundingVolume} The modified result parameter or a new TileBoundingVolume instance if none was provided.
*/
export function createBoundingVolume(boundingVolumeHeader, transform, result) {
result = result || {};
assert(boundingVolumeHeader, '3D Tile: boundingVolume must be defined');
if (boundingVolumeHeader.box) {
// The first three elements define the x, y, and z values for the center of the box.
Expand All @@ -33,9 +34,9 @@ export function createBoundingVolume(boundingVolumeHeader, transform, result) {
center = new Matrix4(transform).transformVector(center);
center = Ellipsoid.WGS84.cartesianToCartographic(center, center);

Object.assign(boundingVolumeHeader, {center});
Object.assign(result, boundingVolumeHeader, {center});

return boundingVolumeHeader;
return result;
// return createBox(boundingVolumeHeader.box, transform, result);
}
if (boundingVolumeHeader.region) {
Expand All @@ -49,9 +50,9 @@ export function createBoundingVolume(boundingVolumeHeader, transform, result) {
degrees((north + south) / 2),
(minHeight + maxHeight) / 2
);
Object.assign(boundingVolumeHeader, {center});
Object.assign(result, boundingVolumeHeader, {center});

return boundingVolumeHeader;
return result;
// return createRegion(boundingVolumeHeader.region, transform, this._initialTransform, result);
}
if (boundingVolumeHeader.sphere) {
Expand All @@ -62,9 +63,9 @@ export function createBoundingVolume(boundingVolumeHeader, transform, result) {
center = new Matrix4(transform).transformVector(center);
center = Ellipsoid.WGS84.cartesianToCartographic(center, center);

Object.assign(boundingVolumeHeader, {center});
Object.assign(result, boundingVolumeHeader, {center});

return boundingVolumeHeader;
return result;
// return createSphere(boundingVolumeHeader.sphere, transform, result);
}
throw new Error('3D Tile: boundingVolume must contain a sphere, region, or box');
Expand Down
14 changes: 0 additions & 14 deletions modules/3d-tiles/src/tileset/tile-3d-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ export default class Tile3DHeader {
return this._contentBoundingVolume || this._boundingVolume;
}

// Get the bounding region derived from the tile's bounding volume.
get boundingRegion() {
return this._boundingVolume.boundingBox;
}

// Get the bounding box derived from the tile's bounding volume.
get boundingBox() {
return this._boundingVolume.boundingRegion;
}

// Get the bounding sphere derived from the tile's bounding volume.
get boundingSphere() {
return this._boundingVolume.boundingSphere;
Expand All @@ -165,10 +155,6 @@ export default class Tile3DHeader {
return this._depth;
}

get viewState() {
return this._viewState;
}

// Get the tile's screen space error.
getScreenSpaceError({frustum, width, height}, useParentGeometricError) {
const tileset = this._tileset;
Expand Down

0 comments on commit 30126bf

Please sign in to comment.