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