/** * Updates the appearance of this obstacle cylinder. */ protected void updateAppearance() { this.getAttributes().setInteriorMaterial(new Material(ObstacleColor.getColor(activeCost))); if (0 > this.activeCost) { this.getAttributes().setInteriorOpacity(1.0); } else { this.getAttributes().setInteriorOpacity(0.5); } // TODO: elements could change color, transparency or even an associated image/icon }
/** * Constructs an obstacle cylinder with a specified center position, height * and radius. * * @param centerPosition the center position of this obstacle cylinder * @param height the height in meters of this obstacle cylinder * @param radius the radius in meters of this obstacle cylinder * * @see VerticalCylinder#VerticalCylinder(Position, double, double) */ public ObstacleCylinder(Position centerPosition, double height, double radius) { super(centerPosition, height, radius); this.setAttributes(new BasicShapeAttributes()); this.getAttributes().setInteriorOpacity(0.25); this.getAttributes().setEnableLighting(true); this.getAttributes().setDrawInterior(true); this.getAttributes().setDrawOutline(false); }