AStarAddPoint Method |
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(Int32, Int32) 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.
var astar = AStar.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 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.
Namespace: Godot
public void AddPoint( int id, Vector3 position, float weightScale = 1f )
[Missing <param name="id"/> documentation for "M:Godot.AStar.AddPoint(System.Int32,Godot.Vector3,System.Single)"]
[Missing <param name="position"/> documentation for "M:Godot.AStar.AddPoint(System.Int32,Godot.Vector3,System.Single)"]
[Missing <param name="weightScale"/> documentation for "M:Godot.AStar.AddPoint(System.Int32,Godot.Vector3,System.Single)"]