Sign in to follow this  
opethism

Rope simulation in PhysX

Recommended Posts

opethism    122
Hi, I'm doing rope simulation for crane operation in PhysX. One problem I'm facing now is that my rope cannot carry heavy weights (like 2000kgs, right now it can only carry 20kgs). I'm using spherical joints to link a bunch of cylinders together. And attach a container to the other end of the rope using a fixed joint. If the container is too heavy (2000kgs), the whole rope will fall apart. http://img354.imageshack.us/img354/4905/ropesimulationql6.jpg I try to use joint projection to set the projection distance to 0.001. Now it can carry 2000kg container, but after awhile the rope will automatically oscillate around, just like what the PhysX doc says (because the projection distance is too small). The problem remains even if I change from spherical joints to distance joints. Do you have any solution for this, so that my rope can carry heavy things? One more thing, do you know how to dynamically change the length of this type of rope (made of many joints). I'm thinking of adding/removing each joint but it will not look smooth if the length of each joint/cylinder is too big. Thanks.

Share this post


Link to post
Share on other sites
Dirk Gregorius    2757
This is a limitation of the iterative solver. All game physic engines suffer from this. You could use the direct Dantzig solver of the ODE if this is your only application of a physic system.

I think the PhysX docs say that you should staty within a mass ratio of 1 : 10. You should follow this. Just scale all you objects within this range. Also use joint projection and tweak the inertia tensor of your rope bodies.

HTH,
-Dirk

Share this post


Link to post
Share on other sites
opethism    122
Thanks Dirk,

I guess I have to scale down everything. I'm just afraid it will look like the container is too light and cannot straighten the rope, makes the rope look like a rubber band.

It seems like the RemoteDebugger has a serious memory leak while the Physics program is fine. Even when I use their sample programs. Any ideas?

Thanks.

Share this post


Link to post
Share on other sites
lubby    290
For Viva Pinata : Party Animals, which used PhysX and had a stable rope simulation in one of it's mini games - bashing Pinatas with a big stick. I tried the old chain of joints trick but it was not stable enough. Eventually I used the PhysX cloth functionality, dynamically generating a hollow cylinder/tube and cooking as cloth.

The cloth damping coefficient was the main param responsible for a stable simulation. Ended up, the coefficient could be calculated based on the mass of the object attached to the lower sheave and the number of vertices on the rope circumference (that being a cylinder cross section)

Share this post


Link to post
Share on other sites
opethism    122
Thanks guys.

I already reduce the weight of the container to 20 kgs or even 1 kgs. But I still have the problem with the rope being springy.

The rope is supposed to be a metal rope but when I attach the container to one end of the rope, the weight of the container pulls down the whole rope and makes it spring up and down like a rubber band.
That happens even when I don't enable the NX_SJF_JOINT_SPRING_ENABLED. If I did, it would spring even more.

http://img341.imageshack.us/img341/2936/spingyropesy1.jpg

Another thing is that the rope is not straight when you move its upper end. It takes a while for the lower end to align with its upper end.
Even when I already limit the swing and twist angle by
sphericalDesc.flags = NX_SJF_TWIST_LIMIT_ENABLED | NX_SJF_SWING_LIMIT_ENABLED;

http://img518.imageshack.us/img518/1561/flexibleropelo4.jpg

All the of above problems don't occur at all when I only use one long cylinder. So I suspect that the problems happen when you link up a lot of spherical joints, each joint goes a little bit out of its limit and they add up a lot.
Is there any way to say "Dude, stay in your position!"? Using too small of a joint projection distance will make the simulation not stable after a while.

I can avoid all of these if I use one long fixed distance joint for the entire rope. But they want to see how each individual link of the rope moves. So the requirement of the rope simulation is it can carry heavy things, behave like a metal rope.

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this