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

Examples of com.badlogic.gdx.graphics.g3d.particles.influencers.Influencer


              model.addElement(value);
          }
          JPanel panel = null;
          addRow(controllerPropertiesPanel, getPanel(controller.emitter));
          for(int i=0, c = controller.influencers.size; i < c; ++i){
            Influencer influencer = (Influencer)controller.influencers.get(i);
            panel = getPanel(influencer);
            if(panel != null)
              addRow(controllerPropertiesPanel, panel, 1, i == c-1 ? 1 : 0);
          }
          for (Component component : controllerPropertiesPanel.getComponents())
View Full Code Here


    if(controller.findInfluencer(type) != null) return;

    try {
      controller.end();
     
      Influencer newInfluencer = type.newInstance();
      boolean replaced = false;
      if(ColorInfluencer.class.isAssignableFrom(type)){
         replaced = controller.replaceInfluencer(ColorInfluencer.class, (ColorInfluencer)newInfluencer);
      }
      else if(RegionInfluencer.class.isAssignableFrom(type)){
         replaced = controller.replaceInfluencer(RegionInfluencer.class, (RegionInfluencer)newInfluencer);
      }
      else if(ModelInfluencer.class.isAssignableFrom(type)){
        ModelInfluencer newModelInfluencer = (ModelInfluencer) newInfluencer;
        ModelInfluencer currentInfluencer = (ModelInfluencer)controller.findInfluencer(ModelInfluencer.class);
        if(currentInfluencer != null){
            newModelInfluencer.models.add(currentInfluencer.models.first());
        }
        replaced = controller.replaceInfluencer(ModelInfluencer.class, (ModelInfluencer)newInfluencer);
      }
      else if(ParticleControllerInfluencer.class.isAssignableFrom(type)){   
        ParticleControllerInfluencer newModelInfluencer = (ParticleControllerInfluencer) newInfluencer;
        ParticleControllerInfluencer currentInfluencer = (ParticleControllerInfluencer)controller.findInfluencer(ParticleControllerInfluencer.class);
        if(currentInfluencer != null){
            newModelInfluencer.templates.add(currentInfluencer.templates.first());
        }
        replaced = controller.replaceInfluencer(ParticleControllerInfluencer.class, (ParticleControllerInfluencer)newInfluencer);
      }
     
      if(!replaced){
        if(getControllerType() != ControllerType.ParticleController)
          controller.influencers.add(newInfluencer);
        else{
          Influencer finalizer = controller.influencers.pop();
          controller.influencers.add(newInfluencer);
          controller.influencers.add(finalizer);
        }
      }
View Full Code Here

  }

  /** @return the index of the Influencer of the given type. */
  private <K extends Influencer> int findIndex(Class<K> type){
    for(int i = 0; i< influencers.size; ++i){
      Influencer influencer = influencers.get(i);
      if(ClassReflection.isAssignableFrom(type, influencer.getClass())){
        return i;
      }
    }
    return -1;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.g3d.particles.influencers.Influencer

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.