Package net.cis.client.game

Source Code of net.cis.client.game.TestEmitter

package net.cis.client.game;

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;

public class TestEmitter extends SimpleApplication{

  public TestEmitter(){
   
  }
 
  @Override
  public void simpleInitApp() {
    ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 1);
      Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
      mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/shockwave.png"));
      fire.setMaterial(mat_red);
      fire.setImagesX(1); fire.setImagesY(1); // 2x2 texture animation
      fire.setEndColornew ColorRGBA(0f, 0f, 0.1f, 1f));  
      fire.setStartColor(new ColorRGBA(0f, 0f, 0.6f, 1f));
      fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0,0,-25f));
      fire.setStartSize(1.5f);
      fire.setEndSize(0.05f);
      fire.setGravity(0,0,0);
//      fire.setLowLife(6f);
//      fire.setHighLife(6f);
//      fire.getParticleInfluencer().setVelocityVariation(0.3f);
      rootNode.attachChild(fire);
  }
 
  public static void main(String[] args){
    new TestEmitter().start();
  }
}
TOP

Related Classes of net.cis.client.game.TestEmitter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.