public void rebuildLine()
{
/*
if (lines.Count < 1)
return;
if (lines [0].points.Count < 2)
return;
List<Vector3> newPoints = new List<Vector3>();
newPoints.Add(lines[0].points[0].pos);
newPoints.Add(lines[0].points[1].pos);
lineRen.SetVertexCount (1);
lineRen.SetPosition (0, lines[0].points[0].pos);
lineRen.SetVertexCount (2);
lineRen.SetPosition (1, lines[0].points[1].pos);
for (int i = 2 ; i < vertCount ; i++) {
Vector3 p0 = getVertFromTotalIndex(i).pos;
Vector3 p1 = getVertFromTotalIndex(i - 1).pos;
Vector3 p2 = getVertFromTotalIndex(i - 2).pos;
Vector3 targetDir = p0 - p1;
Vector3 forward = p1 - p2;
float angle = Vector3.Angle (targetDir, forward);
if(Mathf.Abs(angle)>detailAngle)
newPoints.Add( p0 );
}
*/
int accum = 0;
for (int i = 0; i < lines.Count; i++) {
for (int j = 0; j < lines[i].points.Count; j++) {
lineRen.SetVertexCount (accum+1);
lineRen.SetPosition(accum,lines[i].points[j].pos);
++accum;
}
}
}