#include "particlevisualizer.hpp" ParticleVisualizer::ParticleVisualizer(const ParticleMap& map, const std::string& particleId, float radius, GLuint sphereShaderProgram, GLuint widgetShaderProgram) : _map(map), _particleId(particleId), _sphere({radius, 2, sphereShaderProgram}), _widget(widgetShaderProgram) { } void ParticleVisualizer::render(float time) { // TODO: get mean anomly from particle which has the mass!! const float meanAnomaly = time; glm::vec3 pos = _map.getParticlePosition(_particleId, meanAnomaly); float y = pos.z; pos.z = pos.y; pos.y = y; pos.z *= -1; // TODO: extract widget to its own visualizer since we know it wants an orbit but we // might not have one here //// render widget //const Orbit& orbit = _map.getOrbit(_particleId); //glm::mat4 widgetMatrix = orbit.getLookAlongMatrix(time); //_widget.setModelMatrix(widgetMatrix); //_widget.render(time); // render sphere _sphere.setPosition(pos); _sphere.render(time); }