/** * Create a new particle system as a copy of the old * * @param toCopy */ public E3DParticleSystem(E3DParticleSystem toCopy) { super(toCopy.getEngine()); this.orientation = new E3DOrientation(toCopy.getOrientation()); // don't copy the ID. Its useless. It needs to be given a new id and set by hand E3DParticle particle = null; this.renderTree = new E3DRenderTree(getEngine()); // this.blendAndTextureSortedParticleMap = new E3DSortedRenderableMap(); setParticleList(new ArrayList()); for (int i = 0; i < toCopy.getParticleList().size(); i++) // make actual copies of all the particles { particle = (E3DParticle) toCopy.getParticleList().get(i); try { addParticle(particle.onGetClone()); } catch (Exception e) { e.printStackTrace(); } } setGravityDirection(new E3DVector3F(toCopy.getGravityDirection())); this.lifeSeconds = toCopy.getLifeSeconds(); startTime = -1.0; setBlendMode(new E3DBlendMode(toCopy.getBlendMode())); setRenderMode(new E3DRenderMode(toCopy.getRenderMode())); }