Fix orientation of non-solid rectangle3d overlays, too

This commit is contained in:
David Rowe 2015-02-03 15:52:20 -08:00
parent 7f7cba8a1b
commit 8297bbd5e7

View file

@ -76,10 +76,10 @@ void Rectangle3DOverlay::render(RenderArgs* args) {
} else { } else {
if (getIsDashedLine()) { if (getIsDashedLine()) {
glm::vec3 point1(-halfDimensions.x, 0.0f, -halfDimensions.y); glm::vec3 point1(-halfDimensions.x, -halfDimensions.y, 0.0f);
glm::vec3 point2(halfDimensions.x, 0.0f, -halfDimensions.y); glm::vec3 point2(halfDimensions.x, -halfDimensions.y, 0.0f);
glm::vec3 point3(halfDimensions.x, 0.0f, halfDimensions.y); glm::vec3 point3(halfDimensions.x, halfDimensions.y, 0.0f);
glm::vec3 point4(-halfDimensions.x, 0.0f, halfDimensions.y); glm::vec3 point4(-halfDimensions.x, halfDimensions.y, 0.0f);
geometryCache->renderDashedLine(point1, point2, rectangleColor); geometryCache->renderDashedLine(point1, point2, rectangleColor);
geometryCache->renderDashedLine(point2, point3, rectangleColor); geometryCache->renderDashedLine(point2, point3, rectangleColor);
@ -90,11 +90,11 @@ void Rectangle3DOverlay::render(RenderArgs* args) {
if (halfDimensions != _previousHalfDimensions) { if (halfDimensions != _previousHalfDimensions) {
QVector<glm::vec3> border; QVector<glm::vec3> border;
border << glm::vec3(-halfDimensions.x, 0.0f, -halfDimensions.y); border << glm::vec3(-halfDimensions.x, -halfDimensions.y, 0.0f);
border << glm::vec3(halfDimensions.x, 0.0f, -halfDimensions.y); border << glm::vec3(halfDimensions.x, -halfDimensions.y, 0.0f);
border << glm::vec3(halfDimensions.x, 0.0f, halfDimensions.y); border << glm::vec3(halfDimensions.x, halfDimensions.y, 0.0f);
border << glm::vec3(-halfDimensions.x, 0.0f, halfDimensions.y); border << glm::vec3(-halfDimensions.x, halfDimensions.y, 0.0f);
border << glm::vec3(-halfDimensions.x, 0.0f, -halfDimensions.y); border << glm::vec3(-halfDimensions.x, -halfDimensions.y, 0.0f);
geometryCache->updateVertices(_geometryCacheID, border, rectangleColor); geometryCache->updateVertices(_geometryCacheID, border, rectangleColor);
_previousHalfDimensions = halfDimensions; _previousHalfDimensions = halfDimensions;