Search in sources :

Example 1 with ParticleControllerControllerRenderer

use of com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer 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 ParticleControllerControllerRenderer

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

Aggregations

ParticleController (com.badlogic.gdx.graphics.g3d.particles.ParticleController)2 ParticleControllerControllerRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerControllerRenderer)2 RegularEmitter (com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter)1 DynamicsInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer)1 DynamicsModifier (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)1 ParticleControllerFinalizerInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerFinalizerInfluencer)1 ParticleControllerInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ParticleControllerInfluencer)1 ScaleInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.ScaleInfluencer)1 SpawnInfluencer (com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer)1 BillboardRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer)1 ModelInstanceRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.ModelInstanceRenderer)1 PointSpriteRenderer (com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteRenderer)1 EllipseSpawnShapeValue (com.badlogic.gdx.graphics.g3d.particles.values.EllipseSpawnShapeValue)1