mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
use toGlm for color. remove some commented-out code
This commit is contained in:
parent
f647db3bf0
commit
4e679c7e3a
1 changed files with 7 additions and 19 deletions
|
@ -26,31 +26,19 @@ void RenderableLineEntityItem::render(RenderArgs* args) {
|
||||||
PerformanceTimer perfTimer("RenderableLineEntityItem::render");
|
PerformanceTimer perfTimer("RenderableLineEntityItem::render");
|
||||||
assert(getType() == EntityTypes::Line);
|
assert(getType() == EntityTypes::Line);
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position = getPosition();
|
||||||
// glm::vec3 center = getCenter();
|
|
||||||
glm::vec3 dimensions = getDimensions();
|
glm::vec3 dimensions = getDimensions();
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
|
|
||||||
glm::vec4 lineColor(getColor()[RED_INDEX] / MAX_COLOR, getColor()[GREEN_INDEX] / MAX_COLOR,
|
glm::vec4 lineColor(toGlm(getColor()), getLocalRenderAlpha());
|
||||||
getColor()[BLUE_INDEX] / MAX_COLOR, getLocalRenderAlpha());
|
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(position.x, position.y, position.z);
|
glTranslatef(position.x, position.y, position.z);
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
// glPushMatrix();
|
glm::vec3 p1 = {0.0f, 0.0f, 0.0f};
|
||||||
// glm::vec3 positionToCenter = center - position;
|
glm::vec3& p2 = dimensions;
|
||||||
// glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
DependencyManager::get<DeferredLightingEffect>()->renderLine(p1, p2, lineColor, lineColor);
|
||||||
// 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();
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
RenderableDebugableEntityItem::render(this, args);
|
RenderableDebugableEntityItem::render(this, args);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue