Page 1 of 1

Glitch with Revolute Joints

Posted: Wed Jul 02, 2014 11:31 am
by skinwalker
Hello,
I finally ran my Rube project with AndEngine on my android device.I have 2 caves connected with a bridge ( I used this tutorial to create my bridge with revolute joints http://youtu.be/WqLR4dFn1qE ).So when I start my project sometimes the joints break here is a picture of my bridge

Image

Here is a picture of the same bridge when the glitch engaged

Image

The glitch appears when I tap on the screen before the scene is loaded and I don't have a splash scene,because this is my test project.So what do you think? What may cause the glitch ?

Re: Glitch with Revolute Joints

Posted: Wed Jul 02, 2014 3:04 pm
by iforce2d
Honestly I have no idea just from looking at a picture. Are you using a fixed time step?

Re: Glitch with Revolute Joints

Posted: Wed Jul 02, 2014 8:33 pm
by skinwalker
When I pause my game and then resume it all of the joints (even wheel joints) break and I have no idea why :?

Re: Glitch with Revolute Joints

Posted: Wed Jul 02, 2014 9:38 pm
by iforce2d
Are you using a fixed time step?

Re: Glitch with Revolute Joints

Posted: Wed Jul 02, 2014 11:07 pm
by skinwalker
I am a beginner and honestly I have no idea what this is.

Re: Glitch with Revolute Joints

Posted: Thu Jul 03, 2014 1:30 am
by iforce2d
When you step the physics world, usually you give a time length for the step. If your game runs at 60fps, usually the time length will be 1/60 second. For example, in C++ the call to step the world would be like this:

world->Step( 1/60.0, velocityIterations, positionIterations);

That would be a fixed time step, because it always uses the same constant length (1/60 second). The other way you can do it, is with a variable-length time step, where you measure how much time (real world time) has passed since the last step was done, and use that as the length of the time step. This is a bad idea for many reasons, which you can read about by googling something like "fixed time step vs variable time step".

If you are using a variable time step, I would expect to see big problems like those you describe, because the time passed between pausing the game and restarting would be much longer than 1/60 second, so you might be simulating a very long time in one step.