Particle Sparks jme3 - Java Big Data

Java examples for Big Data:apache spark

Description

Particle Sparks jme3

Demo Code

package Effects;/*from   w w w  . j a va 2  s  . com*/

import com.jme3.app.SimpleApplication;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh.Type;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme
.scene.shape.Box;

/**
 * test
 *
 * @author normenhansen
 */
public class Particle2Sparks extends SimpleApplication {

    public static void main(String[] args) {
        Particle2Sparks app = new Particle2Sparks();
        app.start();
    }

    @Override
    public void simpleInitApp() {
        ParticleEmitter sparksEmitter = new ParticleEmitter(
                "Spark emitter", Type.Triangle, 60);
        rootNode.attachChild(sparksEmitter);

        Material sparkMat = new Material(assetManager,
                "Common/MatDefs/Misc/Particle.j3md");
        sparkMat.setTexture("Texture",
                assetManager.loadTexture("Effects/spark.png"));
        sparksEmitter.setMaterial(sparkMat);

        sparksEmitter.setImagesX(1);
        sparksEmitter.setImagesY(1);

        sparksEmitter.getParticleInfluencer().setInitialVelocity(
                new Vector3f(0, 10, 0));
        sparksEmitter.getParticleInfluencer().setVelocityVariation(1.0f);

        sparksEmitter.setStartColor(ColorRGBA.Yellow);
        sparksEmitter.setEndColor(ColorRGBA.Red);

        sparksEmitter.setGravity(0, 50, 0);

        sparksEmitter.setFacingVelocity(true);

        sparksEmitter.setStartSize(.5f);
        sparksEmitter.setEndSize(.5f);

        sparksEmitter.setLowLife(.7f);
        sparksEmitter.setHighLife(0.8f);

    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }

    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }
}

Related Tutorials