无人扫描示例
实现思路
1.绘制圆柱体根据参数调成圆锥形状
2.加载动画czml路径
3.通过时钟对象获取当前路径点
4.将当前路径点通过 CallbackProperty 赋值给圆锥
5.路径点每次改动圆锥随之移动
代码
获取路径点(移动的实体目标)
let cartesian = entity.position.getValue(this.clock.currentTime);
let positions = this.mouseManager.worldToLonlat(cartesian);
this.scanEntity =
this.dynamicCylinder({positions:positions,entity:entityObj,v:this.CoreV,cylinder:{legnth:600000,slices:4,bottomRadius:600000/2}});
this.EntityObj.push(this.entitys.add( this.scanEntity));
传递的动态路径点 实现绑定效果(CallbackProperty)
function dynamicCylinder(obj) {
let c = obj.cylinder;
this.options = {
cylinder: {
HeightReference: HeightReference.RELATIVE_TO_GROUND, //表示相对于地形的位置。
length: c.length, //长度
topRadius: 0, //顶点半径
bottomRadius: c.bottomRadius, //底部半径
material: new Color(0, 1, 1, .4),
slices: c.slices
}
}
this.posi