I’m running the following script and get no errors but testCone.conicSensor.lateralSurfaceMaterial is undefined after the assignment. I’ve checked and coneSide is defined and I’ve tried assigning the material directly but it remains undefined. Anyone seen this before?
I’m running the following script and get no errors but testCone.conicSensor.lateralSurfaceMaterial is undefined after the assignment. I’ve checked and coneSide is defined and I’ve tried assigning the material directly but it remains undefined. Anyone seen this before?
ok do you mean testCone.conicSensor.lateralSurfaceMaterial is undefined?
This attribute is waiting a property data and not a material for me.
I don’t understand the distinction you’re making here. Is testCone.conicSensor.lateralSurfaceMaterial not a material? Can you give an example of how to assign a value to it?
Check out this example here. I’m not completely sure what value is being inserted programatically by your code, but maybe comparing the value of what coneSide is inserting to the hard-coded value in that example might help.
Thanks that fixed that problem. But I’m still not seeing the sensor. No errors, everything seems to be assigned just fine. Here’s the snippet:
var testCone = viewer.entities.add({
name: ‘test cone’,
show: true,
position: new Cesium.Cartesian3(4650397.56551457, -3390535.52275848, -4087729.48877329)
});
testCone.addProperty(‘conicSensor’);
testCone.conicSensor = new CesiumSensors.ConicSensorGraphics();
testCone.conicSensor.show = true;
testCone.conicSensor.intersectionColor = new Cesium.ConstantProperty(Cesium.Color.RED);
testCone.conicSensor.showIntersection = true;
testCone.conicSensor.radius = 10000000; //maximum cone projection distance in m
Yep. I figured it out and forgot to come back to this thread. I was misunderstanding the terminology. For what I was trying to do, I needed to use the outerHalfAngle and set the innerHalfAngle to zero.