Particles Effects gravitating (collapsing) towards a player?
by Robert Lee · in Torque Game Engine · 01/05/2005 (2:02 pm) · 3 replies
I'm wondering how I could go about making an effect were a bunch of particles are spawned around the player and then they collapse into the player.
(I want it to look like the player is absorbing the particles that we generated around him)
Any suggestions?
(I want it to look like the player is absorbing the particles that we generated around him)
Any suggestions?
#2
thenmake all your particles start at an offset, with no gravity and a -emitter velocity. they should then zoom in towards your player, you'll have to adjust the lifetime of the particle so that they die when they get to the player.
yet another way would be to add support for a gravity sink and have the particles update their velocity based on the gravitational force...then put a gravity sink at the player's position :)
the easiest would be the first option I mentioned, next easiest would be the second one, and hardest would be the last.
01/05/2005 (3:05 pm)
Another way would be to add support for a -emitter velocity that would emit in the opposite direction as normal velocity emitts.thenmake all your particles start at an offset, with no gravity and a -emitter velocity. they should then zoom in towards your player, you'll have to adjust the lifetime of the particle so that they die when they get to the player.
yet another way would be to add support for a gravity sink and have the particles update their velocity based on the gravitational force...then put a gravity sink at the player's position :)
the easiest would be the first option I mentioned, next easiest would be the second one, and hardest would be the last.
#3
and comment out the chunk of code in ParticleEmitterData::loadParameters() like so:
the way everything else is set up it will just work, if you are using the particle editor, you'll have to modify the sliders range to allow negative numbers.
01/05/2005 (5:43 pm)
If you want to try out using a negative emitter velocity then open up ParticleEngine.ccand comment out the chunk of code in ParticleEmitterData::loadParameters() like so:
//if (ejectionVelocity < 0.0f) {
// Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) ejectionVelocity < 0.0f", getName());
// ejectionVelocity = 0.0f;
//} //clint: nothing wrong with thatthe way everything else is set up it will just work, if you are using the particle editor, you'll have to modify the sliders range to allow negative numbers.
Torque Owner Clint S. Brewer
so yuo have a super big particle centered at the player at t=0
and at t=1 the particle is tiny, still centered at the player