Tunneling Problem

Zurzaza
Posts: 11
Joined: Tue Aug 24, 2010 9:34 pm

Tunneling Problem

Post by Zurzaza »

Hi all,
I'm currently developing a game with Irrlicht and my own wrapper for bullet physics.
I'm really pleased to use this great physics engine, except that i had a problem when using fast moving object.

I need to shoot a really fast object through the level (a little cube), but even after setting the proper CCD values, the object still tunneling some objects.
It seems that the object pass through only certain object (Trimeshes), but i cannot see the relationship in this problem.

I also tried to put a very little value to the CCD threshold, but nothing changed.
This is the code:

Code: Select all

ISceneNode * node = smgr->addCubeSceneNode(10,0,-1,smgr->getActiveCamera()->getPosition());
body = bulletmgr->addRigidBox(node,40); //This line will create the box shape, motion state, transform, ...
body->getBodyPtr()->setCcdMotionThreshold(0.5f);
body->getBodyPtr()->setCcdSweptSphereRadius(0.5f);
Did I miss some parameters?
Thank you very much
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: Tunneling Problem

Post by pico »

You could test first if it's really tunneling. Bullet may actually detect the hit but fails to stop the object.

Even with CCD i experienced that fast moving objects gone through trimeshes although Bullet detected the hit. The seperation impulse seemed to be too small.
You may want to test to raise the m_erp value closer to 1.0. That gave me a better response, tho didn't cured the problem really.
Zurzaza
Posts: 11
Joined: Tue Aug 24, 2010 9:34 pm

Re: Tunneling Problem

Post by Zurzaza »

I tried your solution, setting m_erp and m_erp2 to 0.9f. I also setted the CFM to 0.9 too.
The collision detection has been improved, but some collision problems still remain...any suggestion? I noticed that this problem happens with trimeshes
User avatar
jarno
Posts: 57
Joined: Tue Mar 16, 2010 1:42 am

Re: Tunneling Problem

Post by jarno »

Maybe try a smaller fixedTimeStep for the dynamics world stepSimulation() (and increase maxSubSteps to match). That way objects won't move as much between collision checks.

---JvdL---
Toadcop
Posts: 11
Joined: Mon Feb 22, 2010 10:13 pm

Re: Tunneling Problem

Post by Toadcop »

Maybe try a smaller fixedTimeStep
great suggestion...
well i am also still searching for solution...
// today i installed and tested Havok and it sufferes the same as bullet from tunneling.
btw it's not direct problem with trimeshes primites are also get tunneled if speed is high enough =)
i wonder if it's possible to increase stability by loosing functionality... it's interesting how shipped games solved such issues.