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 › physics libraries and collision detection
Page Index Toggle Pages: 1
physics libraries and collision detection (Read 1368 times)
physics libraries and collision detection
Jan 17th, 2010, 6:04pm
 
Disclaimer: I'm sure this topic has been discussed ad nauseum elsewhere, but I haven't been able to find it, so feel free to reply with a link to another thread!

I'm trying to find the best way to handle simple 2D collision-detection in Processing. I've toyed with Toxiclibs, Traer and BoxWrap2D. All of these seem to handle simple vertexes-and-springs ok, but none of them seem to handle collisions especially easily.

I have seen some sketches where people have handled collisions using springs somehow. (For instance, Toxi's NokiaFriends.) But I haven't seen the code for it an I don't know enough to figure it out for myself.

Any advice anyone could give me on how best to meet this problem would be a big help. Thanks in advance!!

=T=

Re: physics libraries and collision detection
Reply #1 - Jan 17th, 2010, 6:11pm
 
I should add that by "collision detection" I mean two things.

#1: The ability to detect when one vertex (or particle or whatever) has "collided" with another. This is relatively simple to implement of course.

#2: Determining the resulting changes in the vectors (or trajectory or whatever) of one or both vertices. This is trickier to implement of course.

=T=

Re: physics libraries and collision detection
Reply #2 - Jan 18th, 2010, 4:23am
 
Tones wrote on Jan 17th, 2010, 6:04pm:
none of them seem to handle collisions especially easily.

I don't get this part. What do you mean by "easily"

BoxWrap2D works quite well for collision of convex objects.

Describing your final purpose might help too.
Re: physics libraries and collision detection
Reply #3 - Jan 18th, 2010, 1:49pm
 
Thanks for the reply, PhiLho

By "easily" I just mean that collisions ought to have some level of abstraction to them. For instance, if I could just assign collision-related properties (elasticity or friction or whatever) to each object and then let the simulation handle the resulting interactions.

I distinguish this from "difficult" collision detection as in Toxiclibs, where (as far as I can tell) I'd need to write some redundant custom code to check distance between vertices and then manage the appropriate changes in springs/vectors.

I think you're right about BoxWrap, I'll go experiment with that some more and see where it gets me.

I don't have a specific final purpose right now, I'm just playing around.
Re: physics libraries and collision detection
Reply #4 - Jan 18th, 2010, 3:05pm
 
BoxWrap seems good for now.
Page Index Toggle Pages: 1