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

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

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

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 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 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

  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

emit.setStartColor(ColorRGBA.White);
emit.setEndColor(ColorRGBA.White);
emit.setSelectRandomImage(true);
emit.emitAllParticles();
origin: jMonkeyEngine/jmonkeyengine

debris.setImagesX(3); 
debris.setImagesY(3); // 3x3 texture animation
debris.setSelectRandomImage(true);
debris.setRotateSpeed(4);
debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 4, 0));
origin: tonihele/OpenKeeper

emitter.setImagesX(Math.max(1, resource.getData("frames")));
emitter.setImagesY(1);
emitter.setSelectRandomImage(resource.getFlags().contains(ArtResource.ArtResourceFlag.RANDOM_START_FRAME));
emitter.setInWorldSpace(false);
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.effectParticleEmittersetSelectRandomImage

Javadoc

Set to true if every particle spawned should get a random image from a pool of images constructed from the texture, with X by Y possible images.

By default, X and Y are equal to 1, thus allowing only 1 possible image to be selected, but if the particle is configured with multiple images by using ParticleEmitter#setImagesX(int)and {#link ParticleEmitter#setImagesY(int) } methods, then multiple images can be selected. Setting to false will cause each particle to have an animation of images displayed, starting at image 1, and going until image X*Y when the particle reaches its end of life.

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,
  • setMaterial,
  • setNumParticles,
  • setShadowMode,
  • setStartColor,
  • setStartSize,
  • addControl,
  • emitParticle

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • 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