I'm trying to predict the amount of lift a vessel creates at arbitrary (not only current) AOA, mach number,...
I found a function called GetAirfoilParam which asks for an airfoil handle and returns all of the airfoil's characteristics , including (amazingly enough) the pointer to the function that calculates the airfoil coefficients - AirfoilCoeffFunc and the parameters that need to be passed to it. Great, my dreams have all come true...
Now, how do I get all of the vessel's airfoil handles that the function requires to return the data?
I've looked through the API reference, searched the forum and even looked through the list of functions of the VESSEL class, but found nothing... I hope it's possible to get the handles. If not, then that seems like quite an oversight in the API and will hopefully be corrected in the future Orbiter release... and in the mean time, I'll have to resort to logging...
---------- Post added 29th Oct 2012 at 02:30 ---------- Previous post was 28th Oct 2012 at 20:56 ----------
In the mean time, I'd like to say that this sledgehammer works... ish
Basically a for loop through the entire memory, looking for where the function returns true, however, on my computer it takes 15 seconds for every vessel in the scenario. It's unacceptable.
Alternatives?
I found a function called GetAirfoilParam which asks for an airfoil handle and returns all of the airfoil's characteristics , including (amazingly enough) the pointer to the function that calculates the airfoil coefficients - AirfoilCoeffFunc and the parameters that need to be passed to it. Great, my dreams have all come true...
Now, how do I get all of the vessel's airfoil handles that the function requires to return the data?
I've looked through the API reference, searched the forum and even looked through the list of functions of the VESSEL class, but found nothing... I hope it's possible to get the handles. If not, then that seems like quite an oversight in the API and will hopefully be corrected in the future Orbiter release... and in the mean time, I'll have to resort to logging...
---------- Post added 29th Oct 2012 at 02:30 ---------- Previous post was 28th Oct 2012 at 20:56 ----------
In the mean time, I'd like to say that this sledgehammer works... ish
Code:
for (unsigned int I = 0; I < (unsigned int) pow(2.0, 32) - 1; I++)
{
if (Parent->GetAirfoilParam(AIRFOILHANDLE(I), &ReferenceVector, &Function, &Context, &C, &S, &A) == true)
{
AirfoilHandles.push_back(AIRFOILHANDLE(I));
}
}
Basically a for loop through the entire memory, looking for where the function returns true, however, on my computer it takes 15 seconds for every vessel in the scenario. It's unacceptable.
Alternatives?
Last edited: