Any way to get physics delta time?

Hey,

I’m just experimenting with using time based physics, rather than frame based (https://docs.coronalabs.com/api/library/physics/setTimeStep.html)

I have a camera set up that lerps the camera to the player (a physics object). The lerping takes the corona deltatime (time it takes for a frame to complete) into account, however I don’t believe the physics deltatime and enterFrame deltatime are the same, as the tracking movement is visibly jerky. The movement itself isn’t jerky, it’s due to the “smooth (lol) tracking” on the camera.

TL:DR Is there a way to get the time it takes for a physics frame update to occur when using time based physics?

I could put together a demo project if that helps.

Thanks!

Hi Rob,

I’m not sure this is possible, but a small demo project would be useful, then I could tinker around with it…

Thanks,

Brent

Hi Brent,

Thanks for the reply.

I’ve set up a really small project that highlights the issue here:

https://github.com/LaserDogRob/coronaTimeBasedPhysics

Any questions at all, don’t hesitate to ask :slight_smile:

Hi Rob,

I tried out the sample project, but sorry to say I’m not sure how the physics time step works exactly, and how it plays into delta time.

If I take out the time step of 0 line (just use default), the camera seems to follow the ball smoothly. What is your goal with using time-based physics and camera? What are you trying to achieve specifically with this test?

Best regards,

Brent

Hi Rob,

I’m not sure this is possible, but a small demo project would be useful, then I could tinker around with it…

Thanks,

Brent

Hi Brent,

Thanks for the reply.

I’ve set up a really small project that highlights the issue here:

https://github.com/LaserDogRob/coronaTimeBasedPhysics

Any questions at all, don’t hesitate to ask :slight_smile:

Hi Rob,

I tried out the sample project, but sorry to say I’m not sure how the physics time step works exactly, and how it plays into delta time.

If I take out the time step of 0 line (just use default), the camera seems to follow the ball smoothly. What is your goal with using time-based physics and camera? What are you trying to achieve specifically with this test?

Best regards,

Brent