本文整理汇总了Java中com.jme3.effect.ParticleEmitter.setRotateSpeed方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleEmitter.setRotateSpeed方法的具体用法?Java ParticleEmitter.setRotateSpeed怎么用?Java ParticleEmitter.setRotateSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.effect.ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter.setRotateSpeed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDebris
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
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);
}
示例2: createDebris
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createDebris() {
debris = new ParticleEmitter("Debris", Type.Triangle, 15);
Material debris_mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
debris_mat.setTexture("Texture", assetManager.loadTexture("Effects/debris.png"));
debris.setMaterial(debris_mat);
debris.setImagesX(3);
debris.setImagesY(3);
debris.setSelectRandomImage(false);
attachChild(debris);
debris.setRandomAngle(true);
debris.setRotateSpeed(FastMath.TWO_PI * 4);
debris.setStartColor(new ColorRGBA(0.4f, 0.4f, 0.0f, 1.0f));
debris.setEndColor(new ColorRGBA(0.4f, 0.4f, 0.0f, 1.0f));
debris.setStartSize(.2f);
debris.setEndSize(2f);
debris.setGravity(0, 15f, 0);
debris.setLowLife(2f);
debris.setHighLife(3f);
debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 7, 0));
debris.getParticleInfluencer().setVelocityVariation(.60f);
debris.setParticlesPerSec(0);
}
示例3: simpleInitApp
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
fire.setMaterial(mat_red);
fire.setImagesX(2); fire.setImagesY(2); // 2x2 texture animation
fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red
fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
fire.setInitialVelocity(new Vector3f(0, 2, 0));
fire.setStartSize(1.5f);
fire.setEndSize(0.1f);
fire.setGravity(0, 0, 0);
fire.setLowLife(1f);
fire.setHighLife(3f);
fire.setVelocityVariation(0.3f);
rootNode.attachChild(fire);
ParticleEmitter debris = new ParticleEmitter("Debris", ParticleMesh.Type.Triangle, 10);
Material debris_mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
debris_mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
debris.setMaterial(debris_mat);
debris.setImagesX(3); debris.setImagesY(3); // 3x3 texture animation
debris.setRotateSpeed(4);
debris.setSelectRandomImage(true);
debris.setInitialVelocity(new Vector3f(0, 4, 0));
debris.setStartColor(ColorRGBA.White);
debris.setGravity(0, 6, 0);
debris.setVelocityVariation(.60f);
rootNode.attachChild(debris);
debris.emitAllParticles();
// ParticleEmitter water = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
// Material mat_blue = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
// mat_blue.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
// water.setMaterial(mat_blue);
// water.setImagesX(2); water.setImagesY(2); // 2x2 texture animation
// water.setStartColor(new ColorRGBA(0f, 0f, 1f, 1f)); // blue
// water.setEndColor( new ColorRGBA(0f, 1f, 1f, 1f)); // turquois
// water.setInitialVelocity(new Vector3f(0, -2, 0));
// water.setStartSize(1f);
// water.setEndSize(1.5f);
// water.setGravity(1);
// water.setLowLife(1f);
// water.setHighLife(3f);
// water.setVelocityVariation(0.3f);
// water.setLocalTranslation(0, 5, 0);
// rootNode.attachChild(water);
}
示例4: loadEmitter
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private ParticleEmitter loadEmitter(ParticleEmitter pe) {
pe.setName("emitter");
pe.setMeshType(ParticleMesh.Type.Triangle);
pe.setNumParticles(data.getNumParticles());
if (data.getEndColor() != null) {
pe.setEndColor(data.getEndColor());
}
if (data.getEndSize() != null) {
pe.setEndSize(data.getEndSize());
}
if (data.getFaceNormal() != null) {
pe.setFaceNormal(data.getFaceNormal());
}
if (data.getFacingVelocity() != null) {
pe.setFacingVelocity(data.getFacingVelocity());
}
if (data.getGravity() != null) {
pe.setGravity(data.getGravity());
}
if (data.getHighLife() != null) {
pe.setHighLife(data.getHighLife());
}
if (data.getImagesX() != null) {
pe.setImagesX(data.getImagesX());
}
if (data.getImagesY() != null) {
pe.setImagesY(data.getImagesY());
}
if (data.getLowLife() != null) {
pe.setLowLife(data.getLowLife());
}
if (data.getParticlesPerSec() != null) {
pe.setParticlesPerSec(data.getParticlesPerSec());
}
if (data.getRandomAngle() != null) {
pe.setRandomAngle(data.getRandomAngle());
}
if (data.getRotateSpeed() != null) {
pe.setRotateSpeed(data.getRotateSpeed());
}
if (data.getSelectRandomImage() != null) {
pe.setSelectRandomImage(data.getSelectRandomImage());
}
if (data.getStartColor() != null) {
pe.setStartColor(data.getStartColor());
}
if (data.getStartSize() != null) {
pe.setStartSize(data.getStartSize());
}
if (data.getInitialVelocity() != null) {
pe.getParticleInfluencer().setInitialVelocity(data.getInitialVelocity());
}
if (data.getVelocityVariation() != null) {
pe.getParticleInfluencer().setVelocityVariation(data.getVelocityVariation());
}
if (data.getShape() != null) {
pe.setShape(new EmitterShapeWrap((Position) Loader.load(data.getShape())));
}
AssetManager am = LuoYing.getAssetManager();
Material mat = new Material(am, AssetConstants.MATERIAL_PARTICLE);
mat.setTexture("Texture", am.loadTexture(data.getTexture()));
pe.setMaterial(mat);
return pe;
}
示例5: createEmitter
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
private void createEmitter(ParticleActor actor){
ParticleEmitter emitter = new ParticleEmitter("", ParticleMesh.Type.Triangle, actor.maxCount);
Material m = actorDrawer.getParticleMat(actor.spritePath);
if(!actor.add) {
m.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
}
emitter.setMaterial(m);
emitter.setParticlesPerSec(actor.perSecond);
emitter.setImagesX(actor.nbRow);
emitter.setImagesY(actor.nbCol);
emitter.setStartColor(TranslateUtil.toColorRGBA(actor.startColor));
emitter.setEndColor(TranslateUtil.toColorRGBA(actor.endColor));
emitter.setStartSize((float)actor.startSize);
emitter.setEndSize((float)actor.endSize);
if(actor.gravity) {
emitter.setGravity(0, 0, 4);
} else {
emitter.setGravity(0, 0, 0);
}
emitter.setLowLife((float)actor.minLife);
emitter.setHighLife((float)actor.maxLife);
emitter.setRotateSpeed((float)actor.rotationSpeed);
if(actor.startVariation != 0) {
emitter.setShape(new EmitterSphereShape(Vector3f.ZERO, (float)actor.startVariation));
}
if(actor.facing == ParticleActor.Facing.Horizontal) {
emitter.setFaceNormal(Vector3f.UNIT_Z);
}
if(actor.velocity != 0) {
emitter.setFacingVelocity(true);
}
emitter.setQueueBucket(Bucket.Transparent);
actorDrawer.mainNode.attachChild(emitter);
actor.getViewElements().particleEmitter = emitter;
}
示例6: simpleInitApp
import com.jme3.effect.ParticleEmitter; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
ParticleEmitter fire =
new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
Material mat_red = new Material(assetManager,
"Common/MatDefs/Misc/Particle.j3md");
mat_red.setTexture("Texture", assetManager.loadTexture(
"Effects/Explosion/flame.png"));
fire.setMaterial(mat_red);
fire.setImagesX(2);
fire.setImagesY(2); // 2x2 texture animation
fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red
fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));
fire.setStartSize(1.5f);
fire.setEndSize(0.1f);
fire.setGravity(0, 0, 0);
fire.setLowLife(1f);
fire.setHighLife(3f);
fire.getParticleInfluencer().setVelocityVariation(0.3f);
rootNode.attachChild(fire);
ParticleEmitter debris =
new ParticleEmitter("Debris", ParticleMesh.Type.Triangle, 10);
Material debris_mat = new Material(assetManager,
"Common/MatDefs/Misc/Particle.j3md");
debris_mat.setTexture("Texture", assetManager.loadTexture(
"Effects/Explosion/Debris.png"));
debris.setMaterial(debris_mat);
debris.setImagesX(3);
debris.setImagesY(3); // 3x3 texture animation
debris.setSelectRandomImage(true);
debris.setRotateSpeed(4);
debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 4, 0));
debris.setStartColor(ColorRGBA.White);
debris.setGravity(0, 6, 0);
debris.getParticleInfluencer().setVelocityVariation(.60f);
rootNode.attachChild(debris);
debris.emitAllParticles();
// ParticleEmitter water =
// new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 20);
// Material mat_blue = new Material(assetManager,
// "Common/MatDefs/Misc/Particle.j3md");
// mat_blue.setTexture("Texture", assetManager.loadTexture(
// "Effects/Explosion/flame.png"));
// water.setMaterial(mat_blue);
// water.setImagesX(2);
// water.setImagesY(2); // 2x2 texture animation
// water.setStartColor( ColorRGBA.Blue);
// water.setEndColor( ColorRGBA.Cyan);
// water.getParticleInfluencer().setInitialVelocity(new Vector3f(0, -4, 0));
// water.setStartSize(1f);
// water.setEndSize(1.5f);
// water.setGravity(0,1,0);
// water.setLowLife(1f);
// water.setHighLife(1f);
// water.getParticleInfluencer().setVelocityVariation(0.1f);
// water.setLocalTranslation(0, 6, 0);
// rootNode.attachChild(water);
}