Examples of ParticleSystem


Examples of com.ardor3d.extension.effect.particle.ParticleSystem

    @Override
    protected void initExample() {
        _canvas.setTitle("Particle System - Example");
        _lightState.setEnabled(false);

        final ParticleSystem particles = ParticleFactory.buildParticles("particles", 1);
        particles.setEmissionDirection(new Vector3(0, 1, 0));
        particles.setInitialVelocity(0);
        particles.setMinimumLifeTime(2500);
        particles.setMaximumLifeTime(2500);
        particles.setMaximumAngle(45 * MathUtils.DEG_TO_RAD);
        particles.getParticleController().setControlFlow(false);
        particles.setParticlesInWorldCoords(true);

        // Start color is RED, opaque
        particles.setStartColor(new ColorRGBA(1, 0, 0, 1));
        particles.setStartSize(2.5);

        // At 25% life, let's have the color be WHITE, opaque
        final RampEntry entry25 = new RampEntry(.25);
        entry25.setColor(new ColorRGBA(1, 1, 1, 1));
        particles.getRamp().addEntry(entry25);

        // At 50% life, (25% higher than previous) let's have the color be RED, opaque and twice as big.
        // Note that at 25% life the size will be about 3.75 since we did not set a size on that.
        final RampEntry entry50 = new RampEntry(.25);
        entry50.setColor(new ColorRGBA(1, 0, 0, 1));
        entry50.setSize(5);
        particles.getRamp().addEntry(entry50);

        // At 75% life, (25% higher than previous) let's have the color be WHITE, opaque
        final RampEntry entry75 = new RampEntry(.25);
        entry75.setColor(new ColorRGBA(1, 1, 1, 1));
        particles.getRamp().addEntry(entry75);

        // End color is BLUE, opaque (size is back to 2.5 now.
        particles.setEndColor(new ColorRGBA(0, 0, 1, 1));
        particles.setEndSize(2.5);

        particles.warmUp(60);

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        blend.setDestinationFunction(BlendState.DestinationFunction.One);
        particles.setRenderState(blend);

        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/flaresmall.jpg", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));
        ts.setEnabled(true);
        particles.setRenderState(ts);

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        particles.setRenderState(zstate);

        particles.getParticleGeometry().setModelBound(new BoundingBox());

        _root.attachChild(particles);
    }
View Full Code Here

Examples of com.ardor3d.extension.effect.particle.ParticleSystem

        // find location of fist
        final SkeletonPose pose = mesh.getCurrentPose();
        final Transform loc = mesh.getWorldTransform().multiply(pose.getGlobalJointTransforms()[15], null);

        // Spawn a short lived explosion
        final ParticleSystem explosion = ParticleFactory.buildParticles("big", 80);
        explosion.setEmissionDirection(new Vector3(0.0f, 1.0f, 0.0f));
        explosion.setMaximumAngle(MathUtils.PI);
        explosion.setSpeed(0.9f);
        explosion.setMinimumLifeTime(300.0f);
        explosion.setMaximumLifeTime(500.0f);
        explosion.setStartSize(2.0f);
        explosion.setEndSize(5.0f);
        explosion.setStartColor(new ColorRGBA(1.0f, 0.312f, 0.121f, 1.0f));
        explosion.setEndColor(new ColorRGBA(1.0f, 0.24313726f, 0.03137255f, 0.0f));
        explosion.setControlFlow(false);
        explosion.setInitialVelocity(0.04f);
        explosion.setParticleSpinSpeed(0.0f);
        explosion.setRepeatType(RepeatType.CLAMP);

        // attach to root, at fist location
        explosion.setTransform(loc);
        explosion.warmUp(1);
        example.getRoot().attachChild(explosion);
        example.getRoot().updateWorldTransform(true);

        explosion.getParticleController().addListener(new ParticleControllerListener() {
            @Override
            public void onDead(final ParticleSystem particles) {
                explosion.removeFromParent();
            }
        });
        explosion.forceRespawn();

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        blend.setDestinationFunction(BlendState.DestinationFunction.One);
        explosion.setRenderState(blend);

        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/flaresmall.jpg", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));
        ts.getTexture().setWrap(WrapMode.BorderClamp);
        ts.setEnabled(true);
        explosion.setRenderState(ts);

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        explosion.setRenderState(zstate);
    }
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.protocol.primitives.ParticleSystem

            prim.Light.Radius = this.Light.Radius;
        }

        if (this.Particles != null)
        {
            prim.ParticleSys = new ParticleSystem();
            prim.ParticleSys.AngularVelocity = this.Particles.AngularVelocity;
            prim.ParticleSys.PartAcceleration = this.Particles.Acceleration;
            prim.ParticleSys.BurstPartCount = (byte)this.Particles.BurstParticleCount;
            prim.ParticleSys.BurstRate = this.Particles.BurstRadius;
            prim.ParticleSys.BurstRate = this.Particles.BurstRate;
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.protocol.primitives.ParticleSystem

        prim.TextureAnim = new TextureAnimation(block.TextureAnim, 0);
       
        //FIXME need to fix the following exception
        try{
          prim.ParticleSys = new ParticleSystem(block.PSBlock, 0);
        }
        catch(Exception ex)
        {
          JLogger.warn("Error while decoding ParticleSystem from packet: "
              + Utils.getExceptionStackTraceAsString(ex));
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.protocol.primitives.ParticleSystem

        }

        // Particle system
        if ((flags & CompressedFlags.HasParticles.getIndex())  != 0)
        {
          prim.ParticleSys = new ParticleSystem(block.Data, i);
          i += 86;
        }

        // Extra parameters
        i += prim.SetExtraParamsFromBytes(block.Data, i);
View Full Code Here

Examples of org.jbox2d.particle.ParticleSystem

    m_inv_dt0 = 0f;

    m_contactManager = new ContactManager(this, broadPhase);
    m_profile = new Profile();

    m_particleSystem = new ParticleSystem(this);

    initializeRegisters();
  }
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  public ParticleActor() {
  }

  public ParticleActor(float x, float y) {
    super(x, y);
    particleSystem = new ParticleSystem("particle.png");
    particleSystem.addEmitter(new FireEmitter());
 
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

    super.paint(g);
  }

  public void update(int time) {
    if(fire==null){
      fire = new ParticleSystem("particle.png",20);
      FireEmitter f=new FireEmitter(0,0,5);     
      fire.addEmitter(f)
    }
    super.update(time);
    fire.update(time);
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

   *
   * @param additive
   *            True if the particle system should be set to additive
   */
  public void clearSystem(boolean additive) {
    system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
    if (additive) {
      system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
    }
    system.setRemoveCompletedEmitters(false);
  }
View Full Code Here

Examples of org.newdawn.slick.particles.ParticleSystem

  public void init(GameContainer container) throws SlickException {
    container.getInput().addListener(listener);
    container.setShowFPS(false);
   
    system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
    system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
    system.setRemoveCompletedEmitters(false);

    for (int i = 0; i < waiting.size(); i++) {
      system.addEmitter((ParticleEmitter) waiting.get(i));
View Full Code Here
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.