SDK Question change orbital elements

weiqi

New member
Joined
Feb 20, 2009
Messages
23
Reaction score
0
Points
0
Hello everyone! I have created a new spaceship which named SKY, and now I'm developing the SKY.dll. If I want the spaceship to change its orbital elements during a mission,what should I do?

I know I could change the Obital elements in the scenario editor, but can you tell whether I could realise this function: when I press some key in the keyboard, it will change the orbital elements itself. If can, how should I do?

Thanks a lot!

(There are some functions about orbital elements in API_Reference.pdf, but I can find any example about this. )
 
You usually do this by using a propulsive maneuer with your thrusters. You can calculate the direction in which you have to burn and when, from the old and new orbit elements.

But you can of course also cheat and manipulate the orbit elements directly. It just kills the fun of it.
 
(There are some functions about orbital elements in API_Reference.pdf, but I can find any example about this. )
The Scenario Editor code has good examples of their use.
 
Last edited:
a little more detail description about the question

First, I want to give my deepest thankfulness to the two friends above.
Second, I think I should describe my question a little more clear: If I just want to demonstrate a spacecraft flying around another little planet body, so I should change its orbital elements during the elements. Just as a friend said above , I could use the thrusters to realize this goal. However, if I have known orbital elements change under the two states, and I just want realize change the orbital elements by pressing a simple key, how should I do?

Thanks again!
 
All you need do is call SetElements from your vessel's clbkConsumeBufferedKey function. Have a look at the Scenario Editor code (it is in OrbiterSDK\samples\ScnEditor). Specifically, have a look at the function called when you press the Apply button in the Orbital Elements tab - EditorTab_Elements::Apply. It calls VESSEL::SetElements and you should be able to see how it populates the structures that are the arguments to that function.
 
Thanks for your help! I will try it later and share that with my friends. Thank you!
 
Back
Top