30 lines
603 B
C++
30 lines
603 B
C++
|
#pragma once
|
||
|
|
||
|
#include "icosphere.hpp"
|
||
|
#include "orbit.hpp"
|
||
|
#include "widget.hpp"
|
||
|
|
||
|
class Orbiter
|
||
|
{
|
||
|
public:
|
||
|
Orbiter(Icosphere& sphere, Orbit& orbit, GLuint unlitShaderProgram);
|
||
|
~Orbiter();
|
||
|
|
||
|
void render(const float time);
|
||
|
|
||
|
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;
|
||
|
|
||
|
const int ANIM_ORBITING = 0;
|
||
|
const int ANIM_ECCENTRICITY = 1;
|
||
|
};
|