replace GL_LINES with a call to renderWireBox for node bounds

This commit is contained in:
ZappoMan 2015-01-05 13:58:58 -08:00
parent 125dc5010e
commit bd38df2a15

View file

@ -12,6 +12,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#include <DependencyManager.h>
#include <GeometryCache.h> #include <GeometryCache.h>
#include "Application.h" #include "Application.h"
@ -155,52 +156,11 @@ void NodeBounds::draw() {
void NodeBounds::drawNodeBorder(const glm::vec3& center, float scale, float red, float green, float blue) { void NodeBounds::drawNodeBorder(const glm::vec3& center, float scale, float red, float green, float blue) {
glPushMatrix(); glPushMatrix();
glTranslatef(center.x, center.y, center.z); glTranslatef(center.x, center.y, center.z);
glScalef(scale, scale, scale); glScalef(scale, scale, scale);
glLineWidth(2.5); glLineWidth(2.5);
glColor3f(red, green, blue); glColor3f(red, green, blue);
glBegin(GL_LINES); DependencyManager::get<GeometryCache>()->renderWireCube(1.0f);
glVertex3f(-0.5, -0.5, -0.5);
glVertex3f( 0.5, -0.5, -0.5);
glVertex3f(-0.5, -0.5, -0.5);
glVertex3f(-0.5, 0.5, -0.5);
glVertex3f(-0.5, -0.5, -0.5);
glVertex3f(-0.5, -0.5, 0.5);
glVertex3f(-0.5, 0.5, -0.5);
glVertex3f( 0.5, 0.5, -0.5);
glVertex3f(-0.5, 0.5, -0.5);
glVertex3f(-0.5, 0.5, 0.5);
glVertex3f( 0.5, 0.5, 0.5);
glVertex3f(-0.5, 0.5, 0.5);
glVertex3f( 0.5, 0.5, 0.5);
glVertex3f( 0.5, -0.5, 0.5);
glVertex3f( 0.5, 0.5, 0.5);
glVertex3f( 0.5, 0.5, -0.5);
glVertex3f( 0.5, -0.5, 0.5);
glVertex3f(-0.5, -0.5, 0.5);
glVertex3f( 0.5, -0.5, 0.5);
glVertex3f( 0.5, -0.5, -0.5);
glVertex3f( 0.5, 0.5, -0.5);
glVertex3f( 0.5, -0.5, -0.5);
glVertex3f(-0.5, 0.5, 0.5);
glVertex3f(-0.5, -0.5, 0.5);
glEnd();
glPopMatrix(); glPopMatrix();
} }