Breakable Chain - best way to implement this requirement

mxms
Total Points:
80
Registered User
October 14, 2008 2:03 PM PDT
Rate
 
#3 Reply to #2
Quoting - sean.thurston

Hi mxms,

Cool video, I like the weird kind of art-style you have going there with the sun.

Unforturnately, this is kind of a bad case scenarios for constraints. You have long, thin chains that are using ball and socket constraints which limit translation, but not rotation. Then you are going to tangle a few of them up. I could see this becoming unstable pretty quick due to angular forces.

If you want to be able to break the constraints, then you can't really use a constraint chain. You need to use a chain of constraints. Here is some advice on this:

1) Try to limit the number of constraints you using. Try to use a lower level of detail in the physics rope and interpolate positions in the higher quality graphics rope. Less is always better. I imagine you will probably use capsules for the rigid bodies.

2) Read the section about stabilizing constraints in the docs. Havok Physics->Havok Dynamics->Constraints->Tuning and Tweaking Constraints.

3) In order to control the chain, put a rigid body that represents your kite at the end. Attach the chain to the "kite" and then keyframe it. Moving the kite will make the chain move with it.

4) The constraints are going to be between rigid bodies, so you should be able to do damage in a similar way to how other games do damage. Just do collision detection between the rigid bodies. Make sure to filter out collisions between rigid bodies in the same rope.

5) Use MOTION_STABILIZED_BOX_INERTIA or MOTION_STABILIZED_SPHERE_INERTIA for the rigid bodies in the rope.

6) For breaking the link, it might be best to just remove the contraint. This doesn't really work with a hkpConstraintChainInstance.

Hopefully this will at least get you started. This is probably going to be pretty difficult to work out.

Let me know how it goes.

Thanks,
Sean


 

Hi Sean,

Thanks a lot for the info - yeah I realize it isn't a trivial problem to solve, but will give it a go and see where we reach. Lower level detail in the physics rope and interpolating for higher detail is a great idea.

While going through the Swinging Rope demo, it showed how much more efficient the constraint chain approach was, which is why I tried it out. Would the reason for not using constraint chain only be that the constraints are not breakable? Could we still have collision detection between two strings using constraint chain?

I'll work on a chain of constraints today and see how it comes out. Thank you for your inputs - will let you know about progress.

Regards,
Varun.



Intel Software Network Forums Statistics

8289 users have contributed to 31235 threads and 99109 posts to date.
In the past 24 hours, we have 7 new thread(s) 24 new posts(s), and 30 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member Michael Johanson