August 2018
Beginner
334 pages
10h 19m
English
This is an easy, yet powerful, function:
public List<Vertex> Smooth(List<Vertex> path)
{
// next steps here
}
List<Vertex> newPath = new List<Vertex>();
if (path.Count == 0)
return newPath;
if (path.Count < 3)
return path;
newPath.Add(path[0]);
int i, j;
for (i = 0; i < path.Count - 1;)
{
for (j = i + 1; j < path.Count; j++)
{
// next steps here
}
i = j - 1;
newPath.Add(path[i]);
}
return newPath;
Vector3 origin = path[i].transform.position; Vector3 destination = path[j].transform.position; Vector3 ...
Read now
Unlock full access