var promise = Cesium.Transforms.preloadIcrfFixed(timeInterval);
promise.then(function() {
var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(dateToCheck);
var pointInInertial = new Cesium.Cartesian3();
if (Cesium.defined(fixedToIcrf)) {
pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
}
});
``
However, when my app loads the preloadIcrfFixed promise is not resolved and always fails on the first go (i.e. when the page loads). Using the code snipped above. below I have constructed a small Sandcastle example that demonstrates my problem. You can view it here: MWE
Here is the Sandcastle code. When the page loads, “FAILURE” is always printed to the console.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
Sandcastle.addDefaultToolbarButton(‘Default styling’, function() {
var start_time = new Date(1285216305688);
var stop_time = new Date(1285259505688);
var timeInterval = new Cesium.TimeInterval({
start : start_time,
stop : stop_time,
isStartIncluded : true,
isStopIncluded : true
});
var promise = Cesium.Transforms.preloadIcrfFixed(timeInterval);
promise.then(function() {
var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(stop_time);
var pointInInertial = new Cesium.Cartesian3();
if (Cesium.defined(fixedToIcrf)) {
pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
console.info("SUCCESS");
}
else{
console.info("FAILURE");
}
});
});
``
``