Jump to content

How to identify the Sun when it's been renamed?


Recommended Posts

Bit of a hack but I found (in limited testing) that crawling up the parent body chain until I found a body with a temp over some limit (think I used 2000) seemed to work. Not sure how low some of the extreme low mass stars can go, or how high a hot Jupiter can go, but 2K should be near the lower limit for a star. This of course assumes the mod star has a realistic temperature.

Link to comment
Share on other sites

That's the best way if you need to find it starting from scratch.

If you already have a reference to a CelestialBody and need to determine whether it's the Sun, I found that the Sun is the only body that is its own referenceBody (I would have preferred null, but oh well).

    bool isSun(CelestialBody body) { return (body.GetOrbit().referenceBody == body); }

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...