Search in sources :

Example 1 with DefaultParticleGenerator

use of com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator in project gdx-graph by MarcinSc.

the class ParticlesShaderTestScene method createEffect.

private void createEffect(GraphParticleEffects particleEffects, Vector3 center, float size) {
    SpherePositionGenerator positionGenerator = new SpherePositionGenerator();
    positionGenerator.getCenter().set(center);
    positionGenerator.setRadius(0.3f);
    DefaultParticleGenerator particleGenerator = new DefaultParticleGenerator(timeKeeper, 1f, 0, 10);
    particleGenerator.setPositionGenerator(positionGenerator);
    MapWritablePropertyContainer properties = new MapWritablePropertyContainer();
    properties.setValue("Size", size);
    CommonPropertiesParticleEffectAdapter particleEffectAdapter = new CommonPropertiesParticleEffectAdapter(particleEffects, Vector3.Zero, null, properties);
    particleEffectAdapter.addTag("Test", particleGenerator);
    particleEffectAdapter.startEffect("Test");
}
Also used : DefaultParticleGenerator(com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator) SpherePositionGenerator(com.gempukku.libgdx.graph.util.particles.generator.SpherePositionGenerator) CommonPropertiesParticleEffectAdapter(com.gempukku.libgdx.graph.util.particles.CommonPropertiesParticleEffectAdapter) MapWritablePropertyContainer(com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)

Example 2 with DefaultParticleGenerator

use of com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator in project gdx-graph by MarcinSc.

the class Episode18Scene method createExhaust.

private void createExhaust(GraphParticleEffects effects, Vector3 point1, Vector3 point2) {
    final LinePositionGenerator positionGenerator = new LinePositionGenerator();
    positionGenerator.getPoint1().set(point1);
    positionGenerator.getPoint2().set(point2);
    DefaultParticleGenerator particleGenerator = new DefaultParticleGenerator(timeKeeper, 0.5f, 0, 1000) {

        @Override
        protected void generateAttributes(ObjectMap attributes) {
            attributes.put("Move X", MathUtils.random(-0.05f, 0.05f));
            attributes.put("Move Y", MathUtils.random(-0.05f, 0.05f));
        }
    };
    particleGenerator.setPositionGenerator(positionGenerator);
    CommonPropertiesParticleEffectAdapter particleEffectAdapter = new CommonPropertiesParticleEffectAdapter(effects);
    particleEffectAdapter.addTag("exhaust", particleGenerator);
    particleEffectAdapter.startEffect("exhaust");
}
Also used : DefaultParticleGenerator(com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator) CommonPropertiesParticleEffectAdapter(com.gempukku.libgdx.graph.util.particles.CommonPropertiesParticleEffectAdapter) ObjectMap(com.badlogic.gdx.utils.ObjectMap) LinePositionGenerator(com.gempukku.libgdx.graph.util.particles.generator.LinePositionGenerator)

Aggregations

CommonPropertiesParticleEffectAdapter (com.gempukku.libgdx.graph.util.particles.CommonPropertiesParticleEffectAdapter)2 DefaultParticleGenerator (com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator)2 ObjectMap (com.badlogic.gdx.utils.ObjectMap)1 MapWritablePropertyContainer (com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)1 LinePositionGenerator (com.gempukku.libgdx.graph.util.particles.generator.LinePositionGenerator)1 SpherePositionGenerator (com.gempukku.libgdx.graph.util.particles.generator.SpherePositionGenerator)1