|
|
@ -211,6 +211,42 @@ public class ParticleEmitter extends Geometry { |
|
|
|
return clone; |
|
|
|
return clone; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Called internally by com.jme3.util.clone.Cloner. Do not call directly. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void cloneFields( Cloner cloner, Object original ) { |
|
|
|
|
|
|
|
this.shape = cloner.clone(shape); |
|
|
|
|
|
|
|
this.control = cloner.clone(control); |
|
|
|
|
|
|
|
this.faceNormal = cloner.clone(faceNormal); |
|
|
|
|
|
|
|
this.startColor = cloner.clone(startColor); |
|
|
|
|
|
|
|
this.endColor = cloner.clone(endColor); |
|
|
|
|
|
|
|
this.particleInfluencer = cloner.clone(particleInfluencer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// change in behavior: gravity was not cloned before -pspeed
|
|
|
|
|
|
|
|
this.gravity = cloner.clone(gravity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// So, simply setting the mesh type will cause all kinds of things
|
|
|
|
|
|
|
|
// to happen:
|
|
|
|
|
|
|
|
// 1) the new mesh gets created.
|
|
|
|
|
|
|
|
// 2) it is set to the Geometry
|
|
|
|
|
|
|
|
// 3) the particles array is recreated because setNumParticles()
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// ...so this should be equivalent but simpler than half of the old clone()
|
|
|
|
|
|
|
|
// method. Note: we do not ever want to share particleMesh so we do not
|
|
|
|
|
|
|
|
// clone it at all.
|
|
|
|
|
|
|
|
setMeshType(meshType); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// change in behavior: temp and lastPos were not cloned before...
|
|
|
|
|
|
|
|
// perhaps because it was believed that 'transient' fields were exluded
|
|
|
|
|
|
|
|
// from cloning? (they aren't)
|
|
|
|
|
|
|
|
// If it was ok for these to be shared because of how they are used
|
|
|
|
|
|
|
|
// then they could just as well be made static... else I think it's clearer
|
|
|
|
|
|
|
|
// to clone them.
|
|
|
|
|
|
|
|
this.temp = cloner.clone(temp); |
|
|
|
|
|
|
|
this.lastPos = cloner.clone(lastPos); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ParticleEmitter(String name, Type type, int numParticles) { |
|
|
|
public ParticleEmitter(String name, Type type, int numParticles) { |
|
|
|
super(name); |
|
|
|
super(name); |
|
|
|
setBatchHint(BatchHint.Never); |
|
|
|
setBatchHint(BatchHint.Never); |
|
|
|