A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: NewtonBodyGetAcceleration()

Postby Julio Jerez » Mon Apr 15, 2019 5:34 pm

is in file ../applications\demosSandbox\sdkDemos\toolBox\PhysicsUtils.cpp
by the end.
Julio Jerez
Posts: 10804
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodyGetAcceleration()

Postby misho » Mon Apr 15, 2019 5:43 pm

Julio Jerez wrote:is in file ../applications\demosSandbox\sdkDemos\toolBox\PhysicsUtils.cpp
by the end.

Got it, thanks! I thought it was a part of main Newton :wink:
Posts: 500
Joined: Tue May 04, 2010 10:13 am

Re: NewtonBodyGetAcceleration()

Postby misho » Thu Apr 25, 2019 2:45 pm

Hi Julio,

Thanks again for the acceleration equation! Unfortunately - it does not work. It is giving me near zero acceleration on the earth surface, and zero values for the acceleration calculated for contacts.

As I mentioned before, I managed to get "my version" showing me values I expect, for (so far) all cases: in orbit, on the ground, and during powered flight:

Code: Select all
   // G factor: Add up force of gravity, centripetal force and any force due to the powered flight:
   dVector dvFG = dVector(0.0f, 0.0f, 0.0f);
#if 1

   dVector dvFC = dVector(0.0f, 0.0f, 0.0f);
   dVector dvFB = dVector(0.0f, 0.0f, 0.0f);

//   entSource->GetCentripetalForce(dvFC);
   dvFB = dvAccelerationTotal.Scale(entSource->GetCurrentBodyMass());
   dVector   dvForceSum = dvFG + dvFC - dvFB;
   dVector   dvForceSum = entSource->GetTotalAcceleration();

   NavData.dGFactor = abs(vLength(dvForceSum) / vLength(dvFG));

As you can see, I skipped adding centripetal acceleration - body in orbit seems to already have that "resolved", as my call GetGravityForce(dvFG); gives me a value of 0 in orbit, and a value of -9.81 on earth surface.
This value is NOT CRITICAL, as it is used only for instrument display purposes, and not in any calculations. Let me know if you have any ideas on what may be wrong, but again, this is nothing urgent, I can live with it for now.

Posts: 500
Joined: Tue May 04, 2010 10:13 am


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests