void ParticleTrailGenerator::TrailParticleSystemListener::particleStolen(const ParticleEventUnrecPtr e) { if(_mTrailGenerator->_mTrails[e->getParticleIndex()].size() > 0) { _mTrailGenerator->_mKilledParticleTrails[e->getParticleIndex()] =_mTrailGenerator->_mTrails[e->getParticleIndex()]; } _mTrailGenerator->_mTrails[e->getParticleIndex()] = _mTrailGenerator->_mTrails[_mTrailGenerator->_mTrails.size()-1]; _mTrailGenerator->_mTrails.erase(_mTrailGenerator->_mTrails.size()-1); _mTrailGenerator->internalKill(e); }
void ParticleTrailGenerator::TrailParticleSystemListener::particleGenerated(const ParticleEventUnrecPtr e) { ParticleTrailGenerator::TrailSection newSection; newSection.pos = e->getParticlePosition(); newSection.time = e->getTimeStamp(); newSection.ID = _mTrailGenerator->getNextTSID(); ParticleTrailGenerator::ParticleTrail trail; trail.push_back(newSection); _mTrailGenerator->_mTrails[e->getParticleIndex()] = trail; _mTrailGenerator->internalGenerated(e); _mTrailGenerator->internalTrailSectGenerated(newSection, e->getParticleVelocity()); }