Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PolygonPathFinder

Hérite de : Resource < RefCounted < Object

There is currently no description for this class. Please help us by contributing one!

Méthodes

PackedVector2Array

find_path(from: Vector2, to: Vector2)

Rect2

get_bounds() const

Vector2

get_closest_point(point: Vector2) const

PackedVector2Array

get_intersections(from: Vector2, to: Vector2) const

float

get_point_penalty(idx: int) const

bool

is_point_inside(point: Vector2) const

void

set_point_penalty(idx: int, penalty: float)

void

setup(points: PackedVector2Array, connections: PackedInt32Array)


Descriptions des méthodes

PackedVector2Array find_path(from: Vector2, to: Vector2) 🔗

There is currently no description for this method. Please help us by contributing one!


Rect2 get_bounds() const 🔗

There is currently no description for this method. Please help us by contributing one!


Vector2 get_closest_point(point: Vector2) const 🔗

There is currently no description for this method. Please help us by contributing one!


PackedVector2Array get_intersections(from: Vector2, to: Vector2) const 🔗

There is currently no description for this method. Please help us by contributing one!


float get_point_penalty(idx: int) const 🔗

There is currently no description for this method. Please help us by contributing one!


bool is_point_inside(point: Vector2) const 🔗

Renvoie true si point tombe dans la zone du polygone.

var polygon_path_finder = PolygonPathFinder.new()
var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)]
var connections = [0, 1, 1, 2, 2, 0]
polygon_path_finder.setup(points, connections)
print(polygon_path_finder.is_point_inside(Vector2(0.2, 0.2))) # Prints true
print(polygon_path_finder.is_point_inside(Vector2(1.0, 1.0))) # Prints false

void set_point_penalty(idx: int, penalty: float) 🔗

There is currently no description for this method. Please help us by contributing one!


void setup(points: PackedVector2Array, connections: PackedInt32Array) 🔗

Configure PolygonPathFinder avec un tableau de points qui définissent les sommets du polygone, et un tableau d'indices qui déterminent les bords du polygone.

La longueur des connections doit être paire, renvoie une erreur si impaire.

var polygon_path_finder = PolygonPathFinder.new()
var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)]
var connections = [0, 1, 1, 2, 2, 0]
polygon_path_finder.setup(points, connections)