Search in sources :

Example 1 with LinePositionGenerator

use of com.gempukku.libgdx.graph.util.particles.generator.LinePositionGenerator 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

ObjectMap (com.badlogic.gdx.utils.ObjectMap)1 CommonPropertiesParticleEffectAdapter (com.gempukku.libgdx.graph.util.particles.CommonPropertiesParticleEffectAdapter)1 DefaultParticleGenerator (com.gempukku.libgdx.graph.util.particles.generator.DefaultParticleGenerator)1 LinePositionGenerator (com.gempukku.libgdx.graph.util.particles.generator.LinePositionGenerator)1