Missing body

Topics: Developer Forum, User Forum
Aug 2, 2011 at 8:40 AM

Hello again!

I have a trouble with a body. I'm developing a game for Wp7, throwing a ball. I throw it with ApplyLinearImpulse and then bounce with the floor correctly, but when I throw it very strong against the floor, the ball like to disappeared, cross the floor.

I think that the mass of them is the solution, I've 1f in mass in the ball and the floor, is this correct?

How can I solve this?

Thanks!!

Aug 2, 2011 at 10:27 AM

i think it's because the timestep (tunneling). you can solve this by seting the body's IsBullet flag to true (so it haves CCD)

after that it should work

Aug 2, 2011 at 10:45 AM
Edited Aug 2, 2011 at 10:45 AM

I set IsBullet to true in ball's body and floor's body and it's the same, don't work.

I do this in update method:

 

world.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));

 

Is correct?

What is CCD?

Aug 2, 2011 at 7:21 PM

i don't think you need the min thing (just world.Step( (float)gameTime.ElapsedGameTime.TotalSeconds this works fine for me)). but that shouldn't be the problem.

and CCD is continuous collision detection (time of impact; some sort of ray tracing of the body)