About Store Forum Documentation Contact



Post Reply 
Particles::offset_range
Author Message
menajev Offline
Member

Post: #1
Particles::offset_range
Can I know how is this calculated? I mean particles position in draw func.

I'm using DrawParticle* as I needed to change few things and this is the only thing I can't recreate.
11-26-2017 11:35 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Particles::offset_range
Hi there,

Code:
Bool                    offset      =(offset_range>EPS);
         Flt        offset_time =Time.time()*offset_speed,
                    offset_time2=offset_time*0.7f,
         Randomizer random(UIDZero);
REPA(p)
            {
             C Particle &p=T.p[i];
                  if(offset)pos  +=random(Ball(offset_range), false)*Sin(random.f(PI2)+offset_time )
                                  +random(Ball(offset_range), false)*Sin(random.f(PI2)+offset_time2);

Full source code here:
https://github.com/Esenthel/EsenthelEngi...e.cpp#L529
11-27-2017 03:50 AM
Find all posts by this user Quote this message in a reply
Post Reply