fix: copy particle id on construction

This commit is contained in:
Cat Flynn 2024-08-20 20:21:44 +01:00
parent 56aa50251b
commit 11d5330c73
2 changed files with 4 additions and 5 deletions

View File

@ -106,12 +106,11 @@ int main()
// TODO: add something in a nice eccentric orbit around the moon
// make the earth-moon system
ParticleMap map;
map.setParticle({"moon", 7.3e22});
map.setParticle({"earth", 5.9e24});
map.setRelationship("moon", "earth", orbit);
// TODO: there is a bug where re-ordering the visualizers breaks rendering
ParticleVisualizer moonVis(map, "moon", 0.1, litProgram, unlitProgram);
map.setParticle({"moon", 7.3e22});
map.setRelationship("earth", "moon", orbit);
ParticleVisualizer earthVis(map, "earth", 0.2, litProgram, unlitProgram);
ParticleVisualizer moonVis(map, "moon", 0.1, litProgram, unlitProgram);
OrbitVisualizer orbitVis(orbit, unlitProgram);
// register input

View File

@ -17,7 +17,7 @@ class ParticleVisualizer
void updateModelMatrix();
const ParticleMap& _map;
const std::string& _particleId;
const std::string _particleId;
Icosphere _sphere;
Widget _widget;
};