Is there a way to have a moving position using INERTIAL Reference Frame without use sample position property with time. I can do fixed successfully with just the position. I can do both with FIXED and INERTIAL with sampled position but uses too much memory. So would like to have a dynamic moving position point that you can change the reference frame.
Here is my current code:
const satPosition = new Cesium.CallbackProperty((time) => {
try {
const jsDate = Cesium.JulianDate.toDate(time);
const positionAndVelocity = satellite.propagate(satRec, jsDate);
const gmst = satellite.gstime(jsDate);
if (enableECF) {
// FIXED Frame Reference
const p = satellite.eciToGeodetic(positionAndVelocity.position, gmst);
const posFixed = Cesium.Cartesian3.fromRadians(
p.longitude,
p.latitude,
p.height * 1000
);
return posFixed;
}
// INERTIAL Frame Reference
const posECI = positionAndVelocity.position;
const posInertial = Cesium.Cartesian3.fromElements(
posECI.x * 1000,
posECI.y * 1000,
posECI.z * 1000
);
return posInertial;
} catch (err) {
return null;
}
}, false);
I know for INERTIAL, I have to update the camera:
const cameraTrackEci = (scene, time) => {
if (scene.mode !== Cesium.SceneMode.SCENE3D) {
return;
}
const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
if (Cesium.defined(icrfToFixed)) {
const { camera } = scene;
const offset = Cesium.Cartesian3.clone(camera.position);
const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
camera.lookAtTransform(transform, offset);
}
};
How to make the posInertial in the Cesium.ReferenceFrame.INERTIAL. I tried the ConstantPositionProperty but no luck. Any suggestions?
Thanks