void CFadeOutAffector::Update(boost::shared_ptr<CParticle> &particle, math::float32 dt) { if(particle->GetLiveTime()-mFadeTime < 0.f) { math::float32 alpha = particle->GetAlpha() - (particle->GetAlpha()/particle->GetLiveTime())*dt; particle->SetAlpha(alpha); if(this->mMinAlpha > alpha) particle->SetAlpha(mMinAlpha); } }
void CFadeInAffector::Update(boost::shared_ptr<CParticle> &particle, math::float32 dt) { math::float32 alpha_beg = particle->GetAlpha(); if(/*particle->GetStartLiveTime()-mFadeTime < particle->GetLiveTime()*/particle->GetAlpha() < mMaxAlpha) { math::float32 alpha = mSpeed*dt; particle->SetAlpha(particle->GetAlpha() + alpha); if(particle->GetAlpha() > mMaxAlpha) particle->SetAlpha(mMaxAlpha); } }