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

Method enterOrbit

source/game/StarSystemWorld.cpp:399–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399void SystemObject::enterOrbit(CelestialCoordinate const& target, Vec2F const& targetPosition, double time) {
400 int direction = Random::randf() > 0.5 ? 1 : -1; // random direction
401 m_orbit.set(CelestialOrbit{target, direction, time, targetPosition - position()});
402 m_approach.reset();
403}
404
405Maybe<CelestialCoordinate> SystemObject::orbitTarget() const {
406 if (m_orbit.get())

Callers 2

placeInitialObjectsMethod · 0.80
spawnObjectsMethod · 0.80

Calls 3

randfFunction · 0.85
setMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected