Showing the changes to interface/src/ParticleTreeRenderer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -84,12 +84,11 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element, RenderArgs* arg · 83 unmodified lines | ||
| 84 | 84 | const float alpha = 1.0f; |
| 85 | 85 | |
| 86 | 86 | Model* model = getModel(particle.getModelURL()); |
| 87 | − | |
| 88 | − glm::vec3 translationAdjustment = particle.getModelTranslation(); | |
| 89 | − | |
| 87 | + glm::vec3 translationAdjustment = particle.getModelTranslation() * radius; | |
| 88 | + | |
| 90 | 89 | // set the position |
| 91 | − glm::vec3 translation(position.x, position.y, position.z); | |
| 92 | − model->setTranslation(translation + translationAdjustment); | |
| 90 | + glm::vec3 translation = position + translationAdjustment; | |
| 91 | + model->setTranslation(translation); | |
| 93 | 92 | |
| 94 | 93 | // set the rotation |
| 95 | 94 | glm::quat rotation = particle.getModelRotation(); |
| @@ -100,14 +99,20 @@ void ParticleTreeRenderer::renderElement(OctreeElement* element, RenderArgs* arg · 4 unmodified lines | ||
| 100 | 99 | const float MODEL_SCALE = 0.00575f; |
| 101 | 100 | glm::vec3 scale(1.0f,1.0f,1.0f); |
| 102 | 101 | |
| 103 | − // TODO: There is some kind of a bug in packing of the particle packets which is causing modelscale to | |
| 104 | − // sometimes be garbage. | |
| 105 | − float modelScale = 2.0f; /// particle.getModelScale() | |
| 102 | + float modelScale = particle.getModelScale(); | |
| 106 | 103 | model->setScale(scale * MODEL_SCALE * radius * modelScale); |
| 107 | 104 | |
| 108 | 105 | model->simulate(0.0f); |
| 109 | 106 | model->render(alpha); // TODO: should we allow particles to have alpha on their models? |
| 110 | 107 | |
| 108 | + const bool wantDebugSphere = false; | |
| 109 | + if (wantDebugSphere) { | |
| 110 | + glPushMatrix(); | |
| 111 | + glTranslatef(position.x, position.y, position.z); | |
| 112 | + glutWireSphere(radius, 15, 15); | |
| 113 | + glPopMatrix(); | |
| 114 | + } | |
| 115 | + | |
| 111 | 116 | glPopMatrix(); |
| 112 | 117 | } else { |
| 113 | 118 | glPushMatrix(); |