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 & HelpSyntax Questions › Collision Detection bug
Page Index Toggle Pages: 1
Collision Detection bug (Read 365 times)
Collision Detection bug
Jan 18th, 2009, 7:58pm
 
Hi, I am trying to do a collision detection on a system of objects

The sketch can be found here:

http://homepage.ntlworld.com/ricardo.sanchez/processing/collision/

Nothing special, the circles should change the strokeWeight when they are touching, if you test the code the collition is working but the changing appareance in not, so I guess it must be the way I am drawing the objects mmmmm not sure...

If you can have a llok will be much appretiated, any advice welcome as well.

/** The Orb class is not been use **/

Thanks
rS
Re: Collision Detection bug
Reply #1 - Jan 19th, 2009, 10:51am
 
minDist should be the sum of the radii, or half diameters.
Also not sure why you stop the loop on i before the last element.
Re: Collision Detection bug
Reply #2 - Jan 19th, 2009, 11:18am
 
Hi PhiLho, thanks for the reply!


Yes the _radius property should be call _diameter as that is what that represent, my bad there.

I dont see the code where you mention "Also not sure why you stop the loop on i before the last element."

Can you point me in the right direction?

Thanks again
rS
Re: Collision Detection bug
Reply #3 - Jan 19th, 2009, 1:20pm
 
Forget the second remark, it was finally pointless... :-P
Page Index Toggle Pages: 1