Package com.badlogic.gdx.graphics.g3d.particles

Examples of com.badlogic.gdx.graphics.g3d.particles.ParticleController


    addContent(i++, 0, angularVelocityPanel);
    addContent(i++, 0, emptyPanel);
  }

  protected void velocityChecked (int index, boolean isChecked) {
    ParticleController controller = editor.getEmitter();
    DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class);   
    influencer.velocities.clear();
    velocities.get(index).isActive = isChecked;
    for(VelocityWrapper wrapper : velocities){
      if(wrapper.isActive)
        influencer.velocities.add(wrapper.velocityValue);
View Full Code Here


  protected void deleteVelocity () {
    int row = velocityTable.getSelectedRow();
    if (row == -1) return;
   
    //Remove the velocity from the table
    ParticleController controller = editor.getEmitter();
    DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class);
    influencer.velocities.removeValue(velocities.removeIndex(row).velocityValue, true);
    velocityTableModel.removeRow(row);
   
    //Restart the effect and reinit the controller
    editor.restart();
View Full Code Here

    selectedVelocityPanel = null;
  }

  protected void createVelocity (Object selectedItem) {
    //Add the velocity to the table and to the influencer
    ParticleController controller = editor.getEmitter();
    DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class);
    VelocityWrapper wrapper = new VelocityWrapper(createVelocityValue(selectedItem), true);
    velocities.add(wrapper);
    influencer.velocities.add(wrapper.velocityValue);
    int index = velocities.size-1;
    velocityTableModel.addRow(new Object[] {"Velocity "+index, true});
View Full Code Here

 
  @Override
  public void dispose () {
    if(controller != null){
      for(int i=0; i < controller.particles.size; ++i){
        ParticleController controller = particleControllerChannel.data[i];
        if(controller != null){
          controller.dispose();
          particleControllerChannel.data[i]= null;
        }
      }
    }
  }
View Full Code Here

      ParticleEffect effect = effects.get(i);
      Array<ParticleController> effectControllers = effect.getControllers();
      Iterator<ParticleController> iterator = controllers.iterator();
      Array<Integer> indices = null;
      while(iterator.hasNext()){
        ParticleController controller = iterator.next();
        int index = -1;
        if( (index = effectControllers.indexOf(controller, true)) >-1){
          if(indices == null){
            indices = new Array<Integer>();
          }
View Full Code Here

      super(particleControllerSingle);
    }

    @Override
    public void init () {
      ParticleController first = templates.first();
      for(int i=0, c = controller.particles.capacity; i < c; ++i){
        ParticleController copy = first.copy();
        copy.init();
        particleControllerChannel.data[i] = copy;
      }
    }
View Full Code Here

    }

    @Override
    public void activateParticles (int startIndex, int count) {
      for(int i=startIndex, c = startIndex +count; i < c; ++i){
        ParticleController controller = pool.obtain();
        controller.start();
        particleControllerChannel.data[i] = controller;
      }
    }
View Full Code Here

    }
   
    @Override
    public void killParticles (int startIndex, int count) {
      for(int i=startIndex, c = startIndex +count; i < c; ++i){
        ParticleController controller = particleControllerChannel.data[i];
        controller.end();
        pool.free(controller);
        particleControllerChannel.data[i] = null;
      }
    }
View Full Code Here

    private class ParticleControllerPool extends Pool<ParticleController>{
      public ParticleControllerPool () {}

      @Override
      public ParticleController newObject () {
        ParticleController controller = templates.random().copy();
        controller.init();
        return controller;
      }
View Full Code Here

  @Override
  public void update () {
    for(int i=0, positionOffset = 0, c = controller.particles.size;
      i< c;
      ++i, positionOffset += positionChannel.strideSize){
      ParticleController particleController = controllerChannel.data[i];
      float scale = hasScale ? scaleChannel.data[i] : 1;
      float qx=0, qy=0, qz=0, qw=1;
      if(hasRotation){
        int rotationOffset = i* rotationChannel.strideSize;
        qx = rotationChannel.data[rotationOffset + ParticleChannels.XOffset];
        qy = rotationChannel.data[rotationOffset + ParticleChannels.YOffset];
        qz = rotationChannel.data[rotationOffset + ParticleChannels.ZOffset];
        qw = rotationChannel.data[rotationOffset + ParticleChannels.WOffset];
      }
      particleController.setTransformpositionChannel.data[positionOffset + ParticleChannels.XOffset],
        positionChannel.data[positionOffset + ParticleChannels.YOffset],
        positionChannel.data[positionOffset + ParticleChannels.ZOffset],
        qx,qy,qz,qw, scale);
      particleController.update();
    }
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.g3d.particles.ParticleController

Copyright © 2018 www.massapicom. 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.