Removes unnecessary spline nodes, trying to preserve the spline shape as much as possible.
This generator could be used to speed up all connected spline nodes.
Some generators subdivide the spline segments, and thus require long segments instead of a serie of the short ones. For example, Pathfinding inds a path between spline nodes, and will work only if the distance between nodes is more than a pathfinding cell. In this cases ioptimized spline can help to get better result.
Optimize generator works in two stage: first it splits the curved segement in a serie of straight short segemnts, and then removes the spline nodes that the nodes that afect the spline shapes as little as possible, up to reaching the deviation value.
Properties
-
Split: the number of straight segments the long curved segment is subdivided. When the value is 1, it will not subdivide the line, and this will only remove already existing nodes. No nodes in new positions will be added, and no nodes will be "moved" to preserve the spline shape in this case.
-
Deviation: the amount o the optimization. When the spline is split, Optimize node evaluates the distance of each node from the line, connecting neighbour nodes. Deviation value - is the minimum distance ratio allowed. If the ratio is lower than the value - the node is removed.