use toGlm for color. remove some commented-out code

This commit is contained in:
Seth Alves 2015-05-12 15:08:26 -07:00
parent f647db3bf0
commit 4e679c7e3a

View file

@ -26,31 +26,19 @@ void RenderableLineEntityItem::render(RenderArgs* args) {
PerformanceTimer perfTimer("RenderableLineEntityItem::render");
assert(getType() == EntityTypes::Line);
glm::vec3 position = getPosition();
// glm::vec3 center = getCenter();
glm::vec3 dimensions = getDimensions();
glm::quat rotation = getRotation();
const float MAX_COLOR = 255.0f;
glm::vec4 lineColor(getColor()[RED_INDEX] / MAX_COLOR, getColor()[GREEN_INDEX] / MAX_COLOR,
getColor()[BLUE_INDEX] / MAX_COLOR, getLocalRenderAlpha());
glm::vec4 lineColor(toGlm(getColor()), getLocalRenderAlpha());
glPushMatrix();
glTranslatef(position.x, position.y, position.z);
glm::vec3 axis = glm::axis(rotation);
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
// glPushMatrix();
// glm::vec3 positionToCenter = center - position;
// glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
// glScalef(dimensions.x, dimensions.y, dimensions.z);
glm::vec3 p1 = {0.0f, 0.0f, 0.0f};
glm::vec3& p2 = dimensions;
DependencyManager::get<DeferredLightingEffect>()->renderLine(p1, p2, lineColor, lineColor);
// glPopMatrix();
glTranslatef(position.x, position.y, position.z);
glm::vec3 axis = glm::axis(rotation);
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
glm::vec3 p1 = {0.0f, 0.0f, 0.0f};
glm::vec3& p2 = dimensions;
DependencyManager::get<DeferredLightingEffect>()->renderLine(p1, p2, lineColor, lineColor);
glPopMatrix();
RenderableDebugableEntityItem::render(this, args);
};