NewtonBodyApplyImpulsePair() varies? [SOLVED]

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

NewtonBodyApplyImpulsePair() varies? [SOLVED]

Postby misho » Sat Mar 16, 2019 4:52 pm

I have 3 panels on the rocket, connected using a hard joint, that have to be "ejected" during ascent to orbit, at around 170 km altitude. I do this by adding a linear and angular impulse, using

Code: Select all
NewtonBodyApplyImpulsePair(body, &LinearImpulse[0], &AngularImpulse[0], timediff);


I notice that, when testing this on the launch pad (no velocity), the speed of ejection is about 3x smaller than the speed at 170 km, when the rocket has a much higher velocity. The only variable going in to the above call is timediff, and the values for the timediff, for the 3 panels, are as below:

At Pad: ~50 fps (visual frame, not Newton frame)

IMPULSE TIMEDIFF: 0.053251
IMPULSE TIMEDIFF: 0.053377
IMPULSE TIMEDIFF: 0.053460

At 170km: ~45 fps (visual frame, not Newton frame)

IMPULSE TIMEDIFF: 0.040350
IMPULSE TIMEDIFF: 0.040510
IMPULSE TIMEDIFF: 0.040574

Would this small variation in timediff (due to FPS) cause such a large and apparent difference in impulse velocity? Or does it also depend on the velocity of the body itself? ( I know it shouldn't )
Last edited by misho on Thu May 09, 2019 3:19 pm, edited 1 time in total.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: NewtonBodyApplyImpulsePair() varies?

Postby Julio Jerez » Sun Mar 17, 2019 1:23 pm

If the hatch is attached to the rocket, or some how has some connection to it, the added impulse it added to the whole thing.
So my guess is that the configurations are different in the launch pad than in the air.
Is like trwoing a ball from a moving car, look it up in youtube there are many demonstrations.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodyApplyImpulsePair() varies?

Postby Julio Jerez » Sun Mar 17, 2019 1:28 pm

Also the timediff is a major factor.
The impulse is not appplied immidially, is calculated as a impulse added to the force accumultionc over time,
The time diff should always be a simulation time step. Not sure how you get different values, I am hoping your simulation runs at a fix step.

If you aren't the other will be lot of inconsistencies like that, has you added a listener for your logic? That will let you do that kind of logic at simulation time, even when they are originated from the graphic time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 3 guests