Generic constraints.

Discuss new features and future development.

Re: Generic constraints.

Postby slembcke » Wed May 13, 2009 8:58 am

Again, the basic algorithms used in Chipmunk are meant to be very fast, not perfectly accurate. Joints will separate by a small amount and collisions will get mushy if you use to few iterations. Using more iterations will make the simulation more accurate, but more costly in CPU terms. Game developers have always had to find clever ways to get around the fact that computers have finite resources even for ideas that seem like they are simple conceptually.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Generic constraints.

Postby iisystems » Tue May 19, 2009 11:41 am

Scott & Thomas,

Thanks very much for the reply. I'm actually using slide joints, not pivot joints but I understand the same principles apply. Well this is a bit of a setback... are there any other Chipmunk options out there to build a rope chain or net or the like?

Scott
iisystems
 
Posts: 16
Joined: Tue Apr 14, 2009 2:42 pm

Re: Generic constraints.

Postby slembcke » Tue May 19, 2009 1:47 pm

Well, again the problem is that to make a net, you have to have a long chain of jointed bodies. That itself is not a problem, but if you want the net to feel solid and not bouncy/stretchy you are going to have to use a lot of CPU time to do it in a rigid body simulation. The more of the functionality of the net that you can fake by doing something simpler using just plain forces or fewer bodies/joints the better off you will be.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Generic constraints.

Postby iisystems » Sun May 24, 2009 6:00 pm

Thanks for the replies. So there's no way to use Chipmunk to create a net or the like which will stretch a finite amount?
iisystems
 
Posts: 16
Joined: Tue Apr 14, 2009 2:42 pm

Re: Generic constraints.

Postby iisystems » Sun May 24, 2009 6:01 pm

slembcke,

Thanks. Sorry about the last post. I had posted the previous question, which you replied to, but when I just viewed the forum, I didn't see it, so I thought it didn't post. I'll have to look for another solution to this.

Thanks again,
Scott
iisystems
 
Posts: 16
Joined: Tue Apr 14, 2009 2:42 pm

Re: Generic constraints.

Postby jbishop » Thu Jul 16, 2009 6:44 pm

EDIT:
I did manage to grab what looked like the current code from http://chipmunk-physics.googlecode.com/svn/trunk (no longer constraint spike?) so I will give that a go. I will check the demo code for an answer to the second question (how to anchor a joint to the world) but any assistance on that would be greatly appreciated.

OLD:
I am new to chipmunk, but the first hurdles I have run into are with limitations on constraints. This thread seems very promising! Breakable joints and damped rotary springs are of particular interest to me. What is the best way for me begin customizing constraints and/or using the constraints discussed in this thread? I wasn't able to access the branch with my forum login/pass.

Also, after looking at the video link at the top of this thread, I saw that the "hanging bridge" ends are connected to the world. This is another problem I had. The docs mentioned that joints' bodies need to be added to the space, but conversely states that static shapes should not add their bodies. So, as a second question, how can I connect one static and one non-static shape with a joint to anchor the joint to the world?

Thanks!
jbishop
 
Posts: 2
Joined: Thu Jul 16, 2009 6:25 pm

Re: Generic constraints.

Postby slembcke » Fri Jul 17, 2009 7:54 am

You don't need a login at all to check out the code. Just make sure you are using the public url (http, read only), and not the private one (https, read/write). http://chipmunk-physics.googlecode.com/svn/trunk/ You can pretty easily create new constraints and add them to Chipmunk. Just copy one of the simpler joints and use that as a starting point. I tried to make the API fairly simple, but the math can get complicated. Not much that can be done about that with an API though.

Breakable joints are sort of in Limbo at the moment. The current implementation sort of works, but is incomplete. It leaks memory and can cause other issues. Haven't figured out what I'm going to do about it exactly.

As for hooking a joint up to the world, I guess that is sort of a special case. You can attach the joint anchors to the same static body that you attach all your static shapes to. It doesn't need to be added to the space because it never moves.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Generic constraints.

Postby jbishop » Fri Jul 17, 2009 8:14 pm

Got the code, compiled it with cocos2d, and used your tip on anchoring joints to the world (1 static body for all). Not sure what I did wrong the first time around, but I followed the demo structure and now it works like a charm! Thanks a lot!
jbishop
 
Posts: 2
Joined: Thu Jul 16, 2009 6:25 pm

Previous

Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest