SOLVED: Forces on a body enigma

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Forces on a body enigma

Postby misho » Mon Apr 02, 2018 8:59 pm

Sounds good! :wink:
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Tue Apr 03, 2018 8:56 am

yes you where right there was a bug in a function that I recently changed. TestZero was change to use old SSE not the new 4.x, but I made a mistake in the double class.
If you sync it should be fine now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 2:43 pm

Thanks, I got it and it is working. I'll create my test cases ASAP and report on what I find out...

FYI, a lot of demos seem to broken... many of them show 0 loaded bodies. Coefficients of friction show 10 bodies sliding down all at the same time, so obviously the coefficients seem to be all the same. All the vehicle demos show blank skybox, no bodies loaded. Player controller demos have all players stuck, unable to move...Probably something simple, just wanted to give you heads up.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 3:13 pm

Ok, I have built my test cases with the newest up to date Newton libraries from the GitHub.

The behaviour of the FAR case is BETTER: There are no random object attitude changes, and the rocket body is rising under applied thrust.

However, the rocket body is rising in steps, perhaps one meter step by the look of it, not in a smooth manner I'd expect, and how it behaves when the body is positioned at the origin of the coordinate system (NEAR case). So, yeah, there is still a slight problem when it comes to far-positioned object.

I can send test cases to illustrate. The code is nearly identical to what I posted, except now I see that the GetKeyState() has been moved to scene class, out of mainWindow class.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Tue Apr 03, 2018 3:19 pm

misho wrote:Thanks, I got it and it is working. I'll create my test cases ASAP and report on what I find out...FYI, a lot of demos seem to broken... many of them show 0 loaded bodies. Coefficients of friction show 10 bodies sliding down all at the same time, so obviously the coefficients seem to be all the same.

not that's a bug I just tested and is work fine in float, but is wrong with double.
It seem like some alignment problem with double
Let me fix these error first, we can not trust the engine like this, we have to make sure the low lever is consistent first.

on the black demos, yes there are few commented out because there was a lot of work on the engine tat does demo interfere with, I am re enabling that one at a time.

So before I get your demo, let us get a stable build so that you integrate first.
I am work now, I will try to check that out tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 3:33 pm

Excellent, thank you! I will check the non-double version!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Tue Apr 03, 2018 3:40 pm

ok the bug was fixed, is was an alignment by me save a double in a void pointer, but in 32 bit more a pointer is 32 bit while a double is 64, It is fixed now.
Please sync and build your demo, them tell me how to get your repro demo.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 3:41 pm

I just checked: the non-double (float) version is not behaving properly:

A non-initiated roll of the body happens a few seconds into the runtime, and the body "floats" away"

If I initiate the thrust force, the body just sits still on the launchpad.

Again, the only difference is, the rocket body and the static base it sits on are 6378 km in the y direction.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 3:43 pm

Julio Jerez wrote:ok the bug was fixed, is was an alignment by me save a double in a void pointer, but in 32 bit more a pointer is 32 bit while a double is 64, It is fixed now.
Please sync and build your demo, them tell me how to get your repro demo.


OK, thanks, will do ASAP!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 4:03 pm

Ok, I just did, no change from the previous :cry:

You can grab the demos here

they are the FAR versions of the test case. Basically, hit spacebar to activate thrust:

  • On the double version, you will see the cylinder rise up in steps. If you don't activate the thrust, the cylinder will be still
  • On the non-double version, the cylinder will not rise. If you don't activate the thrust, after a few seconds the cylinder will rotate and "float" on its own.

Let me know if you need the NEAR test cases, to see how the objects are supposed to behave.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Tue Apr 03, 2018 4:14 pm

Ok I download it tonight and see what is wrong,
what d you mean not change, the friction demo failed? I just tested again and is works in my machine.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Forces on a body enigma

Postby misho » Tue Apr 03, 2018 4:22 pm

Julio Jerez wrote:Ok I download it tonight and see what is wrong,


Excellent, thank you!

Julio Jerez wrote:what d you mean not change, the friction demo failed? I just tested again and is works in my machine.


Oh - no, I was talking about my rocket demos - I thought you might have fixed that! I haven't tested other demos, my comments were just FYI. I tested it now, the friction demo works perfectly! :D
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Wed Apr 04, 2018 8:48 am

I look an the site and I only see tow sandbox executable, I can't do anything with that,

if you added a test to teh sandbox you nee to provide the source,
or if you wnat to provide an executable, I mean an executable of your project that link to the newton dlls,

and execulation that line to static libraries can't be debugged.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Forces on a body enigma

Postby misho » Wed Apr 04, 2018 10:21 am

Ok - I can't provide my project - it is too large and has many dependencies (a server).

Can I provide source code for the test scene? I already pasted it a few posts ago, but I can provide files as well. You can find them in the same location here

  • MishoRocketTest.cpp - a scene setup file, add it as is, it is set up just like the other 42 demos
  • PhysicsUtils.cpp - Only change I did is added code that adds thrust to the rocket in PhysicsApplyGravityForce()
  • DemoEntityManager.cpp - Only change is code relative to the addition of MishosRocketTest() test scene

Or - the whole scene is very simple: I think any object placed very far from the origin will misbehave, and I think a huge mass is a factor. My scene is simply a STATIC newton object, and on top of it a heavy dynamic object with a mass of 980000kg. The whole scene is placed 6380000 m from the origin Also, you'll need a force strong enough to lift the heavy object.

Hope this helps, let me know if there is anything else you'd need.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Forces on a body enigma

Postby Julio Jerez » Wed Apr 04, 2018 10:55 am

I added the project but I thing you made a mistake in PhysicsUtils.cpp
The file there is DemoCameraManager.cpp
you must change an existing funtion because it compile, but maybe does no work properlly
please verify the change to PhysicsUtils.cpp is there,

you can just post the file here, it is eassy to get that way, I can no open links to othe site form work.
Anyway, sync and tell me if this is how is suppose to integrate.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 13 guests