Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Box2d smoothed step — Gideros Forum

Box2d smoothed step

billydbbillydb Member
edited July 2015 in Game & application design
I think the only thing preventing a smooth experience on winRt for my game is getting the physics to keep time with fps. On winRt the phys moves slower than tweens etc. I think the solution is a smoothed time step, as in this:

http://giderosmobile.com/forum/discussion/383/box-2d-worldstep-fixed-time-steps/p1

The only problem is me no understandy:

fdt = event.deltaTime * lowfilter + fdt * (1 - lowfilter)
world:step(fdt, 6, 3)

I get the general idea but how do you do the actual "lowfilter". He mentions a filter value of 0.4 but does that mean the lowfilter var is just a float of 0.4 or is that some other bit of code that generates the lowfilter value?

I tried

fdt = event.deltaTime * 0.4+ fdt * (1 - 0.4)
world:step(fdt, 6, 3)

But didn't look right. In fact it looked very similar to another post that suggested to use deltaTime in place of 1/60 for the step value, but it seems things get freaky and out of sync.
Can anyone explain how to get a smooth time step, like your explaining to a complete idiot? Thanks :)
Sign In or Register to comment.