What I am trying to do is to create a function that is executed by the simulator every frame. The function will be dynamically adjusting parameters of the spacecraft (such as adjusting engine power every frame). how do I do this?
clbkPreStep()
clbkPostStep()
And not 86/second (at least in 1920x1440, or 81/second in 2048x1536)? :lol:(ideally 60/second with VSync)
These two are called once for every time step (ideally 60/second with VSync):
Code:clbkPreStep() clbkPostStep()
I don't know but PreStep was giving me more stable results in my PID autopilot.
This method is useful when the step length Dt is required in
* advance of the time integration, for example to apply a force that
* produces a given Dv, since the AddForce request will be applied in
* the next update. Using clbkPostStep for this purpose would be
* wrong, because its Dt parameter refers to the previous step length.
clbkPreStep is called after the step size has been computed, but before the simulation state has been propagated. clbkPostStep is called after the state propagation.
Hehe, guys, I realize that
The real question is: why do we need the PostStep?
Thats a really great diagram, will it be in the new API docs? And can it be uploaded to Orbiter-Wiki?
It's already there (in the API_Reference.chm) since December last year:Thats a really great diagram, will it be in the new API docs?
From SVN r.15, you'll find under "Related pages | Orbiter program flow and module callback order" a flowchart for the orbiter frame update loop and vessel callback functions.
It's already there (in the API_Reference.chm) since December last year:
clbkPreStep is called after the step size has been computed, but before the simulation state has been propagated. clbkPostStep is called after the state propagation.