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...
NavigationObstacle3D
Expérimental : This class may be changed or removed in future versions.
Hérite de : Node3D < Node < Object
Obstacle 3D utilisé pour affecter le pré-calcul d'un maillage de navigation ou limiter les vitesses des agents utilisant de l'évitement.
Description
An obstacle needs a navigation map and outline vertices defined to work correctly. The outlines can not cross or overlap and are restricted to a plane projection. This means the y-axis of the vertices is ignored, instead the obstacle's global y-axis position is used for placement. The projected shape is extruded by the obstacles height along the y-axis.
Obstacles can be included in the navigation mesh baking process when affect_navigation_mesh is enabled. They do not add walkable geometry, instead their role is to discard other source geometry inside the shape. This can be used to prevent navigation mesh from appearing in unwanted places, e.g. inside "solid" geometry or on top of it. If carve_navigation_mesh is enabled the baked shape will not be affected by offsets of the navigation mesh baking, e.g. the agent radius.
With avoidance_enabled the obstacle can constrain the avoidance velocities of avoidance using agents. If the obstacle's vertices are wound in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Obstacles using vertices and avoidance can warp to a new position but should not be moved every single frame as each change requires a rebuild of the avoidance map.
Tutoriels
Propriétés
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Méthodes
get_avoidance_layer_value(layer_number: int) const |
|
get_navigation_map() const |
|
get_rid() const |
|
void |
set_avoidance_layer_value(layer_number: int, value: bool) |
void |
set_navigation_map(navigation_map: RID) |
Descriptions des propriétés
bool affect_navigation_mesh = false 🔗
Si activé et parsé dans un pré-calcul de maillage de navigation, l'obstacle supprimera la géométrie source à l'intérieur de sa forme définie par vertices et height.
bool avoidance_enabled = true 🔗
Si true, l'obstacle affecte les agents utilisant de l'évitement.
Un bitfield déterminant les couches d'évitement pour cet obstacle. Les agents avec un bit correspondant sur leur masque d'évitement éviteront cet obstacle.
bool carve_navigation_mesh = false 🔗
If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius).
It will still be affected by further postprocessing of the baking process, like edge and polygon simplification.
Requires affect_navigation_mesh to be enabled.
Définit la hauteur de l'obstacle utilisée dans l'évitement 2D. Les agents utilisant de l'évitement 2D ignorent les obstacles qui sont en dessous ou au dessus d'eux.
Définit le rayon d'évitement pour l'obstacle.
bool use_3d_avoidance = false 🔗
If true the obstacle affects 3D avoidance using agent's with obstacle radius.
If false the obstacle affects 2D avoidance using agent's with both obstacle vertices as well as obstacle radius.
Vector3 velocity = Vector3(0, 0, 0) 🔗
Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles radius. Does nothing for the obstacles static vertices.
PackedVector3Array vertices = PackedVector3Array() 🔗
void set_vertices(value: PackedVector3Array)
PackedVector3Array get_vertices()
The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector3Array for more details.
Descriptions des méthodes
bool get_avoidance_layer_value(layer_number: int) const 🔗
Renvoie si la couche spécifiée du masque de bits avoidance_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 pour ce nœud NavigationObstacle. Cette fonction renvoie toujours la carte définie sur le nœud NavigationObstacle et non la carte de l'obstacle abstrait sur le NavigationServer. Si la carte de l'obstacle est changée directement avec l'API de NavigationServer, le nœud NavigationObstacle ne sera pas au courant du changement de carte. Utilisez set_navigation_map() pour changer la carte de navigation pour le NavigationObstacle et mettre aussi à jour l'obstacle sur le NavigationServer.
Renvoie le RID de cet obstacle sur le NavigationServer3D.
void set_avoidance_layer_value(layer_number: int, value: bool) 🔗
Selon value, active ou désactive la couche spécifiée dans le masque de bits avoidance_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 ce nœud NavigationObstacle devrait utiliser et met à jour l'agent sur le NavigationServer.