Skip to content

Commit 1320c7d

Browse files
authored
Merge branch 'main' into splat-spz-concept
2 parents aaa5aba + 44c13e4 commit 1320c7d

File tree

12 files changed

+155
-11
lines changed

12 files changed

+155
-11
lines changed

Apps/Sandcastle/CesiumSandcastle.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ body {
5353
width: 40%;
5454
}
5555

56-
#bottomPanel {
56+
#bottomSection {
5757
height: 225px;
5858
}
5959

Apps/Sandcastle/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,13 @@
303303
</div>
304304
</div>
305305
<div
306-
id="bottomPanel"
306+
id="bottomSection"
307307
class="bottomPanel"
308308
data-dojo-type="dijit.layout.BorderContainer"
309309
data-dojo-props="region: 'bottom', splitter: true"
310310
>
311311
<div
312+
id="bottomPanel"
312313
class="bottomPanel"
313314
data-dojo-type="dijit.layout.TabContainer"
314315
data-dojo-props="region: 'center', splitter: false"

CHANGES.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Change Log
22

3-
## 1.131 - TBD
3+
4+
## 1.131 - 2025-07-01
5+
6+
### @cesium/engine
7+
8+
### Fixes :wrench:
9+
10+
- Updates use of deprecated options on createImageBitmap. [#12664](https://github.com/CesiumGS/cesium/pull/12664)
11+
12+
#### Additions :tada:
13+
14+
- Added `HeightReference` to `Cesium3DTileset.ConstructorOptions` to allow clamping point features in 3D Tile vector data to terrain or 3D Tiles [#11710](https://github.com/CesiumGS/cesium/pull/11710)
15+
16+
## 1.130.1 - 2025-06-16
417

518
### @cesium/engine
619

CONTRIBUTORS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
207207
- [IKangXu](https://github.com/IKangXu)
208208
- [EMapGIS](https://github.com/EMapGIS)
209209
- [CandyACE](https://github.com/CandyACE)
210+
- [EARTHBRAIN, Ltd.](https://www.earthbrain.com/en/)
211+
- [Gregory Diehl](https://github.com/gdiehleb)
210212

211213
## [Individual CLA](Documentation/Contributors/CLAs/individual-contributor-license-agreement-v1.0.pdf)
212214

@@ -421,3 +423,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
421423
- [Andrew Dassonville](https://github.com/andrewda)
422424
- [Cody Butler](https://github.com/CodyBu)
423425
- [Hiwen](https://github.com/Hiwen)
426+
- [Matt Schwartz](https://github.com/mzschwartz5)

packages/engine/Source/Core/Resource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Resource.supportsImageBitmapOptions = function () {
231231
})
232232
.then(function (blob) {
233233
const imageBitmapOptions = {
234-
imageOrientation: "flipY", // default is "none"
234+
imageOrientation: "flipY", // default is "from-image"
235235
premultiplyAlpha: "none", // default is "default"
236236
colorSpaceConversion: "none", // default is "default"
237237
};
@@ -2036,7 +2036,7 @@ Resource.createImageBitmapFromBlob = function (blob, options) {
20362036
);
20372037

20382038
return createImageBitmap(blob, {
2039-
imageOrientation: options.flipY ? "flipY" : "none",
2039+
imageOrientation: options.flipY ? "flipY" : "from-image",
20402040
premultiplyAlpha: options.premultiplyAlpha ? "premultiply" : "none",
20412041
colorSpaceConversion: options.skipColorSpaceConversion ? "none" : "default",
20422042
});

packages/engine/Source/Scene/Cesium3DTileset.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js";
102102
* @property {ClippingPlaneCollection} [clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
103103
* @property {ClippingPolygonCollection} [clippingPolygons] The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset.
104104
* @property {ClassificationType} [classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
105+
* @property {HeightReference} [heightReference] Sets the {@link HeightReference} for point features in vector tilesets.
106+
* @property {Scene} [scene] The {@link CesiumWidget#scene} that the tileset will be rendered in, required for tilesets that specify a {@link heightReference} value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles.
105107
* @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.
106108
* @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
107109
* @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
@@ -337,6 +339,8 @@ function Cesium3DTileset(options) {
337339
this._tileDebugLabels = undefined;
338340

339341
this._classificationType = options.classificationType;
342+
this._heightReference = options.heightReference;
343+
this._scene = options.scene;
340344

341345
this._ellipsoid = options.ellipsoid ?? Ellipsoid.WGS84;
342346

@@ -1820,6 +1824,43 @@ Object.defineProperties(Cesium3DTileset.prototype, {
18201824
},
18211825
},
18221826

1827+
/**
1828+
* Specifies if the height is relative to terrain, 3D Tiles, or both.
1829+
* <p>
1830+
* This option is only applied to point features in tilesets containing vector data.
1831+
* This option requires the Viewer's scene to be passed in through options.scene.
1832+
* </p>
1833+
*
1834+
* @memberof Cesium3DTileset.prototype
1835+
*
1836+
* @type {HeightReference | undefined}
1837+
* @default undefined
1838+
*
1839+
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
1840+
* @readonly
1841+
*/
1842+
heightReference: {
1843+
get: function () {
1844+
return this._heightReference;
1845+
},
1846+
},
1847+
1848+
/**
1849+
* The {@link CesiumWidget#scene} that the tileset will be rendered in, required for tilesets that specify a {@link heightReference} value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles.
1850+
*
1851+
* @member of Cesium3DTileset.prototype
1852+
*
1853+
* @type {Scene | undefined}
1854+
* @default undefined
1855+
* @readonly
1856+
*
1857+
*/
1858+
scene: {
1859+
get: function () {
1860+
return this._scene;
1861+
},
1862+
},
1863+
18231864
/**
18241865
* Gets an ellipsoid describing the shape of the globe.
18251866
*

packages/engine/Source/Scene/Model/UniformType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const UniformType = {
106106
*/
107107
MAT3: "mat3",
108108
/**
109-
* A 3x3 matrix of floating point values.
109+
* A 4x4 matrix of floating point values.
110110
*
111111
* @type {string}
112112
* @constant

packages/engine/Source/Scene/Vector3DTileContent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ function initialize(content, arrayBuffer, byteOffset) {
524524
modelMatrix: modelMatrix,
525525
});
526526
}
527-
527+
const tileset = content._tileset;
528528
if (numberOfPolylines > 0) {
529529
featureTable.featuresLength = numberOfPolylines;
530530

@@ -570,7 +570,6 @@ function initialize(content, arrayBuffer, byteOffset) {
570570
);
571571
byteOffset += polylinePositionByteLength;
572572

573-
const tileset = content._tileset;
574573
const examineVectorLinesFunction = tileset.examineVectorLinesFunction;
575574
if (defined(examineVectorLinesFunction)) {
576575
const decodedPositions = decodeVectorPolylinePositions(
@@ -625,6 +624,8 @@ function initialize(content, arrayBuffer, byteOffset) {
625624
maximumHeight: maxHeight,
626625
rectangle: rectangle,
627626
batchTable: batchTable,
627+
heightReference: tileset.heightReference,
628+
scene: tileset.scene,
628629
});
629630
}
630631
}

packages/engine/Source/Scene/Vector3DTilePoints.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import LabelCollection from "./LabelCollection.js";
1515
import LabelStyle from "./LabelStyle.js";
1616
import PolylineCollection from "./PolylineCollection.js";
1717
import VerticalOrigin from "./VerticalOrigin.js";
18+
import HeightReference from "./HeightReference.js";
1819

1920
/**
2021
* Creates a batch of points or billboards and labels.
@@ -27,8 +28,10 @@ import VerticalOrigin from "./VerticalOrigin.js";
2728
* @param {number} options.minimumHeight The minimum height of the terrain covered by the tile.
2829
* @param {number} options.maximumHeight The maximum height of the terrain covered by the tile.
2930
* @param {Rectangle} options.rectangle The rectangle containing the tile.
31+
* @param {HeightReference} options.heightReference Determines how billboard and label features are positioned relative to terrain or 3d tiles.
3032
* @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polygons.
3133
* @param {Uint16Array} options.batchIds The batch ids for each polygon.
34+
* @param {Scene} options.scene The Cesium Viewer {@link Scene}. This is required for clamping billboards and labels with {@link HeightReference}
3235
*
3336
* @private
3437
*/
@@ -42,12 +45,15 @@ function Vector3DTilePoints(options) {
4245
this._rectangle = options.rectangle;
4346
this._minHeight = options.minimumHeight;
4447
this._maxHeight = options.maximumHeight;
48+
this._heightReference = options.heightReference;
4549

4650
this._billboardCollection = new BillboardCollection({
4751
batchTable: options.batchTable,
52+
scene: options.scene,
4853
});
4954
this._labelCollection = new LabelCollection({
5055
batchTable: options.batchTable,
56+
scene: options.scene,
5157
});
5258
this._polylineCollection = new PolylineCollection();
5359
this._polylineCollection._useHighlightColor = true;
@@ -175,6 +181,8 @@ function createPoints(points, ellipsoid) {
175181
const batchIds = points._batchIds;
176182
const numberOfPoints = positions.length / 3;
177183

184+
const heightReference = points._heightReference ?? HeightReference.NONE;
185+
178186
for (let i = 0; i < numberOfPoints; ++i) {
179187
const id = batchIds[i];
180188

@@ -183,11 +191,13 @@ function createPoints(points, ellipsoid) {
183191
const b = billboardCollection.add();
184192
b.position = position;
185193
b._batchIndex = id;
194+
b.heightReference = heightReference;
186195

187196
const l = labelCollection.add();
188197
l.text = " ";
189198
l.position = position;
190199
l._batchIndex = id;
200+
l.heightReference = heightReference;
191201

192202
const p = polylineCollection.add();
193203
p.positions = [Cartesian3.clone(position), Cartesian3.clone(position)];

packages/engine/Specs/Core/loadImageFromTypedArraySpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("Core/loadImageFromTypedArray", function () {
5959
})
6060
.then(function () {
6161
expect(window.createImageBitmap).toHaveBeenCalledWith(blob, {
62-
imageOrientation: "none",
62+
imageOrientation: "from-image",
6363
premultiplyAlpha: "none",
6464
colorSpaceConversion: "default",
6565
});
@@ -91,7 +91,7 @@ describe("Core/loadImageFromTypedArray", function () {
9191
return loadImageFromTypedArray(options)
9292
.then(function () {
9393
expect(window.createImageBitmap).toHaveBeenCalledWith(blob, {
94-
imageOrientation: "none",
94+
imageOrientation: "from-image",
9595
premultiplyAlpha: "none",
9696
colorSpaceConversion: "none",
9797
});
@@ -102,7 +102,7 @@ describe("Core/loadImageFromTypedArray", function () {
102102
})
103103
.then(function () {
104104
expect(window.createImageBitmap).toHaveBeenCalledWith(blob, {
105-
imageOrientation: "none",
105+
imageOrientation: "from-image",
106106
premultiplyAlpha: "none",
107107
colorSpaceConversion: "default",
108108
});

0 commit comments

Comments
 (0)