A feature request

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: A feature request

Postby Sweenie » Sun Jan 19, 2020 3:54 pm

One thing that may be helpful in finding the problem(the stuttering in this case) is logging your sim data to a text file. Each frame, log the frame number, total time, frame time, newton updates performed, position and/or rotation etc. and then load the data into Microsoft Excel or similar.
Make use of graphs to visualise the numbers.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: A feature request

Postby misho » Sun Jan 19, 2020 5:26 pm

Sweenie wrote:One thing that may be helpful in finding the problem(the stuttering in this case) is logging your sim data to a text file. Each frame, log the frame number, total time, frame time, newton updates performed, position and/or rotation etc. and then load the data into Microsoft Excel or similar.
Make use of graphs to visualise the numbers.


Thanks, yeah, I was thinking that at some point I will have to take a close look at the numbers...

One thing that I noticed since my last post is that in demoSandbox, immediately after UpdatePhysics(timestep), a call is made to

Code: Select all
m_cameraManager->InterpolateMatrices (this, CalculateInteplationParam());


I ignored this because I saw that it was called by the cameraManager (which I don't use), but looking closely at it, the call has a comment above it: "Get the interpolated location of each body in the scene"... and I'm wondering if I need to do body interpolation after all...
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A feature request

Postby misho » Fri Jan 24, 2020 4:38 pm

Just an update - Since I cannot reproduce my observations with time compression/dilation in the demosSandBox, I've decided to do a major reorganization of how my Newton world is set up, to follow a lot more closely how it is done in the demosSandBox. I suspect that my problems were stemming from how I was structuring my "scene" (what is called DemoEntityManager in demosSandBox) and the DemoEntity itself. In particular, I have stripped some functionality from the DemoEntityManager for which I thought I had no use. As I mentioned before, one such line was residing in Camera manager class, for which I was sure I had no use, so I discarded it. But within it, there was code that was interpolating entity matrices, along with camera matrix:

Code: Select all
void DemoCameraManager::InterpolateMatrices (DemoEntityManager* const scene, dFloat param)
{
   // interpolate the location of all entities in the world
   for (DemoEntityManager::dListNode* node = scene->GetFirst(); node; node = node->GetNext()) {
      DemoEntity* const entity = node->GetInfo();
      entity->InterpolateMatrix(*scene, param);
   }
   // interpolate the Camera matrix;
   m_camera->InterpolateMatrix (*scene, param);
}


The more I look at it, the more I suspect that my stutters result from the absence of this interpolation...

That being said, I wish that DemoEntityManager/DemoEntity in demosSandBox were structured so that they were detached/independent from the openGL display system. That way, I would have an access to "vanilla" Newton world, and invoke only the functionality I need (for example, I don't need any of the openGL/mesh visual functionality, since I have my own visual display system). I know that the demosSandBox is only intended as an illustration of how Newton should be set up, but it would be really nice if the developers who are using a separate visual display system would have an access to a plain Newton DemoEntityManager-type class and derive it to their liking, so that they can easily add the derived DemoEntity-type objects.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 20 guests