Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Command suggestion: AddParticlesGravityForce( ID, starttime, endtime, x, y, f )

Author
Message
TDavid
12
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 1st Feb 2014 12:06
Adds a point that will attract every particle of the emitter at a given time in their life.

AddParticlesGravityForce( ID, starttime, endtime, x, y, f )

ID - The ID of the emitter to modify.
starttime - The time in a particle's life at which this force should start having an effect.
endtime - The time in a particle's life at which this force should stop having an effect.
x - The x coordinate of the gravity point.
y - The y coordinate of the gravity point.
f - The force with which the particule is pulled towards the point in unit per second.

And of course the sister command: ClearParticlesGravityForce(ID).

I didn't find a way to use the current particle system to achieve such a result. This could be done from scratch with the sprite commands but we would lose the performance boost from the optimised particle system. I think this command would fit well in the current system and I think we could make some nice visual effects with it.
Markus
Valued Member
21
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2014 09:17
nice idea.
http://code.google.com/p/agk/issues/list

i think its similar this command.
AddParticlesForce( ID, starttime, endtime, x, y )
the force * normalized vector to gravity point.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
TDavid
12
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 2nd Feb 2014 13:08 Edited at: 2nd Feb 2014 13:11
AddParticlesForce adds the same vector to every particle. AddParticlesGravityForce would apply a different vector to each particle (with the same force) depending on their position to the gravity point.

AddParticlesRepulsionForce( ID, starttime, endtime, x, y, f )

The opposite effect: place a point that repulses every particle outward.
Markus
Valued Member
21
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2014 18:41
ohh, you are right,sorry.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670

Login to post a reply

Server time is: 2025-05-24 11:41:02
Your offset time is: 2025-05-24 11:41:02