MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / coordinateSeed

Method coordinateSeed

source/game/StarSystemWorld.cpp:139–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139uint64_t SystemWorld::coordinateSeed(CelestialCoordinate const& coordinate, String const& seedMix) const {
140 auto satellite = coordinate.isSatelliteBody() ? coordinate.orbitNumber() : 0;
141 auto planet = coordinate.isSatelliteBody() ? coordinate.parent().orbitNumber() : (coordinate.isPlanetaryBody() && coordinate.orbitNumber()) || 0;
142 return staticRandomU64(coordinate.location()[0], coordinate.location()[1], coordinate.location()[2], planet, satellite, seedMix);
143}
144
145float SystemWorld::planetOrbitDistance(CelestialCoordinate const& coordinate) const {
146 RandomSource random(coordinateSeed(coordinate, "PlanetOrbitDistance"));

Callers

nothing calls this directly

Calls 6

staticRandomU64Function · 0.85
isSatelliteBodyMethod · 0.80
orbitNumberMethod · 0.80
isPlanetaryBodyMethod · 0.80
parentMethod · 0.45
locationMethod · 0.45

Tested by

no test coverage detected