改变图标位置的动画 看起来很不流畅 该怎么解决呢
const addTextBillboard = () => {
const pos = getTargetData()
entity = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(pos.lon, pos.lat),
billboard: {
image: billboardImg,
width: 50,
height: 98,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
}
})
}
function start() {
const nowPos = getTargetData(), prevPos = getPrevTargetData()
const runTime = 2
const positionTween = new TWEEN.Tween(prevPos)
.to(nowPos, runTime * 1000)
.easing(TWEEN.Easing.Sinusoidal.InOut)
.onUpdate(function (config) {
entity.position.setValue(Cesium.Cartesian3.fromDegrees(config.lon, config.lat, config.alt))
}).start();
}