# Bullet - objects falling through

I have problem with bullet collisions. You can see problem on this video (around 0:18):

http://goo.gl/DiVP8l

Objects are "embeded" inside vertical bars - that is not correct - they should be bouncing like at the beggining of the video. I am using sphere and box as bullet bodies. I have also enabled CCD, that improves stability a little, but problem is still there.

Pulsing bars are controlled with this code:

dist = distance I need the bar to change its position in a single frame
float g = (2 * dist) / (times.dTime); //dTime = 1/60
bars[i]->GetBulletBody()->setLinearVelocity(btVector3(0, 0, 0));
bars[i]->GetBulletBody()->setGravity(btVector3(0, speedUpFactor * g, 0));


I have constant update rate of physics and world, set to be 1/60 s.

• It seems like the collision works just fine but the boxes are trapped below the bar when bars move over them. When extending bars, you could try to move any boxes below bars to the new level of bars. – wondra Aug 4 '14 at 18:40
• @wondra Shouldn´t that be solved by Bullet? I mean, if ball is in position and bar move over it, I would expect Bullet to push ball out of collision and let him rest on top of the bar. – Martin Perry Aug 5 '14 at 17:04
• Why should it? You didnt move the bar, you "teleported" it by t * dS, there is no continous movement on computer, only discrete. – wondra Aug 5 '14 at 17:07
• @wondra I never set position manually, but through gravity change. If I do the same using force change, it has the same outcome. Before Bullet runs its loop, positions are correct (ball is above bar), but after that they are stucked inside each other. The only solution will be to "teleport" ball after Bullet loop, just before rendering, but that will mess my engine logic a little bit. – Martin Perry Aug 5 '14 at 17:10
• That doesnt change the fact, you set the position discretely. – wondra Aug 5 '14 at 17:13