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

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


  public FlameMain () {
    super("Flame");
    MathUtils.random = new RandomXS128();
    particleSystem = ParticleSystem.get();
    effect = new ParticleEffect();
    particleSystem.add(effect);
    assetManager = new AssetManager();
    assetManager.setErrorListener(this);
    assetManager.setLoader(ParticleEffect.class, new ParticleEffectLoader(new InternalFileHandleResolver()));
    controllersData = new Array<ControllerData>();
View Full Code Here


  public Array<ParticleEffect> getParticleEffects (Array<ParticleController> controllers, Array<ParticleEffect> out) {
    out.clear();
    assetManager.getAll(ParticleEffect.class, out);
    for(int i=0; i < out.size;){
      ParticleEffect effect = out.get(i);
      Array<ParticleController> effectControllers = effect.getControllers();
      boolean remove = true;
      for(ParticleController controller : controllers){
        if(effectControllers.contains(controller, true)){
          remove = false;
          break;
View Full Code Here

    }
  }

  public ParticleEffect openEffect (File file, boolean replaceCurrentWorkspace) {
    try {
      ParticleEffect loadedEffect = load(file.getAbsolutePath(), ParticleEffect.class, null,
        new ParticleEffectLoader.ParticleEffectLoadParameter(particleSystem.getBatches()));
      loadedEffect = loadedEffect.copy();
      loadedEffect.init();
      if(replaceCurrentWorkspace){
        effect = loadedEffect;
        controllersData.clear();
        particleSystem.removeAll();
        particleSystem.add(effect);
View Full Code Here

  @Override
  public void handle (int aEventType, Object aEventData) {
    if(aEventType == FlameMain.EVT_ASSET_RELOADED){
      Object[] data = (Object[])aEventData;
      if(data[0] instanceof ParticleEffect){
        ParticleEffect oldEffect = (ParticleEffect) data[0];
        int currentCount = value.templates.size;
        value.templates.removeAll(oldEffect.getControllers(), true);
        if(value.templates.size != currentCount){
          int diff = currentCount - value.templates.size;
          if(diff > 0){
            ParticleEffect newEffect = (ParticleEffect) data[1];
            Array<ParticleController> newControllers = newEffect.getControllers();
            if(newControllers.size > 0){
              for(int i=0, c=Math.min(diff, newControllers.size); i<c; ++i)
                value.templates.add(newControllers.get(i));
            }
          }
View Full Code Here

  }
 
  protected void importEffect () {
    File file = editor.showFileLoadDialog();
    if(file != null){
      ParticleEffect effect;
      if( (effect = editor.openEffect(file, false)) != null){
        for(ParticleController controller : effect.getControllers())
          addEmitter(controller, false);
        editIndex = 0;
        emitterTable.getSelectionModel().setSelectionInterval(editIndex, editIndex);
      }
    }
View Full Code Here

   
    Array<ParticleController> controllers = new Array<ParticleController>(templates);
    Array<Array<Integer>>effectsIndices = new Array<Array<Integer>>();
   
    for(int i=0; i < effects.size && controllers.size >0; ++i){
      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;
View Full Code Here

    SaveData data = resources.getSaveData();
    Array<Array<Integer>>effectsIndices = data.load("indices");
    AssetDescriptor descriptor;
    Iterator<Array<Integer>> iterator = effectsIndices.iterator();
    while((descriptor = data.loadAsset()) != null){
      ParticleEffect effect = (ParticleEffect)manager.get(descriptor);
      if(effect == null)
        throw new RuntimeException("Template is null");
      Array<ParticleController> effectControllers = effect.getControllers();
      Array<Integer> effectIndices = iterator.next();
     
      for(Integer index : effectIndices){
          templates.add(effectControllers.get(index));
      }
View Full Code Here

TOP

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

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.