From f51b1d2ac28b0087bad735fd936226f88682fc57 Mon Sep 17 00:00:00 2001 From: Eric Levin Date: Tue, 9 Jun 2015 17:30:15 -0700 Subject: [PATCH 1/2] clamping line points between 0 and TREE_SCALE --- libraries/entities/src/LineEntityItem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/LineEntityItem.cpp b/libraries/entities/src/LineEntityItem.cpp index e7e1c90b41..7a0890739e 100644 --- a/libraries/entities/src/LineEntityItem.cpp +++ b/libraries/entities/src/LineEntityItem.cpp @@ -18,6 +18,7 @@ #include "EntityTree.h" #include "EntitiesLogging.h" #include "EntityTreeElement.h" +#include "OctreeConstants.h" @@ -90,8 +91,8 @@ void LineEntityItem::setLinePoints(const QVector& points) { for (int i = 0; i < points.size(); i++) { glm::vec3 point = points.at(i); // Make sure all of our points are valid numbers. - // Must be greater than 0 because vector component is set to 0 if it is invalid data - if (point.x > 0 && point.y > 0 && point.z > 0){ + // Must be greater than 0 because vector component is set to 0 if it is invalid data. Also should never be greater than 16000 + if ( (point.x > 0 && point.x < TREE_SCALE) && (point.y > 0 && point.y < TREE_SCALE) && (point.z > 0 && point.z < TREE_SCALE) ) { sanitizedPoints << point; } else { ++invalidPoints; From 286b7bf5735814d29141baad6eb6ea2ee4edc914 Mon Sep 17 00:00:00 2001 From: Eric Levin Date: Wed, 10 Jun 2015 08:48:26 -0700 Subject: [PATCH 2/2] changed comment to use TREE_SCALE instead of 16000 --- libraries/entities/src/LineEntityItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities/src/LineEntityItem.cpp b/libraries/entities/src/LineEntityItem.cpp index 7a0890739e..094536f63a 100644 --- a/libraries/entities/src/LineEntityItem.cpp +++ b/libraries/entities/src/LineEntityItem.cpp @@ -91,7 +91,7 @@ void LineEntityItem::setLinePoints(const QVector& points) { for (int i = 0; i < points.size(); i++) { glm::vec3 point = points.at(i); // Make sure all of our points are valid numbers. - // Must be greater than 0 because vector component is set to 0 if it is invalid data. Also should never be greater than 16000 + // Must be greater than 0 because vector component is set to 0 if it is invalid data. Also should never be greater than TREE_SCALE if ( (point.x > 0 && point.x < TREE_SCALE) && (point.y > 0 && point.y < TREE_SCALE) && (point.z > 0 && point.z < TREE_SCALE) ) { sanitizedPoints << point; } else {