/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.jme3.app.SimpleApplication
 *  com.jme3.light.DirectionalLight
 *  com.jme3.light.Light
 *  com.jme3.material.Material
 *  com.jme3.material.RenderState$BlendMode
 *  com.jme3.math.ColorRGBA
 *  com.jme3.math.Vector3f
 *  com.jme3.renderer.queue.RenderQueue$Bucket
 *  com.jme3.scene.Geometry
 *  com.jme3.scene.Mesh
 *  com.jme3.scene.Spatial
 *  com.jme3.scene.shape.Box
 *  com.jme3.scene.shape.Sphere
 *  com.jme3.scene.shape.Sphere$TextureMode
 *  com.jme3.util.TangentBinormalGenerator
 */
package jme3.hello;

import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.light.Light;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere;
import com.jme3.util.TangentBinormalGenerator;

public class HelloMaterial
extends SimpleApplication {
    public static void main(String[] args) {
        HelloMaterial app = new HelloMaterial();
        app.start();
    }

    public void simpleInitApp() {
        Box boxshape3 = new Box(new Vector3f(0.0f, 0.0f, 0.0f), 1.0f, 1.0f, 0.01f);
        Geometry window_frame = new Geometry("window frame", (Mesh)boxshape3);
        Material mat_tt = new Material(this.assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat_tt.setTexture("ColorMap", this.assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
        mat_tt.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
        window_frame.setMaterial(mat_tt);
        window_frame.setQueueBucket(RenderQueue.Bucket.Transparent);
        this.rootNode.attachChild((Spatial)window_frame);
        Box boxshape4 = new Box(new Vector3f(3.0f, -1.0f, 0.0f), 1.0f, 1.0f, 1.0f);
        Geometry cube_leak = new Geometry("Leak-through color cube", (Mesh)boxshape4);
        cube_leak.setMaterial(this.assetManager.loadMaterial("Materials/LeakThrough.j3m"));
        this.rootNode.attachChild((Spatial)cube_leak);
        Sphere rock = new Sphere(32, 32, 2.0f);
        Geometry shiny_rock = new Geometry("Shiny rock", (Mesh)rock);
        rock.setTextureMode(Sphere.TextureMode.Projected);
        TangentBinormalGenerator.generate((Mesh)rock);
        Material mat_lit = new Material(this.assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mat_lit.setTexture("DiffuseMap", this.assetManager.loadTexture("Textures/Terrain/Pond/Pond.jpg"));
        mat_lit.setTexture("NormalMap", this.assetManager.loadTexture("Textures/Terrain/Pond/Pond_normal.png"));
        mat_lit.setBoolean("UseMaterialColors", true);
        mat_lit.setColor("Specular", ColorRGBA.White);
        mat_lit.setColor("Diffuse", ColorRGBA.White);
        mat_lit.setFloat("Shininess", 127.0f);
        shiny_rock.setMaterial(mat_lit);
        shiny_rock.setLocalTranslation(0.0f, 2.0f, -2.0f);
        shiny_rock.rotate(1.6f, 0.0f, 0.0f);
        this.rootNode.attachChild((Spatial)shiny_rock);
        DirectionalLight sun = new DirectionalLight();
        sun.setDirection(new Vector3f(1.0f, 0.0f, -2.0f).normalizeLocal());
        sun.setColor(ColorRGBA.White);
        this.rootNode.addLight((Light)sun);
    }
}
