AStar2D.addPoint

Adds a new point at the given position with the given identifier. The id must be 0 or larger, and the weight_scale must be 1 or larger. The weight_scale is multiplied by the result of _computeCost when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower weight_scales to form a path.

More...
struct AStar2D
@nogc nothrow
void
addPoint
(
in long id
,
in Vector2 position
,
in double weight_scale = 1
)

Detailed Description

var astar = AStar2D.new() astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1

If there already exists a point for the given id, its position and weight scale are updated to the given values.

Meta