mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +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");
|
||||
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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue