KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
691 stars 229 forks source link

vector to euler #2706

Closed erentar closed 3 years ago

erentar commented 4 years ago

Need to convert from V(x,y,z) to R(pitch,yaw,roll) without setting it to steering

apologies for lazy issue, could not find any better way to get help

nuggreat commented 4 years ago

A vector does not cleanly convert to a direction as a vector only contains two of the three elements of a direction, thus a second vector is needed to get the third element. While setting steering to a vector will convert the vector to a direction you can't access the resulting direction as that only exists internally and is not accessible in kerboscript, also NEVER SET STEERING. If you do need a direction than the function LOOKDIRUP() is the method to convert a pair of vectors to a direction. Also for something like this the kOS subreddit or the kOS discord would be better places to ask for help of this type.

erentar commented 4 years ago

Thanks for the fast response! LOOKDIRUP() is exactly what i needed.

erentar commented 4 years ago

Pull request #2707 to put these in documentation

Dunbaratu commented 3 years ago

Should have closed but it didn't because I had to type PR 2707 by hand to recreate it from develop instead of from master