Tunneling of small spheres against large, static objects

Muller
Posts: 6
Joined: Fri Oct 16, 2009 12:20 pm

Tunneling of small spheres against large, static objects

Post by Muller »

Hi all!

Simple question - I have a bunch of small spheres (that represent links in a rope, that's working beautifully by the way) - These spheres, or the rope, moves along at a fairly high speed. Often times when the spheres hit the ground, they stick to the ground. I'm guessing their go through a face of the ground and stick on the inner side of the mesh.

The spheres are represented as a sphere collision object obviously, and the ground is a static triangle mesh.

What is the preferred course of action for fixing this? Assuming the spheres need to be moving in the speed in which they are, and they cannot be made any larger because of visual reasons - How would I go about fixing this?
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Tunneling of small spheres against large, static objects

Post by Garibalde »

Hi

I am encountering the same problem as you. The rope created is from rigid bodies.. I have not found a solution to the problem either. In addition i find that at high velocities the links of the rope seperate
allowing objects to pass between them. Do you encounter this problem too? I would like the rope i have to be rigid (i.e have a constant length during runtime). Mine varies depening on the force on the rope.

Garibalde
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Tunneling of small spheres against large, static objects

Post by Erwin Coumans »

You could try to use a smaller internal timestep (at the cost of a bit performance):
Note that deltaTime is the actual delta time (second units), while fixedInternalStep is the internal simulation step.

Code: Select all

btScalar fixedInternalStep = 1./240.f;

stepSimulation(deltaTime, 10, fixedInternalStep)
Another option is to enable CCD motion clamping. Best to choose a coreRadius that is smaller than the actual sphere radius. Also the motionThreshold might require some tuning.

Code: Select all

	body->setCcdMotionThreshold(motionThreshold);
	body->setCcdSweptSphereRadius(coreRadius);
Hope this helps,
Erwin
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Tunneling of small spheres against large, static objects

Post by Garibalde »

Thanks Erwin,

I tried the first method and its much more stable now.. i dont get passing through the rope effects at this time.
I didnt try the second method, since the first for now has solved my immediate problem. I may test it later and report back.. Or if anyone tests please report here.

Thanks
Garibalde