diff --git a/Apps/Sandcastle/gallery/3D Tiles.html b/Apps/Sandcastle/gallery/3D Tiles.html index 34d9ce25d0e5..f776a342121f 100644 --- a/Apps/Sandcastle/gallery/3D Tiles.html +++ b/Apps/Sandcastle/gallery/3D Tiles.html @@ -48,6 +48,8 @@ name : 'Batched', url : '../../../Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/' }, { name : 'Instanced', url : '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/' +}, { + name : 'Instanced/Orientation', url : '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/' }, { name : 'Composite', url : '../../../Specs/Data/Cesium3DTiles/Composite/Composite/' }, { diff --git a/Source/Scene/Cesium3DTileFeatureTableResources.js b/Source/Scene/Cesium3DTileFeatureTableResources.js new file mode 100644 index 000000000000..7334421782f2 --- /dev/null +++ b/Source/Scene/Cesium3DTileFeatureTableResources.js @@ -0,0 +1,85 @@ +/*global define*/ +define([ + '../Core/ComponentDatatype', + '../Core/defaultValue', + '../Core/defined', + '../Core/DeveloperError' + ], function( + ComponentDatatype, + defaultValue, + defined, + DeveloperError) { + 'use strict'; + + /** + * @private + */ + function Cesium3DTileFeatureTableResources(featureTableJSON, featureTableBinary) { + this.json = featureTableJSON; + this.buffer = featureTableBinary; + this._cachedArrayBufferViews = {}; + this.featuresLength = 0; + } + + Cesium3DTileFeatureTableResources.prototype.getTypedArrayForSemantic = function(semantic, byteOffset, componentType, count, featureSize) { + //>>includeStart('debug', pragmas.debug); + if (!defined(byteOffset)) { + throw new DeveloperError('byteOffset must be defined to read from binary data for semantic: ' + semantic); + } + if (!defined(componentType)) { + throw new DeveloperError('componentType must be defined to read from binary data for semantic: ' + semantic); + } + if (!defined(count)) { + throw new DeveloperError('count must be defined to read from binary data for semantic: ' + semantic); + } + //>>includeEnd('debug'); + var cachedArrayBufferViews = this._cachedArrayBufferViews; + var arrayBuffer = cachedArrayBufferViews[semantic]; + if (!defined(arrayBuffer)) { + arrayBuffer = ComponentDatatype.createArrayBufferView(componentType, this.buffer.buffer, this.buffer.byteOffset + byteOffset, count * featureSize); + cachedArrayBufferViews[semantic] = arrayBuffer; + } + return arrayBuffer; + }; + + Cesium3DTileFeatureTableResources.prototype.getGlobalProperty = function(semantic, componentType, count) { + var jsonValue = this.json[semantic]; + if (defined(jsonValue)) { + var byteOffset = jsonValue.byteOffset; + if (defined(byteOffset)) { + // This is a reference to the binary + count = defaultValue(count, 1); + var typedArray = this.getTypedArrayForSemantic(semantic, byteOffset, componentType, count, 1); + var subArray = typedArray.subarray(0, count); + if (subArray.length === 1) { + return subArray[0]; + } + return subArray; + } + } + return jsonValue; + }; + + Cesium3DTileFeatureTableResources.prototype.getProperty = function(semantic, featureId, componentType, featureSize) { + var jsonValue = this.json[semantic]; + if (defined(jsonValue)) { + var byteOffset = jsonValue.byteOffset; + if (defined(byteOffset)) { + // This is a reference to the binary + featureSize = defaultValue(featureSize, 1); + var typedArray = this.getTypedArrayForSemantic(semantic, byteOffset, componentType, this.featuresLength, featureSize); + var subArray = typedArray.subarray(featureId * featureSize, featureId * featureSize + featureSize); + if (subArray.length === 1) { + return subArray[0]; + } + return subArray; + } + } + if (Array.isArray(jsonValue)) { + return jsonValue.slice(featureId * featureSize, featureId * featureSize + featureSize); + } + return jsonValue; + }; + + return Cesium3DTileFeatureTableResources; +}); \ No newline at end of file diff --git a/Source/Scene/Instanced3DModel3DTileContent.js b/Source/Scene/Instanced3DModel3DTileContent.js index b8160f86e882..d8b226d5365a 100644 --- a/Source/Scene/Instanced3DModel3DTileContent.js +++ b/Source/Scene/Instanced3DModel3DTileContent.js @@ -1,7 +1,10 @@ /*global define*/ define([ + '../Core/AttributeCompression', + '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Color', + '../Core/ComponentDatatype', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -12,20 +15,28 @@ define([ '../Core/getStringFromTypedArray', '../Core/joinUrls', '../Core/loadArrayBuffer', + '../Core/Matrix3', '../Core/Matrix4', + '../Core/Math', + '../Core/Quaternion', '../Core/Request', '../Core/RequestScheduler', '../Core/RequestType', '../Core/Transforms', + '../Core/TranslationRotationScale', '../ThirdParty/Uri', '../ThirdParty/when', './Cesium3DTileFeature', './Cesium3DTileBatchTableResources', './Cesium3DTileContentState', + './Cesium3DTileFeatureTableResources', './ModelInstanceCollection' ], function( + AttributeCompression, + Cartesian2, Cartesian3, Color, + ComponentDatatype, defaultValue, defined, defineProperties, @@ -36,16 +47,21 @@ define([ getStringFromTypedArray, joinUrls, loadArrayBuffer, + Matrix3, Matrix4, + CesiumMath, + Quaternion, Request, RequestScheduler, RequestType, Transforms, + TranslationRotationScale, Uri, when, Cesium3DTileFeature, Cesium3DTileBatchTableResources, Cesium3DTileContentState, + Cesium3DTileFeatureTableResources, ModelInstanceCollection) { 'use strict'; @@ -149,16 +165,13 @@ define([ return this._features[batchId]; }; - var sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT; var sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT; - var sizeOfFloat64 = Float64Array.BYTES_PER_ELEMENT; /** * Part of the {@link Cesium3DTileContent} interface. */ Instanced3DModel3DTileContent.prototype.request = function() { var that = this; - var distance = this._tile.distanceToCamera; var promise = RequestScheduler.schedule(new Request({ url : this._url, @@ -200,8 +213,8 @@ define([ var view = new DataView(arrayBuffer); byteOffset += sizeOfUint32; // Skip magic number - //>>includeStart('debug', pragmas.debug); var version = view.getUint32(byteOffset, true); + //>>includeStart('debug', pragmas.debug); if (version !== 1) { throw new DeveloperError('Only Instanced 3D Model version 1 is supported. Version ' + version + ' is not.'); } @@ -211,45 +224,73 @@ define([ // Skip byteLength byteOffset += sizeOfUint32; - var batchTableByteLength = view.getUint32(byteOffset, true); + var featureTableJSONByteLength = view.getUint32(byteOffset, true); + //>>includeStart('debug', pragmas.debug); + if (featureTableJSONByteLength === 0) { + throw new DeveloperError('featureTableJSONByteLength is zero, the feature table must be defined.'); + } + //>>includeEnd('debug'); byteOffset += sizeOfUint32; - var gltfByteLength = view.getUint32(byteOffset, true); + var featureTableBinaryByteLength = view.getUint32(byteOffset, true); byteOffset += sizeOfUint32; - var gltfFormat = view.getUint32(byteOffset, true); + var batchTableJSONByteLength = view.getUint32(byteOffset, true); byteOffset += sizeOfUint32; - var instancesLength = view.getUint32(byteOffset, true); + var batchTableBinaryByteLength = view.getUint32(byteOffset, true); + byteOffset += sizeOfUint32; + + var gltfByteLength = view.getUint32(byteOffset, true); + //>>includeStart('debug', pragmas.debug); + if (gltfByteLength === 0) { + throw new DeveloperError('glTF byte length is zero, i3dm must have a glTF to instance.'); + } + //>>includeEnd('debug'); + byteOffset += sizeOfUint32; + + var gltfFormat = view.getUint32(byteOffset, true); + //>>includeStart('debug', pragmas.debug); + if (gltfFormat !== 1 && gltfFormat !== 0) { + throw new DeveloperError('Only glTF format 0 (uri) or 1 (embedded) are supported. Format ' + gltfFormat + ' is not.'); + } + //>>includeEnd('debug'); byteOffset += sizeOfUint32; + var featureTableString = getStringFromTypedArray(uint8Array, byteOffset, featureTableJSONByteLength); + var featureTableJSON = JSON.parse(featureTableString); + byteOffset += featureTableJSONByteLength; + + var featureTableBinary = new Uint8Array(arrayBuffer, byteOffset, featureTableBinaryByteLength); + byteOffset += featureTableBinaryByteLength; + + var featureTableResources = new Cesium3DTileFeatureTableResources(featureTableJSON, featureTableBinary); + var instancesLength = featureTableResources.getGlobalProperty('INSTANCES_LENGTH', ComponentDatatype.UNSIGNED_INT); + if (Array.isArray(instancesLength)) { + instancesLength = instancesLength[0]; + } + featureTableResources.featuresLength = instancesLength; + //>>includeStart('debug', pragmas.debug); - if ((gltfFormat !== 0) && (gltfFormat !== 1)) { - throw new DeveloperError('Only glTF format 0 (uri) or 1 (embedded) are supported. Format ' + gltfFormat + ' is not'); + if (!defined(instancesLength)) { + throw new DeveloperError('Feature table global property: INSTANCES_LENGTH must be defined'); } //>>includeEnd('debug'); var batchTableResources = new Cesium3DTileBatchTableResources(this, instancesLength); this.batchTableResources = batchTableResources; - var hasBatchTable = false; - if (batchTableByteLength > 0) { - hasBatchTable = true; - var batchTableString = getStringFromTypedArray(uint8Array, byteOffset, batchTableByteLength); + if (batchTableJSONByteLength > 0) { + var batchTableString = getStringFromTypedArray(uint8Array, byteOffset, batchTableJSONByteLength); batchTableResources.batchTable = JSON.parse(batchTableString); - byteOffset += batchTableByteLength; + byteOffset += batchTableJSONByteLength; } + // TODO: Right now batchTableResources doesn't support binary + byteOffset += batchTableBinaryByteLength; + var gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength); byteOffset += gltfByteLength; - // Each vertex has a longitude, latitude, and optionally batchId if there is a batch table - // Coordinates are in double precision, batchId is a short - var instanceByteLength = sizeOfFloat64 * 2 + (hasBatchTable ? sizeOfUint16 : 0); - var instancesByteLength = instancesLength * instanceByteLength; - - var instancesView = new DataView(arrayBuffer, byteOffset, instancesByteLength); - byteOffset += instancesByteLength; - // Create model instance collection var collectionOptions = { instances : new Array(instancesLength), @@ -265,35 +306,120 @@ define([ if (gltfFormat === 0) { var gltfUrl = getStringFromTypedArray(gltfView); - collectionOptions.url = joinUrls(this._tileset.baseUrl, gltfUrl); + var baseUrl = defaultValue(this._tileset.baseUrl, ''); + collectionOptions.url = joinUrls(baseUrl, gltfUrl); } else { collectionOptions.gltf = gltfView; collectionOptions.basePath = this._url; } - var ellipsoid = Ellipsoid.WGS84; - var position = new Cartesian3(); var instances = collectionOptions.instances; - byteOffset = 0; - - for (var i = 0; i < instancesLength; ++i) { - // Get longitude and latitude - var longitude = instancesView.getFloat64(byteOffset, true); - byteOffset += sizeOfFloat64; - var latitude = instancesView.getFloat64(byteOffset, true); - byteOffset += sizeOfFloat64; - var height = 0.0; - - // Get batch id. If there is no batch table, the batch id is the array index. - var batchId = i; - if (hasBatchTable) { - batchId = instancesView.getUint16(byteOffset, true); - byteOffset += sizeOfUint16; + var instancePosition = new Cartesian3(); + var instancePositionArray = new Array(3); + var instanceNormalRight = new Cartesian3(); + var instanceNormalUp = new Cartesian3(); + var instanceNormalForward = new Cartesian3(); + var instanceRotation = new Matrix3(); + var instanceQuaternion = new Quaternion(); + var instanceScale = new Cartesian3(); + var instanceTranslationRotationScale = new TranslationRotationScale(); + var instanceTransform = new Matrix4(); + for (var i = 0; i < instancesLength; i++) { + // Get the instance position + var position = featureTableResources.getProperty('POSITION', i, ComponentDatatype.FLOAT, 3); + if (!defined(position)) { + position = instancePositionArray; + var positionQuantized = featureTableResources.getProperty('POSITION_QUANTIZED', i, ComponentDatatype.UNSIGNED_SHORT, 3); + //>>includeStart('debug', pragmas.debug); + if (!defined(positionQuantized)) { + throw new DeveloperError('Either POSITION or POSITION_QUANTIZED must be defined for each instance.'); + } + //>>includeEnd('debug'); + var quantizedVolumeOffset = featureTableResources.getGlobalProperty('QUANTIZED_VOLUME_OFFSET', ComponentDatatype.FLOAT, 3); + //>>includeStart('debug', pragmas.debug); + if (!defined(quantizedVolumeOffset)) { + throw new DeveloperError('Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.'); + } + //>>includeEnd('debug'); + var quantizedVolumeScale = featureTableResources.getGlobalProperty('QUANTIZED_VOLUME_SCALE', ComponentDatatype.FLOAT, 3); + //>>includeStart('debug', pragmas.debug); + if (!defined(quantizedVolumeScale)) { + throw new DeveloperError('Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.'); + } + //>>includeEnd('debug'); + for (var j = 0; j < 3; j++) { + position[j] = (positionQuantized[j] / 65535.0 * quantizedVolumeScale[j]) + quantizedVolumeOffset[j]; + } } + Cartesian3.unpack(position, 0, instancePosition); + instanceTranslationRotationScale.translation = instancePosition; + + // Get the instance rotation + var normalUp = featureTableResources.getProperty('NORMAL_UP', i, ComponentDatatype.FLOAT, 3); + var normalRight = featureTableResources.getProperty('NORMAL_RIGHT', i, ComponentDatatype.FLOAT, 3); + var hasCustomOrientation = false; + if (defined(normalUp)) { + //>>includeStart('debug', pragmas.debug); + if (!defined(normalRight)) { + throw new DeveloperError('To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.'); + } + //>>includeEnd('debug'); + Cartesian3.unpack(normalUp, 0, instanceNormalUp); + Cartesian3.unpack(normalRight, 0, instanceNormalRight); + hasCustomOrientation = true; + } else { + var octNormalUp = featureTableResources.getProperty('NORMAL_UP_OCT32P', i, ComponentDatatype.UNSIGNED_SHORT, 2); + var octNormalRight = featureTableResources.getProperty('NORMAL_RIGHT_OCT32P', i, ComponentDatatype.UNSIGNED_SHORT, 2); + if (defined(octNormalUp)) { + //>>includeStart('debug', pragmas.debug); + if (!defined(octNormalRight)) { + throw new DeveloperError('To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.'); + } + //>>includeEnd('debug'); + AttributeCompression.octDecodeInRange(octNormalUp[0], octNormalUp[1], 65535, instanceNormalUp); + AttributeCompression.octDecodeInRange(octNormalRight[0], octNormalRight[1], 65535, instanceNormalRight); + hasCustomOrientation = true; + } else { + // Custom orientation is not defined, default to WGS84 + Transforms.eastNorthUpToFixedFrame(instancePosition, Ellipsoid.WGS84, instanceTransform); + Matrix4.getRotation(instanceTransform, instanceRotation); + } + } + if (hasCustomOrientation) { + Cartesian3.cross(instanceNormalRight, instanceNormalUp, instanceNormalForward); + Cartesian3.normalize(instanceNormalForward, instanceNormalForward); + Matrix3.setColumn(instanceRotation, 0, instanceNormalRight, instanceRotation); + Matrix3.setColumn(instanceRotation, 1, instanceNormalUp, instanceRotation); + Matrix3.setColumn(instanceRotation, 2, instanceNormalForward, instanceRotation); + } + Quaternion.fromRotationMatrix(instanceRotation, instanceQuaternion); + instanceTranslationRotationScale.rotation = instanceQuaternion; + + // Get the instance scale + instanceScale.x = 1.0; + instanceScale.y = 1.0; + instanceScale.z = 1.0; + var scale = featureTableResources.getProperty('SCALE', i, ComponentDatatype.FLOAT); + if (defined(scale)) { + Cartesian3.multiplyByScalar(instanceScale, scale, instanceScale); + } + var nonUniformScale = featureTableResources.getProperty('SCALE_NON_UNIFORM', i, ComponentDatatype.FLOAT, 3); + if (defined(nonUniformScale)) { + instanceScale.x *= nonUniformScale[0]; + instanceScale.y *= nonUniformScale[1]; + instanceScale.z *= nonUniformScale[2]; + } + instanceTranslationRotationScale.scale = instanceScale; - Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, position); - var modelMatrix = Transforms.eastNorthUpToFixedFrame(position); - + // Get the batchId + var batchId = featureTableResources.getProperty('BATCH_ID', i , ComponentDatatype.UNSIGNED_SHORT); + if (!defined(batchId)) { + // If BATCH_ID semantic is undefined, batchId is just the instance number + batchId = i; + } + // Create the model matrix and the instance + Matrix4.fromTranslationRotationScale(instanceTranslationRotationScale, instanceTransform); + var modelMatrix = instanceTransform.clone(); instances[i] = { modelMatrix : modelMatrix, batchId : batchId diff --git a/Specs/Cesium3DTilesTester.js b/Specs/Cesium3DTilesTester.js index 3d1ffbb768a8..f4250d12be26 100644 --- a/Specs/Cesium3DTilesTester.js +++ b/Specs/Cesium3DTilesTester.js @@ -199,32 +199,47 @@ define([ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var magic = defaultValue(options.magic, [105, 51, 100, 109]); var version = defaultValue(options.version, 1); + var gltfFormat = defaultValue(options.gltfFormat, 1); + var gltfUri = defaultValue(options.gltfUri, ''); + var gltfUriByteLength = gltfUri.length; + var featuresLength = defaultValue(options.featuresLength, 1); + var featureTableJSON = { + INSTANCES_LENGTH : featuresLength, + POSITION : new Array(featuresLength * 3).fill(0) + }; + var featureTableJSONString = JSON.stringify(featureTableJSON); + var featureTableJSONByteLength = featureTableJSONString.length; - var headerByteLength = 28; - var instancesByteLength = featuresLength * 16; - var byteLength = headerByteLength + instancesByteLength; + var headerByteLength = 36; + var uriByteLength = gltfUri.length; + var byteLength = headerByteLength + featureTableJSONByteLength + uriByteLength; var buffer = new ArrayBuffer(byteLength); var view = new DataView(buffer); view.setUint8(0, magic[0]); view.setUint8(1, magic[1]); view.setUint8(2, magic[2]); view.setUint8(3, magic[3]); - view.setUint32(4, version, true); // version - view.setUint32(8, byteLength, true); // byteLength - view.setUint32(12, 0, true); // batchTableByteLength - view.setUint32(16, 0, true); // gltfByteLength - view.setUint32(20, gltfFormat, true); // gltfFormat - view.setUint32(24, featuresLength, true); // featuresLength + view.setUint32(4, version, true); // version + view.setUint32(8, byteLength, true); // byteLength + view.setUint32(12, featureTableJSONByteLength, true); // featureTableJSONByteLength + view.setUint32(16, 0, true); // featureTableBinaryByteLength + view.setUint32(20, 0, true); // batchTableJSONByteLength + view.setUint32(24, 0, true); // batchTableBinaryByteLength + view.setUint32(28, gltfUriByteLength, true); // gltfByteLength + view.setUint32(36, gltfFormat, true); // gltfFormat + var i; var byteOffset = headerByteLength; - for (var j = 0; j < featuresLength; ++j) { - view.setFloat64(byteOffset, 0.0, true); - view.setFloat64(byteOffset + 8, 0.0, true); - byteOffset += 16; + for (i = 0; i < featureTableJSONByteLength; i++) { + view.setUint8(byteOffset, featureTableJSONString.charCodeAt(i)); + byteOffset++; + } + for (i = 0; i < gltfUriByteLength; i++) { + view.setUint8(byteOffset, gltfUri.charCodeAt(i)); + byteOffset++; } - return buffer; }; diff --git a/Specs/Data/Cesium3DTiles/Composite/Composite/composite.cmpt b/Specs/Data/Cesium3DTiles/Composite/Composite/composite.cmpt index 32b3ac0eac09..36da812ec98f 100644 Binary files a/Specs/Data/Cesium3DTiles/Composite/Composite/composite.cmpt and b/Specs/Data/Cesium3DTiles/Composite/Composite/composite.cmpt differ diff --git a/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/compositeOfComposite.cmpt b/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/compositeOfComposite.cmpt index 7149e7ebc404..2fca8ba959ec 100644 Binary files a/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/compositeOfComposite.cmpt and b/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/compositeOfComposite.cmpt differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/instancedGltfEmbedded.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/instancedGltfEmbedded.i3dm deleted file mode 100644 index b7df99f1fed2..000000000000 Binary files a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/instancedGltfEmbedded.i3dm and /dev/null differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/Box.glb b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/Box.glb new file mode 100644 index 000000000000..3e90b83888c3 Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/Box.glb differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/instancedGltfExternal.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/instancedGltfExternal.i3dm index 828a5bbf2882..66a4127e1cde 100644 Binary files a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/instancedGltfExternal.i3dm and b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/instancedGltfExternal.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/sphere.glb b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/sphere.glb deleted file mode 100644 index 41bbb5e40e60..000000000000 Binary files a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/sphere.glb and /dev/null differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tileset.json index f1ac603c5e97..42127ac5bf1b 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tileset.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tileset.json @@ -16,8 +16,8 @@ "maximum": 0.6988894207110236 }, "Height": { - "minimum": 15, - "maximum": 15 + "minimum": 0, + "maximum": 80 } }, "geometricError": 40, @@ -25,12 +25,12 @@ "refine": "add", "boundingVolume": { "region": [ - -1.3197004795898053, - 0.6988582109, - -1.3196595204101946, - 0.6988897891, + -1.3197004048940548, + 0.6988585409308616, + -1.3196602716044172, + 0.6988894207110236, 0, - 15 + 80 ] }, "geometricError": 0, diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/instancedOct32POrientationWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/instancedOct32POrientationWithBatchTable.i3dm new file mode 100644 index 000000000000..bc7ffdb1c735 Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/instancedOct32POrientationWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/tileset.json new file mode 100644 index 000000000000..a28b1c03aed3 --- /dev/null +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/tileset.json @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "0.0" + }, + "properties": { + "id": { + "minimum": 0, + "maximum": 99 + }, + "Longitude": { + "minimum": -1.3197004048940548, + "maximum": -1.3196602716044172 + }, + "Latitude": { + "minimum": 0.6988585409308616, + "maximum": 0.6988894207110236 + }, + "Height": { + "minimum": 0, + "maximum": 80 + } + }, + "geometricError": 40, + "refine": "add", + "root": { + "boundingVolume": { + "region": [ + -1.3197004795898053, + 0.6988582109, + -1.3196595204101946, + 0.6988897891, + 0, + 80 + ] + }, + "geometricError": 0, + "content": { + "url": "instancedOct32POrientationWithBatchTable.i3dm" + } + } +} diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/instancedOrientationWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/instancedOrientationWithBatchTable.i3dm new file mode 100644 index 000000000000..b034bac861c5 Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/instancedOrientationWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/tileset.json new file mode 100644 index 000000000000..9861fccdc412 --- /dev/null +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/tileset.json @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "0.0" + }, + "properties": { + "id": { + "minimum": 0, + "maximum": 99 + }, + "Longitude": { + "minimum": -1.3197004048940548, + "maximum": -1.3196602716044172 + }, + "Latitude": { + "minimum": 0.6988585409308616, + "maximum": 0.6988894207110236 + }, + "Height": { + "minimum": 0, + "maximum": 80 + } + }, + "geometricError": 40, + "refine": "add", + "root": { + "boundingVolume": { + "region": [ + -1.3197004795898053, + 0.6988582109, + -1.3196595204101946, + 0.6988897891, + 0, + 80 + ] + }, + "geometricError": 0, + "content": { + "url": "instancedOrientationWithBatchTable.i3dm" + } + } +} diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/instancedQuantizedOct32POrientationWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/instancedQuantizedOct32POrientationWithBatchTable.i3dm new file mode 100644 index 000000000000..ee38865e49e9 Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/instancedQuantizedOct32POrientationWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/tileset.json new file mode 100644 index 000000000000..6e838a85347b --- /dev/null +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/tileset.json @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "0.0" + }, + "properties": { + "id": { + "minimum": 0, + "maximum": 99 + }, + "Longitude": { + "minimum": -1.3197004048940548, + "maximum": -1.3196602716044172 + }, + "Latitude": { + "minimum": 0.6988585409308616, + "maximum": 0.6988894207110236 + }, + "Height": { + "minimum": 0, + "maximum": 80 + } + }, + "geometricError": 40, + "refine": "add", + "root": { + "boundingVolume": { + "region": [ + -1.3197004795898053, + 0.6988582109, + -1.3196595204101946, + 0.6988897891, + 0, + 80 + ] + }, + "geometricError": 0, + "content": { + "url": "instancedQuantizedOct32POrientationWithBatchTable.i3dm" + } + } +} diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/instancedQuantizedWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/instancedQuantizedWithBatchTable.i3dm new file mode 100644 index 000000000000..c6bad524bf9f Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/instancedQuantizedWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/tileset.json new file mode 100644 index 000000000000..a8342b5bb849 --- /dev/null +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/tileset.json @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "0.0" + }, + "properties": { + "id": { + "minimum": 0, + "maximum": 99 + }, + "Longitude": { + "minimum": -1.3197004048940548, + "maximum": -1.3196602716044172 + }, + "Latitude": { + "minimum": 0.6988585409308616, + "maximum": 0.6988894207110236 + }, + "Height": { + "minimum": 0, + "maximum": 80 + } + }, + "geometricError": 40, + "refine": "add", + "root": { + "boundingVolume": { + "region": [ + -1.3197004795898053, + 0.6988582109, + -1.3196595204101946, + 0.6988897891, + 0, + 80 + ] + }, + "geometricError": 0, + "content": { + "url": "instancedQuantizedWithBatchTable.i3dm" + } + } +} diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/instancedScaleNonUniformWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/instancedScaleNonUniformWithBatchTable.i3dm new file mode 100644 index 000000000000..e921403dbd52 Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/instancedScaleNonUniformWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/tileset.json new file mode 100644 index 000000000000..2d430f76ac21 --- /dev/null +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/tileset.json @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "0.0" + }, + "properties": { + "id": { + "minimum": 0, + "maximum": 99 + }, + "Longitude": { + "minimum": -1.3197004048940548, + "maximum": -1.3196602716044172 + }, + "Latitude": { + "minimum": 0.6988585409308616, + "maximum": 0.6988894207110236 + }, + "Height": { + "minimum": 0, + "maximum": 80 + } + }, + "geometricError": 40, + "refine": "add", + "root": { + "boundingVolume": { + "region": [ + -1.3197004795898053, + 0.6988582109, + -1.3196595204101946, + 0.6988897891, + 0, + 80 + ] + }, + "geometricError": 0, + "content": { + "url": "instancedScaleNonUniformWithBatchTable.i3dm" + } + } +} diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/instancedScaleWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/instancedScaleWithBatchTable.i3dm new file mode 100644 index 000000000000..eaf5213f072c Binary files /dev/null and b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/instancedScaleWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/tileset.json similarity index 86% rename from Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tileset.json rename to Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/tileset.json index f162448debf6..ed762aa079d2 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tileset.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/tileset.json @@ -16,8 +16,8 @@ "maximum": 0.6988894207110236 }, "Height": { - "minimum": 15, - "maximum": 15 + "minimum": 0, + "maximum": 80 } }, "geometricError": 40, @@ -30,12 +30,12 @@ -1.3196595204101946, 0.6988897891, 0, - 15 + 80 ] }, "geometricError": 0, "content": { - "url": "instancedGltfEmbedded.i3dm" + "url": "instancedScaleWithBatchTable.i3dm" } } } diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/instancedWithBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/instancedWithBatchTable.i3dm index b7df99f1fed2..28164687123a 100644 Binary files a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/instancedWithBatchTable.i3dm and b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/instancedWithBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json index 040f9306763f..b43b5830c52a 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json @@ -16,8 +16,8 @@ "maximum": 0.6988894207110236 }, "Height": { - "minimum": 15, - "maximum": 15 + "minimum": 0, + "maximum": 80 } }, "geometricError": 40, @@ -30,7 +30,7 @@ -1.3196595204101946, 0.6988897891, 0, - 15 + 80 ] }, "geometricError": 0, diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/instancedWithoutBatchTable.i3dm b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/instancedWithoutBatchTable.i3dm index 761d0f78236e..fdae0666336e 100644 Binary files a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/instancedWithoutBatchTable.i3dm and b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/instancedWithoutBatchTable.i3dm differ diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tileset.json index abe6de0d220a..c4e72e9325c9 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tileset.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tileset.json @@ -16,8 +16,8 @@ "maximum": 0.6988894207110236 }, "Height": { - "minimum": 15, - "maximum": 15 + "minimum": 0, + "maximum": 80 } }, "geometricError": 40, @@ -25,12 +25,12 @@ "refine": "add", "boundingVolume": { "region": [ - -1.3197004795898053, - 0.6988582109, - -1.3196595204101946, - 0.6988897891, + -1.3197004048940548, + 0.6988585409308616, + -1.3196602716044172, + 0.6988894207110236, 0, - 15 + 80 ] }, "geometricError": 0, diff --git a/Specs/Scene/Cesium3DTileFeatureTableResourcesSpec.js b/Specs/Scene/Cesium3DTileFeatureTableResourcesSpec.js new file mode 100644 index 000000000000..135dfa1a21be --- /dev/null +++ b/Specs/Scene/Cesium3DTileFeatureTableResourcesSpec.js @@ -0,0 +1,65 @@ +/*global defineSuite*/ +defineSuite([ + 'Core/ComponentDatatype', + 'Scene/Cesium3DTileFeatureTableResources' + ], function( + ComponentDatatype, + Cesium3DTileFeatureTableResources) { + 'use strict'; + + it('getTypedArrayForSemantic throws exception if byteOffset is not defined', function() { + var featureTable = new Cesium3DTileFeatureTableResources(); + expect(function() { + featureTable.getTypedArrayForSemantic('TEST', undefined, ComponentDatatype.UNSIGNED_INT, 5, 1); + }).toThrowDeveloperError(); + }); + + it('getTypedArrayForSemantic throws exception if componentType is not defined', function() { + var featureTable = new Cesium3DTileFeatureTableResources(); + expect(function() { + featureTable.getTypedArrayForSemantic('TEST', 0, undefined, 5, 1); + }).toThrowDeveloperError(); + }); + + it('getTypedArrayForSemantic throws exception if count is not defined', function() { + var featureTable = new Cesium3DTileFeatureTableResources(); + expect(function() { + featureTable.getTypedArrayForSemantic('TEST', 0, ComponentDatatype.UNSIGNED_INT, undefined, 1); + }).toThrowDeveloperError(); + }); + + it('loads from JSON', function() { + var featureTable = new Cesium3DTileFeatureTableResources({ + TEST : [0, 1, 2, 3, 4, 5] + }); + var all = featureTable.getGlobalProperty('TEST', ComponentDatatype.UNSIGNED_BYTE); + expect(all).toEqual([0, 1, 2, 3, 4, 5]); + var feature = featureTable.getProperty('TEST', 1, ComponentDatatype.UNSIGNED_BYTE, 2); + expect(feature).toEqual([2, 3]); + }); + + it('loads from cached array buffer views', function() { + var featureTable = new Cesium3DTileFeatureTableResources({ + TEST : { + byteOffset : Number.POSITIVE_INFINITY + } + }); + featureTable._cachedArrayBufferViews.TEST = new Uint8Array([0, 1, 2, 3, 4, 5]); + var all = featureTable.getGlobalProperty('TEST', ComponentDatatype.UNSIGNED_BYTE, 5); + expect(all).toEqual([0, 1, 2, 3, 4]); + var feature = featureTable.getProperty('TEST', 1, ComponentDatatype.UNSIGNED_BYTE, 2); + expect(feature).toEqual([2, 3]); + }); + + it('loads from JSON byteOffset', function() { + var featureTable = new Cesium3DTileFeatureTableResources({ + TEST : { + byteOffset : 4 + } + }, new Uint8Array([0, 0, 0, 0, 0, 1, 2, 3, 4, 5])); + var all = featureTable.getGlobalProperty('TEST', ComponentDatatype.UNSIGNED_BYTE, 5); + expect(all).toEqual([0, 1, 2, 3, 4]); + var feature = featureTable.getProperty('TEST', 1, ComponentDatatype.UNSIGNED_BYTE, 2); + expect(feature).toEqual([2, 3]); + }); +}); \ No newline at end of file diff --git a/Specs/Scene/Composite3DTileContentSpec.js b/Specs/Scene/Composite3DTileContentSpec.js index 183804a1d17a..63331ea6dfe0 100644 --- a/Specs/Scene/Composite3DTileContentSpec.js +++ b/Specs/Scene/Composite3DTileContentSpec.js @@ -121,7 +121,8 @@ defineSuite([ // Instanced3DModel3DTileContent, and Composite3DTileContent. var arrayBuffer = Cesium3DTilesTester.generateCompositeTileBuffer({ tiles : [Cesium3DTilesTester.generateInstancedTileBuffer({ - gltfFormat : 0 + gltfFormat : 0, + gltfUri : 'invalid' })] }); return Cesium3DTilesTester.rejectsReadyPromiseOnError(scene, arrayBuffer, 'cmpt'); diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js index b99500cbb912..99d9d9e9827c 100644 --- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js +++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js @@ -18,20 +18,24 @@ defineSuite([ 'use strict'; var scene; - var centerLongitude = -1.31968; - var centerLatitude = 0.698874; + var originLongitude = -1.3197004048940548; + var originLatitude = 0.6988585409308616; - var gltfEmbeddedUrl = './Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/'; var gltfExternalUrl = './Data/Cesium3DTiles/Instanced/InstancedGltfExternal/'; var withBatchTableUrl = './Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/'; var withoutBatchTableUrl = './Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/'; + var orientationUrl = './Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/'; + var oct16POrientationUrl = './Data/Cesium3DTiles/Instanced/InstancedOct32POrientationWithBatchTable/'; + var scaleUrl = './Data/Cesium3DTiles/Instanced/InstancedScaleWithBatchTable/'; + var scaleNonUniformUrl = './Data/Cesium3DTiles/Instanced/InstancedScaleNonUniformWithBatchTable/'; + var quantizedUrl = './Data/Cesium3DTiles/Instanced/InstancedQuantizedWithBatchTable/'; + var quantizedOct32POrientationUrl = './Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientationWithBatchTable/'; beforeAll(function() { scene = createScene(); - - // One instance in each data set is always located in the center, so point the camera there - var center = Cartesian3.fromRadians(centerLongitude, centerLatitude, 5.0); - scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 10.0)); + // One instance is located on the bottom corner, point the camera there + var bottomCorner = Cartesian3.fromRadians(originLongitude, originLatitude, 5.0); + scene.camera.lookAt(bottomCorner, new HeadingPitchRange(0.0, -1.57, 50.0)); }); afterAll(function() { @@ -70,7 +74,7 @@ defineSuite([ }); it('resolves readyPromise', function() { - return Cesium3DTilesTester.resolvesReadyPromise(scene, gltfEmbeddedUrl); + return Cesium3DTilesTester.resolvesReadyPromise(scene, withoutBatchTableUrl); }); it('rejects readyPromise on error', function() { @@ -78,7 +82,8 @@ defineSuite([ // Expect promise to be rejected in Model, then in ModelInstanceCollection, and // finally in Instanced3DModel3DTileContent. var arrayBuffer = Cesium3DTilesTester.generateInstancedTileBuffer({ - gltfFormat : 0 + gltfFormat : 0, + gltfUri : 'not-a-real-path' }); return Cesium3DTilesTester.rejectsReadyPromiseOnError(scene, arrayBuffer, 'i3dm'); }); @@ -89,7 +94,8 @@ defineSuite([ it('loads with no instances, but does not become ready', function() { var arrayBuffer = Cesium3DTilesTester.generateInstancedTileBuffer({ - featuresLength : 0 + featuresLength : 0, + gltfUri : '../Data/Models/Box/CesiumBoxTest.gltf' }); var tileset = {}; @@ -106,12 +112,6 @@ defineSuite([ } }); - it('renders with embedded gltf', function() { - return Cesium3DTilesTester.loadTileset(scene, gltfEmbeddedUrl).then(function(tileset) { - Cesium3DTilesTester.expectRenderTileset(scene, tileset); - }); - }); - it('renders with external gltf', function() { return Cesium3DTilesTester.loadTileset(scene, gltfExternalUrl).then(function(tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); @@ -130,12 +130,48 @@ defineSuite([ }); }); + it('renders with feature defined orientation', function() { + return Cesium3DTilesTester.loadTileset(scene, orientationUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + + it('renders with feature defined Oct32P encoded orientation', function() { + return Cesium3DTilesTester.loadTileset(scene, oct16POrientationUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + + it('renders with feature defined scale', function() { + return Cesium3DTilesTester.loadTileset(scene, scaleUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + + it('renders with feature defined non-uniform scale', function() { + return Cesium3DTilesTester.loadTileset(scene, scaleNonUniformUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + + it('renders with feature defined quantized position', function() { + return Cesium3DTilesTester.loadTileset(scene, quantizedUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + + it('renders with feature defined quantized position and Oct32P encoded orientation', function() { + return Cesium3DTilesTester.loadTileset(scene, quantizedOct32POrientationUrl).then(function(tileset) { + Cesium3DTilesTester.expectRenderTileset(scene, tileset); + }); + }); + it('renders when instancing is disabled', function() { // Disable extension var instancedArrays = scene.context._instancedArrays; scene.context._instancedArrays = undefined; - return Cesium3DTilesTester.loadTileset(scene, gltfEmbeddedUrl).then(function(tileset) { + return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then(function(tileset) { Cesium3DTilesTester.expectRenderTileset(scene, tileset); // Re-enable extension scene.context._instancedArrays = instancedArrays; @@ -143,13 +179,13 @@ defineSuite([ }); it('throws when calling getFeature with invalid index', function() { - return Cesium3DTilesTester.loadTileset(scene, gltfEmbeddedUrl).then(function(tileset) { + return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then(function(tileset) { var content = tileset._root.content; expect(function(){ content.getFeature(-1); }).toThrowDeveloperError(); expect(function(){ - content.getFeature(1000); + content.getFeature(10000); }).toThrowDeveloperError(); expect(function(){ content.getFeature(); @@ -158,11 +194,11 @@ defineSuite([ }); it('destroys', function() { - return Cesium3DTilesTester.tileDestroys(scene, gltfEmbeddedUrl); + return Cesium3DTilesTester.tileDestroys(scene, withoutBatchTableUrl); }); it('destroys before loading finishes', function() { - return Cesium3DTilesTester.tileDestroysBeforeLoad(scene, gltfEmbeddedUrl); + return Cesium3DTilesTester.tileDestroysBeforeLoad(scene, withoutBatchTableUrl); }); }, 'WebGL');