|
|
|
String body = " /** Uses Texture from jme3-test-data library! */\n ParticleEmitter fire = new ParticleEmitter(\"Emitter\", ParticleMesh.Type.Triangle, 30);\n Material mat_red = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n //mat_red.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/flame.png\"));\n fire.setMaterial(mat_red);\n fire.setImagesX(2); fire.setImagesY(2); // 2x2 texture animation\n fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red\n fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow\n fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));\n fire.setStartSize(0.6f);\n fire.setEndSize(0.1f);\n fire.setGravity(0f,0f,0f);\n fire.setLowLife(0.5f);\n fire.setHighLife(3f);\n fire.getParticleInfluencer().setVelocityVariation(0.3f);\n rootNode.attachChild(fire);\n"; |
|
|
|
String body = " /** Uses Texture from jme3-test-data library! */\n ParticleEmitter fireEffect = new ParticleEmitter(\"Emitter\", ParticleMesh.Type.Triangle, 30);\n Material fireMat = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n //fireMat.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/flame.png\"));\n fireEffect.setMaterial(fireMat);\n fireEffect.setImagesX(2); fireEffect.setImagesY(2); // 2x2 texture animation\n fireEffect.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f) ); // red\n fireEffect.setStartColor( new ColorRGBA(1f, 1f, 0f, 0.5f) ); // yellow\n fireEffect.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));\n fireEffect.setStartSize(0.6f);\n fireEffect.setEndSize(0.1f);\n fireEffect.setGravity(0f,0f,0f);\n fireEffect.setLowLife(0.5f);\n fireEffect.setHighLife(3f);\n fireEffect.getParticleInfluencer().setVelocityVariation(0.3f);\n rootNode.attachChild(fireEffect);\n"; |