Corridor()

A corridor is a sequence of portal edges representing a walkable way within a navigation mesh. The class is able to find the shortest path through this corridor as a sequence of waypoints. It's an implementation of the so called Funnel Algorithm. Read the paper Efficient Triangulation-Based Pathfinding for more detailed information.

new Corridor()

Creates a new corridor.

Author:

Members

portalEdges :Array.<Object>

The portal edges of the corridor.

Methods

generate() → {Array.<Vector3>}

Generates the shortest path through the corridor as an array of 3D vectors.

Returns:
Array.<Vector3> -

An array of 3D waypoints.

push(left, right) → {Corridor}

Adds a portal edge defined by its left and right vertex to this corridor.

Parameters:
Name Type Description
left Vector3

The left point (origin) of the portal edge.

right Vector3

The right point (destination) of the portal edge.

Returns:
Corridor -

A reference to this corridor.