-
-
Save Jordach/5304356f7557bee0b72fa8b66f35a7b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Sky::setStarCount(u16 star_count, bool force_update) | |
{ | |
// Force updating star count at game init. | |
if (m_star_params.count != star_count || force_update) { | |
m_star_params.count = star_count; | |
m_stars.clear(); | |
// Rebuild the stars surrounding the camera | |
for (u16 i = 0; i < star_count; i++) { | |
v3f star = v3f( | |
myrand_range(-10000, 10000), | |
myrand_range(-10000, 10000), | |
myrand_range(-10000, 10000) | |
); | |
star.normalize(); | |
m_stars.emplace_back(star); | |
} | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment