sunDirection

function sunDirection
devtools/src/maneuvers.ts:107
sunDirection(world: World, system: SystemId, frame: FrameId, time: number) → Vec3

The unit vector toward the star, in the given frame, at a given instant.

The star, not the frame's parent. For a planet the two agree — its parent is the system frame, whose origin is the star — but a moon's parent is its planet: composed against that, full-face on Luna frames the earthlit side at whatever phase Earth is in, and sunset chases Earth's azimuth instead of the sun's.

The instant is a parameter because two callers disagree about it: a shot places the ship at the simulation's own time, while the observatory holds a photographic instant of its own — and the sun over a stance is a fact about the picture's time, not the clock's.

worldWorld
Undocumented
systemSystemId
Undocumented
frameFrameId
Undocumented
timenumber
Undocumented
ReturnsVec3