Timestep values in NewtonUpdate()

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Timestep values in NewtonUpdate()

Postby misho » Mon May 02, 2016 4:32 pm

I am working with an existing visual simulation environment that allows for a time expansion/compression of 1/4x to 128x of real time (basically, used to slow down/speed up time). When using Newton, I use this factor fSimSpeed and multiply the timestep value in NewtonUpdate():

Code: Select all
NewtonUpdate (g_world, deltaTime*fSimSpeed);

However, an upper timestep clamp, defined in NewtonClass.h as:

Code: Select all
#define DG_MAX_TIMESTEP (1.0f / 30.0f)   

prevents me from compressing time more than 2x (about a half of my FPS). The documentation doesn't state why, but I assume it is because of the instability. So, just for fun, I decided to override this value and re-compile newton.lib:

Code: Select all
#define DG_MAX_TIMESTEP (1.0f / 0.10f)

I tested my simulator, and to my surprise, it is perfectly stable at 128x time compression (well, with the things I have so far, which are simple orbital mechanics). The only thing I've observed so far was that my supposedly rigid joint is visibly oscillating at high timestep values (time compression), but I am unsure if this is due to high timestep values. What can I expect as far as instabilities, when passing 128x factor for a timestep?

Misho Katulic
CTO, FSX SpacePort
Posts: 568
Joined: Tue May 04, 2010 10:13 am

Return to General Discussion

Who is online

Users browsing this forum: Dave Gravel and 3 guests