Tabnine Logo
com.jme3.effect
Code IndexAdd Tabnine to your IDE (free)

How to use com.jme3.effect

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

origin: jMonkeyEngine/jmonkeyengine

private void stop() {
  emitter.setParticlesPerSec(0);
  emitted = false;
  if (!killParticles.stopRequested) {
    emitter.addControl(killParticles);
    killParticles.stopRequested = true;
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Set the number of images along the Y axis (height).
 *
 * <p>To determine how multiple particle images are selected and used, see the
 * {@link ParticleEmitter#setSelectRandomImage(boolean) } method.
 *
 * @param imagesY the number of images along the Y axis (height).
 */
public void setImagesY(int imagesY) {
  this.imagesY = imagesY;
  particleMesh.setImagesXY(this.imagesX, this.imagesY);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Callback from Control.update(), do not use.
 * @param tpf
 */
public void updateFromControl(float tpf) {
  if (enabled) {
    this.updateParticleState(tpf);
  }
}
origin: jMonkeyEngine/jmonkeyengine

@Override
protected void controlUpdate(float tpf) {
  if (remove) {
    emitter.removeControl(this);
    return;
  }
  if (emitter.getNumVisibleParticles() == 0) {
    emitter.setCullHint(CullHint.Always);
    emitter.setEnabled(false);
    emitter.removeControl(this);
    stopRequested = false;
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets the type of mesh used by the particle emitter.
 * @param meshType The mesh type to use
 */
public void setMeshType(ParticleMesh.Type meshType) {
  this.meshType = meshType;
  switch (meshType) {
    case Point:
      particleMesh = new ParticlePointMesh();
      this.setMesh(particleMesh);
      break;
    case Triangle:
      particleMesh = new ParticleTriMesh();
      this.setMesh(particleMesh);
      break;
    default:
      throw new IllegalStateException("Unrecognized particle type: " + meshType);
  }
  this.setNumParticles(particles.length);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Set the maximum amount of particles that
 * can exist at the same time with this emitter.
 * Calling this method many times is not recommended.
 *
 * @param numParticles the maximum amount of particles that
 * can exist at the same time with this emitter.
 */
public final void setNumParticles(int numParticles) {
  particles = new Particle[numParticles];
  for (int i = 0; i < numParticles; i++) {
    particles[i] = new Particle();
  }
  //We have to reinit the mesh's buffers with the new size
  particleMesh.initParticleData(this, particles.length);
  particleMesh.setImagesXY(this.imagesX, this.imagesY);
  firstUnUsed = 0;
  lastUsed = -1;
}
origin: jMonkeyEngine/jmonkeyengine

public void preload(RenderManager rm, ViewPort vp) {
  this.updateParticleState(0);
  particleMesh.updateParticleData(particles, vp.getCamera(), Matrix3f.IDENTITY);
}
origin: jMonkeyEngine/jmonkeyengine

private void setUserData(EffectTrack effectTrack) {
  //fetching the UserData TrackInfo.
  TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo");
  //if it does not exist, we create it and attach it to the emitter.
  if (data == null) {
    data = new TrackInfo();
    effectTrack.emitter.setUserData("TrackInfo", data);
  }
  //adding the given Track to the TrackInfo.
  data.addTrack(effectTrack);
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public ParticleEmitter clone() {
  return clone(true);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Instantly kills all active particles, after this method is called, all
 * particles will be dead and no longer visible.
 */
public void killAllParticles() {
  for (int i = 0; i < particles.length; ++i) {
    if (particles[i].life > 0) {
      this.freeParticle(i);
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

public boolean isEnabled() {
  return parentEmitter.isEnabled();
}
origin: jMonkeyEngine/jmonkeyengine

public void setEnabled(boolean enabled) {
  parentEmitter.setEnabled(enabled);
}
origin: jMonkeyEngine/jmonkeyengine

public void update(float tpf) {
  parentEmitter.updateFromControl(tpf);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Set to true if particles should spawn in world space.
 *
 * <p>If set to true and the particle emitter is moved in the scene,
 * then particles that have already spawned won't be affected by this
 * motion. If set to false, the particles will emit in local space
 * and when the emitter is moved, so are all the particles that
 * were emitted previously.
 *
 * @param worldSpace true if particles should spawn in world space.
 */
public void setInWorldSpace(boolean worldSpace) {
  this.setIgnoreTransform(worldSpace);
  this.worldSpace = worldSpace;
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public void setImagesXY(int imagesX, int imagesY) {
  this.imagesX = imagesX;
  this.imagesY = imagesY;
  if (imagesX != 1 || imagesY != 1){
    uniqueTexCoords = true;
    getBuffer(VertexBuffer.Type.TexCoord).setUsage(Usage.Stream);
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Instantly emits all the particles possible to be emitted. Any particles
 * which are currently inactive will be spawned immediately.
 */
public void emitAllParticles() {
  emitParticles(particles.length);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * For serialization only. Do not use.
 */
public ParticleEmitter() {
  super();
  setBatchHint(BatchHint.Never);
}
origin: jMonkeyEngine/jmonkeyengine

  @Override
  public void simpleUpdate(float tpf) {
    angle += tpf;
    angle %= FastMath.TWO_PI;
    float x = FastMath.cos(angle) * 2;
    float y = FastMath.sin(angle) * 2;
    emit.setLocalTranslation(x, 0, y);
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Set the number of images along the X axis (width).
 *
 * <p>To determine
 * how multiple particle images are selected and used, see the
 * {@link ParticleEmitter#setSelectRandomImage(boolean) } method.
 *
 * @param imagesX the number of images along the X axis (width).
 */
public void setImagesX(int imagesX) {
  this.imagesX = imagesX;
  particleMesh.setImagesXY(this.imagesX, this.imagesY);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Kills the particle at the given index.
 *
 * @param index The index of the particle to kill
 * @see #getParticles()
 */
public void killParticle(int index){
  freeParticle(index);
}
com.jme3.effect

Most used classes

  • ParticleEmitter
    ParticleEmitter is a special kind of geometry which simulates a particle system. Particle emitters
  • ParticleInfluencer
    An interface that defines the methods to affect initial velocity of the particles.
  • EmitterSphereShape
  • NewtonianParticleInfluencer
    This influencer calculates initial velocity with the use of the emitter's shape.
  • EmitterBoxShape
  • EmitterMeshVertexShape,
  • Particle,
  • ParticleEmitter$ParticleEmitterControl,
  • ParticleMesh,
  • ParticlePointMesh,
  • ParticleTriMesh,
  • DefaultParticleInfluencer,
  • EmitterShape,
  • ParticleComparator,
  • EmptyParticleInfluencer,
  • EmitterMeshConvexHullShape
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