本文整理汇总了Java中com.jme3.effect.ParticleEmitter.setShape方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleEmitter.setShape方法的具体用法?Java ParticleEmitter.setShape怎么用?Java ParticleEmitter.setShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.effect.ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter.setShape方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareEffect
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void prepareEffect(AssetManager assetManager) {
int COUNT_FACTOR = 1;
float COUNT_FACTOR_F = 1f;
effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
effect.setSelectRandomImage(true);
effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
effect.setStartSize(1.3f);
effect.setEndSize(2f);
effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
effect.setParticlesPerSec(0);
effect.setGravity(0, -5f, 0);
effect.setLowLife(.4f);
effect.setHighLife(.5f);
effect.setInitialVelocity(new Vector3f(0, 7, 0));
effect.setVelocityVariation(1f);
effect.setImagesX(2);
effect.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
effect.setMaterial(mat);
effect.setLocalScale(100);
}
示例2: prepareEffect
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void prepareEffect() {
int COUNT_FACTOR = 1;
float COUNT_FACTOR_F = 1f;
effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
effect.setSelectRandomImage(true);
effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
effect.setStartSize(1.3f);
effect.setEndSize(2f);
effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
effect.setParticlesPerSec(0);
effect.setGravity(0, -5, 0);
effect.setLowLife(.4f);
effect.setHighLife(.5f);
effect.setInitialVelocity(new Vector3f(0, 7, 0));
effect.setVelocityVariation(1f);
effect.setImagesX(2);
effect.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
effect.setMaterial(mat);
effect.setLocalScale(100);
rootNode.attachChild(effect);
}
示例3: simpleInitApp
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
ParticleEmitter emit = new ParticleEmitter("Emitter", Type.Point, 10000);
emit.setShape(new EmitterBoxShape(new Vector3f(-1.8f, -1.8f, -1.8f),
new Vector3f(1.8f, 1.8f, 1.8f)));
emit.setGravity(0, 0, 0);
emit.setLowLife(60);
emit.setHighLife(60);
emit.setInitialVelocity(new Vector3f(0, 0, 0));
emit.setImagesX(15);
emit.setStartSize(0.05f);
emit.setEndSize(0.05f);
emit.setStartColor(ColorRGBA.White);
emit.setEndColor(ColorRGBA.White);
emit.setSelectRandomImage(true);
emit.emitAllParticles();
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setBoolean("PointSprite", true);
mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
emit.setMaterial(mat);
rootNode.attachChild(emit);
}
示例4: createFlame
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createFlame(){
flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
flame.setSelectRandomImage(true);
flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
flame.setStartSize(1.3f);
flame.setEndSize(2f);
flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
flame.setParticlesPerSec(0);
flame.setGravity(0, -5, 0);
flame.setLowLife(.4f);
flame.setHighLife(.5f);
flame.setInitialVelocity(new Vector3f(0, 7, 0));
flame.setVelocityVariation(1f);
flame.setImagesX(2);
flame.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
mat.setBoolean("PointSprite", POINT_SPRITE);
flame.setMaterial(mat);
explosionEffect.attachChild(flame);
}
示例5: createFlash
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createFlash(){
flash = new ParticleEmitter("Flash", EMITTER_TYPE, 24 * COUNT_FACTOR);
flash.setSelectRandomImage(true);
flash.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1f / COUNT_FACTOR_F)));
flash.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
flash.setStartSize(.1f);
flash.setEndSize(3.0f);
flash.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
flash.setParticlesPerSec(0);
flash.setGravity(0, 0, 0);
flash.setLowLife(.2f);
flash.setHighLife(.2f);
flash.setInitialVelocity(new Vector3f(0, 5f, 0));
flash.setVelocityVariation(1);
flash.setImagesX(2);
flash.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flash.png"));
mat.setBoolean("PointSprite", POINT_SPRITE);
flash.setMaterial(mat);
explosionEffect.attachChild(flash);
}
示例6: createRoundSpark
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
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);
}
示例7: simpleInitApp
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
ParticleEmitter emit = new ParticleEmitter("Emitter", Type.Triangle, 200);
emit.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
emit.setGravity(0, 0, 0);
emit.setLowLife(5);
emit.setHighLife(10);
emit.setInitialVelocity(new Vector3f(0, 0, 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);
// Camera cam2 = cam.clone();
// cam.setViewPortTop(0.5f);
// cam2.setViewPortBottom(0.5f);
// ViewPort vp = renderManager.createMainView("SecondView", cam2);
// viewPort.setClearEnabled(false);
// vp.attachScene(rootNode);
}
示例8: createFlame
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createFlame(){
flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
flame.setSelectRandomImage(true);
flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
flame.setStartSize(1.3f);
flame.setEndSize(2f);
flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
flame.setParticlesPerSec(0);
flame.setGravity(0, -5, 0);
flame.setLowLife(.4f);
flame.setHighLife(.5f);
flame.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 7, 0));
flame.getParticleInfluencer().setVelocityVariation(1f);
flame.setImagesX(2);
flame.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
mat.setBoolean("PointSprite", POINT_SPRITE);
flame.setMaterial(mat);
explosionEffect.attachChild(flame);
}
示例9: createBurst
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createBurst() {
burst = new ParticleEmitter("Flash", Type.Triangle, 5);
Material burst_mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
burst_mat.setTexture("Texture", assetManager.loadTexture("Effects/flash.png"));
burst.setMaterial(burst_mat);
burst.setImagesX(2);
burst.setImagesY(2);
burst.setSelectRandomImage(true);
attachChild(burst);
burst.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1f));
burst.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
burst.setStartSize(.1f);
burst.setEndSize(6.0f);
burst.setGravity(0, 0, 0);
burst.setLowLife(.5f);
burst.setHighLife(.5f);
burst.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 5f, 0));
burst.getParticleInfluencer().setVelocityVariation(1);
burst.setShape(new EmitterSphereShape(Vector3f.ZERO, .5f));
burst.setParticlesPerSec(0);
}
示例10: createEmbers
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createEmbers() {
embers = new ParticleEmitter("embers", Type.Triangle, 50);
Material embers_mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
embers_mat.setTexture("Texture", assetManager.loadTexture("Effects/roundspark.png"));
embers.setMaterial(embers_mat);
embers.setImagesX(1);
embers.setImagesY(1);
attachChild(embers);
embers.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, 1.0f));
embers.setEndColor(new ColorRGBA(0, 0, 0, 0.5f));
embers.setStartSize(1.2f);
embers.setEndSize(1.8f);
embers.setGravity(0, -.5f, 0);
embers.setLowLife(1.8f);
embers.setHighLife(5f);
embers.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 3, 0));
embers.getParticleInfluencer().setVelocityVariation(.5f);
embers.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f));
embers.setParticlesPerSec(0);
}
示例11: initBloodEffect
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void initBloodEffect () {
blood = new ParticleEmitter("blood", Type.Point, 32 * 30);
blood.setSelectRandomImage(true);
blood.setStartColor(new ColorRGBA(0.1f, 0.0f, 0.0f, 1f));
blood.setEndColor(new ColorRGBA(0.1f, 0.0f, 0.0f, 1f));
blood.setStartSize(1f);
blood.setEndSize(1f);
blood.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
blood.setParticlesPerSec(0);
blood.setGravity(0, 10, 0);
blood.setLowLife(0.2f);
blood.setHighLife(0.2f);
blood.getParticleInfluencer().setInitialVelocity(new Vector3f(0, -9, 0));
blood.getParticleInfluencer().setVelocityVariation(0f);
blood.setImagesX(2);
blood.setImagesY(2);
Material mat = new Material(world.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", world.getAssetManager().loadTexture("Effects/Explosion/flame.png"));
mat.setBoolean("PointSprite", true);
blood.setMaterial(mat);
world.getNode().attachChild(blood);
}
示例12: prepareEffect
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void prepareEffect() {
int COUNT_FACTOR = 1;
float COUNT_FACTOR_F = 1f;
effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR);
effect.setSelectRandomImage(true);
effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
effect.setStartSize(1.3f);
effect.setEndSize(2f);
effect.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
effect.setParticlesPerSec(0);
effect.setGravity(0, -5, 0);
effect.setLowLife(.4f);
effect.setHighLife(.5f);
effect.setInitialVelocity(new Vector3f(0, 7, 0));
effect.setVelocityVariation(1f);
effect.setImagesX(2);
effect.setImagesY(2);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
effect.setMaterial(mat);
// effect.setLocalScale(100);
rootNode.attachChild(effect);
}
示例13: createSmokePuff
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createSmokePuff(Node root, Vector3f location) {
ParticleEmitter smokePuff = new ParticleEmitter("smoke-puff",
ParticleMesh.Type.Triangle, 20);
Material material = new Material(assetManager,
"Common/MatDefs/Misc/Particle.j3md");
material.setTexture("Texture",
assetManager.loadTexture("Effects/flame_alpha.png"));
material.getAdditionalRenderState()
.setBlendMode(RenderState.BlendMode.Alpha);
smokePuff.setMaterial(material);
smokePuff.setImagesX(2);
smokePuff.setImagesY(2);
smokePuff.setSelectRandomImage(true);
smokePuff.setStartColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.2f));
smokePuff.setStartColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.1f));
smokePuff.getParticleInfluencer()
.setInitialVelocity(Vector3f.UNIT_X.mult(5f));
smokePuff.getParticleInfluencer().setVelocityVariation(1f);
smokePuff.setStartSize(2f);
smokePuff.setEndSize(6f);
smokePuff.setGravity(Vector3f.ZERO);
smokePuff.setLowLife(0.75f);
smokePuff.setHighLife(1f);
smokePuff.setParticlesPerSec(0f);
smokePuff.setRandomAngle(true);
smokePuff.setShape(new EmitterSphereShape(Vector3f.ZERO, 4f));
root.attachChild(smokePuff);
smokePuff.setLocalTranslation(location);
smokePuff.emitAllParticles();
smokePuff.addControl(new CTimedExistence(1f));
}
示例14: createFireEmitter
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private ParticleEmitter createFireEmitter() {
ParticleEmitter fire = new ParticleEmitter("fire-emitter",
ParticleMesh.Type.Triangle, 200);
Material materialRed = new Material(assets,
"Common/MatDefs/Misc/Particle.j3md");
materialRed.setTexture("Texture",
assets.loadTexture("Effects/flame.png"));
fire.setMaterial(materialRed);
fire.setImagesX(2);
fire.setImagesY(2);
fire.setSelectRandomImage(true);
fire.setRandomAngle(true);
fire.setGravity(Vector3f.ZERO);
fire.setStartColor(new ColorRGBA(0.95f, 0.15f, 0f, 0.4f));
fire.setEndColor(new ColorRGBA(1f, 1f, 0f, 0f));
fire.setLowLife(0.1f);
fire.setHighLife(0.3f);
fire.setNumParticles(100);
fire.setStartSize(0.50f);
fire.setEndSize(30f);
fire.getParticleInfluencer()
.setInitialVelocity(Vector3f.UNIT_X.mult(15f));
fire.getParticleInfluencer().setVelocityVariation(1f);
fire.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f));
fire.setParticlesPerSec(0f);
return fire;
}
示例15: createSmokePuff
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createSmokePuff(Node worldRoot, Vector3f worldTranslation) {
ParticleEmitter smokePuff = new ParticleEmitter("smoke-puff",
ParticleMesh.Type.Triangle, 20);
Material materialGray = new Material(assets,
"Common/MatDefs/Misc/Particle.j3md");
materialGray.setTexture("Texture",
assets.loadTexture("Effects/flame.png"));
smokePuff.setMaterial(materialGray);
smokePuff.setImagesX(2);
smokePuff.setImagesY(2);
smokePuff.setSelectRandomImage(true);
smokePuff.setStartColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.2f));
smokePuff.setStartColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.1f));
smokePuff.getParticleInfluencer()
.setInitialVelocity(Vector3f.UNIT_X.mult(5.0f));
smokePuff.getParticleInfluencer().setVelocityVariation(1f);
smokePuff.setStartSize(2f);
smokePuff.setEndSize(6f);
smokePuff.setGravity(Vector3f.ZERO);
smokePuff.setLowLife(0.75f);
smokePuff.setHighLife(1f);
smokePuff.setParticlesPerSec(0);
smokePuff.setRandomAngle(true);
smokePuff.setShape(new EmitterSphereShape(Vector3f.ZERO, 4f));
worldRoot.attachChild(smokePuff);
smokePuff.setLocalTranslation(worldTranslation);
smokePuff.emitAllParticles();
}