Contents

pathWithFloat3Points:count:radius:cyclical:

Creates a path with the specified array of 3D points.

Declaration

+ (instancetype) pathWithFloat3Points:(vector_float3 *) points count:(size_t) count radius:(float) radius cyclical:(BOOL) cyclical;

Parameters

  • points:

    An array of points representing the vertices in the path. The order of points in this array determines the order in which an agent follows the path.

  • count:

    The number of elements in the pointsarray.

  • radius:

    The radius of the path.

  • cyclical:

    True if the path’s end point (the last element of the points array) should connect to its start point (the first element in the points array); otherwise False.

Return Value

A new path object.

Discussion

The radius parameter defines the space occupied by the path—think of this space as the volume created by sweeping a sphere of the specified radius along the path from vertex to vertex. Agents with path-related goals will attempt to move to or stay within this volume.

The cyclical parameter determines whether the path loops around on itself. If the path is cyclical, an agent with a follow-path goal will proceed around the path indefinitely. If the path is not cyclical, an agent following the path will stop at the last point in the path.

To use the newly created path to constrain an agent’s behavior, create a goal with the init(toStayOn:maxPredictionTime:) or init(toFollow:maxPredictionTime:forward:) method.

See Also

Creating a Path