Creating a Particle Goal
by Thomas Shaw · in Torque Game Engine · 07/21/2005 (5:21 am) · 4 replies
I have a sort of vacuum that I want a bunch of particles being emitted from several emitters to be sucked into. In other words I would like to set a common point that all the particles are drawn to.
Is this possible in Torque?
As far as I know there isn't any way to define a goal for particles already built in. If someone knows of a trick or code that can accomplish this I would really appreciate it.
Thanks
Is this possible in Torque?
As far as I know there isn't any way to define a goal for particles already built in. If someone knows of a trick or code that can accomplish this I would really appreciate it.
Thanks
#2
Let me know if you need me to explain further.
07/25/2005 (4:07 am)
Thomas. The only thing I can think of... Is creating an object that does a radiuscheck every x seconds and increases the velocity of any particles it finds towards itself. Then everyhting would gain velocity in the direction of hte object. Actually, that wouldn't be too difficult to do in script. Shouldn't require any engine code atall... Unless the radius check cant be configured to find particles that is. Let me know if you need me to explain further.
#3
Check out "engine/game/fx/particleEngine.cc". You'll want to add a goal point, probably to ParticleEmitterData. As well as a goal strength or some such property, I should think. Then I would suggest extending the "physics" of the particles in PEngine::updateSingleParticle to allow the particles to react to the goal point.
07/25/2005 (10:58 am)
The radius check should find the emitters, but not the particles. To do what you want, I believe you'll need to modify the particle engine. Check out "engine/game/fx/particleEngine.cc". You'll want to add a goal point, probably to ParticleEmitterData. As well as a goal strength or some such property, I should think. Then I would suggest extending the "physics" of the particles in PEngine::updateSingleParticle to allow the particles to react to the goal point.
#4
Using a set goal position in the ParticleEmitterData datablock won't alow for dynamic goals. Scripting the functionality into a goal object will allow you to move the goal whenever you want.
07/25/2005 (11:12 am)
The particles already have a velocity... all you have to do is add to that velocity in the direction of the goal scaled by the strength of the goal, and possibly scaled by the length away from the goal.Using a set goal position in the ParticleEmitterData datablock won't alow for dynamic goals. Scripting the functionality into a goal object will allow you to move the goal whenever you want.
Torque 3D Owner Thomas Shaw
Would suffice :)