}
private void genPlanet() {
Sphere planetSphere = new Sphere(48, 48, size, false, false);
//Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
Texture tex = assetManager.loadTexture("Textures/"+texture);
planetSphere.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres
TangentBinormalGenerator.generate(planetSphere); // for lighting effect
mat.setTexture("DiffuseMap", tex);
mat.setFloat("Shininess", 0.0001f);
planet = new Geometry("geo_"+name, planetSphere);
planet.setMaterial(mat);
planet.setShadowMode(ShadowMode.CastAndReceive);
this.attachChild(planet);
Sphere planetAtmosphere = new Sphere(48, 48, size*1.1f, false, true);
Material matAtmosphere = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
matAtmosphere.setColor("Color", new ColorRGBA(0,0,1,0.1f));
matAtmosphere.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
atmosphere = new Geometry("geo_"+name+"_atmosphere", planetAtmosphere);
atmosphere.setMaterial(matAtmosphere);
this.attachChild(atmosphere);
}