How to change AttractionBehavior's strength and jitter values from a set of particles?
in
Contributed Library Questions
•
1 year ago
I create my particles like this:
- public void addParticle() {
- VerletParticle2D p = new VerletParticle2D( Vec2D.randomVector().scale( 5 ).addSelf( width / 2, height / 2) );
- physics.addParticle( p );
- physics.addBehavior( new AttractionBehavior( p, 20, attractionStrength, attractionJitter ) );
- }
I want to be able to change the strength and jitter values of the attraction behaviour at will once the all the particles have been created but I'm not sure how to access the particles behaviour and apply the new values, any help will be much appreciated.
I'm using toxiclibs verletphysics by the way.
1