Body Color Pipeline Fix
Problem
Mars (and potentially other bodies) appears as a blue sphere (#6688ff) in the
cockpit 3D view when far away. Two root causes:
-
Color not propagated through physics service: The
colorfield exists inephemeris-j2000.jsonand the galaxy service proto, but the physics serviceCelestialBodymodel, Redis state, andBodyStateproto all omit it. The api-gateway therefore cannot includecolorin tick broadcasts. -
Texture lazy-load distance threshold: Textures only load when the ship is within
200 * body.radiusof the body. For distant targets (e.g., Mars at 350 Gm), the texture never loads and the fallbackdata.color || '#6688ff'is used. Sincedata.coloris undefined (cause #1), the blue fallback shows.
Fix
1. Propagate color through physics pipeline
physics.protoBodyState: Addstring color = 10physics/src/models.pyCelestialBody: Addcolor: str = ""physics/src/redis_state.py: Includecolorin_body_to_mappingandget_body/get_all_bodiesphysics/src/grpc_server.pyInitializeBodies: Readb.colorfrom proto;GetAllBodies: IncludecolorinBodyStateapi-gateway/src/websocket_manager.py: Include"color": b.colorin body dict
2. Force-load texture for targeted body
web-client/src/cockpitView.js_checkTextureLoading(): Ifstate.targetIdis a body and its texture isn’t loaded, request it regardless of distance.