VelocityField + RandomDrift

7 views
Skip to first unread message

chkd...@googlemail.com

unread,
Jun 2, 2010, 3:46:21 AM6/2/10
to Stardust Particle Engine
Hi

I want to use VelocityField for particles flowing through some tubes.
This works perfectly.

But now I want to add some random movement. I thought I can use
RandomDrift for that. But I can't get both to work together.
At the moment I use ist like that in my emitter:

var velField:VelocityField = new VelocityField();
velField.field = bmpField;
addAction(velField);

var rDrift:RandomDrift = new RandomDrift(2,2);
rDrift.massless = true;
addAction(rDrift);

I tried it with different priorities but at the moment I use the
velocityfield my particles move straight ahead. Without the velField
they move in random.

Has someone an idea to get e little bit random movement to this?


Thanks.
Christoph

CJ Cat (Allen Chou)

unread,
Jun 2, 2010, 9:42:26 AM6/2/10
to Stardust Particle Engine
Ah, this problem might be caused by the default priorities of the
actions.
RandomField has a default priority of 0, and VelocityField has -2.
This means VelocityFIeld is executed after RandomField because actions
are sorted according to their priorities.

I think it's more logical to give RandomField a lower priority than
VelocityField. I'll tweak their priorities in the next revision.
For now, you can manually adjust their priorities.

var rf:RandomField = new RandomField(2, 2);
rf.massless = true;
rf.priority = -3; //lower than -2
addAction(rf);

Thanks for spotting this problem.

chkd...@googlemail.com

unread,
Jun 4, 2010, 8:02:30 AM6/4/10
to Stardust Particle Engine
hi

Cool, thanks, that works.

Christoph
Reply all
Reply to author
Forward
0 new messages