Skip to content

Commit c598f94

Browse files
committed
Fix Cesium's breaking changes: +X and +Z faces (gltf_version=[0.8|1.0])
1 parent efad89d commit c598f94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/CitydbKmlDataSource.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1599,15 +1599,21 @@
15991599
rollValue = 0;
16001600
}
16011601

1602+
// by default in glTF 2.0 +Z faces forward, while earlier version of Cesium uses +X
1603+
// https://github.com/AnalyticalGraphicsInc/cesium/pull/6632
1604+
headingValue = headingValue + 90;
1605+
16021606
var heading = Cesium.Math.toRadians(headingValue);
16031607
var pitch = Cesium.Math.toRadians(tiltValue);
16041608
var roll = Cesium.Math.toRadians(rollValue);
16051609

16061610
// Backward compatible....
16071611
var gltfVersion = CitydbUtil.parse_query_string('gltf_version', window.location.href);
16081612
if (gltfVersion == '0.8') {
1609-
var heading = Cesium.Math.toRadians(headingValue - 180);
1610-
var pitch = Cesium.Math.toRadians(180);
1613+
heading = Cesium.Math.toRadians(headingValue - 180);
1614+
pitch = Cesium.Math.toRadians(180);
1615+
} else if (gltfVersion == '1.0') {
1616+
heading = Cesium.Math.toRadians(headingValue - 90);
16111617
}
16121618

16131619
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);

0 commit comments

Comments
 (0)