[sldev] Reviewing/Fixing the Particle System

Strife Onizuka blindwanderer at gmail.com
Tue May 22 22:25:08 PDT 2007


I've never seen the 60 second limit mentioned on PSYS_SRC_MAX_AGE before. I
think it's an error in the documentation. It isn't logical that it should
clamp the particle system life, implementing this would kill objects that
constantly stream particles but never update the particle system (like
fires).

It's hard to follow the code because both the particle and particle system
classes both have a mMaxAge attribute (corresponding to PSYS_PART_MAX_AGE &
PSYS_SRC_MAX_AGE respectively). I can't find anywhere in the source where
the system life is clamped so I'm removing that from the documentation
outright (the only clamping going on mMaxAge is on the particle life side).

Thanks for bringing this to my attention.

Strife

On 5/22/07, Nicholaz Beresford <nicholaz at blueflash.cc> wrote:
>
>
> Hi!
>
> I'm currently looking (again) at the particle system (bascially VWR-418).
>
> There are a lot of intertwined issues, but one thing I'm trying to do is
> to
> verify the parameters on the client side before generating particles.
>
> Here is a piece of code I'm currently using to match the parameters
> against
> http://wiki.secondlife.com/wiki/LlParticleSystem
>
> Reviews please ...
>
>
>     // PATCH limit particle system and particle values [Nicholaz
> Beresford]
>     //
>     // see limits as per http://wiki.secondlife.com/wiki/LlParticleSystem
>
>     LLPartSysData &psd = mPartSysData;    // a little shorthand
>     LLPartData &pd = psd.mPartData;
>
>     S32 parts_per_second =
> (S32)((1.f/psd.mBurstRate)*(S32)psd.mBurstPartCount);  // particle
> generation rate
>
>     if (0.f == psd.mMaxAge || psd.mMaxAge > 60.f)    // don't llclamp!
> (zero equals indefinite => 60s)
>     {
>         psd.mMaxAge = 60.f;
>     }
>
>     psd.mPartAccel.mV[0] = llclamp(psd.mPartAccel.mV[0], 0.f, 100.f);
>     psd.mPartAccel.mV[1] = llclamp(psd.mPartAccel.mV[1], 0.f, 100.f);
>     psd.mPartAccel.mV[2] = llclamp(psd.mPartAccel.mV[2], 0.f, 100.f);
>
>     pd.mMaxAge = llclamp(pd.mMaxAge, 0.f, 30.f);
>     pd.mStartScale.mV[0] = llclamp(pd.mStartScale.mV[0], 0.04f, 4.f);
>     pd.mStartScale.mV[1] = llclamp(pd.mStartScale.mV[1], 0.04f, 4.f);
>     pd.mStartScale.mV[2] = llclamp(pd.mStartScale.mV[2], 0.04f, 4.f);
>     //
>     // ~PATCH
>
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20070523/724e8f3f/attachment.htm


More information about the SLDev mailing list