use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Billboards method setBillboardProperties.
private void setBillboardProperties() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
// default: undefined
billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
// default
billboardGraphicsOptions.show = new ConstantProperty<>(true);
// default: (0, 0)
billboardGraphicsOptions.pixelOffset = new ConstantProperty<>(new Cartesian2(0, -50));
// default
billboardGraphicsOptions.eyeOffset = new ConstantProperty<>(new Cartesian3(0, 0, 0));
// default
billboardGraphicsOptions.horizontalOrigin = new ConstantProperty<>(HorizontalOrigin.CENTER());
// default: CENTER
billboardGraphicsOptions.verticalOrigin = new ConstantProperty<>(VerticalOrigin.BOTTOM());
// default: 1.0
billboardGraphicsOptions.scale = new ConstantProperty<>(2.0);
// default: WHITE
billboardGraphicsOptions.color = new ConstantProperty<>(Color.LIME());
// default: 0.0
billboardGraphicsOptions.rotation = new ConstantProperty<>(Math.PI_OVER_FOUR());
// default
billboardGraphicsOptions.alignedAxis = new ConstantProperty<>(Cartesian3.ZERO());
// default: undefined
billboardGraphicsOptions.width = new ConstantProperty<>(100);
// default: undefined
billboardGraphicsOptions.height = new ConstantProperty<>(25);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Models3D method createModel.
private void createModel(String url, double height) {
csVPanel.getViewer().entities().removeAll();
ModelGraphicsOptions modelGraphicsOptions = new ModelGraphicsOptions();
modelGraphicsOptions.uri = new ConstantProperty<>(url);
modelGraphicsOptions.minimumPixelSize = new ConstantProperty<>(128);
modelGraphicsOptions.maximumScale = new ConstantProperty<>(20000);
ModelGraphics modelGraphics = new ModelGraphics(modelGraphicsOptions);
Cartesian3 position = Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
double heading = Math.toRadians(135);
double pitch = 0;
double roll = 0;
Quaternion orientation = Transforms.headingPitchRollQuaternion(position, new org.cesiumjs.cs.core.HeadingPitchRoll(heading, pitch, roll));
EntityOptions entityOptions = new EntityOptions();
entityOptions.name = url;
entityOptions.position = new ConstantPositionProperty(position);
entityOptions.orientation = new ConstantProperty<>(orientation);
entityOptions.model = modelGraphics;
csVPanel.getViewer().trackedEntity = csVPanel.getViewer().entities().add(entityOptions);
;
}
use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Shadows method setLocation.
public void setLocation(Location location) {
double lon = location.lon;
double lat = location.lat;
double height = location.height;
for (int i = 0; i < csVPanel.getViewer().entities().values().length; ++i) {
Entity entity = csVPanel.getViewer().entities().values()[i];
entity.position = new ConstantPositionProperty(Cartesian3.fromRadians(lon, lat, height + JsObject.getNumber(entity, "height").doubleValue()));
}
csVPanel.getViewer().clock().currentTime = new JulianDate(location.date);
csVPanel.getViewer().clock().multiplier = 1.0;
}
Aggregations