Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to calculate prograde/retrograde value? #12

Closed
GodToRun opened this issue Oct 13, 2022 · 1 comment
Closed

How to calculate prograde/retrograde value? #12

GodToRun opened this issue Oct 13, 2022 · 1 comment
Labels

Comments

@GodToRun
Copy link

GodToRun commented Oct 13, 2022

Hello. i'm currently working on a game like KSP. so i want to calculate prograde/retrograde value.
i tried velocityHandle.transform.position += velocityHandle.transform.right but it is not perfect solution.
anyone help me?

@Karth42
Copy link
Owner

Karth42 commented Oct 18, 2022

hi. what do you mean by 'value'? the direction (normal vector)? in this case you can just normalize velocity vector, which will give you prograde direction. from this you can derive everything else. for example, you can add this vector to your body's position to get world space position of prograde point (it seems like this is what you trying to get).
note: velocityHandle transform is not a root source of the orbit data (it's just a simple way to display and manually control velocity), so I would not recommend using it anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants