Tabnine Logo
ParticleEmitter.setMaterial
Code IndexAdd Tabnine to your IDE (free)

How to use
setMaterial
method
in
com.jme3.effect.ParticleEmitter

Best Java code snippets using com.jme3.effect.ParticleEmitter.setMaterial (Showing top 19 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

meshes.add(mesh);
Material material = materialHelper.getParticlesMaterial(((Geometry) spatial).getMaterial(), alphaFunction, blenderContext);
emitter.setMaterial(material);// TODO: divide into several pieces
origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  emit = new ParticleEmitter("Emitter", Type.Triangle, 300);
  emit.setGravity(0, 0, 0);
  emit.getParticleInfluencer().setVelocityVariation(1);
  emit.setLowLife(1);
  emit.setHighLife(1);
  emit.getParticleInfluencer()
      .setInitialVelocity(new Vector3f(0, .5f, 0));
  emit.setImagesX(15);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
  emit.setMaterial(mat);
  
  rootNode.attachChild(emit);
  
  inputManager.addListener(new ActionListener() {
    
    public void onAction(String name, boolean isPressed, float tpf) {
      if ("setNum".equals(name) && isPressed) {
        emit.setNumParticles(1000);
      }
    }
  }, "setNum");
  
  inputManager.addMapping("setNum", new KeyTrigger(KeyInput.KEY_SPACE));
}

origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  ParticleEmitter emit = new ParticleEmitter("Emitter", Type.Triangle, 200);
  emit.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
  emit.setGravity(0, 0, 0);
  emit.setLowLife(5);
  emit.setHighLife(10);
  emit.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 0));
  emit.setImagesX(15);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
  emit.setMaterial(mat);
  ParticleEmitter emit2 = emit.clone();
  emit2.move(3, 0, 0);
  
  rootNode.attachChild(emit);
  rootNode.attachChild(emit2);
  
  ParticleEmitter emit3 = BinaryExporter.saveAndLoad(assetManager, emit);
  emit3.move(-3, 0, 0);
  rootNode.attachChild(emit3);
}
origin: jMonkeyEngine/jmonkeyengine

private void createSpark(){
  spark = new ParticleEmitter("Spark", Type.Triangle, 30 * COUNT_FACTOR);
  spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
  spark.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
  spark.setStartSize(.5f);
  spark.setEndSize(.5f);
  spark.setFacingVelocity(true);
  spark.setParticlesPerSec(0);
  spark.setGravity(0, 5, 0);
  spark.setLowLife(1.1f);
  spark.setHighLife(1.5f);
  spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0));
  spark.getParticleInfluencer().setVelocityVariation(1);
  spark.setImagesX(1);
  spark.setImagesY(1);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/spark.png"));
  spark.setMaterial(mat);
  explosionEffect.attachChild(spark);
}
origin: jMonkeyEngine/jmonkeyengine

fire.setMaterial(material);
fire.setShape(new EmitterSphereShape(Vector3f.ZERO, 0.1f));
fire.setImagesX(2);
smoke.setMaterial(material);
smoke.setShape(new EmitterSphereShape(Vector3f.ZERO, 5));
smoke.setImagesX(1);
origin: jMonkeyEngine/jmonkeyengine

  private void createShockwave(){
    shockwave = new ParticleEmitter("Shockwave", Type.Triangle, 1 * COUNT_FACTOR);
//        shockwave.setRandomAngle(true);
    shockwave.setFaceNormal(Vector3f.UNIT_Y);
    shockwave.setStartColor(new ColorRGBA(.48f, 0.17f, 0.01f, (float) (.8f / COUNT_FACTOR_F)));
    shockwave.setEndColor(new ColorRGBA(.48f, 0.17f, 0.01f, 0f));

    shockwave.setStartSize(0f);
    shockwave.setEndSize(7f);

    shockwave.setParticlesPerSec(0);
    shockwave.setGravity(0, 0, 0);
    shockwave.setLowLife(0.5f);
    shockwave.setHighLife(0.5f);
    shockwave.getParticleInfluencer()
        .setInitialVelocity(new Vector3f(0, 0, 0));
    shockwave.getParticleInfluencer().setVelocityVariation(0f);
    shockwave.setImagesX(1);
    shockwave.setImagesY(1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/shockwave.png"));
    shockwave.setMaterial(mat);
    explosionEffect.attachChild(shockwave);
  }

origin: jMonkeyEngine/jmonkeyengine

private void createFire() {
  /**
   * Uses Texture from jme3-test-data library!
   */
  ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
  Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
  fire.setMaterial(mat_red);
  fire.setImagesX(2);
  fire.setImagesY(2); // 2x2 texture animation
  fire.setEndColor(new ColorRGBA(1f, 0f, 0f, 1f));   // red
  fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
  fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));
  fire.setStartSize(10f);
  fire.setEndSize(1f);
  fire.setGravity(0, 0, 0);
  fire.setLowLife(0.5f);
  fire.setHighLife(1.5f);
  fire.getParticleInfluencer().setVelocityVariation(0.3f);
  fire.setLocalTranslation(-600, 50, 300);
  fire.setQueueBucket(Bucket.Translucent);
  rootNode.attachChild(fire);
}
origin: jMonkeyEngine/jmonkeyengine

  private void createSmokeTrail(){
    smoketrail = new ParticleEmitter("SmokeTrail", Type.Triangle, 22 * COUNT_FACTOR);
    smoketrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
    smoketrail.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
    smoketrail.setStartSize(.2f);
    smoketrail.setEndSize(1f);

//        smoketrail.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
    smoketrail.setFacingVelocity(true);
    smoketrail.setParticlesPerSec(0);
    smoketrail.setGravity(0, 1, 0);
    smoketrail.setLowLife(.4f);
    smoketrail.setHighLife(.5f);
    smoketrail.getParticleInfluencer()
        .setInitialVelocity(new Vector3f(0, 12, 0));
    smoketrail.getParticleInfluencer().setVelocityVariation(1);
    smoketrail.setImagesX(1);
    smoketrail.setImagesY(3);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/smoketrail.png"));
    smoketrail.setMaterial(mat);
    explosionEffect.attachChild(smoketrail);
  }

origin: jMonkeyEngine/jmonkeyengine

private void createRoundSpark(){
  roundspark = new ParticleEmitter("RoundSpark", EMITTER_TYPE, 20 * COUNT_FACTOR);
  roundspark.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, (float) (1.0 / COUNT_FACTOR_F)));
  roundspark.setEndColor(new ColorRGBA(0, 0, 0, (float) (0.5f / COUNT_FACTOR_F)));
  roundspark.setStartSize(1.2f);
  roundspark.setEndSize(1.8f);
  roundspark.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f));
  roundspark.setParticlesPerSec(0);
  roundspark.setGravity(0, -.5f, 0);
  roundspark.setLowLife(1.8f);
  roundspark.setHighLife(2f);
  roundspark.getParticleInfluencer()
      .setInitialVelocity(new Vector3f(0, 3, 0));
  roundspark.getParticleInfluencer().setVelocityVariation(.5f);
  roundspark.setImagesX(1);
  roundspark.setImagesY(1);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/roundspark.png"));
  mat.setBoolean("PointSprite", POINT_SPRITE);
  roundspark.setMaterial(mat);
  explosionEffect.attachChild(roundspark);
}
origin: jMonkeyEngine/jmonkeyengine

private void prepareEffect(AssetManager assetManager) {
  int COUNT_FACTOR = 1;
  float COUNT_FACTOR_F = 1f;
  effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
  effect.setSelectRandomImage(true);
  effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
  effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
  effect.setStartSize(1.3f);
  effect.setEndSize(2f);
  effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
  effect.setParticlesPerSec(0);
  effect.setGravity(0, -5f, 0);
  effect.setLowLife(.4f);
  effect.setHighLife(.5f);
  effect.getParticleInfluencer()
      .setInitialVelocity(new Vector3f(0, 7, 0));
  effect.getParticleInfluencer().setVelocityVariation(1f);
  effect.setImagesX(2);
  effect.setImagesY(2);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
  effect.setMaterial(mat);
}
origin: jMonkeyEngine/jmonkeyengine

private void createFlame(){
  flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
  flame.setSelectRandomImage(true);
  flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
  flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
  flame.setStartSize(1.3f);
  flame.setEndSize(2f);
  flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
  flame.setParticlesPerSec(0);
  flame.setGravity(0, -5, 0);
  flame.setLowLife(.4f);
  flame.setHighLife(.5f);
  flame.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 7, 0));
  flame.getParticleInfluencer().setVelocityVariation(1f);
  flame.setImagesX(2);
  flame.setImagesY(2);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
  mat.setBoolean("PointSprite", POINT_SPRITE);
  flame.setMaterial(mat);
  explosionEffect.attachChild(flame);
}
origin: jMonkeyEngine/jmonkeyengine

  private void createDebris(){
    debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR);
    debris.setSelectRandomImage(true);
    debris.setRandomAngle(true);
    debris.setRotateSpeed(FastMath.TWO_PI * 4);
    debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, (float) (1.0f / COUNT_FACTOR_F)));
    debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f));
    debris.setStartSize(.2f);
    debris.setEndSize(.2f);

//        debris.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
    debris.setParticlesPerSec(0);
    debris.setGravity(0, 12f, 0);
    debris.setLowLife(1.4f);
    debris.setHighLife(1.5f);
    debris.getParticleInfluencer()
        .setInitialVelocity(new Vector3f(0, 15, 0));
    debris.getParticleInfluencer().setVelocityVariation(.60f);
    debris.setImagesX(3);
    debris.setImagesY(3);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
    debris.setMaterial(mat);
    explosionEffect.attachChild(debris);
  }

origin: jMonkeyEngine/jmonkeyengine

private void createFlash(){
  flash = new ParticleEmitter("Flash", EMITTER_TYPE, 24 * COUNT_FACTOR);
  flash.setSelectRandomImage(true);
  flash.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1f / COUNT_FACTOR_F)));
  flash.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
  flash.setStartSize(.1f);
  flash.setEndSize(3.0f);
  flash.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
  flash.setParticlesPerSec(0);
  flash.setGravity(0, 0, 0);
  flash.setLowLife(.2f);
  flash.setHighLife(.2f);
  flash.getParticleInfluencer()
      .setInitialVelocity(new Vector3f(0, 5f, 0));
  flash.getParticleInfluencer().setVelocityVariation(1);
  flash.setImagesX(2);
  flash.setImagesY(2);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flash.png"));
  mat.setBoolean("PointSprite", POINT_SPRITE);
  flash.setMaterial(mat);
  explosionEffect.attachChild(flash);
}
origin: jMonkeyEngine/jmonkeyengine

mat_red.setTexture("Texture", assetManager.loadTexture(
    "Effects/Explosion/flame.png"));
fire.setMaterial(mat_red);
fire.setImagesX(2); 
fire.setImagesY(2); // 2x2 texture animation
debris_mat.setTexture("Texture", assetManager.loadTexture(
    "Effects/Explosion/Debris.png"));
debris.setMaterial(debris_mat);
debris.setImagesX(3); 
debris.setImagesY(3); // 3x3 texture animation
origin: jMonkeyEngine/jmonkeyengine

  private void prepareEffect() {
    int COUNT_FACTOR = 1;
    float COUNT_FACTOR_F = 1f;
    effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
    effect.setSelectRandomImage(true);
    effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
    effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
    effect.setStartSize(1.3f);
    effect.setEndSize(2f);
    effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
    effect.setParticlesPerSec(0);
    effect.setGravity(0, -5, 0);
    effect.setLowLife(.4f);
    effect.setHighLife(.5f);
    effect.getParticleInfluencer()
        .setInitialVelocity(new Vector3f(0, 7, 0));
    effect.getParticleInfluencer().setVelocityVariation(1f);
    effect.setImagesX(2);
    effect.setImagesY(2);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
    effect.setMaterial(mat);
//        effect.setLocalScale(100);
    rootNode.attachChild(effect);
  }
 
origin: jMonkeyEngine/jmonkeyengine

mat.setBoolean("PointSprite", true);
mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
emit.setMaterial(mat);
origin: jMonkeyEngine/jmonkeyengine

mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
fire.setShadowMode(ShadowMode.Cast);
fire.setMaterial(mat_red);
fire.setImagesX(2);
fire.setImagesY(2); // 2x2 texture animation
origin: tonihele/OpenKeeper

emitter.setParticlesPerSec(0);
Material material = AssetUtils.createParticleMaterial(resource, assetManager);
emitter.setMaterial(material);
emitter.setImagesX(Math.max(1, resource.getData("frames")));
emitter.setImagesY(1);
origin: org.cogchar/org.cogchar.lib.render.goody

private void prepareEffect(AssetManager assetManager) {
  int COUNT_FACTOR = 1;
  float COUNT_FACTOR_F = 1f;
  effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
  effect.setSelectRandomImage(true);
  effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
  effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
  effect.setStartSize(1.3f);
  effect.setEndSize(2f);
  effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
  effect.setParticlesPerSec(0);
  effect.setGravity(0, -5f, 0);
  effect.setLowLife(.4f);
  effect.setHighLife(.5f);
  effect.setInitialVelocity(new Vector3f(0, 7, 0));
  effect.setVelocityVariation(1f);
  effect.setImagesX(2);
  effect.setImagesY(2);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
  mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
  effect.setMaterial(mat);
}
com.jme3.effectParticleEmittersetMaterial

Popular methods of ParticleEmitter

  • emitAllParticles
    Instantly emits all the particles possible to be emitted. Any particles which are currently inactive
  • getName
  • setQueueBucket
  • getMaterial
  • setParticlesPerSec
    Set the number of particles to spawn per second.
  • <init>
  • clone
  • getNumVisibleParticles
    Returns the number of visible particles (spawned but not dead).
  • setEndColor
    Set the end color of the particles spawned.The particle color at any time is determined by blending
  • setEndSize
    Set the end size of the particles spawned.The particle size at any time is determined by blending th
  • setGravity
    This method sets the gravity vector.
  • setHighLife
    Set the high value of life.The particle's lifetime/expiration is determined by randomly selecting a
  • setGravity,
  • setHighLife,
  • setLowLife,
  • setNumParticles,
  • setShadowMode,
  • setStartColor,
  • setStartSize,
  • addControl,
  • emitParticle

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now