#pragma once #include "raylib.h" #include "Vec3.hpp" #include "Planet.hpp" // Mouse-picking helpers: ray from the 3D viewport, sphere intersection, nearest // cell to a direction, and angular distance between two unit directions. // Custom camera ray for the 3D viewport (GetScreenToWorldRay assumes the full // screen; the globe occupies only the top-left quadrant). Vec3 rayDirFromMouse(Vector3 pos, Vector3 target, float fovyDeg, float mx, float my, float vw, float vh); bool raySphere(Vec3 o, Vec3 d, double R, Vec3& hitUnit); int nearestCell(const Planet& p, const Vec3& dir); double angBetween(const Vec3& a, const Vec3& b); // Rotate v by `deg` degrees CCW about the world +Z axis (matches rlRotatef(deg,0,0,1)). // Used for the axial-tilt transform: +tilt maps model->world, -tilt world->model. Vec3 rotateZ(const Vec3& v, double deg);