1. A concise explanation of the problem you’re experiencing.
I have four Drones in my scene, and wish to toggle a line of sight ( simply connecting two drones with a line object together) between any pair I like. I already created a webSocket infrastructure with Python which delivers the data to cesium and everything is working great. aside of the issue that I can’t change the objects set for the line of sight. I make the line of sight adding an object to my scene , with a callback which takes the position properties from the two drones I need and thus constatnly updates as the objects move… the problem is , that it’s hard-coded. once it’s there , I can’t touch it . I would like to toggle the lines between the drones as I choose to. I tried doing it with classes etc, but it’s not like C++ , which can have an offset for a callback from this-> , or like a C callback which can accept an arbitrary amount of parameters as input , allowing me to manupulate data .
Thank you .
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
function getPositions(time,result)
{
var pos1 = entArray[0].position._value;//This keeps updating the line automatically to draw between drones 0 and 1
var pos2 = entArray[1].position._value; //I can't change it once its there to , say drones 0 and 2....
return [pos1,pos2];
}
entArray[4] = viewer.entities.add({ //4 will be the entity of the line which draws between the drones (0…3) are the drone entities
polyline: {
followSurface: false,
width: 1,
arcType : Cesium.ArcType.NONE,
positions: new Cesium.CallbackProperty(getPositions,false),
material: new Cesium.ColorMaterialProperty(Cesium.Color.RED)
}
});
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
dynamic toggling for line of sight simulation
4. The Cesium version you’re using, your operating system and browser.
1.62