@Override
public void renderTo(Target<?> target) {
double directionAngle = parseDirection(node.getTags(), PI);
VectorXZ faceVector = VectorXZ.fromAngle(directionAngle);
Material machineMaterial = null;
Material poleMaterial = STEEL;
Type type = null;
if (node.getTags().contains("vending", "bicycle_tube") && node.getTags().containsAny("operator", asList("Continental", "continental"))){
machineMaterial = new ImmutableMaterial(Lighting.FLAT, Color.ORANGE );
} else if(node.getTags().contains("vending", "bicycle_tube")){
machineMaterial = new ImmutableMaterial(Lighting.FLAT, Color.BLUE );
} else if(node.getTags().contains("vending", "cigarettes")){
machineMaterial = new ImmutableMaterial(Lighting.FLAT, new Color(0.8f, 0.73f, 0.5f));
} else if(node.getTags().contains("vending", "condoms")){
machineMaterial = new ImmutableMaterial(Lighting.FLAT, new Color(0.39f, 0.15f, 0.11f) );
}
// get Type of vending machine
if(isInWall(node)){
type = Type.WALL;
} else {
type = Type.PILLAR;
}
// default dimensions will differ depending on the post box type
float height = 0f;
switch(type) {
case WALL:
break;
case PILLAR:
height = parseHeight(node.getTags(), 1.8f);
target.drawBox(poleMaterial,
getBase().add(new VectorXYZ(0,0, -0.05).rotateY(faceVector.angle())),
faceVector, height-0.3, 0.1, 0.1);
target.drawBox(machineMaterial,
getBase().addY(height-1).add(new VectorXYZ(0,0, 0.1 ).rotateY(directionAngle)),
faceVector, 1, 1, 0.2);