private void calculateLineVertices()
{
int waypointIndex = -1;
int currentRenderIndex = 0;
lineRenderer.SetVertexCount((int)waypoints.Count / SamplingFactor);
//mapLineRenderer.SetVertexCount((int)waypoints.Count / SamplingFactor);
foreach (Waypoint waypoint in waypoints)
{
waypointIndex++;
if (waypointIndex % SamplingFactor > 0)
continue;
//Debug.Log("adding waypoint#" + waypoint + " to renderer at index = " + currentRenderIndex);
//Transform LAT/LON/ALT to unity coordinates
Vector3 unityPos = this.referenceBody.GetWorldSurfacePosition(waypoint.latitude, waypoint.longitude, waypoint.altitude);
lineRenderer.SetPosition(currentRenderIndex, unityPos);
//mapLineRenderer.SetPosition(currentRenderIndex, ScaledSpace.LocalToScaledSpace(unityPos));
currentRenderIndex++;
//this.renderCoords.Add(unityPos);
}
}