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);
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 );
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