Search in sources :

Example 1 with DynamicsInfluencer

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer in project libgdx by libgdx.

the class EffectPanel method createDefaultParticleController.

private ParticleController createDefaultParticleController() {
    //Emission
    RegularEmitter emitter = new RegularEmitter();
    emitter.getDuration().setLow(3000);
    emitter.getEmission().setHigh(90);
    emitter.getLife().setHigh(3000);
    emitter.setMaxParticleCount(100);
    //Spawn
    EllipseSpawnShapeValue pointSpawnShapeValue = new EllipseSpawnShapeValue();
    pointSpawnShapeValue.setDimensions(1, 1, 1);
    pointSpawnShapeValue.setSide(SpawnSide.top);
    SpawnInfluencer spawnSource = new SpawnInfluencer(pointSpawnShapeValue);
    //Scale
    ScaleInfluencer scaleInfluencer = new ScaleInfluencer();
    scaleInfluencer.value.setHigh(1);
    scaleInfluencer.value.setLow(0);
    scaleInfluencer.value.setTimeline(new float[] { 0, 1 });
    scaleInfluencer.value.setScaling(new float[] { 1, 0 });
    //Velocity
    DynamicsInfluencer velocityInfluencer = new DynamicsInfluencer();
    //Directional
    DynamicsModifier.CentripetalAcceleration velocityValue = new DynamicsModifier.CentripetalAcceleration();
    velocityValue.strengthValue.setHigh(5, 10);
    velocityValue.strengthValue.setActive(true);
    velocityInfluencer.velocities.add(velocityValue);
    return new ParticleController("ParticleController Controller", emitter, new ParticleControllerControllerRenderer(), new ParticleControllerInfluencer.Single(editor.assetManager.get(FlameMain.DEFAULT_TEMPLATE_PFX, ParticleEffect.class).getControllers().get(0)), spawnSource, scaleInfluencer, velocityInfluencer, new ParticleControllerFinalizerInfluencer());
}
Also used : DynamicsInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer) RegularEmitter(com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter) ParticleControllerFinalizerInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerFinalizerInfluencer) DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier) EllipseSpawnShapeValue(com.badlogic.gdx.graphics.g3d.particles.values.EllipseSpawnShapeValue) ScaleInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ScaleInfluencer) ParticleControllerControllerRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) ParticleControllerInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerInfluencer) SpawnInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)

Example 2 with DynamicsInfluencer

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer in project libgdx by libgdx.

the class EffectPanel method createDefaultPointController.

private ParticleController createDefaultPointController() {
    //Emission
    RegularEmitter emitter = new RegularEmitter();
    emitter.getDuration().setLow(3000);
    emitter.getEmission().setHigh(250);
    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(200);
    //Scale
    ScaleInfluencer scaleInfluencer = new ScaleInfluencer();
    scaleInfluencer.value.setHigh(1);
    //Color
    ColorInfluencer.Single colorInfluencer = new ColorInfluencer.Single();
    colorInfluencer.colorValue.setColors(new float[] { 0.12156863f, 0.047058824f, 1, 0, 0, 0 });
    colorInfluencer.colorValue.setTimeline(new float[] { 0, 1 });
    colorInfluencer.alphaValue.setHigh(1);
    colorInfluencer.alphaValue.setTimeline(new float[] { 0, 0.5f, 0.8f, 1 });
    colorInfluencer.alphaValue.setScaling(new float[] { 0, 0.15f, 0.5f, 0 });
    //Spawn
    PointSpawnShapeValue pointSpawnShapeValue = new PointSpawnShapeValue();
    SpawnInfluencer spawnSource = new SpawnInfluencer(pointSpawnShapeValue);
    //Velocity
    DynamicsInfluencer velocityInfluencer = new DynamicsInfluencer();
    //Directional
    DynamicsModifier.PolarAcceleration velocityValue = new DynamicsModifier.PolarAcceleration();
    velocityValue.phiValue.setHigh(-35, 35);
    velocityValue.phiValue.setActive(true);
    velocityValue.phiValue.setTimeline(new float[] { 0, 0.5f, 1 });
    velocityValue.phiValue.setScaling(new float[] { 1, 0, 0 });
    velocityValue.thetaValue.setHigh(0, 360);
    velocityValue.strengthValue.setHigh(5, 10);
    return new ParticleController("PointSprite Controller", emitter, new PointSpriteRenderer(editor.getPointSpriteBatch()), new RegionInfluencer.Single((Texture) editor.assetManager.get(FlameMain.DEFAULT_BILLBOARD_PARTICLE)), spawnSource, scaleInfluencer, colorInfluencer, velocityInfluencer);
}
Also used : DynamicsInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer) RegularEmitter(com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter) Texture(com.badlogic.gdx.graphics.Texture) DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier) PointSpawnShapeValue(com.badlogic.gdx.graphics.g3d.particles.values.PointSpawnShapeValue) ScaleInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ScaleInfluencer) PointSpriteRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteRenderer) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) ColorInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer) RegionInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.RegionInfluencer) SpawnInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)

Example 3 with DynamicsInfluencer

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer in project libgdx by libgdx.

the class EffectPanel method createDefaultBillboardController.

private ParticleController createDefaultBillboardController() {
    //Emission
    RegularEmitter emitter = new RegularEmitter();
    emitter.getDuration().setLow(3000);
    emitter.getEmission().setHigh(250);
    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(200);
    //Spawn
    PointSpawnShapeValue pointSpawnShapeValue = new PointSpawnShapeValue();
    SpawnInfluencer spawnSource = new SpawnInfluencer(pointSpawnShapeValue);
    //Color
    ColorInfluencer.Single colorInfluencer = new ColorInfluencer.Single();
    colorInfluencer.colorValue.setColors(new float[] { 1, 0.12156863f, 0.047058824f, 0, 0, 0 });
    colorInfluencer.colorValue.setTimeline(new float[] { 0, 1 });
    colorInfluencer.alphaValue.setHigh(1);
    colorInfluencer.alphaValue.setTimeline(new float[] { 0, 0.5f, 0.8f, 1 });
    colorInfluencer.alphaValue.setScaling(new float[] { 0, 0.15f, 0.5f, 0 });
    //Velocity
    DynamicsInfluencer velocityInfluencer = new DynamicsInfluencer();
    //Directional
    DynamicsModifier.PolarAcceleration velocityValue = new DynamicsModifier.PolarAcceleration();
    velocityValue.phiValue.setHigh(-35, 35);
    velocityValue.phiValue.setActive(true);
    velocityValue.phiValue.setTimeline(new float[] { 0, 0.5f, 1 });
    velocityValue.phiValue.setScaling(new float[] { 1, 0, 0 });
    velocityValue.thetaValue.setHigh(0, 360);
    velocityValue.strengthValue.setHigh(5, 10);
    velocityInfluencer.velocities.add(velocityValue);
    return new ParticleController("Billboard Controller", emitter, new BillboardRenderer(editor.getBillboardBatch()), new RegionInfluencer.Single(editor.getTexture()), spawnSource, colorInfluencer, velocityInfluencer);
}
Also used : DynamicsInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer) BillboardRenderer(com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer) RegularEmitter(com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter) DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier) PointSpawnShapeValue(com.badlogic.gdx.graphics.g3d.particles.values.PointSpawnShapeValue) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) ColorInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer) RegionInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.RegionInfluencer) SpawnInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)

Example 4 with DynamicsInfluencer

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer 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)

Example 5 with DynamicsInfluencer

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer in project libgdx by libgdx.

the class DynamicsInfluencerPanel method deleteVelocity.

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();
    selectedVelocityPanel.setVisible(false);
    selectedVelocityPanel = null;
}
Also used : DynamicsInfluencer(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController)

Aggregations

ParticleController (com.badlogic.gdx.graphics.g3d.particles.ParticleController)8 DynamicsInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer)8 RegularEmitter (com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter)5 SpawnInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)5 ColorInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer)4 DynamicsModifier (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)4 RegionInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.RegionInfluencer)3 ScaleInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ScaleInfluencer)3 PointSpawnShapeValue (com.badlogic.gdx.graphics.g3d.particles.values.PointSpawnShapeValue)3 BillboardRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer)2 EllipseSpawnShapeValue (com.badlogic.gdx.graphics.g3d.particles.values.EllipseSpawnShapeValue)2 Texture (com.badlogic.gdx.graphics.Texture)1 Model (com.badlogic.gdx.graphics.g3d.Model)1 Single (com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer.Single)1 BrownianAcceleration (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.BrownianAcceleration)1 ModelInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ModelInfluencer)1 ParticleControllerFinalizerInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerFinalizerInfluencer)1 ParticleControllerInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerInfluencer)1 ModelInstanceRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer)1 ParticleControllerControllerRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer)1