c30.scale(0.3f);
Vector3d scale = scale(entity);
// TODO: use this as fallback, but load real 3D models if available
if (true) {
Shape3D sh = tilesetManager.getModel(entity);
Transform3D t = new Transform3D();
t.rotX(pitch(entity));
t.setScale(scale);
mech = new TransformGroup(t);
mech.addChild(sh);
}
mech.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
Transform3D ftrans = new Transform3D();
ftrans.rotZ(facing(dir));
ftrans.setTranslation(location(hex, c, elevation, height(entity)));
facing = new TransformGroup(ftrans);
facing.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
facing.addChild(mech);
if (entity.getECMRange() != Entity.NONE) {
int range = entity.getECMRange();
Appearance eapp = new Appearance();
eapp.setColoringAttributes(new ColoringAttributes(c50, ColoringAttributes.SHADE_FLAT));
TransparencyAttributes ta = new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.90f);
ta.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
eapp.setTransparencyAttributes(ta);
TransparencyInterpolator ti = new TransparencyInterpolator(C.halfAlpha, ta, .90f, .97f);
ti.setSchedulingBounds(BoardModel.bounds);
addChild(ti);
eapp.setPolygonAttributes(C.noCull);
Shape3D ecm = makeECMArea(range);
ecm.setAppearance(eapp);
ecm.setPickable(false);
facing.addChild(ecm);
ecm = makeECMBorder(range);
ecm.setAppearance(eapp);
ecm.setPickable(false);
facing.addChild(ecm);
eapp = new Appearance();
eapp.setColoringAttributes(new ColoringAttributes(c50, ColoringAttributes.SHADE_FLAT));
eapp.setLineAttributes(C.defLine);
ecm = makeECMOutline(range);
ecm.setAppearance(eapp);
ecm.setPickable(false);
facing.addChild(ecm);
}
Appearance sapp = new Appearance();
sapp.setMaterial(new Material(new Color3f(tint), C.black, c50, C.white, 64.0f));