Creating a moving particle blob
by CEMA, Monash University · in Torque Game Engine · 03/30/2006 (10:45 pm) · 5 replies
I want to create a simple glowing blob of particles that can move in straight
lines at an unchanging speed, but have the direction and speed of those lines
changed whenever the server feels like it. (This particle blob will be an
AI-controlled thing.)
I have in mind something like the worker unit for the Night Elves in Warcraft 3
;)
My first attempt was to use class Projectile. This works ok, but I have an
issue with particles...
I can change the direction and speed by copying what the "bounce" code
does. That is, just do a setMaskBits(Projectile::BounceMask) and modify
mCurrVelocity and mCurrPosition as needed. Torque will then communicate this to
the client and all is well.
The main problem is that the particles emitted by the projectile have a position
and velocity in their own right, whereas I would simply like them drawn
wherever the projectile is.
I thought of giving the particles the same velocity as the projectile, so that they
will stay with the projectile as it moves. This would screw up when projectile
changes direction, because the particles will continue along their merry way
without also changing direction.
Is there a way to tell the engine to draw particles right on top of their parent
object? Failing that what can be done?
Thanks,
Nick
lines at an unchanging speed, but have the direction and speed of those lines
changed whenever the server feels like it. (This particle blob will be an
AI-controlled thing.)
I have in mind something like the worker unit for the Night Elves in Warcraft 3
;)
My first attempt was to use class Projectile. This works ok, but I have an
issue with particles...
I can change the direction and speed by copying what the "bounce" code
does. That is, just do a setMaskBits(Projectile::BounceMask) and modify
mCurrVelocity and mCurrPosition as needed. Torque will then communicate this to
the client and all is well.
The main problem is that the particles emitted by the projectile have a position
and velocity in their own right, whereas I would simply like them drawn
wherever the projectile is.
I thought of giving the particles the same velocity as the projectile, so that they
will stay with the projectile as it moves. This would screw up when projectile
changes direction, because the particles will continue along their merry way
without also changing direction.
Is there a way to tell the engine to draw particles right on top of their parent
object? Failing that what can be done?
Thanks,
Nick
#2
Really all I want to do is draw some particles so that they have no position of their own, and assume the position of their parent emitter object, which in this case is a Projectile.
03/30/2006 (11:44 pm)
I'm referring to just the regular particles that TGE provides. Sorry if I gave the wrong impression ;)Really all I want to do is draw some particles so that they have no position of their own, and assume the position of their parent emitter object, which in this case is a Projectile.
#3
03/31/2006 (5:10 am)
So you want to add particles to a projectile
#4
04/02/2006 (5:35 pm)
Yes. But the particles should stay at the same position as the projectile at all times. Even when the projectile bounces.
#5
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4163
That sounds like almost exactly what you want to do, so i hope that helps you some :)
Getting it AI controlled will take some effort, but the swirling particle mass should be handled perfectly by that resource right there.
If you've got any other questions, lay it on me :)
04/02/2006 (5:54 pm)
Sounds like this may help:http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4163
That sounds like almost exactly what you want to do, so i hope that helps you some :)
Getting it AI controlled will take some effort, but the swirling particle mass should be handled perfectly by that resource right there.
If you've got any other questions, lay it on me :)
Torque Owner Skylar Kelty
SkylarK