import Vector from '../../../math/Vector'; import Path, { PathParam } from '../Path'; /** * A {@code LinePathParam} contains the status of a {@link LinePath}. * * @author davebaol */ export declare class LinePathParam implements PathParam { segmentIndex: number; distance: number; getDistance(): number; setDistance(distance: number): void; /** Returns the index of the current segment along the path */ getSegmentIndex(): number; } /** * A {@code Segment} connects two consecutive waypoints of a {@link LinePath}. * * @param Type of vector, either 2D or 3D, implementing the {@link Vector} interface * * @author davebaol */ export declare class Segment> { begin: T; end: T; length: number; cumulativeLength: number; /** * Creates a {@code Segment} for the 2 given points. * @param begin * @param end */ constructor(begin: T, end: T); /** Returns the start point of this segment. */ getBegin(): T; /** Returns the end point of this segment. */ getEnd(): T; /** Returns the length of this segment. */ getLength(): number; /** Returns the cumulative length from the first waypoint of the {@link LinePath} this segment belongs to. */ getCumulativeLength(): number; } /** * A {@code LinePath} is a path for path following behaviors that is made up of a series of waypoints. Each waypoint is connected * to the successor with a {@link Segment}. * * @param Type of vector, either 2D or 3D, implementing the {@link Vector} interface * * @author davebaol * @author Daniel Holderbaum */ declare class LinePath> implements Path { private segments; private _isOpen; private pathLength; private nearestPointOnCurrentSegment; private nearestPointOnPath; private tmpB; private tmpC; /** * Creates a {@code LinePath} for the specified {@code waypoints}. * @param waypoints the points making up the path * @param isOpen a flag indicating whether the path is open or not * @throws IllegalArgumentException if {@code waypoints} is {@code null} or has less than two (2) waypoints. */ constructor(waypoints: Array, isOpen?: boolean); isOpen(): boolean; getLength(): number; getStartPoint(): T; getEndPoint(): T; /** * Returns the square distance of the nearest point on line segment {@code a-b}, from point {@code c}. Also, the {@code out} * vector is assigned to the nearest point. * @param out the output vector that contains the nearest point on return * @param a the start point of the line segment * @param b the end point of the line segment * @param c the point to calculate the distance from */ calculatePointSegmentSquareDistance(out: T, a: T, b: T, c: T): number; createParam(): LinePathParam; calculateDistance(agentCurrPos: T, parameter: LinePathParam): number; calculateTargetPosition(out: T, param: LinePathParam, targetDistance: number): void; /** * Sets up this {@link Path} using the given way points. * @param waypoints The way points of this path. * @throws IllegalArgumentException if {@code waypoints} is {@code null} or empty. */ createPath(waypoints: Array): void; getSegments(): Array>; } export default LinePath;