refactor: move sphere to visualizer
This commit is contained in:
parent
284c82f7ea
commit
4d9adf2e7f
|
@ -95,7 +95,6 @@ int main()
|
||||||
// set up scene
|
// set up scene
|
||||||
Icosphere planet(0.2, 3, litProgram);
|
Icosphere planet(0.2, 3, litProgram);
|
||||||
|
|
||||||
//Orbiter orbiter(orbiterSphere, orbit, unlitProgram);
|
|
||||||
Orbiter orbiter;
|
Orbiter orbiter;
|
||||||
Orbit& orbit = orbiter.getOrbit();
|
Orbit& orbit = orbiter.getOrbit();
|
||||||
orbit.setSemiMajorAxis(.75);
|
orbit.setSemiMajorAxis(.75);
|
||||||
|
@ -104,8 +103,7 @@ int main()
|
||||||
orbit.setArgumentOfPeriapsis(2.0);
|
orbit.setArgumentOfPeriapsis(2.0);
|
||||||
orbit.setLongitudeOfAscendingNode(0.1);
|
orbit.setLongitudeOfAscendingNode(0.1);
|
||||||
|
|
||||||
Icosphere orbiterSphere(0.07, 2, litProgram);
|
OrbiterVisualizer orbiterVisualizer(orbiter, litProgram, unlitProgram);
|
||||||
OrbiterVisualizer orbiterVisualizer(orbiter, orbiterSphere, unlitProgram);
|
|
||||||
OrbitVisualizer orbitVisualizer(orbit, unlitProgram);
|
OrbitVisualizer orbitVisualizer(orbit, unlitProgram);
|
||||||
|
|
||||||
// register input
|
// register input
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "orbitervisualizer.hpp"
|
#include "orbitervisualizer.hpp"
|
||||||
|
|
||||||
OrbiterVisualizer::OrbiterVisualizer(Orbiter& orbiter, Icosphere& sphere, GLuint shaderProgram)
|
OrbiterVisualizer::OrbiterVisualizer(Orbiter& orbiter, GLuint sphereShaderProgram, GLuint widgetShaderProgram)
|
||||||
: _orbiter(orbiter), _sphere(sphere), _widget(shaderProgram)
|
: _orbiter(orbiter), _sphere({0.07, 2, sphereShaderProgram}), _widget(widgetShaderProgram)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
class OrbiterVisualizer
|
class OrbiterVisualizer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OrbiterVisualizer(Orbiter& orbiter, Icosphere& sphere, GLuint shaderProgram);
|
OrbiterVisualizer(Orbiter& orbiter, GLuint sphereShaderProgram, GLuint widgetShaderProgram);
|
||||||
~OrbiterVisualizer() = default;
|
~OrbiterVisualizer() = default;
|
||||||
|
|
||||||
void render(float time);
|
void render(float time);
|
||||||
|
@ -16,6 +16,6 @@ class OrbiterVisualizer
|
||||||
void updateModelMatrix();
|
void updateModelMatrix();
|
||||||
|
|
||||||
Orbiter& _orbiter;
|
Orbiter& _orbiter;
|
||||||
Icosphere& _sphere;
|
Icosphere _sphere;
|
||||||
Widget _widget;
|
Widget _widget;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue