Thanks, will do that.
Actually there are not that many changes: mostly I changed the NewtonUpdate call. If you find any of this interesting please add it to the wrapper:
void newton_start()
{
newton_running = 1;
nworld = NewtonCreate(0, 0);
newton_addstaticcollisiongeometry();
while(newton_running) // newton has to update every frame
{
advance = time_frame/16;
slices = integer((advance / MIN_NEWTON_ADVANCE) + 1);
for (slices_left = slices; slices_left > 0; slices_left--){
NewtonUpdate(nworld, advance/slices);
}
wait(1);
proc_mode = PROC_LATE;
}
}
I implemented time slicing because I wanted precise control over the fineness of the simulation and felt NewtonSetMinimumFrameRate didn't work quite like I expected back in newton 1.53. Maybe this is useless now.
I also set proc_mode to PROC_LATE: this way the simulation is performed right after the main cycle, instead of before. I believe this way to be better as the time_frame value used in calculations in main() (in my case acceleration calculations based on user input) refers to the same frame as the time_frame used to compute the update time.
Hope this are useful 2 cents! Please let me know what you think.