Merge pull request #5940 from ericrius1/polyLineFix

Made polyline painting experience smoother- no more flickering
This commit is contained in:
Ryan Huffman 2015-09-29 18:22:01 -07:00
commit b4ca03ac3f
2 changed files with 65 additions and 65 deletions

View file

@ -86,8 +86,8 @@ void RenderablePolyLineEntityItem::updateGeometry() {
int numTailStrips = 5;
int numHeadStrips = 10;
int startHeadIndex = _normals.size() - numHeadStrips;
for (int i = 0; i < _normals.size(); i++) {
int startHeadIndex = _vertices.size() / 2 - numHeadStrips;
for (int i = 0; i < _vertices.size() / 2; i++) {
uCoord = 0.26f;
vCoord = 0.0f;
//tail
@ -124,7 +124,7 @@ void RenderablePolyLineEntityItem::updateGeometry() {
void RenderablePolyLineEntityItem::render(RenderArgs* args) {
QWriteLocker lock(&_quadReadWriteLock);
if (_points.size() < 2 || _vertices.size() != _normals.size() * 2) {
if (_points.size() < 2 || _normals.size () < 2 || _vertices.size() < 2) {
return;
}

View file

@ -139,7 +139,7 @@ bool PolyLineEntityItem::setNormals(const QVector<glm::vec3>& normals) {
_vertices << v1 << v2;
}
//for last point we can just assume binormals are same since it represents last two vertices of quad
point = _points.at(_points.size() - 1);
point = _points.at(minVectorSize - 1);
v1 = point + binormal;
v2 = point - binormal;
_vertices << v1 << v2;