#pragma once

#include "orbit.hpp"
#include <glm/glm.hpp>

class Widget
{
public:
    // A widget is renderer at a point on the orbit.
    // It consists of 3 orthagonally intersecting lines.

    Widget(Orbit& orbit, GLuint shaderProgram);
    void render();

    void setPosition(glm::vec3 position);
    ~Widget();
private:
    Orbit& _orbit;
    glm::vec3 _position;

    GLuint _vao;
    GLuint _vbo;
    GLuint _shaderProgram;

    void updateModelMatrix();

    float _lineLength = 0.2;
    float _vertices[3*6] =
    {
        -1, 0, 0,
         1, 0, 0,
         0, 1, 0,
         0,-1, 0,
         0, 0, 1,
         0, 0,-1
    };
};