Skip to content

Commit

Permalink
Merge pull request #10415 from CesiumGS/deprecate-some-model-options
Browse files Browse the repository at this point in the history
Deprecate some Model options that will not be supported in `ModelExperimental`
  • Loading branch information
ggetz authored Jun 1, 2022
2 parents f461a10 + c5f5b69 commit d4796e3
Show file tree
Hide file tree
Showing 18 changed files with 247 additions and 144 deletions.
6 changes: 4 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@

##### Deprecated :hourglass_flowing_sand:

- glTF 1.0 assets have been deprecated and will be removed in CesiumJS 1.95. Please convert any glTF 1.0 assets to glTF 2.0.
- Support for the glTF extension `KHR_techniques_webgl` have been deprecated and will be removed in CesiumJS 1.95. If custom GLSL shaders are needed, use `CustomShader` instead.
- Support for glTF 1.0 assets has been deprecated and will be removed in CesiumJS 1.95. Please convert any glTF 1.0 assets to glTF 2.0. [#10414](https://github.com/CesiumGS/cesium/pull/10414)
- Support for the glTF extension `KHR_techniques_webgl` has been deprecated and will be removed in CesiumJS 1.95. If custom GLSL shaders are needed, use `CustomShader` instead. [#10414](https://github.com/CesiumGS/cesium/pull/10414)
- `Model.gltf`, `Model.basePath`, `Model.pendingTextureLoads` (properties), and `Model.dequantizeInShader` (constructor option) were deprecate in CesiumJS 1.94 and will be removed in CesiumJS 1.95. [#10415](https://github.com/CesiumGS/cesium/pull/10415)
- `Model.boundingSphere` currently returns results in the model's local coordinate system, but in CesiumJS 1.95 it will be changed to return results in ECEF coordinates. [#10415](https://github.com/CesiumGS/cesium/pull/10415)
- `Cesium3DTileStyle` constructor parameters of `string` or `Resource` type have been deprecated and will be removed in CesiumJS 1.96. If loading a style from a url, use `Cesium3DTileStyle.fromUrl` instead. [#10348](https://github.com/CesiumGS/cesium/pull/10348)
- `Cesium3DTileStyle.readyPromise` and `Cesium3DTileStyle.ready` have been deprecated and will be removed in CesiumJS 1.96. If loading a style from a url, use `Cesium3DTileStyle.fromUrl` instead. [#10348](https://github.com/CesiumGS/cesium/pull/10348)

Expand Down
2 changes: 1 addition & 1 deletion Documentation/Contributors/CodingGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ A public identifier (class, function, property) should be deprecated before bein
function Foo() {
deprecationWarning(
"Foo",
"Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead."
"Foo was deprecated in CesiumJS 1.01. It will be removed in 1.03. Use newFoo instead."
);
// ...
}
Expand Down
8 changes: 6 additions & 2 deletions Source/DataSources/ModelVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,17 @@ ModelVisualizer.prototype.getBoundingSphere = function (entity, result) {
}

if (model.heightReference === HeightReference.NONE) {
BoundingSphere.transform(model.boundingSphere, model.modelMatrix, result);
BoundingSphere.transform(
model.boundingSphereInternal,
model.modelMatrix,
result
);
} else {
if (!defined(model._clampedModelMatrix)) {
return BoundingSphereState.PENDING;
}
BoundingSphere.transform(
model.boundingSphere,
model.boundingSphereInternal,
model._clampedModelMatrix,
result
);
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Batched3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function getVertexShaderCallback(content) {
const batchTable = content._batchTable;
const handleTranslucent = !defined(content._classificationType);

const gltf = content._model.gltf;
const gltf = content._model.gltfInternal;
if (defined(gltf)) {
content._batchIdAttributeName = getBatchIdAttributeName(gltf);
content._diffuseAttributeOrUniformName[
Expand All @@ -206,7 +206,7 @@ function getFragmentShaderCallback(content) {
const batchTable = content._batchTable;
const handleTranslucent = !defined(content._classificationType);

const gltf = content._model.gltf;
const gltf = content._model.gltfInternal;
if (defined(gltf)) {
content._diffuseAttributeOrUniformName[
programId
Expand Down
6 changes: 3 additions & 3 deletions Source/Scene/Cesium3DTileStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Cesium3DTileStyle(style) {
//>>includeStart('debug', pragmas.debug);
deprecationWarning(
"Cesium3DTileStyle constructor",
"string or Resource style parameter in the Cesium3DTileStyle constructor was deprecated in Cesium 1.94. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
"string or Resource style parameter in the Cesium3DTileStyle constructor was deprecated in CesiumJS 1.94. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
);
//>>includeEnd('debug');

Expand Down Expand Up @@ -222,7 +222,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, {
//>>includeStart('debug', pragmas.debug);
deprecationWarning(
"ready",
"ready was deprecated in Cesium 1.94. It will be removed in 1.96. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
"ready was deprecated in CesiumJS 1.94. It will be removed in 1.96. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
);
//>>includeEnd('debug');
return this._ready;
Expand All @@ -243,7 +243,7 @@ Object.defineProperties(Cesium3DTileStyle.prototype, {
//>>includeStart('debug', pragmas.debug);
deprecationWarning(
"readyPromise",
"readyPromise was deprecated in Cesium 1.94. It will be removed in 1.96. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
"readyPromise was deprecated in CesiumJS 1.94. It will be removed in 1.96. If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."
);
//>>includeEnd('debug');
return this._readyPromise;
Expand Down
14 changes: 13 additions & 1 deletion Source/Scene/ClassificationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,18 @@ Object.defineProperties(ClassificationModel.prototype, {
},
},

/**
* For compatibility with Model which now uses gltfInternal to avoid
* deprecation noise.
*
* @private
*/
gltfInternal: {
get: function () {
return this._gltf;
},
},

/**
* The model's bounding sphere in its local coordinate system.
*
Expand Down Expand Up @@ -993,7 +1005,7 @@ function updateNodeModelMatrix(
);
model._rtcCenter = model._rtcCenter3D;
} else {
const center = model.boundingSphere.center;
const center = model.boundingSphereInternal.center;
const to2D = Transforms.wgs84To2DModelMatrix(
projection,
center,
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/DracoLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ DracoLoader.parse = function (model, context) {
}

const dequantizeInShader = model._dequantizeInShader;
const gltf = model.gltf;
const gltf = model.gltfInternal;
ForEach.mesh(gltf, function (mesh, meshId) {
ForEach.meshPrimitive(mesh, function (primitive, primitiveId) {
if (!defined(primitive.extensions)) {
Expand Down
Loading

0 comments on commit d4796e3

Please sign in to comment.