Table of Contents

Method GetInsertIndex

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

GetInsertIndex(List<Vector3>, Vector3)

Finds the insertion index that best preserves the current polygon order for a new anchor.

public static int GetInsertIndex(List<Vector3> anchors, Vector3 newAnchor)

Parameters

anchors List<Vector3>

Existing ordered anchor loop.

newAnchor Vector3

Anchor to insert.

Returns

int

The index before which the new anchor should be inserted, or -1 when there are not enough anchors to define a segment.

Remarks

The method compares the new point against the midpoint of every polygon edge, including the closing edge from the last anchor back to the first.