Search in sources :

Example 1 with ModelInstanceRenderer

use of com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer in project libgdx by libgdx.

the class FlameMain method getControllerType.

public ControllerType getControllerType() {
    ParticleController controller = getEmitter();
    ControllerType type = null;
    if (controller.renderer instanceof BillboardRenderer)
        type = ControllerType.Billboard;
    else if (controller.renderer instanceof PointSpriteRenderer)
        type = ControllerType.PointSprite;
    else if (controller.renderer instanceof ModelInstanceRenderer)
        type = ControllerType.ModelInstance;
    else if (controller.renderer instanceof ParticleControllerControllerRenderer)
        type = ControllerType.ParticleController;
    return type;
}
Also used : BillboardRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer) ParticleControllerControllerRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer) PointSpriteRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteRenderer) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) ModelInstanceRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer)

Example 2 with ModelInstanceRenderer

use of com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer in project libgdx by libgdx.

the class EffectPanel method createDefaultModelInstanceController.

private ParticleController createDefaultModelInstanceController() {
    //Emission
    RegularEmitter emitter = new RegularEmitter();
    emitter.getDuration().setLow(3000);
    emitter.getEmission().setHigh(80);
    emitter.getLife().setHigh(500, 1000);
    emitter.getLife().setTimeline(new float[] { 0, 0.66f, 1 });
    emitter.getLife().setScaling(new float[] { 1, 1, 0.3f });
    emitter.setMaxParticleCount(100);
    //Color
    ColorInfluencer.Random colorInfluencer = new ColorInfluencer.Random();
    //Spawn
    EllipseSpawnShapeValue spawnShapeValue = new EllipseSpawnShapeValue();
    spawnShapeValue.setDimensions(1, 1, 1);
    SpawnInfluencer spawnSource = new SpawnInfluencer(spawnShapeValue);
    //Velocity
    DynamicsInfluencer velocityInfluencer = new DynamicsInfluencer();
    //Directional
    DynamicsModifier.CentripetalAcceleration velocityValue = new DynamicsModifier.CentripetalAcceleration();
    velocityValue.strengthValue.setHigh(5, 11);
    velocityValue.strengthValue.setActive(true);
    //velocityValue.setActive(true);
    velocityInfluencer.velocities.add(velocityValue);
    return new ParticleController("ModelInstance Controller", emitter, new ModelInstanceRenderer(editor.getModelInstanceParticleBatch()), new ModelInfluencer.Single((Model) editor.assetManager.get(FlameMain.DEFAULT_MODEL_PARTICLE)), spawnSource, colorInfluencer, velocityInfluencer);
}
Also used : DynamicsInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer) ModelInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ModelInfluencer) RegularEmitter(com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter) ModelInstanceRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer) DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier) EllipseSpawnShapeValue(com.badlogic.gdx.graphics.g3d.particles.values.EllipseSpawnShapeValue) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) ColorInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer) ListSelectionModel(javax.swing.ListSelectionModel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) DefaultTableModel(javax.swing.table.DefaultTableModel) Model(com.badlogic.gdx.graphics.g3d.Model) SpawnInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)

Aggregations

ParticleController (com.badlogic.gdx.graphics.g3d.particles.ParticleController)2 ModelInstanceRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer)2 Model (com.badlogic.gdx.graphics.g3d.Model)1 RegularEmitter (com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter)1 ColorInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer)1 DynamicsInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer)1 DynamicsModifier (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)1 ModelInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ModelInfluencer)1 SpawnInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)1 BillboardRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer)1 ParticleControllerControllerRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer)1 PointSpriteRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteRenderer)1 EllipseSpawnShapeValue (com.badlogic.gdx.graphics.g3d.particles.values.EllipseSpawnShapeValue)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 ListSelectionModel (javax.swing.ListSelectionModel)1 DefaultTableModel (javax.swing.table.DefaultTableModel)1