skein/src/orbiter.hpp

38 lines
749 B
C++
Raw Normal View History

#pragma once
2024-03-04 07:57:42 +00:00
#include "gfx.hpp"
#include "icosphere.hpp"
#include "widget.hpp"
2024-03-04 07:57:42 +00:00
#include <GLFW/glfw3.h>
2024-08-17 21:51:42 +01:00
#include <skein/orbit.h>
2024-03-04 07:57:42 +00:00
class Orbiter
{
public:
2024-03-04 07:57:42 +00:00
Orbiter(Icosphere& sphere, Orbit& orbit, GLuint shaderProgram);
~Orbiter();
void render(const float time);
2024-03-04 07:57:42 +00:00
void cycleAnimation();
private:
void updateModelMatrix();
float getMeanAnomaly();
glm::vec3 getPosition(const float time);
void getOrbitalElements(const float time, Vector6& keplerianElements);
Icosphere& _sphere;
Orbit& _orbit;
Widget _widget;
const float ORBITAL_PERIOD = 6.284;
2024-03-04 07:57:42 +00:00
// TODO: convert these to an enum
const int ANIM_ORBITING = 0;
const int ANIM_ECCENTRICITY = 1;
2024-03-04 07:57:42 +00:00
int _animation = ANIM_ORBITING;
};