Tunneling problems

James
Posts: 1
Joined: Mon Apr 16, 2007 2:32 am

Tunneling problems

Post by James »

I was asking about tunneling just before the forums went down. Since then I've changed Bullet to use the btCollisionShape::calculateTemporalAabb() function rather than the default getAabb() when it comes to collision detection. I've also hooked the near-callback with something similar to:

Code: Select all

// Check to see if the convex cast will be justified
if (Ratio of speed to size is large enough &&
    Neither object is the ground plane)
{
    Perform a convex cast
    If there is a hit
        // Back off the velocity so the next iteration will cause a collision
        ObjectLinearVelocity *= (fraction * 0.95)
}

Perform the regular collision detection
However I'm still getting tunneling in some cases, and overall it doesn't give me the right "feel". The biggest part I'm unsure about is the adjustment of the linear velocity. I want to work on that first, then I'll worry about the occasional missed collisions that are still happening.

Edit: Removed one of my "optimizations" after I realized that it doubled the work.
--
-James