Hi (new to Cesium) Im currently running into an issue in my code that I cant seem to figure out. My project currently uses a cesium widget and not a viewer. Long story short, we cant simply migrate to a viewer because of cascading issues. So, I have to recreate the trackedEntity property that the viewer supports. I have a 3D model that Im tracking on the map. The model is frequently updated every second and, im storing its updated position in a variable called “cartesian3”. I need to lookAt the model when it travels and, I currently call a function that contains this logic:
if (cartesian3) {
const heading = this.scene.camera.heading;
const pitch = this.scene.camera.pitch;
const height = this.scene.camera.position.z;
const hpr = new Cesium.HeadingPitchRange(heading, pitch, height);
this.scene.camera.lookAt(cartesian3, hpr);
}
When looking top down or in 2D, the logic works flawlessly. The issue is that when I tilt the map Im looking at the model. sometimes it zooms in slightly. But everytime on release, the camera is thrown out to see the globe. I’ve noticed that the camera position is constantly different and, I’m unsure why because Im not setting the view. I’m just calling lookAt while tilted and everything goes haywire.