Getting Acceleration Vectors

Topper

Addon Developer
Addon Developer
Donator
Joined
Mar 28, 2008
Messages
671
Reaction score
32
Points
43
Hi,
how can i get the acceleration vector of the horizontal acceleration witch is shown in the surface-MFD (bottom right)?

I have tried different thinks but i never can get a clear, "constant" value.
I can't find anythink in the sdk-docs.

thx!
 
thx, but iam using this function now:

Code:
void landap::getAccelerations(double dSimTime)
{
    static double SimTimeOld = 0;

    static double horz_speed_old = 0;
    static double vert_speed_old = 0;

    double SimTimeNew = oapiGetSimTime();
    
    VESSEL* V = oapiGetFocusInterface();
    VECTOR3 V3;

    V->GetHorizonAirspeedVector    (V3);

    double horz_speed_new = sqrt((V3.x*V3.x)+(V3.z*V3.z));
    double vert_speed_new = V3.y;
    
    HorzAcc = (horz_speed_new - horz_speed_old) / dSimTime;
    VerAcc  = (vert_speed_new - vert_speed_old) / dSimTime;
    //TotAcc = sqrt((HorzAcc*HorzAcc)+(VerAcc*VerAcc));
    SimTimeOld = SimTimeNew;
    horz_speed_old = horz_speed_new;
    vert_speed_old = vert_speed_new;
}
 
Back
Top