use of com.jme3.material.Material in project jmonkeyengine by jMonkeyEngine.
the class TestExplosionEffect method createSmokeTrail.
private void createSmokeTrail() {
smoketrail = new ParticleEmitter("SmokeTrail", Type.Triangle, 22 * COUNT_FACTOR);
smoketrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
smoketrail.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
smoketrail.setStartSize(.2f);
smoketrail.setEndSize(1f);
// smoketrail.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
smoketrail.setFacingVelocity(true);
smoketrail.setParticlesPerSec(0);
smoketrail.setGravity(0, 1, 0);
smoketrail.setLowLife(.4f);
smoketrail.setHighLife(.5f);
smoketrail.setInitialVelocity(new Vector3f(0, 12, 0));
smoketrail.setVelocityVariation(1);
smoketrail.setImagesX(1);
smoketrail.setImagesY(3);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/smoketrail.png"));
smoketrail.setMaterial(mat);
explosionEffect.attachChild(smoketrail);
}
use of com.jme3.material.Material in project jmonkeyengine by jMonkeyEngine.
the class TestExplosionEffect method createDebris.
private void createDebris() {
debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR);
debris.setSelectRandomImage(true);
debris.setRandomAngle(true);
debris.setRotateSpeed(FastMath.TWO_PI * 4);
debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, (float) (1.0f / COUNT_FACTOR_F)));
debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f));
debris.setStartSize(.2f);
debris.setEndSize(.2f);
// debris.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
debris.setParticlesPerSec(0);
debris.setGravity(0, 12f, 0);
debris.setLowLife(1.4f);
debris.setHighLife(1.5f);
debris.setInitialVelocity(new Vector3f(0, 15, 0));
debris.setVelocityVariation(.60f);
debris.setImagesX(3);
debris.setImagesY(3);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
debris.setMaterial(mat);
explosionEffect.attachChild(debris);
}
use of com.jme3.material.Material in project jmonkeyengine by jMonkeyEngine.
the class TestExplosionEffect method createRoundSpark.
private void createRoundSpark() {
roundspark = new ParticleEmitter("RoundSpark", EMITTER_TYPE, 20 * COUNT_FACTOR);
roundspark.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, (float) (1.0 / COUNT_FACTOR_F)));
roundspark.setEndColor(new ColorRGBA(0, 0, 0, (float) (0.5f / COUNT_FACTOR_F)));
roundspark.setStartSize(1.2f);
roundspark.setEndSize(1.8f);
roundspark.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f));
roundspark.setParticlesPerSec(0);
roundspark.setGravity(0, -.5f, 0);
roundspark.setLowLife(1.8f);
roundspark.setHighLife(2f);
roundspark.setInitialVelocity(new Vector3f(0, 3, 0));
roundspark.setVelocityVariation(.5f);
roundspark.setImagesX(1);
roundspark.setImagesY(1);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/roundspark.png"));
mat.setBoolean("PointSprite", POINT_SPRITE);
roundspark.setMaterial(mat);
explosionEffect.attachChild(roundspark);
}
use of com.jme3.material.Material in project jmonkeyengine by jMonkeyEngine.
the class TestExplosionEffect method createSpark.
private void createSpark() {
spark = new ParticleEmitter("Spark", Type.Triangle, 30 * COUNT_FACTOR);
spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
spark.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
spark.setStartSize(.5f);
spark.setEndSize(.5f);
spark.setFacingVelocity(true);
spark.setParticlesPerSec(0);
spark.setGravity(0, 5, 0);
spark.setLowLife(1.1f);
spark.setHighLife(1.5f);
spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0));
spark.getParticleInfluencer().setVelocityVariation(1);
spark.setImagesX(1);
spark.setImagesY(1);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/spark.png"));
spark.setMaterial(mat);
explosionEffect.attachChild(spark);
}
use of com.jme3.material.Material in project jmonkeyengine by jMonkeyEngine.
the class TestMovingParticle method simpleInitApp.
@Override
public void simpleInitApp() {
emit = new ParticleEmitter("Emitter", Type.Triangle, 300);
emit.setGravity(0, 0, 0);
emit.setVelocityVariation(1);
emit.setLowLife(1);
emit.setHighLife(1);
emit.setInitialVelocity(new Vector3f(0, .5f, 0));
emit.setImagesX(15);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
emit.setMaterial(mat);
rootNode.attachChild(emit);
inputManager.addListener(new ActionListener() {
public void onAction(String name, boolean isPressed, float tpf) {
if ("setNum".equals(name) && isPressed) {
emit.setNumParticles(1000);
}
}
}, "setNum");
inputManager.addMapping("setNum", new KeyTrigger(KeyInput.KEY_SPACE));
}
Aggregations