I want to get ephemeris data of all bodies. So I do the following:
What to do when pGBody == NULL? The reference says that the oapiGetCelbodyInterface() function returns: "Pointer to the CELBODY class instance for the body, or NULL if the body is not controlled by an external module." What does that mean and how can I get ephemeris data for those bodies?
And how to get the names and the masses of bodies? Coded as above, I know only the index and can sometimes obtain ephemeris data, but not the name or mass. Thanks for your help!
C++:
unsigned int nGBodies = oapiGetGbodyCount();
for (unsigned int iGBody = 0; iGBody < nGBodies; iGBody++) {
OBJHANDLE hGBody = oapiGetGbodyByIndex (iGBody);
CELBODY *pGBody = oapiGetCelbodyInterface (hGBody);
...
}
What to do when pGBody == NULL? The reference says that the oapiGetCelbodyInterface() function returns: "Pointer to the CELBODY class instance for the body, or NULL if the body is not controlled by an external module." What does that mean and how can I get ephemeris data for those bodies?
And how to get the names and the masses of bodies? Coded as above, I know only the index and can sometimes obtain ephemeris data, but not the name or mass. Thanks for your help!