Planet Height From Sun

  • Thread starter Thread starter Bj
  • Start date Start date
How do you find the hight of a planet in reference to the sun?

oapiGetRelativePos should do it, you'll have to subtract the radius of the planet and the sun.
 
Orbital radius of the planet - diameter of the sun? Or what do you mean?
 
I dunno... since the sun is directly at the center of the global coordinate system, I don't bother... I just use oapiGetGlobalPos() (well, actually, I've just used it for vessels, so I use VESSEL2::GetGlobalPos()).

I guess if you need to find the radius of the sun or something... yeah, I think oapiGetObjectByName("sun") should work. (Hmmm... I wonder if the sun always has the same index...)
 
Assuming the star to be the sun would make your vesse/mfd non-functional with other planetary systems. The best course of action in my opinion is to use the following functions in conjunction.

oapiGetObjectCount
oapiGetObjectByIndex
oapiGetObjectType - if it returns OBJPT_STAR, your object is a star
 
Back
Top