Skip to content

Commit

Permalink
Merge pull request #3458 from AnalyticalGraphicsInc/3d-tiles-doc
Browse files Browse the repository at this point in the history
Start of 3D Tiles reference doc
  • Loading branch information
lilleyse committed Jan 26, 2016
2 parents 811f385 + 6a86603 commit eab81fb
Show file tree
Hide file tree
Showing 18 changed files with 754 additions and 183 deletions.
5 changes: 3 additions & 2 deletions Apps/Sandcastle/gallery/Cities.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
if (Cesium.defined(current.building) && (current.building !== pickedBuilding)) {
// Restore original color to building that is no longer selected

// This assignment is nessearcy to work with the set property
// This assignment is necessary to work with the set property
current.building.color = Cesium.Color.clone(current.originalColor, current.building.color);
current.building = undefined;
}
Expand Down Expand Up @@ -386,11 +386,12 @@
var max = styleableProperties[currentPropertyName].maximum;
var delta = max - min;
var content = tile.content;
var batchTableResources = content.batchTableResources;

// Is the tile a Batched 3D Model?
if (content instanceof Cesium.Batched3DModel3DTileContentProvider) {
// Does it have a per-model height property?
var batchTableResources = content.batchTableResources;

if (batchTableResources.hasProperty(currentPropertyName)) {
var length = content.batchSize;
for (var i = 0; i < length; ++i) {
Expand Down
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ Change Log

### TODO

* Added support for [3D Tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/README.md) for streaming massive heterogeneous 3D geospatial datasets. The new Cesium types are:
* `Cesium3DTileset`
* `Cesium3DTile`
* `Batched3DModel3DTileContentProvider`
* `Instanced3DModel3DTileContentProvider`
* `Points3DTileContentProvider`
* `Composite3DTileContentProvider`
* `Tileset3DTileContentProvider`
* `Empty3DTileContentProvider`
* `BatchedModel`
* `Cesium3DTileBatchTableResources`

TODO: these are still private:
* Added `vertexShaderLoaded`, `fragmentShaderLoaded`, `uniformMapLoaded`, `pickVertexShaderLoaded`, `pickFragmentShaderLoaded`, and `pickUniformMapLoaded` callbacks to the `Model` constructor and `Model.fromGltf`.

TODO: this is not finished yet:
* Added support for glTF compression using the `mesh_compression_open3dgc` glTF extension.

### 1.18 - 2016-02-01
Expand Down
53 changes: 38 additions & 15 deletions Source/Scene/Batched3DModel3DTileContentProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ define([
"use strict";

/**
* DOC_TBA
* Represents the contents of a
* {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Batched3DModel/README.md|Batched 3D Model}
* tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/README.md|3D Tiles} tileset.
* <p>
* Use this to access and modify individual features (models) in the tile.
* </p>
* <p>
* Do not construct this directly. Access it through {@link Cesium3DTile#content}.
* </p>
*
* @alias Batched3DModel3DTileContentProvider
* @constructor
*/
function Batched3DModel3DTileContentProvider(tileset, tile, url) {
this._model = undefined;
Expand All @@ -45,17 +56,23 @@ define([
this._tile = tile;

/**
* @readonly
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
this.state = Cesium3DTileContentState.UNLOADED;

/**
* @type {Promise}
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
this.processingPromise = when.defer();

/**
* @type {Promise}
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
this.readyPromise = when.defer();

Expand Down Expand Up @@ -119,9 +136,9 @@ define([
var sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;

/**
* DOC_TBA
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* Use Cesium3DTile#requestContent
* @private
*/
Batched3DModel3DTileContentProvider.prototype.request = function() {
var that = this;
Expand Down Expand Up @@ -149,7 +166,9 @@ define([
};

/**
* DOC_TBA
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
Batched3DModel3DTileContentProvider.prototype.initialize = function(arrayBuffer, byteOffset) {
var byteStart = defaultValue(byteOffset, 0);
Expand Down Expand Up @@ -230,27 +249,31 @@ define([
};

/**
* DOC_TBA
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* Use Cesium3DTile#update
* @private
*/
Batched3DModel3DTileContentProvider.prototype.update = function(owner, frameState) {
Batched3DModel3DTileContentProvider.prototype.update = function(tiles3D, frameState) {
// In the PROCESSING state we may be calling update() to move forward
// the content's resource loading. In the READY state, it will
// actually generate commands.
this._batchTableResources.update(owner, frameState);
this._batchTableResources.update(tiles3D, frameState);
this._model.update(frameState);
};

/**
* DOC_TBA
*/
/**
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
Batched3DModel3DTileContentProvider.prototype.isDestroyed = function() {
return false;
};

/**
* DOC_TBA
* Part of the {@link Cesium3DTileContentProvider} interface.
*
* @private
*/
Batched3DModel3DTileContentProvider.prototype.destroy = function() {
this._model = this._model && this._model.destroy();
Expand Down
Loading

0 comments on commit eab81fb

Please sign in to comment.