Class SimpleSmoothModifier Extends MonoModifier

Public

Modifier which smooths the path.

This modifier can smooth a path by either moving the points closer together (Simple) or using Bezier curves (Bezier).

Attach this component to the same GameObject as a Seeker component.
This component will hook in to the Seeker's path post-processing system and will post process any paths it searches for. Take a look at the Modifier Priorities settings on the Seeker component to determine where in the process this modifier should process the path.

Several smoothing types are available, here follows a list of them and a short description of what they do, and how they work. But the best way is really to experiment with them yourself.

  • Simple Smooths the path by drawing all points close to each other. This results in paths that might cut corners if you are not careful. It will also subdivide the path to create more more points to smooth as otherwise it would still be quite rough.

  • Bezier Smooths the path using Bezier curves. This results a smooth path which will always pass through all points in the path, but make sure it doesn't turn too quickly.

  • OffsetSimple An alternative to Simple smooth which will offset the path outwards in each step to minimize the corner-cutting. But be careful, if too high values are used, it will turn into loops and look really ugly.

  • Curved Non Uniform

Note

Modifies vectorPath array

Todo

Make the smooth modifier take the world geometry into account when smoothing

Public Methods

Apply (path)

Called for each path that the Seeker calculates after the calculation has finished.

Public
CurvedNonuniform (path)
Public
SmoothBezier (path)
Public
SmoothOffsetSimple (path)
Public
SmoothSimple (path)
Public

Public Static Methods

GetPointOnCubic (a, b, tan1, tan2, t)
Public Static

Public Variables

bezierTangentLength

Length factor of the bezier curves' tangents'.

Public
factor

Roundness factor used for CurvedNonuniform.

Public
iterations

Number of times to apply smoothing.

Public
maxSegmentLength

The length of the segments in the smoothed path when using uniformLength.

Public
offset

Offset to apply in each smoothing iteration when using Offset Simple.

Public
Order
Public
smoothType

Type of smoothing to use.

Public
strength

Determines how much smoothing to apply in each smooth iteration.

Public
subdivisions

Number of times to subdivide when not using a uniform length.

Public
uniformLength

Toggle to divide all lines in equal length segments.

Public

Public Enums

SmoothType
Public

Inherited Public Members

PreProcess (path)
Public
seeker
Public

Private/Protected Members

Awake ()
Protected
OnDisable ()
Protected
OnEnable ()

Alerts the Seeker that this modifier exists.

Protected
OnUpgradeSerializedData (version, unityThread)

Handle serialization backwards compatibility.

Protected