We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Question on Traer Physics Library
Page Index Toggle Pages: 1
Question on Traer Physics Library (Read 1519 times)
Question on Traer Physics Library
Aug 13th, 2006, 11:05pm
 
Dear friends

I have tried to integrate the Physics Library to a project with  particles. Due to my lack of experience with programming in general, I am having problems while trying to constrain the attraction between the particles.What I want to do is to initialize the attraction forces and freeze them at will.
For example while setting the attraction like this:
   physics.makeAttraction(a,b,500,10); //between particles a and b
I am trying to turn it off like this..and it is not working:
   physics.makeAttraction(a,b,0,10).turnOff();

Does anyone know how to declare this???..cause I know I am not doing it the right way Sad
Re: Question on Traer Physics Library
Reply #1 - Aug 14th, 2006, 6:38am
 
That is not going to work, what you're doing is creating a new attraction and then instantly turning it off again. Instead you might try this:

Code:

Attraction attr = physics.makeAttraction(a,b,500,10);


Now you have an Attraction object that you can refer to at will. To turn it off you would call the turnOff() method of that object like this:

Code:

attr.turnOff();


Hope that helps,

 Xavier
Page Index Toggle Pages: 1