private void removeUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { return; } //removing the given Track to the TrackInfo. data.getTracks().remove(effectTrack); }
@Override public void cleanUp() { TrackInfo t = (TrackInfo) emitter.getUserData("TrackInfo"); t.getTracks().remove(this); if (t.getTracks().isEmpty()) { emitter.setUserData("TrackInfo", null); } }
private void setUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { data = new TrackInfo(); effectTrack.emitter.setUserData("TrackInfo", data); } //adding the given Track to the TrackInfo. data.addTrack(effectTrack); }
/** * recursive function responsible for finding the newly cloned Emitter * * @param spat * @return */ private ParticleEmitter findEmitter(Spatial spat) { if (spat instanceof ParticleEmitter) { //spat is a PArticleEmitter ParticleEmitter em = (ParticleEmitter) spat; //getting the UserData TrackInfo so check if it should be attached to this Track TrackInfo t = (TrackInfo) em.getUserData("TrackInfo"); if (t != null && t.getTracks().contains(this)) { return em; } return null; } else if (spat instanceof Node) { for (Spatial child : ((Node) spat).getChildren()) { ParticleEmitter em = findEmitter(child); if (em != null) { return em; } } } return null; }
/** * Sets the Emitter to use in this track * * @param emitter */ public void setEmitter(ParticleEmitter emitter) { if (this.emitter != null) { TrackInfo data = (TrackInfo) emitter.getUserData("TrackInfo"); data.getTracks().remove(this); } this.emitter = emitter; //saving particles per second value this.particlesPerSeconds = emitter.getParticlesPerSec(); //setting the emmitter to not emmit. this.emitter.setParticlesPerSec(0); setUserData(this); }
private void removeUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { return; } //removing the given Track to the TrackInfo. data.getTracks().remove(effectTrack); }
private void removeUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { return; } //removing the given Track to the TrackInfo. data.getTracks().remove(effectTrack); }
public void cleanUp() { TrackInfo t = (TrackInfo) emitter.getUserData("TrackInfo"); t.getTracks().remove(this); if (t.getTracks().isEmpty()) { emitter.setUserData("TrackInfo", null); } }
public void cleanUp() { TrackInfo t = (TrackInfo) emitter.getUserData("TrackInfo"); t.getTracks().remove(this); if (t.getTracks().isEmpty()) { emitter.setUserData("TrackInfo", null); } }
private void setUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { data = new TrackInfo(); effectTrack.emitter.setUserData("TrackInfo", data); } //adding the given Track to the TrackInfo. data.addTrack(effectTrack); }
private void setUserData(EffectTrack effectTrack) { //fetching the UserData TrackInfo. TrackInfo data = (TrackInfo) effectTrack.emitter.getUserData("TrackInfo"); //if it does not exist, we create it and attach it to the emitter. if (data == null) { data = new TrackInfo(); effectTrack.emitter.setUserData("TrackInfo", data); } //adding the given Track to the TrackInfo. data.addTrack(effectTrack); }
/** * recursive function responsible for finding the newly cloned Emitter * * @param spat * @return */ private ParticleEmitter findEmitter(Spatial spat) { if (spat instanceof ParticleEmitter) { //spat is a PArticleEmitter ParticleEmitter em = (ParticleEmitter) spat; //getting the UserData TrackInfo so check if it should be attached to this Track TrackInfo t = (TrackInfo) em.getUserData("TrackInfo"); if (t != null && t.getTracks().contains(this)) { return em; } return null; } else if (spat instanceof Node) { for (Spatial child : ((Node) spat).getChildren()) { ParticleEmitter em = findEmitter(child); if (em != null) { return em; } } } return null; }
/** * recursive function responsible for finding the newly cloned Emitter * * @param spat * @return */ private ParticleEmitter findEmitter(Spatial spat) { if (spat instanceof ParticleEmitter) { //spat is a PArticleEmitter ParticleEmitter em = (ParticleEmitter) spat; //getting the UserData TrackInfo so check if it should be attached to this Track TrackInfo t = (TrackInfo) em.getUserData("TrackInfo"); if (t != null && t.getTracks().contains(this)) { return em; } return null; } else if (spat instanceof Node) { for (Spatial child : ((Node) spat).getChildren()) { ParticleEmitter em = findEmitter(child); if (em != null) { return em; } } } return null; }
/** * Sets the Emitter to use in this track * * @param emitter */ public void setEmitter(ParticleEmitter emitter) { if (this.emitter != null) { TrackInfo data = (TrackInfo) emitter.getUserData("TrackInfo"); data.getTracks().remove(this); } this.emitter = emitter; //saving particles per second value this.particlesPerSeconds = emitter.getParticlesPerSec(); //setting the emmitter to not emmit. this.emitter.setParticlesPerSec(0); setUserData(this); }
/** * Sets the Emitter to use in this track * * @param emitter */ public void setEmitter(ParticleEmitter emitter) { if (this.emitter != null) { TrackInfo data = (TrackInfo) emitter.getUserData("TrackInfo"); data.getTracks().remove(this); } this.emitter = emitter; //saving particles per second value this.particlesPerSeconds = emitter.getParticlesPerSec(); //setting the emmitter to not emmit. this.emitter.setParticlesPerSec(0); setUserData(this); }