Box2D Forums

It is currently Tue May 21, 2013 11:39 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: "Weld" type joint
PostPosted: Sat Mar 08, 2008 11:47 am 
Offline

Joined: Sat Mar 08, 2008 11:34 am
Posts: 2
Hey, just getting started with Box2D (flash), and found what seems to be a glaring omission to the joints: a "weld" joint, a joint that constrains on all 3 DOF.

Basically, my intended use is to provide rigidity to structures, then break the joint on force. Simulates nails, welds, etc. My current solution is to use a revolute or prismatic joint with extremely tight limiting, but this tends to result in joints that are a little "squishy" -- these joints seem to tend to have more give against their limits than against their constriants. Plus it's a lot more of a pain to set up than a simple weld would be, and I'm guessing a weld would be faster to compute, as well.

All in all though, enjoying the system a lot. Thanks!!


Top
 Profile  
 
 Post subject: Re: "Weld" type joint
PostPosted: Sat Mar 08, 2008 12:05 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Instead of a weld joint, I recommend using multiple shapes per body. Then use some heuristic based on contact data about when a shape should be split off into its own body.

With an iterative solver like the one in Box2D, a weld joint will never provide complete rigidity.


Top
 Profile  
 
 Post subject: Re: "Weld" type joint
PostPosted: Sat Mar 08, 2008 3:58 pm 
Offline

Joined: Sat Mar 08, 2008 11:34 am
Posts: 2
Yeah, I investigated doing it with that way (breaking apart shapes), but because constraints provide such a simple way of determining when to break, and breaking them is such a simple process, I'm willing to sacrifice a little rigidity for ease of use.

Now that I'm considering it more, I definitely see the advantages to doing it the way you describe and will progress in that direction (thanks! :) ), but I still feel that a weld joint is a kind of "basic component" that box2d could benefit from.


Top
 Profile  
 
 Post subject: Re: "Weld" type joint
PostPosted: Sat Mar 08, 2008 7:21 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Yeah, it would not be hard to implement the weld joint. I'm just concerned that people will go down the wrong route for breakable objects.

What would be better is some breakable body functionality. If you come up with a good solution, please consider submitting your code to improve Box2D.


Top
 Profile  
 
 Post subject: Re: "Weld" type joint
PostPosted: Sat Aug 09, 2008 3:49 pm 
Offline

Joined: Wed Jul 09, 2008 3:47 am
Posts: 37
Simple way to make weld joint is for example prismatic with both upper and lower limit set to 0.

I made simple breakable objects different way. When the object's health drops below zero, it is deleted and gibs are spawned on its position. I made gibs of polygon shapes with offset of their real relative position, so it looks very realistic


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group