Skip to content

Commit ebe34ca

Browse files
authored
Merge branch 'sandcastle-v2' into sandcastle-react-structure
2 parents 843b10c + 6e3a872 commit ebe34ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3270
-42
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

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
6+
<!-- Use Chrome Frame in IE -->
7+
<meta
8+
name="viewport"
9+
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
10+
/>
11+
<meta
12+
name="description"
13+
content="View the same 3D Tiles power station dataset as a 3D Gaussian splatting tileset and a mesh tileset."
14+
/>
15+
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles" />
16+
<title>Cesium Demo</title>
17+
<script type="text/javascript" src="../Sandcastle-header.js"></script>
18+
<script
19+
type="text/javascript"
20+
src="../../../Build/CesiumUnminified/Cesium.js"
21+
nomodule
22+
></script>
23+
<script type="module" src="../load-cesium-es6.js"></script>
24+
</head>
25+
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
26+
<style>
27+
@import url(../templates/bucket.css);
28+
29+
#slider {
30+
position: absolute;
31+
left: 50%;
32+
top: 0px;
33+
background-color: #d3d3d3;
34+
width: 5px;
35+
height: 100%;
36+
z-index: 9999;
37+
}
38+
39+
#slider:hover {
40+
cursor: ew-resize;
41+
}
42+
</style>
43+
<div id="cesiumContainer" class="fullSize">
44+
<div id="slider"></div>
45+
</div>
46+
<div id="loadingOverlay"><h1>Loading...</h1></div>
47+
<div id="toolbar"></div>
48+
<script id="cesium_sandcastle_script">
49+
window.startup = async function (Cesium) {
50+
"use strict";
51+
//Sandcastle_Begin
52+
const viewer = new Cesium.Viewer("cesiumContainer", {
53+
terrain: Cesium.Terrain.fromWorldTerrain(),
54+
});
55+
56+
try {
57+
const left = await Cesium.Cesium3DTileset.fromIonAssetId(3443920);
58+
viewer.scene.primitives.add(left);
59+
left.splitDirection = Cesium.SplitDirection.LEFT;
60+
61+
viewer.zoomTo(
62+
left,
63+
new Cesium.HeadingPitchRange(
64+
Cesium.Math.toRadians(-50),
65+
Cesium.Math.toRadians(-20),
66+
100.0,
67+
),
68+
);
69+
70+
const right = await Cesium.Cesium3DTileset.fromIonAssetId(3443919);
71+
viewer.scene.primitives.add(right);
72+
right.splitDirection = Cesium.SplitDirection.RIGHT;
73+
} catch (error) {
74+
console.log(`Error loading tileset: ${error}`);
75+
}
76+
77+
// Sync the position of the slider with the split position
78+
const slider = document.getElementById("slider");
79+
viewer.scene.splitPosition = slider.offsetLeft / slider.parentElement.offsetWidth;
80+
81+
const handler = new Cesium.ScreenSpaceEventHandler(slider);
82+
83+
let moveActive = false;
84+
85+
function move(movement) {
86+
if (!moveActive) {
87+
return;
88+
}
89+
90+
const relativeOffset = movement.endPosition.x;
91+
const splitPosition =
92+
(slider.offsetLeft + relativeOffset) / slider.parentElement.offsetWidth;
93+
slider.style.left = `${100.0 * splitPosition}%`;
94+
viewer.scene.splitPosition = splitPosition;
95+
}
96+
97+
handler.setInputAction(function () {
98+
moveActive = true;
99+
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
100+
handler.setInputAction(function () {
101+
moveActive = true;
102+
}, Cesium.ScreenSpaceEventType.PINCH_START);
103+
104+
handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
105+
handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);
106+
107+
handler.setInputAction(function () {
108+
moveActive = false;
109+
}, Cesium.ScreenSpaceEventType.LEFT_UP);
110+
handler.setInputAction(function () {
111+
moveActive = false;
112+
}, Cesium.ScreenSpaceEventType.PINCH_END);
113+
//Sandcastle_End
114+
};
115+
if (typeof Cesium !== "undefined") {
116+
window.startupCalled = true;
117+
window.startup(Cesium).catch((error) => {
118+
"use strict";
119+
console.error(error);
120+
});
121+
Sandcastle.finishedLoading();
122+
}
123+
</script>
124+
</body>
125+
</html>
53.3 KB
Loading

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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Change Log
22

3+
## 1.131 - 2025-07-01
4+
5+
### @cesium/engine
6+
7+
### Fixes :wrench:
8+
9+
- Updates use of deprecated options on createImageBitmap. [#12664](https://github.com/CesiumGS/cesium/pull/12664)
10+
11+
#### Additions :tada:
12+
13+
- 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)
14+
15+
## 1.130.1 - 2025-06-16
16+
17+
### @cesium/engine
18+
19+
#### Additions :tada:
20+
21+
- Added experimental support for loading 3D Tiles with Gaussian splats encoded with SPZ compression using the draft glTF extension [`KHR_spz_gaussian_splats_compression`](https://github.com/KhronosGroup/glTF/pull/2490). [#12582](https://github.com/CesiumGS/cesium/pull/12582)
22+
- Added support for integral texture formats: R32I, RG32I, RGB32I, RGBA32I, R32UI, RG32UI, RGB32UI, RGBA32UI [#12582](https://github.com/CesiumGS/cesium/pull/12582)
23+
324
## 1.130 - 2025-06-02
425

526
### @cesium/engine

CONTRIBUTORS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
169169
- [Adam Morris](https://github.com/weegeekps)
170170
- [Luke McKinstry](https://github.com/lukemckinstry)
171171
- [Ryan Veenstra](https://github.com/r-veenstra)
172+
- [Jason Sobotka](https://github.com/keyboardspecialist)
172173
- [Northrop Grumman](http://www.northropgrumman.com)
173174
- [Joseph Stein](https://github.com/nahgrin)
174175
- [EOX IT Services GmbH](https://eox.at)
@@ -206,6 +207,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
206207
- [IKangXu](https://github.com/IKangXu)
207208
- [EMapGIS](https://github.com/EMapGIS)
208209
- [CandyACE](https://github.com/CandyACE)
210+
- [EARTHBRAIN, Ltd.](https://www.earthbrain.com/en/)
211+
- [Gregory Diehl](https://github.com/gdiehleb)
209212

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

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

Specs/Cesium3DTilesTester.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,26 @@ Cesium3DTilesTester.waitForTilesLoaded = function (scene, tileset) {
104104
});
105105
};
106106

107+
Cesium3DTilesTester.waitForTileContent = function (scene, tile) {
108+
return pollToPromise(function () {
109+
scene.renderForSpecs();
110+
return !tile.contentUnloaded;
111+
}).then(function () {
112+
scene.renderForSpecs();
113+
return tile;
114+
});
115+
};
116+
117+
Cesium3DTilesTester.waitForTileContentReady = function (scene, tile) {
118+
return pollToPromise(function () {
119+
scene.renderForSpecs();
120+
return tile.contentReady;
121+
}).then(function () {
122+
scene.renderForSpecs();
123+
return tile;
124+
});
125+
};
126+
107127
// A white ambient light with low intensity
108128
const defaultIbl = new ImageBasedLighting({
109129
sphericalHarmonicCoefficients: [
1.08 MB
Binary file not shown.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"asset": {
3+
"extras": {
4+
"ion": {
5+
"georeferenced": true,
6+
"movable": true
7+
}
8+
},
9+
"version": "1.1"
10+
},
11+
"extensions": {
12+
"3DTILES_content_gltf": {
13+
"extensionsRequired": [
14+
"KHR_spz_gaussian_splats_compression"
15+
],
16+
"extensionsUsed": [
17+
"KHR_spz_gaussian_splats_compression"
18+
]
19+
}
20+
},
21+
"extensionsUsed": [
22+
"3DTILES_content_gltf"
23+
],
24+
"geometricError": 14.76778488662848,
25+
"root": {
26+
"boundingVolume": {
27+
"box": [
28+
1.2307894825935364,
29+
-0.6764951944351196,
30+
186.9346923828125,
31+
2.405353009700775,
32+
0.0,
33+
0.0,
34+
0.0,
35+
2.5862385034561157,
36+
0.0,
37+
0.0,
38+
0.0,
39+
6.484405517578125
40+
]
41+
},
42+
"content": {
43+
"uri": "0/0.glb"
44+
},
45+
"geometricError": 0.0,
46+
"refine": "REPLACE",
47+
"transform": [
48+
-0.14382095244935905,
49+
0.9896037255571338,
50+
0.0,
51+
0.0,
52+
-0.7120020847592599,
53+
-0.1034765889935951,
54+
0.6945110703428119,
55+
0.0,
56+
0.6872907426519194,
57+
0.09988524362332703,
58+
0.7194820172674795,
59+
0.0,
60+
4391456.686631473,
61+
638218.5788113032,
62+
4566368.395700517,
63+
1.0
64+
]
65+
}
66+
}

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ export async function prepare() {
358358
"node_modules/draco3d/draco_decoder.wasm",
359359
"packages/engine/Source/ThirdParty/draco_decoder.wasm",
360360
);
361-
361+
// Copy Gaussian Splatting utilities into Source
362+
copyFileSync(
363+
"node_modules/@cesium/wasm-splats/wasm_splats_bg.wasm",
364+
"packages/engine/Source/ThirdParty/wasm_splats_bg.wasm",
365+
);
362366
// Copy pako and zip.js worker files to Source/ThirdParty
363367
copyFileSync(
364368
"node_modules/pako/dist/pako_inflate.min.js",

0 commit comments

Comments
 (0)