/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.jme3.app.SimpleApplication
 *  com.jme3.effect.ParticleEmitter
 *  com.jme3.effect.ParticleMesh$Type
 *  com.jme3.material.Material
 *  com.jme3.math.ColorRGBA
 *  com.jme3.math.Vector3f
 *  com.jme3.scene.Spatial
 */
package jme3.hello;

import com.jme3.app.SimpleApplication;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;

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

    public void simpleInitApp() {
        ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
        Material mat_red = new Material(this.assetManager, "Common/MatDefs/Misc/Particle.j3md");
        mat_red.setTexture("Texture", this.assetManager.loadTexture("Effects/Explosion/flame.png"));
        fire.setMaterial(mat_red);
        fire.setImagesX(2);
        fire.setImagesY(2);
        fire.setEndColor(ColorRGBA.Cyan);
        fire.setStartColor(ColorRGBA.Blue);
        fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, -2.0f, 0.0f));
        fire.setStartSize(0.1f);
        fire.setEndSize(1.5f);
        fire.setGravity(0.0f, 1.0f, 0.0f);
        fire.setLowLife(1.0f);
        fire.setHighLife(3.0f);
        fire.getParticleInfluencer().setVelocityVariation(0.3f);
        this.rootNode.attachChild((Spatial)fire);
        ParticleEmitter debris = new ParticleEmitter("Debris", ParticleMesh.Type.Triangle, 10);
        Material debris_mat = new Material(this.assetManager, "Common/MatDefs/Misc/Particle.j3md");
        debris_mat.setTexture("Texture", this.assetManager.loadTexture("Effects/Explosion/Debris.png"));
        debris.setMaterial(debris_mat);
        debris.setImagesX(3);
        debris.setImagesY(3);
        debris.setRotateSpeed(4.0f);
        debris.setSelectRandomImage(true);
        debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 4.0f, 0.0f));
        debris.setStartColor(ColorRGBA.White);
        debris.setGravity(0.0f, 6.0f, 0.0f);
        debris.getParticleInfluencer().setVelocityVariation(0.6f);
        this.rootNode.attachChild((Spatial)debris);
        debris.emitAllParticles();
    }
}
