import type { GalaxySystem, Vec3 } from "./types";

export const BACKEND_GALAXY_CENTER = { x: 390, y: 290 };
export const GALAXY_MAP_SCALE = 0.48;

export function systemToGalaxyWorld(system: GalaxySystem): Vec3 {
  if (system.mapProjection === "world3d") return [system.x, system.y, system.z];

  return [
    (system.x - BACKEND_GALAXY_CENTER.x) * GALAXY_MAP_SCALE,
    system.z,
    (system.y - BACKEND_GALAXY_CENTER.y) * GALAXY_MAP_SCALE,
  ];
}
