I gave a bit of a rant in another thread (http://www.slembcke.net/forums/viewtopic.php?f=1&t=260) about my plans for world domination through constraint programming. For those of you that don't care to read it, constraints are basically like joints, but more generic.
I changed a bunch of the project structure, so only the XCode project will compile without changes. Also, nothing is quite final yet, so take the changes with a grain of salt.
edit: wrong repository URL
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
I'm especially looking forward to using breakable joints to create game worlds that can be destroyed/torn apart. Breakable joints should make it really easy.
This is *super* brilliant. I've been taking a break from my Chipmunk coding the last couple of months to work on the graphics for my game, and I'm just approaching a point where I can return to world/item building and Chipmunk (but now with betterer shiny.) Looking fwd to playing with this stuff very much. Thanks for all the hard work!
\o/ indeed!
[color=#808080]Tartley - Jonathan Hartley, [url]http://tartley.com[/url]
Using Pymunk (Chipmunk's Python bindings) for a game project:
[url]http://code.google.com/p/sole-scion[/url][/color]
I checked everything again, and now breakable joints are working with the trunk!
Now I need to call a ObjC Method when the joint breaks. Anybody have done this already?
---
OK got it working.
Now I have another problem: Instead of removing a constraint in the BreakableJoint preStep Function I now call a callback function. In this function I decide if the joint really breaks.
This works when I set maxForce to the same value for the breakable constraint and its delegate constraint. But as a joint will not always break, when maxForce is reached, setting a maxForce for the delegate will result in a gap between the connected parts of the joint. But when I set the maxForce of the delegate to INFINITY (so basically I don't set it), I get really strange results. When moving my body around, Chipmunk calls my break function and the gap between the joint parts is getting bigger and bigger.
Why does the maxForce of the delegate does have an influence? This is not used in the preStep of the breakablejoint where the breaking is checked, isn't it?
---
Ok, ok. Works.
The preStep function was returning before calling the prestep of the delegate even when the joint was not removed.
Thomas
Thomas
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
I've been looking for people working with the maxforce property (not many posts) and was wondering if this allows you to really enforce a maximum distance between bodies? At one point you said your bodies were sliding further and further apart-- and this is my problem on 4.1.0. I would like to work with the trunk code, but I don't want to waste a lot of time integrating it into my platform if there is still not a solution to this. Could you please let me know what you found with regard to maxforce-- if it really does give you a way to enforce the maximum amount a joint can stretch?
Setting a max force will not help that in the least. In fact it could only make it worse as the default max force is infinite. The problem with the joints stretching is that you have a number of joints together in a chain, and to simulate the chain properly you need to use a lot of iterations. More iterations means more CPU usage.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Yes, maxForce will make this worse. I assume you have pivotJoints. Even when they should not allow any distance between two parts when maxForce is unlimited, it does so and it is getting worse with lower iterations and the faster you move one body relative to the connected body.
At it seems so there is no other way to handle this.
Thomas
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]