diff --git a/interface/resources/images/paintStroke.png b/interface/resources/images/paintStroke.png new file mode 100644 index 0000000000..b9feb0d485 Binary files /dev/null and b/interface/resources/images/paintStroke.png differ diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index 1cb5678bc1..a5eb11f4e1 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -108,7 +108,6 @@ void RenderablePolyLineEntityItem::updateGeometry() { _verticesBuffer->append(sizeof(glm::vec2), (gpu::Byte*)&uv); vertexIndex++; - uv.y = 1.0; _verticesBuffer->append(sizeof(glm::vec3), (const gpu::Byte*)&_vertices.at(vertexIndex)); _verticesBuffer->append(sizeof(glm::vec3), (const gpu::Byte*)&_normals.at(i)); @@ -178,7 +177,6 @@ void RenderablePolyLineEntityItem::render(RenderArgs* args) { batch.setPipeline(_pipeline); batch.setResourceTexture(PAINTSTROKE_GPU_SLOT, _texture); - batch.setInputFormat(_format); batch.setInputBuffer(0, _verticesBuffer, 0, _format->getChannels().at(0)._stride); diff --git a/libraries/entities/src/PolyLineEntityItem.cpp b/libraries/entities/src/PolyLineEntityItem.cpp index e8d504091d..0c068e7789 100644 --- a/libraries/entities/src/PolyLineEntityItem.cpp +++ b/libraries/entities/src/PolyLineEntityItem.cpp @@ -53,13 +53,11 @@ EntityItemProperties PolyLineEntityItem::getProperties() const { properties._color = getXColor(); properties._colorChanged = false; - COPY_ENTITY_PROPERTY_TO_PROPERTIES(lineWidth, getLineWidth); COPY_ENTITY_PROPERTY_TO_PROPERTIES(linePoints, getLinePoints); COPY_ENTITY_PROPERTY_TO_PROPERTIES(normals, getNormals); COPY_ENTITY_PROPERTY_TO_PROPERTIES(strokeWidths, getStrokeWidths); - properties._glowLevel = getGlowLevel(); properties._glowLevelChanged = false; return properties; @@ -75,8 +73,6 @@ bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) { SET_ENTITY_PROPERTY_FROM_PROPERTIES(linePoints, setLinePoints); SET_ENTITY_PROPERTY_FROM_PROPERTIES(normals, setNormals); SET_ENTITY_PROPERTY_FROM_PROPERTIES(strokeWidths, setStrokeWidths); - - if (somethingChanged) { bool wantDebug = false; @@ -89,7 +85,6 @@ bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) { setLastEdited(properties._lastEdited); } return somethingChanged; - } bool PolyLineEntityItem::appendPoint(const glm::vec3& point) { @@ -115,7 +110,6 @@ bool PolyLineEntityItem::setStrokeWidths(const QVector& strokeWidths ) { bool PolyLineEntityItem::setNormals(const QVector& normals) { _normals = normals; if (_points.size () < 2) { -// qDebug() << "points size is less than 2!"; return false; } @@ -126,8 +120,7 @@ bool PolyLineEntityItem::setNormals(const QVector& normals) { if (_strokeWidths.size() < minVectorSize) { minVectorSize = _strokeWidths.size(); } - -// int minArraySize = glm::min(_normals.size(), _points.size()) + _vertices.clear(); glm::vec3 v1, v2, tangent, binormal, point; @@ -139,6 +132,7 @@ bool PolyLineEntityItem::setNormals(const QVector& normals) { glm::vec3 normal = normals.at(i); binormal = glm::normalize(glm::cross(tangent, normal)) * width; + //This checks to make sure binormal is not a NAN assert(binormal.x == binormal.x); v1 = point + binormal; v2 = point - binormal; @@ -174,7 +168,6 @@ bool PolyLineEntityItem::setLinePoints(const QVector& points) { return false; } - for (int i = 0; i < points.size(); i++) { glm::vec3 point = points.at(i); glm::vec3 pos = getPosition(); @@ -183,11 +176,8 @@ bool PolyLineEntityItem::setLinePoints(const QVector& points) { qDebug() << "Point is outside entity's bounding box"; return false; } - } _points = points; - //All our points are valid and at least one point has changed, now create quads from points - return true; }