Programming Question Vertical Speed

edsupagood

Addon Developer
Addon Developer
Joined
Oct 26, 2010
Messages
135
Reaction score
0
Points
16
I am trying to find out the vertical speed of a vessel, what function should I use? I tried oapiGetGlobalVel(OBJHANDLE hObj, VECTOR3 *vel) but I don't know how to convert VECTOR3 to show only the vertical speed.
 
There's much simpler I think, like :

Code:
VECTOR3 ofs;
GetHorizonAirspeedVector(ofs);
double VertSpeed = ofs.y;

The VertSpeed variable gives you your vertical velocity relative to the current main GBody.

A VECTOR3 is made of 3 "double" numbers, like _V(0.5, 0.5, 0).

ofs.y means : "extract the y-axis component from the ofs vector".
 
Last edited:
Thanks, that was exactly what I needed.:thumbup:
 
Back
Top