HowTo prevent falling through floor in modified VehicleDemo?

Erz
Posts: 1
Joined: Mon Nov 24, 2008 2:53 pm

HowTo prevent falling through floor in modified VehicleDemo?

Post by Erz »

Hello, I've just download Bullet 2.73, made some tutorials and now playing with VehicleDemo. I change it little to make car fly:

Code: Select all

//Added function
void VehicleDemo::keyboardCallback(unsigned char key, int x, int y)
{   
    if( key == 'w' || key == 'W' ){
        m_carChassis->applyCentralImpulse(btVector3(0,6000,0));
        return;
    }
    this->DemoApplication::keyboardCallback(key, x,y);
}
Now when I raise vehicle above the ground pressing 'w' several times and let car fall down, it sometimes falls through the floor, which not right thing from my point of view. How to make car not to fall through the floor and stay above the ground?