vibe coding an orbital mechanics simulation to try out claude code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

42 lines
1.5 KiB

#ifndef RENDERER_H
#define RENDERER_H
#include "simulation.h"
#include "raylib.h"
// Rendering state
struct RenderState {
Camera3D camera;
double distance_scale; // Scale factor for distances
double size_scale; // Scale factor for body sizes
int selected_body_index; // -1 = no selection
int previous_selected_body; // Previous selected body index
int body_list_scroll; // Scroll position for body list
int body_list_active; // Active item index in body list
bool camera_follow_body; // Whether camera follows selected body
Vector3 camera_offset; // Offset from target when following body
bool was_following_body; // Previous frame follow state
};
// Renderer initialization and cleanup
void init_renderer(int width, int height, const char* title);
void close_renderer();
// Camera setup and control
void setup_camera(RenderState* render_state);
void update_camera(RenderState* render_state, SimulationState* sim);
// Rendering functions
void render_body(CelestialBody* body, RenderState* render_state);
void render_simulation(SimulationState* sim, RenderState* render_state);
void render_info(SimulationState* sim);
// UI rendering functions
void render_body_list_ui(SimulationState* sim, RenderState* render_state);
void render_body_info_ui(SimulationState* sim, RenderState* render_state);
// Scaling functions
Vector3 scale_position(Vec3 pos, double scale);
float scale_radius(double radius, double scale);
#endif