Skip to content

Commit

Permalink
Merge pull request #9425 from CesiumGS/revert-pick-primitive
Browse files Browse the repository at this point in the history
Revert #9395 Cesium3DTileset pickPrimitive
  • Loading branch information
ebogo1 authored Mar 11, 2021
2 parents 0c31cdf + d0c3b51 commit 37d6d11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 43 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

##### Additions :tada:

- Added `Cesium3DTileset.pickPrimitive` for rendering primitives instead of the tileset during the pick pass.
- Added support for drawing ground primitives on translucent 3D Tiles. [#9399](https://github.com/CesiumGS/cesium/pull/9399)

### 1.79.1 - 2021-03-01
Expand Down
26 changes: 7 additions & 19 deletions Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js";
* @param {String} [options.specularEnvironmentMaps] A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
* @param {Boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
* @param {String} [options.debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
* @param {Object} [options.pickPrimitive] The primitive to be rendered during the pick pass instead of the tileset.
* @param {Boolean} [options.debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
* @param {Boolean} [options.debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
* @param {Boolean} [options.debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.
Expand Down Expand Up @@ -762,13 +761,6 @@ function Cesium3DTileset(options) {
*/
this.backFaceCulling = defaultValue(options.backFaceCulling, true);

/**
* The primitive to be rendered during the pick pass instead of the tileset.
*
* @type {Object}
*/
this.pickPrimitive = options.pickPrimitive;

/**
* This property is for debugging only; it is not optimized for production use.
* <p>
Expand Down Expand Up @@ -2552,17 +2544,13 @@ Cesium3DTileset.prototype.updateForPass = function (
var passStatistics = this._statisticsPerPass[pass];

if (this.show || ignoreCommands) {
if (frameState.passes.pick && defined(this.pickPrimitive)) {
this.pickPrimitive.update(frameState);
} else {
this._pass = pass;
tilesetPassState.ready = update(
this,
frameState,
passStatistics,
passOptions
);
}
this._pass = pass;
tilesetPassState.ready = update(
this,
frameState,
passStatistics,
passOptions
);
}

if (ignoreCommands) {
Expand Down
23 changes: 0 additions & 23 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,29 +719,6 @@ describe(
);
});

function loadTilesetAtFullDetail(url) {
return Cesium3DTilesTester.loadTileset(scene, url).then(function (
tileset
) {
tileset.maximumScreenSpaceError = 0.0;
return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset);
});
}

it("renders pickPrimitive during pick pass if defined", function () {
viewRootOnly();
return when
.all([
loadTilesetAtFullDetail(tilesetUrl),
loadTilesetAtFullDetail(withBatchTableUrl),
])
.then(function (tilesets) {
tilesets[0].pickPrimitive = tilesets[1];
expect(tilesets[0].pickPrimitive).toEqual(tilesets[1]);
expect(scene).toPickPrimitive(tilesets[1]);
});
});

it("verify statistics", function () {
options.url = tilesetUrl;
var tileset = scene.primitives.add(new Cesium3DTileset(options));
Expand Down

0 comments on commit 37d6d11

Please sign in to comment.