Showing the changes to interface/src/ParticleTreeRenderer.cpp (1 of 17 files). Show all
Unified · Split
| @@ -0,0 +1,37 @@ | |||
| 1 | // | ||
| 2 | // ParticleTreeRenderer.cpp | ||
| 3 | // hifi | ||
| 4 | // | ||
| 5 | // Created by Brad Hefta-Gaub on 12/6/13. | ||
| 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. | ||
| 7 | // | ||
| 8 | // | ||
| 9 | |||
| 10 | #include "InterfaceConfig.h" | ||
| 11 | |||
| 12 | #include "ParticleTreeRenderer.h" | ||
| 13 | |||
| 14 | ParticleTreeRenderer::ParticleTreeRenderer() : | ||
| 15 | OctreeRenderer() { | ||
| 16 | } | ||
| 17 | |||
| 18 | ParticleTreeRenderer::~ParticleTreeRenderer() { | ||
| 19 | } | ||
| 20 | |||
| 21 | void ParticleTreeRenderer::renderElement(OctreeElement* element) { | ||
| 22 | // actually render it here... | ||
| 23 | // we need to iterate the actual particles of the element | ||
| 24 | ParticleTreeElement* particleTreeElement = (ParticleTreeElement*)element; | ||
| 25 | |||
| 26 | const std::vector<Particle>& particles = particleTreeElement->getParticles(); | ||
| 27 | |||
| 28 | uint16_t numberOfParticles = particles.size(); | ||
| 29 | |||
| 30 | glBegin(GL_POINTS); | ||
| 31 | for (uint16_t i = 0; i < numberOfParticles; i++) { | ||
| 32 | const Particle& particle = particles[i]; | ||
| 33 | // render particle aspoints | ||
| 34 | glVertex3f(particle.getPosition().x, particle.getPosition().y, particle.getPosition().z); | ||
| 35 | } | ||
| 36 | glEnd(); | ||
| 37 | } | ||