SDK Question Finding the velocity vector of a vessel.

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
295
Reaction score
241
Points
58
Location
Lehi, Utah
Is there an SDK call that returns the velocity vector for a vessel? (Basically the 'prograde' indicator in the HUD.)

My searching has come up empty. If no, any advice on how to calculate it?

Thanks.
 
Is there an SDK call that returns the velocity vector for a vessel? (Basically the 'prograde' indicator in the HUD.)

My searching has come up empty. If no, any advice on how to calculate it?

Thanks.

You can get the relative velocity vector to a planet, which is the orbital prograde. if you mean the surface relative velocity, you mean "air speed". You can also get the horizon-relative velocity vector.
 
GetHorizonAirspeedVector ?
 
I guess what I'm looking for is the vector indicating the direction of travel for the vessel with reference to the local horizon.

For example, GetPitch gives me the pitch of the vessel with reference to the local horizon, I'm looking to get the direction of travel with the same reference.

I'm basically trying to reproduce the HUD circle that indicates the 'prograde direction', also called the velocity vector direction. But I'm not interested in velocity itself.

Hopefully that is clearer.
 
I'm sure that there's probably a better way, but you could try this:

Use oapiGetGlobalPos to find us in global coords.
Use oapiGetGlobalVel to find velocity offsets in global coords.
Add them to make a point you would be at one second from now.
Use your vessel's Global2Local function to drop that point into local coordinates.
This will now give you an XYZ direction offset in your ship's reference.

Not sure if this is what you wanted, or if you really wanted a planetary horizon, which would be a different thing!
 
Have you maybe tried
?

:thumbup:

Figuring out the right question to ask is half the battle. What I think I really need is GetShipAirSpeedVector, and from that determine the angle between vessel pitch, yaw, and airspeed vector. But I think I'm on the right track.

Thanks.

I'll come back and post the math when I figure it out.
 
Back
Top