Ball not colliding?

ripper9100
Posts: 10
Joined: Mon Sep 08, 2008 2:27 am

Ball not colliding?

Post by ripper9100 »

Hi,

Currently I have an application where I'm throwing a ball at a wall and everything works fine as long as I keep the velocity below a certain amount. For example if I throw the ball at 750 m/s everything is fine but if I throw it at 800 m/s then the ball bounces of fine at certain locations but goes right through in others. By the way I'm using a btBvhTriangleMeshShape for the wall.

Anyone know what could be causing this?
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: Ball not colliding?

Post by pico »

Hi,

i guess your object moves within one timestep further then the size of the collider.
To tackle this problem search for "ccd" and "tunneling" in the forum. There are numerous posts on this subject.
ripper9100
Posts: 10
Joined: Mon Sep 08, 2008 2:27 am

Re: Ball not colliding?

Post by ripper9100 »

Thanks for the help, problem solved! I just added the following two lines mBallBody ->setCcdMotionThreshold(1.0f), mBallBody ->setCcdSweptSphereRadius(0.2f) and everything works fine.
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: Ball not colliding?

Post by pico »

Hi,

take care that the current ccd algo doesn't use callbacks and virtual 'needs response' queries. So if you use such then you would run into problems.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Ball not colliding?

Post by Erwin Coumans »

The 'needsResponse' test will be added in the final version of Bullet 2.74, so it should be safe to use Ccd Motion Clamping.

See progress and issue report here:
http://code.google.com/p/bullet/issues/detail?id=179

Thanks,
Erwin