#ifndef SIMULATION_H
#define SIMULATION_H

#include "canvas.h"
#include "camera.h"
#include "ring_buffer.h"
#include <atomic>
#include <memory>
#include <mutex>
#include <vector>

struct Body {
  std::string name;
  Vec3 position;
  Vec3 velocity;
  double mass;
  double radius;
};

struct SimulationState {
  std::vector<Body> bodies;
  uint64_t tick; // global simulation tick
};

extern std::atomic<bool> running;

void simulation_thread(RingBuffer<SimulationState> &buffer);
void render_thread(RingBuffer<SimulationState> &buffer, Canvas &canvas, Camera &cam);

#endif
