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.
Checking the stable version of the documentation...
NavigationRegion3D
Expérimental : This class may be changed or removed in future versions.
Hérite de : Node3D < Node < Object
Une région 3D traversable que des NavigationAgent3Ds peuvent utiliser pour leur recherche de chemin.
Description
A traversable 3D region based on a NavigationMesh that NavigationAgent3Ds can use for pathfinding.
Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using NavigationServer3D.map_set_edge_connection_margin().
Note: Overlapping two regions' navigation meshes is not enough for connecting two regions. They must share a similar edge.
The cost of entering this region from another region can be controlled with the enter_cost value.
Note: This value is not added to the path cost when the start position is already inside this region.
The cost of traveling distances inside this region can be controlled with the travel_cost multiplier.
Note: This node caches changes to its properties, so if you make changes to the underlying region RID in NavigationServer3D, they will not be reflected in this node's properties.
Tutoriels
Propriétés
|
||
|
||
|
||
|
||
|
Méthodes
void |
bake_navigation_mesh(on_thread: bool = true) |
get_bounds() const |
|
get_navigation_layer_value(layer_number: int) const |
|
get_navigation_map() const |
|
get_region_rid() const |
|
get_rid() const |
|
is_baking() const |
|
void |
set_navigation_layer_value(layer_number: int, value: bool) |
void |
set_navigation_map(navigation_map: RID) |
Signaux
bake_finished() 🔗
Notifie quand l'opération de pré-calcul de maillage de navigation est terminée.
navigation_mesh_changed() 🔗
Avertit quand le NavigationMesh a changé.
Descriptions des propriétés
Détermine si la NavigationRegion3D est activée ou désactivée.
Lorsque la recherche de chemin entre dans le maillage de navigation de cette région depuis le maillage de navigation d'une autre région, la valeur enter_cost est ajoutée à la distance du chemin pour déterminer le chemin le plus court.
A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with NavigationServer3D.map_get_path().
NavigationMesh navigation_mesh 🔗
void set_navigation_mesh(value: NavigationMesh)
NavigationMesh get_navigation_mesh()
La ressource NavigationMesh à utiliser.
Lorsque la recherche de chemin se déplace dans le maillage de navigation de cette région, les distances parcourues sont multipliées par travel_cost pour déterminer le chemin le plus court.
bool use_edge_connections = true 🔗
If enabled the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
Descriptions des méthodes
void bake_navigation_mesh(on_thread: bool = true) 🔗
Bakes the NavigationMesh. If on_thread is set to true (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new NavigationMesh. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled).
Returns the axis-aligned bounding box for the region's transformed navigation mesh.
bool get_navigation_layer_value(layer_number: int) const 🔗
Renvoie si la couche spécifiée du masque de bits navigation_layers est activée, étant donné un numéro de couche layer_number entre 1 et 32.
RID get_navigation_map() const 🔗
Renvoie le RID de la carte de navigation actuelle utilisée par cette région.
Obsolète : Use get_rid() instead.
Renvoie le RID de cette région sur le NavigationServer3D.
Renvoie le RID de cette région sur le NavigationServer3D. Combiné avec NavigationServer3D.map_get_closest_point_owner(), cela peut être utilisé pour identifier la NavigationRegion3D la plus proche d'un point sur la carte de navigation fusionnée.
Renvoie true lorsque le NavigationMesh est en cours de pré-calcul sur un thread d'arrière-plan.
void set_navigation_layer_value(layer_number: int, value: bool) 🔗
Selon value, active ou désactive la couche spécifiée dans le masque de bits navigation_layers, étant donné un numéro de couche layer_number entre 1 et 32.
void set_navigation_map(navigation_map: RID) 🔗
Définit le RID de la carte de navigation que cette région devrait utiliser. Par défaut, la région se joindra automatiquement à la carte de navigation par défaut du World3D de sorte à ce que cette fonction ne soit nécessaire que pour redéfinir la carte par défaut.