Ghost objects tunnelling : undesired penetration.

singularPoint
Posts: 6
Joined: Wed Aug 08, 2012 7:24 pm

Ghost objects tunnelling : undesired penetration.

Post by singularPoint »

Hello everybody,

I am using a modified version of the character controller that can be found in the Bullet sample projects. Everything worked great until now.

The problem is that the ghost objects that build my character are moved by a user input device that sometimes indicate that the character should move from point A to point B in a very short time. For moving the character from point A to B i tried:

Code: Select all

 m_ghostObjectS[1].setWorldTransform(newTrans);
   m_ghostObjectS[1].setInterpolationWorldTransform(newTrans);
If i have an object on the line AB this object will be penetrated and only occasional the collision between my character and the object in between is detected.

I tried to use the continuous collision detection by using in the physics initialization method the following:
......

Code: Select all

 m_dynamicsWorld = new btDiscreteDynamicsWorld( m_dispatcher, m_brodPhase, m_constraintSolver, m_collisionConfiguration);   
     m_dynamicsWorld->setGravity(btVector3(0,-10,0));

    m_dynamicsWorld->getDispatchInfo().m_allowedCcdPenetration=0.0001f;
    m_dynamicsWorld->getSolverInfo().m_splitImpulse=true;//
    m_dynamicsWorld->getSolverInfo().m_numIterations = 20;
    m_dynamicsWorld->getDispatchInfo().m_useContinuous=true;
    m_dynamicsWorld->getSolverInfo().m_erp2= 0.9;
....
    m_ghostCharacter[0].setCcdMotionThreshold(Half_box_smallest_dimension );//
    m_ghostCharacter[0].setCcdSweptSphereRadius(0.9*Half_box_smallest_dimension );
This was done according to: http://www.bulletphysics.org/mediawiki- ... n_Clamping
and the AppCcdPhysicsDemo sample application. But the sample application used only rigid bodies. And on my ghost object seemed to not work.
Something is wrong. My ghost objects (character) are teleported from point A to B without having any collision detected in between eve though B might be inside of another rigid object.
I think i might solve this issue if i could interpolate the motion of my ghost objects between the points A and B but setInterpolationWorldTransform method shown above seemed to not help here. Please give me a hint if you spot something wrong there.

Is there a way to use the motionState for interpolating the motion of ghost objects? After days of searching it seems to me that this method is implemented only for rigid bodies.
Also a link towards solving the tunneling problems that involve ghostObjects would be greatly appreciated.


Thank you
singularPoint
Posts: 6
Joined: Wed Aug 08, 2012 7:24 pm

Re: Ghost objects tunnelling : undesired penetration.

Post by singularPoint »

Oh well, i implemented the motion interpolation manually and most of the fast movement of the ghost character do not cause penetration but if i have a stack of rigid cubes in front of my character and the character moves slowly the character will penetrate the stack of rigid bodies . This couldn't be tunneling isn't it

Could it have something to do with numerical accuracy limitations(the small values)? The strange thing is that sometimes this problem happens and other times does not for the same slow movement.

Or may be the fact that the solver can not find a reasonable solution of the dynamic world setup even though collisions might be detected?

So most of the time the collisions and the kinematic response are simulated in a plausible manner but often it happens to fail.