/** * Clone this track * * @return */ @Override public Track clone() { return new EffectTrack(emitter, length, startOffset); }
/** * This method clone the Track and search for the cloned counterpart of the * original emitter in the given cloned spatial. The spatial is assumed to * be the Spatial holding the AnimControl controlling the animation using * this Track. * * @param spatial the Spatial holding the AnimControl * @return the cloned Track with proper reference */ @Override public Track cloneForSpatial(Spatial spatial) { EffectTrack effectTrack = new EffectTrack(); effectTrack.particlesPerSeconds = this.particlesPerSeconds; effectTrack.length = this.length; effectTrack.startOffset = this.startOffset; //searching for the newly cloned ParticleEmitter effectTrack.emitter = findEmitter(spatial); if (effectTrack.emitter == null) { logger.log(Level.WARNING, "{0} was not found in {1} or is not bound to this track", new Object[]{emitter.getName(), spatial.getName()}); effectTrack.emitter = emitter; } removeUserData(this); //setting user data on the new emmitter and marking it with a reference to the cloned Track. setUserData(effectTrack); effectTrack.emitter.setParticlesPerSec(0); return effectTrack; }
/** * Clone this track * * @return */ @Override public Track clone() { return new EffectTrack(emitter, length, startOffset); }
/** * Clone this track * * @return */ @Override public Track clone() { return new EffectTrack(emitter, length, startOffset); }
/** * This method clone the Track and search for the cloned counterpart of the * original emmitter in the given cloned spatial. The spatial is assumed to * be the Spatial holding the AnimControl controling the animation using * this Track. * * @param spatial the Spatial holding the AnimControl * @return the cloned Track with proper reference */ public Track cloneForSpatial(Spatial spatial) { EffectTrack effectTrack = new EffectTrack(); effectTrack.particlesPerSeconds = this.particlesPerSeconds; effectTrack.length = this.length; effectTrack.startOffset = this.startOffset; //searching for the newly cloned ParticleEmitter effectTrack.emitter = findEmitter(spatial); if (effectTrack.emitter == null) { logger.log(Level.WARNING, "{0} was not found in {1} or is not bound to this track", new Object[]{emitter.getName(), spatial.getName()}); effectTrack.emitter = emitter; } removeUserData(this); //setting user data on the new emmitter and marking it with a reference to the cloned Track. setUserData(effectTrack); effectTrack.emitter.setParticlesPerSec(0); return effectTrack; }
/** * This method clone the Track and search for the cloned counterpart of the * original emitter in the given cloned spatial. The spatial is assumed to * be the Spatial holding the AnimControl controlling the animation using * this Track. * * @param spatial the Spatial holding the AnimControl * @return the cloned Track with proper reference */ @Override public Track cloneForSpatial(Spatial spatial) { EffectTrack effectTrack = new EffectTrack(); effectTrack.particlesPerSeconds = this.particlesPerSeconds; effectTrack.length = this.length; effectTrack.startOffset = this.startOffset; //searching for the newly cloned ParticleEmitter effectTrack.emitter = findEmitter(spatial); if (effectTrack.emitter == null) { logger.log(Level.WARNING, "{0} was not found in {1} or is not bound to this track", new Object[]{emitter.getName(), spatial.getName()}); effectTrack.emitter = emitter; } removeUserData(this); //setting user data on the new emmitter and marking it with a reference to the cloned Track. setUserData(effectTrack); effectTrack.emitter.setParticlesPerSec(0); return effectTrack; }