Changes to NewtonUpdate()

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Changes to NewtonUpdate()

Postby misho » Thu May 25, 2017 8:35 pm

Hi all,

I'm migrating to the newest version, from version around November, 2016. After a few small issues, I got everything to compile and link. However, my app crashes inside NewtonUpdate(), without any changes on my end.

So, digging deeper into it, I noticed a few small changes in NewtonUpdate(), namely, omission of following lines:
Code: Select all
   dgFloat32 minstep = dgFloat32 (DG_MIN_TIMESTEP);
   dgFloat32 maxstep = dgFloat32 (DG_MAX_TIMESTEP);

   timestep = dgClamp (dgFloat32 (timestep), minstep, maxstep);


and removal of DG_MIN_TIMESTEP and DG_MAX_TIMESTEP defines. I was using DG_MAX_TIMESTEP to allow for time expansion (my simulation platform allows for time expansion/compression from 1/4 to 128x):

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

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


This allowed for a larger timestep and covered the whole range of time expansion/compression, from 0.25x to 128x.

I was discussing this with a few members on here in this thread. What happened to these parameters? And what changed within NewtonUpdate(), since I am getting a crash at a normal sim speed (without time compression/expansion).

Any insight would be helpful!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Changes to NewtonUpdate()

Postby Julio Jerez » Fri May 26, 2017 9:22 am

yes those tow define were remove and replaced with function
void NewtonSetNumberOfSubsteps (const NewtonWorld* const newtonWorld, int subSteps)

this allowed for the same and more flexibility.
for example of you want you time step to be 1/10 of a second you can change the number of sub step to 3, and so on.
All it does is that the define is now a variable rather that tryin to force the app to fix steps
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Changes to NewtonUpdate()

Postby misho » Fri May 26, 2017 3:14 pm

Thanks, Got it! I introduced my own wrapper that implements the clamp, as before. I'll look into the steps eventually :wink:

Off topic, I "checked off" request for notification when a reply is posted, but nothing came... ?
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests

cron