Showing the changes to interface/src/ParticleTreeRenderer.cpp (1 of 2 files). Show all
Unified · Split
| @@ -72,7 +72,7 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element, RenderArgs* arg · 71 unmodified lines | ||
| 72 | 72 | // render particle aspoints |
| 73 | 73 | glm::vec3 position = particle.getPosition() * (float)TREE_SCALE; |
| 74 | 74 | glColor3ub(particle.getColor()[RED_INDEX],particle.getColor()[GREEN_INDEX],particle.getColor()[BLUE_INDEX]); |
| 75 | − float sphereRadius = particle.getRadius() * (float)TREE_SCALE; | |
| 75 | + float radius = particle.getRadius() * (float)TREE_SCALE; | |
| 76 | 76 | |
| 77 | 77 | bool drawAsModel = particle.hasModel(); |
| 78 | 78 | |
| @@ -90,24 +90,24 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element, RenderArgs* arg · 11 unmodified lines | ||
| 90 | 90 | glm::vec3 translation(position.x, position.y, position.z); |
| 91 | 91 | model->setTranslation(translation + translationAdjustment); |
| 92 | 92 | |
| 93 | − // glm::angleAxis(-90.0f, 1.0f, 0.0f, 0.0f) | |
| 94 | 93 | // set the rotation |
| 95 | 94 | glm::quat rotation = particle.getModelRotation(); |
| 96 | 95 | model->setRotation(rotation); |
| 97 | 96 | |
| 98 | 97 | // scale |
| 99 | − const float MODEL_SCALE = 0.0006f; // need to figure out correct scale adjust | |
| 98 | + // TODO: need to figure out correct scale adjust, this was arbitrarily set to make a couple models work | |
| 99 | + const float MODEL_SCALE = 0.00575f; | |
| 100 | 100 | glm::vec3 scale(1.0f,1.0f,1.0f); |
| 101 | − model->setScale(scale * MODEL_SCALE); | |
| 101 | + model->setScale(scale * MODEL_SCALE * radius * particle.getModelScale()); | |
| 102 | 102 | |
| 103 | 103 | model->simulate(0.0f); |
| 104 | − model->render(alpha); | |
| 105 | − //qDebug() << "called _testModel->render(alpha);"; | |
| 104 | + model->render(alpha); // TODO: should we allow particles to have alpha on their models? | |
| 105 | + | |
| 106 | 106 | glPopMatrix(); |
| 107 | 107 | } else { |
| 108 | 108 | glPushMatrix(); |
| 109 | 109 | glTranslatef(position.x, position.y, position.z); |
| 110 | − glutSolidSphere(sphereRadius, 15, 15); | |
| 110 | + glutSolidSphere(radius, 15, 15); | |
| 111 | 111 | glPopMatrix(); |
| 112 | 112 | } |
| 113 | 113 | } |