:github_url: hide .. _class_NavigationServer3D: NavigationServer3D ================== **實驗性:** This class may be changed or removed in future versions. **繼承:** :ref:`Object` 用於存取低階 3D 導覽的伺服器介面。 .. rst-class:: classref-introduction-group 說明 ---- NavigationServer3D is the server that handles navigation maps, regions and agents. It does not handle A\* navigation from :ref:`AStar3D`. Maps are divided into regions, which are composed of navigation meshes. Together, they define the navigable areas in the 3D world. \ **Note:** Most **NavigationServer3D** changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation-related nodes in the scene tree or made through scripts. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than ``edge_connection_margin`` to the respective other edge's vertex. You may assign navigation layers to regions with :ref:`region_set_navigation_layers()`, which then can be checked upon when requesting a path with :ref:`map_get_path()`. This can be used to allow or deny certain areas for some objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. \ **Note:** The collision avoidance system ignores regions. Using the modified velocity directly may move an agent outside of the traversable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. .. rst-class:: classref-introduction-group 教學 ---- - :doc:`使用 NavigationServer <../tutorials/navigation/navigation_using_navigationservers>` - `3D Navigation Demo `__ .. rst-class:: classref-reftable-group 方法 ---- .. table:: :widths: auto +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_avoidance_enabled`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`agent_get_avoidance_layers`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`agent_get_avoidance_mask`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_avoidance_priority`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_height`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_get_map`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`agent_get_max_neighbors`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_max_speed`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_neighbor_distance`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_paused`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`agent_get_position`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_radius`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_time_horizon_agents`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`agent_get_time_horizon_obstacles`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_use_3d_avoidance`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`agent_get_velocity`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_has_avoidance_callback`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed`\ (\ agent\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_avoidance_callback`\ (\ agent\: :ref:`RID`, callback\: :ref:`Callable`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_avoidance_enabled`\ (\ agent\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_avoidance_layers`\ (\ agent\: :ref:`RID`, layers\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_avoidance_mask`\ (\ agent\: :ref:`RID`, mask\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_avoidance_priority`\ (\ agent\: :ref:`RID`, priority\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_height`\ (\ agent\: :ref:`RID`, height\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_map`\ (\ agent\: :ref:`RID`, map\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_max_neighbors`\ (\ agent\: :ref:`RID`, count\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_max_speed`\ (\ agent\: :ref:`RID`, max_speed\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_neighbor_distance`\ (\ agent\: :ref:`RID`, distance\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_paused`\ (\ agent\: :ref:`RID`, paused\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_position`\ (\ agent\: :ref:`RID`, position\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_radius`\ (\ agent\: :ref:`RID`, radius\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_time_horizon_agents`\ (\ agent\: :ref:`RID`, time_horizon\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_time_horizon_obstacles`\ (\ agent\: :ref:`RID`, time_horizon\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_use_3d_avoidance`\ (\ agent\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_velocity`\ (\ agent\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`agent_set_velocity_forced`\ (\ agent\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`bake_from_source_geometry_data`\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, callback\: :ref:`Callable` = Callable()\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`bake_from_source_geometry_data_async`\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, callback\: :ref:`Callable` = Callable()\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`free_rid`\ (\ rid\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_debug_enabled`\ (\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`get_maps`\ (\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_process_info`\ (\ process_info\: :ref:`ProcessInfo`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_baking_navigation_mesh`\ (\ navigation_mesh\: :ref:`NavigationMesh`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`link_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`link_get_enabled`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`link_get_end_position`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`link_get_enter_cost`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`link_get_iteration_id`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`link_get_map`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`link_get_navigation_layers`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`link_get_owner_id`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`link_get_start_position`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`link_get_travel_cost`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`link_is_bidirectional`\ (\ link\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_bidirectional`\ (\ link\: :ref:`RID`, bidirectional\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_enabled`\ (\ link\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_end_position`\ (\ link\: :ref:`RID`, position\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_enter_cost`\ (\ link\: :ref:`RID`, enter_cost\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_map`\ (\ link\: :ref:`RID`, map\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_navigation_layers`\ (\ link\: :ref:`RID`, navigation_layers\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_owner_id`\ (\ link\: :ref:`RID`, owner_id\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_start_position`\ (\ link\: :ref:`RID`, position\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`link_set_travel_cost`\ (\ link\: :ref:`RID`, travel_cost\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`map_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_force_update`\ (\ map\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_agents`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_cell_height`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_cell_size`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_closest_point`\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_closest_point_normal`\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`map_get_closest_point_owner`\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_closest_point_to_segment`\ (\ map\: :ref:`RID`, start\: :ref:`Vector3`, end\: :ref:`Vector3`, use_collision\: :ref:`bool` = false\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_edge_connection_margin`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`map_get_iteration_id`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_link_connection_radius`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_links`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`map_get_merge_rasterizer_cell_scale`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_obstacles`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector3Array` | :ref:`map_get_path`\ (\ map\: :ref:`RID`, origin\: :ref:`Vector3`, destination\: :ref:`Vector3`, optimize\: :ref:`bool`, navigation_layers\: :ref:`int` = 1\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_random_point`\ (\ map\: :ref:`RID`, navigation_layers\: :ref:`int`, uniformly\: :ref:`bool`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_regions`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_up`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_async_iterations`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_active`\ (\ map\: :ref:`RID`, active\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_cell_height`\ (\ map\: :ref:`RID`, cell_height\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_cell_size`\ (\ map\: :ref:`RID`, cell_size\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_edge_connection_margin`\ (\ map\: :ref:`RID`, margin\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_link_connection_radius`\ (\ map\: :ref:`RID`, radius\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_merge_rasterizer_cell_scale`\ (\ map\: :ref:`RID`, scale\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_up`\ (\ map\: :ref:`RID`, up\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_async_iterations`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_edge_connections`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_avoidance_enabled`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`obstacle_get_avoidance_layers`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`obstacle_get_height`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_get_map`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_paused`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`obstacle_get_position`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`obstacle_get_radius`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_use_3d_avoidance`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`obstacle_get_velocity`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector3Array` | :ref:`obstacle_get_vertices`\ (\ obstacle\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_avoidance_enabled`\ (\ obstacle\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_avoidance_layers`\ (\ obstacle\: :ref:`RID`, layers\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_height`\ (\ obstacle\: :ref:`RID`, height\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_map`\ (\ obstacle\: :ref:`RID`, map\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_paused`\ (\ obstacle\: :ref:`RID`, paused\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_position`\ (\ obstacle\: :ref:`RID`, position\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_radius`\ (\ obstacle\: :ref:`RID`, radius\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_use_3d_avoidance`\ (\ obstacle\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_velocity`\ (\ obstacle\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`obstacle_set_vertices`\ (\ obstacle\: :ref:`RID`, vertices\: :ref:`PackedVector3Array`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`parse_source_geometry_data`\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, root_node\: :ref:`Node`, callback\: :ref:`Callable` = Callable()\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`query_path`\ (\ parameters\: :ref:`NavigationPathQueryParameters3D`, result\: :ref:`NavigationPathQueryResult3D`, callback\: :ref:`Callable` = Callable()\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_bake_navigation_mesh`\ (\ navigation_mesh\: :ref:`NavigationMesh`, root_node\: :ref:`Node`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`region_get_bounds`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_closest_point`\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_closest_point_normal`\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_closest_point_to_segment`\ (\ region\: :ref:`RID`, start\: :ref:`Vector3`, end\: :ref:`Vector3`, use_collision\: :ref:`bool` = false\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_connection_pathway_end`\ (\ region\: :ref:`RID`, connection\: :ref:`int`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_connection_pathway_start`\ (\ region\: :ref:`RID`, connection\: :ref:`int`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_connections_count`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_get_enabled`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_enter_cost`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_iteration_id`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`region_get_map`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_navigation_layers`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_owner_id`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`region_get_random_point`\ (\ region\: :ref:`RID`, navigation_layers\: :ref:`int`, uniformly\: :ref:`bool`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform3D` | :ref:`region_get_transform`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_travel_cost`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_get_use_async_iterations`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_get_use_edge_connections`\ (\ region\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_owns_point`\ (\ region\: :ref:`RID`, point\: :ref:`Vector3`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_enabled`\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_enter_cost`\ (\ region\: :ref:`RID`, enter_cost\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_map`\ (\ region\: :ref:`RID`, map\: :ref:`RID`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_navigation_layers`\ (\ region\: :ref:`RID`, navigation_layers\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_navigation_mesh`\ (\ region\: :ref:`RID`, navigation_mesh\: :ref:`NavigationMesh`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_owner_id`\ (\ region\: :ref:`RID`, owner_id\: :ref:`int`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_transform`\ (\ region\: :ref:`RID`, transform\: :ref:`Transform3D`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_travel_cost`\ (\ region\: :ref:`RID`, travel_cost\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_use_async_iterations`\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`region_set_use_edge_connections`\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_active`\ (\ active\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_debug_enabled`\ (\ enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector3Array` | :ref:`simplify_path`\ (\ path\: :ref:`PackedVector3Array`, epsilon\: :ref:`float`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`source_geometry_parser_create`\ (\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`source_geometry_parser_set_callback`\ (\ parser\: :ref:`RID`, callback\: :ref:`Callable`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 訊號 ---- .. _class_NavigationServer3D_signal_avoidance_debug_changed: .. rst-class:: classref-signal **avoidance_debug_changed**\ (\ ) :ref:`🔗` 當避障除錯設定更改時發出。僅在除錯版本中可用。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_signal_map_changed: .. rst-class:: classref-signal **map_changed**\ (\ map\: :ref:`RID`\ ) :ref:`🔗` 當導覽地圖更新時、地區移動或被修改時發出。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_signal_navigation_debug_changed: .. rst-class:: classref-signal **navigation_debug_changed**\ (\ ) :ref:`🔗` 當導覽除錯設定更改時發出。僅在除錯版本中可用。 .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 列舉 ---- .. _enum_NavigationServer3D_ProcessInfo: .. rst-class:: classref-enumeration enum **ProcessInfo**: :ref:`🔗` .. _class_NavigationServer3D_constant_INFO_ACTIVE_MAPS: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_ACTIVE_MAPS** = ``0`` 常數,用於獲取活動導覽地圖的數量。 .. _class_NavigationServer3D_constant_INFO_REGION_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_REGION_COUNT** = ``1`` 常數,用於獲取活動導覽地區的數量。 .. _class_NavigationServer3D_constant_INFO_AGENT_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_AGENT_COUNT** = ``2`` 常數,用於獲取正在進行避障的活動導覽代理的數量。 .. _class_NavigationServer3D_constant_INFO_LINK_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_LINK_COUNT** = ``3`` 常數,用於獲取活動導覽連結的數量。 .. _class_NavigationServer3D_constant_INFO_POLYGON_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_POLYGON_COUNT** = ``4`` 常數,用於獲取導覽網格多邊形的數量。 .. _class_NavigationServer3D_constant_INFO_EDGE_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_EDGE_COUNT** = ``5`` 常數,用於獲取導覽網格多邊形的邊的數量。 .. _class_NavigationServer3D_constant_INFO_EDGE_MERGE_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_EDGE_MERGE_COUNT** = ``6`` 常數,用於獲取由於邊鍵重疊而被合併的導覽網格多邊形的邊的數量。 .. _class_NavigationServer3D_constant_INFO_EDGE_CONNECTION_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_EDGE_CONNECTION_COUNT** = ``7`` 常數,用以獲取被認為由於邊接近而連接的導覽網格多邊形的邊的數量。 .. _class_NavigationServer3D_constant_INFO_EDGE_FREE_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_EDGE_FREE_COUNT** = ``8`` 常數,用於獲取無法合併但仍可通過邊接近或連結連接的導覽網格多邊形的邊的數量。 .. _class_NavigationServer3D_constant_INFO_OBSTACLE_COUNT: .. rst-class:: classref-enumeration-constant :ref:`ProcessInfo` **INFO_OBSTACLE_COUNT** = ``9`` Constant to get the number of active navigation obstacles. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 方法說明 -------- .. _class_NavigationServer3D_method_agent_create: .. rst-class:: classref-method :ref:`RID` **agent_create**\ (\ ) :ref:`🔗` 建立代理。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_avoidance_enabled: .. rst-class:: classref-method :ref:`bool` **agent_get_avoidance_enabled**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` 如果指定代理 ``agent`` 啟用了避障,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_avoidance_layers: .. rst-class:: classref-method :ref:`int` **agent_get_avoidance_layers**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``avoidance_layers`` bitmask of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_avoidance_mask: .. rst-class:: classref-method :ref:`int` **agent_get_avoidance_mask**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``avoidance_mask`` bitmask of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_avoidance_priority: .. rst-class:: classref-method :ref:`float` **agent_get_avoidance_priority**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``avoidance_priority`` of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_height: .. rst-class:: classref-method :ref:`float` **agent_get_height**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``height`` of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_map: .. rst-class:: classref-method :ref:`RID` **agent_get_map**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` 返回請求 ``agent`` 目前分配到的導覽地圖 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_max_neighbors: .. rst-class:: classref-method :ref:`int` **agent_get_max_neighbors**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the maximum number of other agents the specified ``agent`` takes into account in the navigation. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_max_speed: .. rst-class:: classref-method :ref:`float` **agent_get_max_speed**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the maximum speed of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_neighbor_distance: .. rst-class:: classref-method :ref:`float` **agent_get_neighbor_distance**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the maximum distance to other agents the specified ``agent`` takes into account in the navigation. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_paused: .. rst-class:: classref-method :ref:`bool` **agent_get_paused**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` 如果指定的 ``agent`` 處於暫停狀態,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_position: .. rst-class:: classref-method :ref:`Vector3` **agent_get_position**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the position of the specified ``agent`` in world space. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_radius: .. rst-class:: classref-method :ref:`float` **agent_get_radius**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the radius of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_time_horizon_agents: .. rst-class:: classref-method :ref:`float` **agent_get_time_horizon_agents**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to other agents. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_time_horizon_obstacles: .. rst-class:: classref-method :ref:`float` **agent_get_time_horizon_obstacles**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to static avoidance obstacles. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_use_3d_avoidance: .. rst-class:: classref-method :ref:`bool` **agent_get_use_3d_avoidance**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` 如果指定代理 ``agent`` 使用 3D 空間 Vector3(x,y,z) 的避障而不是水平 2D Vector2(x,y) / Vector3(x,0.0,z) 避障,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_get_velocity: .. rst-class:: classref-method :ref:`Vector3` **agent_get_velocity**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the velocity of the specified ``agent``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_has_avoidance_callback: .. rst-class:: classref-method :ref:`bool` **agent_has_avoidance_callback**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Return ``true`` if the specified ``agent`` has an avoidance callback. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_is_map_changed: .. rst-class:: classref-method :ref:`bool` **agent_is_map_changed**\ (\ agent\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the map got changed the previous frame. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_avoidance_callback: .. rst-class:: classref-method |void| **agent_set_avoidance_callback**\ (\ agent\: :ref:`RID`, callback\: :ref:`Callable`\ ) :ref:`🔗` 設定在 ``agent`` 的每個避障處理步驟之後呼叫的回呼函式 :ref:`Callable`\ 。計算出的 ``safe_velocity`` 將在物理計算之前通過訊號發送。 \ **注意:**\ 只要代理還在導覽地圖上且未被釋放,建立的回呼函式就會始終獨立於 SceneTree 狀態進行處理。要為某個代理禁用回呼函式的發送,請再次使用一個空的 :ref:`Callable` 來呼叫 :ref:`agent_set_avoidance_callback()`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_avoidance_enabled: .. rst-class:: classref-method |void| **agent_set_avoidance_enabled**\ (\ agent\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 如果 ``enabled`` 為 ``true``\ ,則指定的 ``agent`` 使用避障。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_avoidance_layers: .. rst-class:: classref-method |void| **agent_set_avoidance_layers**\ (\ agent\: :ref:`RID`, layers\: :ref:`int`\ ) :ref:`🔗` 設定該代理的 ``avoidance_layers`` 位元遮罩。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_avoidance_mask: .. rst-class:: classref-method |void| **agent_set_avoidance_mask**\ (\ agent\: :ref:`RID`, mask\: :ref:`int`\ ) :ref:`🔗` 設定該代理的 ``avoidance_mask`` 位元遮罩。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_avoidance_priority: .. rst-class:: classref-method |void| **agent_set_avoidance_priority**\ (\ agent\: :ref:`RID`, priority\: :ref:`float`\ ) :ref:`🔗` Set the agent's ``avoidance_priority`` with a ``priority`` between 0.0 (lowest priority) to 1.0 (highest priority). The specified ``agent`` does not adjust the velocity for other agents that would match the ``avoidance_mask`` but have a lower ``avoidance_priority``. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_height: .. rst-class:: classref-method |void| **agent_set_height**\ (\ agent\: :ref:`RID`, height\: :ref:`float`\ ) :ref:`🔗` 更新指定代理 ``agent`` 的高度 ``height``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_map: .. rst-class:: classref-method |void| **agent_set_map**\ (\ agent\: :ref:`RID`, map\: :ref:`RID`\ ) :ref:`🔗` 將代理放入地圖中。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_max_neighbors: .. rst-class:: classref-method |void| **agent_set_max_neighbors**\ (\ agent\: :ref:`RID`, count\: :ref:`int`\ ) :ref:`🔗` 設定在導覽中,該代理所考慮的其他代理的最大數量。這個數越大,模擬的執行時間越長。如果這個數太小,則模擬會不安全。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_max_speed: .. rst-class:: classref-method |void| **agent_set_max_speed**\ (\ agent\: :ref:`RID`, max_speed\: :ref:`float`\ ) :ref:`🔗` 設定該代理的最大速度。必須為正數。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_neighbor_distance: .. rst-class:: classref-method |void| **agent_set_neighbor_distance**\ (\ agent\: :ref:`RID`, distance\: :ref:`float`\ ) :ref:`🔗` 設定在導覽中,該代理所考慮的其他代理的最大距離。這個數越大,模擬的執行時間越長。如果這個數太小,則模擬會不安全。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_paused: .. rst-class:: classref-method |void| **agent_set_paused**\ (\ agent\: :ref:`RID`, paused\: :ref:`bool`\ ) :ref:`🔗` If ``paused`` is ``true`` the specified ``agent`` will not be processed. For example, it will not calculate avoidance velocities or receive avoidance callbacks. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_position: .. rst-class:: classref-method |void| **agent_set_position**\ (\ agent\: :ref:`RID`, position\: :ref:`Vector3`\ ) :ref:`🔗` 設定該代理在世界空間中的位置。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_radius: .. rst-class:: classref-method |void| **agent_set_radius**\ (\ agent\: :ref:`RID`, radius\: :ref:`float`\ ) :ref:`🔗` 設定該代理的半徑。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_time_horizon_agents: .. rst-class:: classref-method |void| **agent_set_time_horizon_agents**\ (\ agent\: :ref:`RID`, time_horizon\: :ref:`float`\ ) :ref:`🔗` 考慮其他代理的前提下,該代理的速度的最短安全時間,這個速度是通過模擬得到的。數值越大,代理回應其他代理的速度就越快,但該代理選擇速度的自由度也就越小。太高的取值會大大降低代理的移動速度。必須為正數。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_time_horizon_obstacles: .. rst-class:: classref-method |void| **agent_set_time_horizon_obstacles**\ (\ agent\: :ref:`RID`, time_horizon\: :ref:`float`\ ) :ref:`🔗` 考慮其他靜態避障障礙物的前提下,該代理的速度的最短安全時間,這個速度是通過仿真得到的。數值越大,代理回應存在的靜態避障障礙物的速度就越快,但該代理選擇速度的自由度也就越小。太高的取值會大大降低代理的移動速度。必須為正數。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_use_3d_avoidance: .. rst-class:: classref-method |void| **agent_set_use_3d_avoidance**\ (\ agent\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` Sets if the agent uses the 2D avoidance or the 3D avoidance while avoidance is enabled. If ``true`` the agent calculates avoidance velocities in 3D for the xyz-axis, e.g. for games that take place in air, underwater or space. The 3D using agent only avoids other 3D avoidance using agent's. The 3D using agent only reacts to radius based avoidance obstacles. The 3D using agent ignores any vertices based obstacles. The 3D using agent only avoids other 3D using agent's. If ``false`` the agent calculates avoidance velocities in 2D along the xz-axis ignoring the y-axis. The 2D using agent only avoids other 2D avoidance using agent's. The 2D using agent reacts to radius avoidance obstacles. The 2D using agent reacts to vertices based avoidance obstacles. The 2D using agent only avoids other 2D using agent's. 2D using agents will ignore other 2D using agents or obstacles that are below their current position or above their current position including the agents height in 2D avoidance. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_velocity: .. rst-class:: classref-method |void| **agent_set_velocity**\ (\ agent\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) :ref:`🔗` 將 ``velocity`` 設定為指定代理 ``agent`` 的新的需求速度。避障模擬會盡可能嘗試滿足這個速度,但為了躲避與其他代理和障礙物的碰撞也會對它進行修改。將代理傳送至新的位置時,請使用 :ref:`agent_set_velocity_forced()` 重設內部模擬速度。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_agent_set_velocity_forced: .. rst-class:: classref-method |void| **agent_set_velocity_forced**\ (\ agent\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) :ref:`🔗` 將指定代理 ``agent`` 的避障模擬內部速度替換為 ``velocity``\ 。將代理傳送至新的位置時,應該在同一影格裡使用這個函式。頻繁呼叫這個函式可能讓代理卡住。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_bake_from_source_geometry_data: .. rst-class:: classref-method |void| **bake_from_source_geometry_data**\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, callback\: :ref:`Callable` = Callable()\ ) :ref:`🔗` 使用 ``source_geometry_data`` 中提供的資料對 ``navigation_mesh`` 進行烘焙。烘焙過程結束後,會呼叫可選的 ``callback``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_bake_from_source_geometry_data_async: .. rst-class:: classref-method |void| **bake_from_source_geometry_data_async**\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, callback\: :ref:`Callable` = Callable()\ ) :ref:`🔗` 使用 ``source_geometry_data`` 中提供的資料對 ``navigation_mesh`` 進行烘焙。烘焙過程結束後,會呼叫可選的 ``callback``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_free_rid: .. rst-class:: classref-method |void| **free_rid**\ (\ rid\: :ref:`RID`\ ) :ref:`🔗` 銷毀給定的 RID。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_get_debug_enabled: .. rst-class:: classref-method :ref:`bool` **get_debug_enabled**\ (\ ) |const| :ref:`🔗` 如果該 NavigationServer 啟用了除錯,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_get_maps: .. rst-class:: classref-method :ref:`Array`\[:ref:`RID`\] **get_maps**\ (\ ) |const| :ref:`🔗` 返回該 NavigationServer 上所有已建立的導覽地圖的 :ref:`RID`\ 。會同時返回已建立的 2D 和 3D 導覽地圖,因為理論上它們之間是沒有區別的。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_get_process_info: .. rst-class:: classref-method :ref:`int` **get_process_info**\ (\ process_info\: :ref:`ProcessInfo`\ ) |const| :ref:`🔗` Returns information about the current state of the NavigationServer. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_is_baking_navigation_mesh: .. rst-class:: classref-method :ref:`bool` **is_baking_navigation_mesh**\ (\ navigation_mesh\: :ref:`NavigationMesh`\ ) |const| :ref:`🔗` Returns ``true`` when the provided navigation mesh is being baked on a background thread. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_create: .. rst-class:: classref-method :ref:`RID` **link_create**\ (\ ) :ref:`🔗` 在地圖上新建兩個地點之間的連結。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_enabled: .. rst-class:: classref-method :ref:`bool` **link_get_enabled**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 如果指定的 ``link`` 處於暫停狀態,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_end_position: .. rst-class:: classref-method :ref:`Vector3` **link_get_end_position**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回連結 ``link`` 的結束位置。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_enter_cost: .. rst-class:: classref-method :ref:`float` **link_get_enter_cost**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``link`` 連結的進入消耗。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_iteration_id: .. rst-class:: classref-method :ref:`int` **link_get_iteration_id**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the current iteration ID of the navigation link. Every time the navigation link changes and synchronizes, the iteration ID increases. An iteration ID of ``0`` means the navigation link has never synchronized. \ **Note:** The iteration ID will wrap around to ``1`` after reaching its range limit. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_map: .. rst-class:: classref-method :ref:`RID` **link_get_map**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回請求的導覽連結 ``link`` 目前分配的導覽地圖的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_navigation_layers: .. rst-class:: classref-method :ref:`int` **link_get_navigation_layers**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``link`` 的導覽層。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_owner_id: .. rst-class:: classref-method :ref:`int` **link_get_owner_id**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回管理該連結的物件的 ``ObjectID``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_start_position: .. rst-class:: classref-method :ref:`Vector3` **link_get_start_position**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``link`` 連結的入口位置。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_get_travel_cost: .. rst-class:: classref-method :ref:`float` **link_get_travel_cost**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``link`` 連結的移動消耗。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_is_bidirectional: .. rst-class:: classref-method :ref:`bool` **link_is_bidirectional**\ (\ link\: :ref:`RID`\ ) |const| :ref:`🔗` 返回該 ``link`` 是否能夠雙向通行。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_bidirectional: .. rst-class:: classref-method |void| **link_set_bidirectional**\ (\ link\: :ref:`RID`, bidirectional\: :ref:`bool`\ ) :ref:`🔗` 設定該 ``link`` 是否能夠雙向通行。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_enabled: .. rst-class:: classref-method |void| **link_set_enabled**\ (\ link\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 如果 ``enabled`` 為 ``true``\ ,則指定的 ``link`` 使用避障。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_end_position: .. rst-class:: classref-method |void| **link_set_end_position**\ (\ link\: :ref:`RID`, position\: :ref:`Vector3`\ ) :ref:`🔗` 設定 ``link`` 的出口位置。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_enter_cost: .. rst-class:: classref-method |void| **link_set_enter_cost**\ (\ link\: :ref:`RID`, enter_cost\: :ref:`float`\ ) :ref:`🔗` 設定 ``link`` 的進入消耗 ``enter_cost``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_map: .. rst-class:: classref-method |void| **link_set_map**\ (\ link\: :ref:`RID`, map\: :ref:`RID`\ ) :ref:`🔗` 設定該連結的導覽地圖 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_navigation_layers: .. rst-class:: classref-method |void| **link_set_navigation_layers**\ (\ link\: :ref:`RID`, navigation_layers\: :ref:`int`\ ) :ref:`🔗` 設定該連結的導覽層。這允許從路徑請求中選擇連結(當使用 :ref:`map_get_path()` 時)。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_owner_id: .. rst-class:: classref-method |void| **link_set_owner_id**\ (\ link\: :ref:`RID`, owner_id\: :ref:`int`\ ) :ref:`🔗` 設定管理該連結的物件的 ``ObjectID``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_start_position: .. rst-class:: classref-method |void| **link_set_start_position**\ (\ link\: :ref:`RID`, position\: :ref:`Vector3`\ ) :ref:`🔗` 設定 ``link`` 的入口位置。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_link_set_travel_cost: .. rst-class:: classref-method |void| **link_set_travel_cost**\ (\ link\: :ref:`RID`, travel_cost\: :ref:`float`\ ) :ref:`🔗` 設定 ``link`` 的移動消耗 ``travel_cost``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_create: .. rst-class:: classref-method :ref:`RID` **map_create**\ (\ ) :ref:`🔗` 建立一張新地圖。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_force_update: .. rst-class:: classref-method |void| **map_force_update**\ (\ map\: :ref:`RID`\ ) :ref:`🔗` **已棄用:** This method is no longer supported, as it is incompatible with asynchronous updates. It can only be used in a single-threaded context, at your own risk. This function immediately forces synchronization of the specified navigation ``map`` :ref:`RID`. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. Avoidance processing and dispatch of the ``safe_velocity`` signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. \ **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_agents: .. rst-class:: classref-method :ref:`Array`\[:ref:`RID`\] **map_get_agents**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回所有與請求的導覽地圖 ``map`` 關聯的導覽代理的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_cell_height: .. rst-class:: classref-method :ref:`float` **map_get_cell_height**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回在 Y 軸上柵格化導覽網格頂點所使用的地圖儲存格高度。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_cell_size: .. rst-class:: classref-method :ref:`float` **map_get_cell_size**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回在 XZ 平面上柵格化導覽網格頂點所使用的地圖儲存格大小。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_closest_point: .. rst-class:: classref-method :ref:`Vector3` **map_get_closest_point**\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``map``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_closest_point_normal: .. rst-class:: classref-method :ref:`Vector3` **map_get_closest_point_normal**\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the navigation mesh surface normal closest to the provided ``to_point`` on the navigation ``map``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_closest_point_owner: .. rst-class:: classref-method :ref:`RID` **map_get_closest_point_owner**\ (\ map\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the owner region RID for the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``map``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_closest_point_to_segment: .. rst-class:: classref-method :ref:`Vector3` **map_get_closest_point_to_segment**\ (\ map\: :ref:`RID`, start\: :ref:`Vector3`, end\: :ref:`Vector3`, use_collision\: :ref:`bool` = false\ ) |const| :ref:`🔗` Returns the navigation mesh surface point closest to the provided ``start`` and ``end`` segment on the navigation ``map``. If ``use_collision`` is ``true``, a closest point test is only done when the segment intersects with the navigation mesh surface. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_edge_connection_margin: .. rst-class:: classref-method :ref:`float` **map_get_edge_connection_margin**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回地圖的邊界連接邊距。這是讓兩個不同地區的邊界相連所需的最小頂點距離。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_iteration_id: .. rst-class:: classref-method :ref:`int` **map_get_iteration_id**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the current iteration id of the navigation map. Every time the navigation map changes and synchronizes the iteration id increases. An iteration id of 0 means the navigation map has never synchronized. \ **Note:** The iteration id will wrap back to 1 after reaching its range limit. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_link_connection_radius: .. rst-class:: classref-method :ref:`float` **map_get_link_connection_radius**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回該地圖的連結連接半徑。該距離是任何連結將搜索要連接的導覽網格多邊形的最大範圍。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_links: .. rst-class:: classref-method :ref:`Array`\[:ref:`RID`\] **map_get_links**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回目前分配給請求的導覽地圖 ``map`` 的所有導覽連結的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_merge_rasterizer_cell_scale: .. rst-class:: classref-method :ref:`float` **map_get_merge_rasterizer_cell_scale**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` Returns map's internal merge rasterizer cell scale. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_obstacles: .. rst-class:: classref-method :ref:`Array`\[:ref:`RID`\] **map_get_obstacles**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回目前分配給請求的導覽地圖 ``map`` 的所有導覽障礙物的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_path: .. rst-class:: classref-method :ref:`PackedVector3Array` **map_get_path**\ (\ map\: :ref:`RID`, origin\: :ref:`Vector3`, destination\: :ref:`Vector3`, optimize\: :ref:`bool`, navigation_layers\: :ref:`int` = 1\ ) :ref:`🔗` 返回從原點到達目的地的導覽路徑。\ ``navigation_layers`` 是被允許在路徑中的所有區塊導覽層的位元遮罩。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_random_point: .. rst-class:: classref-method :ref:`Vector3` **map_get_random_point**\ (\ map\: :ref:`RID`, navigation_layers\: :ref:`int`, uniformly\: :ref:`bool`\ ) |const| :ref:`🔗` Returns a random position picked from all map region polygons with matching ``navigation_layers``. If ``uniformly`` is ``true``, all map regions, polygons, and faces are weighted by their surface area (slower). If ``uniformly`` is ``false``, just a random region and a random polygon are picked (faster). .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_regions: .. rst-class:: classref-method :ref:`Array`\[:ref:`RID`\] **map_get_regions**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回目前分配給所請求的導覽 ``map`` 的所有導覽區塊的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_up: .. rst-class:: classref-method :ref:`Vector3` **map_get_up**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` 返回地圖的上方向。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_use_async_iterations: .. rst-class:: classref-method :ref:`bool` **map_get_use_async_iterations**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_get_use_edge_connections: .. rst-class:: classref-method :ref:`bool` **map_get_use_edge_connections**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the navigation ``map`` allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_is_active: .. rst-class:: classref-method :ref:`bool` **map_is_active**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the map is active. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_active: .. rst-class:: classref-method |void| **map_set_active**\ (\ map\: :ref:`RID`, active\: :ref:`bool`\ ) :ref:`🔗` 設定地圖的啟動態。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_cell_height: .. rst-class:: classref-method |void| **map_set_cell_height**\ (\ map\: :ref:`RID`, cell_height\: :ref:`float`\ ) :ref:`🔗` 設定在 Y 軸上柵格化導覽網格頂點所使用的地圖儲存格高度。必須與所使用的導覽網格的儲存格高度相配對。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_cell_size: .. rst-class:: classref-method |void| **map_set_cell_size**\ (\ map\: :ref:`RID`, cell_size\: :ref:`float`\ ) :ref:`🔗` 設定在 XZ 平面上柵格化導覽網格頂點所使用的地圖儲存格大小。必須與所使用的導覽網格的儲存格大小相配對。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_edge_connection_margin: .. rst-class:: classref-method |void| **map_set_edge_connection_margin**\ (\ map\: :ref:`RID`, margin\: :ref:`float`\ ) :ref:`🔗` 設定用於焊接相容地區邊界的地圖邊界連接邊距。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_link_connection_radius: .. rst-class:: classref-method |void| **map_set_link_connection_radius**\ (\ map\: :ref:`RID`, radius\: :ref:`float`\ ) :ref:`🔗` 設定該地圖用於連接連結和導覽多邊形的連結連接半徑。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_merge_rasterizer_cell_scale: .. rst-class:: classref-method |void| **map_set_merge_rasterizer_cell_scale**\ (\ map\: :ref:`RID`, scale\: :ref:`float`\ ) :ref:`🔗` Set the map's internal merge rasterizer cell scale used to control merging sensitivity. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_up: .. rst-class:: classref-method |void| **map_set_up**\ (\ map\: :ref:`RID`, up\: :ref:`Vector3`\ ) :ref:`🔗` 設定地圖的上方向。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_use_async_iterations: .. rst-class:: classref-method |void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_map_set_use_edge_connections: .. rst-class:: classref-method |void| **map_set_use_edge_connections**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 設定導覽地圖 ``map`` 的邊緣連接使用情況。如果 ``enabled``\ ,則導覽地圖允許導覽區塊使用邊緣連接與位於導覽地圖邊緣連接邊距範圍內的其他導覽區塊相連接。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_create: .. rst-class:: classref-method :ref:`RID` **obstacle_create**\ (\ ) :ref:`🔗` 新建障礙物。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_avoidance_enabled: .. rst-class:: classref-method :ref:`bool` **obstacle_get_avoidance_enabled**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` 如果給定的 ``obstacle`` 啟用了避障,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_avoidance_layers: .. rst-class:: classref-method :ref:`int` **obstacle_get_avoidance_layers**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``avoidance_layers`` bitmask of the specified ``obstacle``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_height: .. rst-class:: classref-method :ref:`float` **obstacle_get_height**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the ``height`` of the specified ``obstacle``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_map: .. rst-class:: classref-method :ref:`RID` **obstacle_get_map**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` 返回請求的障礙物 ``obstacle`` 目前分配的導覽地圖 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_paused: .. rst-class:: classref-method :ref:`bool` **obstacle_get_paused**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` 如果指定的 ``obstacle`` 被暫停,則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_position: .. rst-class:: classref-method :ref:`Vector3` **obstacle_get_position**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the position of the specified ``obstacle`` in world space. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_radius: .. rst-class:: classref-method :ref:`float` **obstacle_get_radius**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the radius of the specified dynamic ``obstacle``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_use_3d_avoidance: .. rst-class:: classref-method :ref:`bool` **obstacle_get_use_3d_avoidance**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` 如果提供的 ``obstacle`` 使用 3D 空間的 Vector3(x,y,z),不使用水平 2D Vector2(x,y) / Vector3(x,0.0,z),則返回 ``true``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_velocity: .. rst-class:: classref-method :ref:`Vector3` **obstacle_get_velocity**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the velocity of the specified dynamic ``obstacle``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_get_vertices: .. rst-class:: classref-method :ref:`PackedVector3Array` **obstacle_get_vertices**\ (\ obstacle\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the outline vertices for the specified ``obstacle``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_avoidance_enabled: .. rst-class:: classref-method |void| **obstacle_set_avoidance_enabled**\ (\ obstacle\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 如果 ``enabled``\ ,則提供的障礙物 ``obstacle`` 會影響代理的避障。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_avoidance_layers: .. rst-class:: classref-method |void| **obstacle_set_avoidance_layers**\ (\ obstacle\: :ref:`RID`, layers\: :ref:`int`\ ) :ref:`🔗` 設定障礙物的避障層 ``avoidance_layers`` 位元遮罩。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_height: .. rst-class:: classref-method |void| **obstacle_set_height**\ (\ obstacle\: :ref:`RID`, height\: :ref:`float`\ ) :ref:`🔗` 設定 ``obstacle`` 的高度 ``height``\ 。3D 代理會忽略位於其上方和下方的障礙物,使用 2D 避障。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_map: .. rst-class:: classref-method |void| **obstacle_set_map**\ (\ obstacle\: :ref:`RID`, map\: :ref:`RID`\ ) :ref:`🔗` 將 ``obstacle`` 分配給導覽地圖。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_paused: .. rst-class:: classref-method |void| **obstacle_set_paused**\ (\ obstacle\: :ref:`RID`, paused\: :ref:`bool`\ ) :ref:`🔗` If ``paused`` is ``true`` the specified ``obstacle`` will not be processed. For example, it will no longer affect avoidance velocities. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_position: .. rst-class:: classref-method |void| **obstacle_set_position**\ (\ obstacle\: :ref:`RID`, position\: :ref:`Vector3`\ ) :ref:`🔗` 為 ``obstacle`` 更新世界空間中的位置 ``position``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_radius: .. rst-class:: classref-method |void| **obstacle_set_radius**\ (\ obstacle\: :ref:`RID`, radius\: :ref:`float`\ ) :ref:`🔗` 設定動態障礙物的半徑。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_use_3d_avoidance: .. rst-class:: classref-method |void| **obstacle_set_use_3d_avoidance**\ (\ obstacle\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 設定 ``obstacle`` 在啟用避障時使用 2D 避障還是 3D 避障。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_velocity: .. rst-class:: classref-method |void| **obstacle_set_velocity**\ (\ obstacle\: :ref:`RID`, velocity\: :ref:`Vector3`\ ) :ref:`🔗` 將動態障礙物 ``obstacle`` 的速度設定為 ``velocity``\ 。能夠讓其他代理更好地預測該動態障礙物的移動。僅在與障礙物半徑一同使用時有效。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_obstacle_set_vertices: .. rst-class:: classref-method |void| **obstacle_set_vertices**\ (\ obstacle\: :ref:`RID`, vertices\: :ref:`PackedVector3Array`\ ) :ref:`🔗` 設定障礙物的輪廓頂點。如果頂點順時針纏繞,則障礙物會將代理向內部推擠,否則向外推擠。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_parse_source_geometry_data: .. rst-class:: classref-method |void| **parse_source_geometry_data**\ (\ navigation_mesh\: :ref:`NavigationMesh`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData3D`, root_node\: :ref:`Node`, callback\: :ref:`Callable` = Callable()\ ) :ref:`🔗` 根據 ``navigation_mesh`` 的屬性解析 :ref:`SceneTree` 中的源幾何體。會使用解析的結果對提供的 ``source_geometry_data`` 資源進行更新。後續可以在使用 :ref:`bake_from_source_geometry_data()` 烘焙導覽網格時使用該資源。解析過程完成後,會呼叫可選的 ``callback``\ 。 \ **注意:**\ 因為 SceneTree 並不是執行緒安全的,所以這個函式需要在主執行緒執行或使用延遲呼叫。 \ **注意:**\ 從 :ref:`Mesh` 資源讀取資料陣列雖然很方便,但會對影格率造成負面影響。這些資料需要從 GPU 獲取,卡住正在處理的 :ref:`RenderingServer`\ 。出於性能考量,請優先使用碰撞形狀或在程式碼中建立完整的資料陣列等方法。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_query_path: .. rst-class:: classref-method |void| **query_path**\ (\ parameters\: :ref:`NavigationPathQueryParameters3D`, result\: :ref:`NavigationPathQueryResult3D`, callback\: :ref:`Callable` = Callable()\ ) :ref:`🔗` Queries a path in a given navigation map. Start and target position and other parameters are defined through :ref:`NavigationPathQueryParameters3D`. Updates the provided :ref:`NavigationPathQueryResult3D` result object with the path among other results requested by the query. After the process is finished the optional ``callback`` will be called. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_bake_navigation_mesh: .. rst-class:: classref-method |void| **region_bake_navigation_mesh**\ (\ navigation_mesh\: :ref:`NavigationMesh`, root_node\: :ref:`Node`\ ) :ref:`🔗` **已棄用:** This method is deprecated due to core threading changes. To upgrade existing code, first create a :ref:`NavigationMeshSourceGeometryData3D` resource. Use this resource with :ref:`parse_source_geometry_data()` to parse the :ref:`SceneTree` for nodes that should contribute to the navigation mesh baking. The :ref:`SceneTree` parsing needs to happen on the main thread. After the parsing is finished use the resource with :ref:`bake_from_source_geometry_data()` to bake a navigation mesh. Bakes the ``navigation_mesh`` with bake source geometry collected starting from the ``root_node``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_create: .. rst-class:: classref-method :ref:`RID` **region_create**\ (\ ) :ref:`🔗` 建立一個新的地區。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_bounds: .. rst-class:: classref-method :ref:`AABB` **region_get_bounds**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the axis-aligned bounding box for the ``region``'s transformed navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_closest_point: .. rst-class:: classref-method :ref:`Vector3` **region_get_closest_point**\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``region``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_closest_point_normal: .. rst-class:: classref-method :ref:`Vector3` **region_get_closest_point_normal**\ (\ region\: :ref:`RID`, to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the navigation mesh surface normal closest to the provided ``to_point`` on the navigation ``region``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_closest_point_to_segment: .. rst-class:: classref-method :ref:`Vector3` **region_get_closest_point_to_segment**\ (\ region\: :ref:`RID`, start\: :ref:`Vector3`, end\: :ref:`Vector3`, use_collision\: :ref:`bool` = false\ ) |const| :ref:`🔗` Returns the navigation mesh surface point closest to the provided ``start`` and ``end`` segment on the navigation ``region``. If ``use_collision`` is ``true``, a closest point test is only done when the segment intersects with the navigation mesh surface. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_connection_pathway_end: .. rst-class:: classref-method :ref:`Vector3` **region_get_connection_pathway_end**\ (\ region\: :ref:`RID`, connection\: :ref:`int`\ ) |const| :ref:`🔗` 返回連接門的終點。\ ``connection`` 是一個索引,介於 0 和 :ref:`region_get_connections_count()` 的返回值之間。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_connection_pathway_start: .. rst-class:: classref-method :ref:`Vector3` **region_get_connection_pathway_start**\ (\ region\: :ref:`RID`, connection\: :ref:`int`\ ) |const| :ref:`🔗` 返回連接門的起點。\ ``connection`` 是一個索引,介於 0 和 :ref:`region_get_connections_count()` 的返回值之間。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_connections_count: .. rst-class:: classref-method :ref:`int` **region_get_connections_count**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``region`` 地區與其他地區在地圖上有多少連接。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_enabled: .. rst-class:: classref-method :ref:`bool` **region_get_enabled**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the specified ``region`` is enabled. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_enter_cost: .. rst-class:: classref-method :ref:`float` **region_get_enter_cost**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``region`` 地區的進入消耗。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_iteration_id: .. rst-class:: classref-method :ref:`int` **region_get_iteration_id**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the current iteration ID of the navigation region. Every time the navigation region changes and synchronizes, the iteration ID increases. An iteration ID of ``0`` means the navigation region has never synchronized. \ **Note:** The iteration ID will wrap around to ``1`` after reaching its range limit. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_map: .. rst-class:: classref-method :ref:`RID` **region_get_map**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回請求的 ``region`` 地區所關聯的導覽地圖的 :ref:`RID`\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_navigation_layers: .. rst-class:: classref-method :ref:`int` **region_get_navigation_layers**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回該地區的導覽層。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_owner_id: .. rst-class:: classref-method :ref:`int` **region_get_owner_id**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回管理該地區物件的 ``ObjectID``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_random_point: .. rst-class:: classref-method :ref:`Vector3` **region_get_random_point**\ (\ region\: :ref:`RID`, navigation_layers\: :ref:`int`, uniformly\: :ref:`bool`\ ) |const| :ref:`🔗` Returns a random position picked from all region polygons with matching ``navigation_layers``. If ``uniformly`` is ``true``, all region polygons and faces are weighted by their surface area (slower). If ``uniformly`` is ``false``, just a random polygon and face is picked (faster). .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_transform: .. rst-class:: classref-method :ref:`Transform3D` **region_get_transform**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns the global transformation of this ``region``. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_travel_cost: .. rst-class:: classref-method :ref:`float` **region_get_travel_cost**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` 返回 ``region`` 地區的移動消耗。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_use_async_iterations: .. rst-class:: classref-method :ref:`bool` **region_get_use_async_iterations**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the ``region`` uses an async synchronization process that runs on a background thread. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_get_use_edge_connections: .. rst-class:: classref-method :ref:`bool` **region_get_use_edge_connections**\ (\ region\: :ref:`RID`\ ) |const| :ref:`🔗` Returns ``true`` if the navigation ``region`` is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_owns_point: .. rst-class:: classref-method :ref:`bool` **region_owns_point**\ (\ region\: :ref:`RID`, point\: :ref:`Vector3`\ ) |const| :ref:`🔗` 如果提供的世界空間中的 ``point`` 目前由提供的導覽區塊 ``region`` 擁有,則返回 ``true``\ 。在這裡的本文中,“擁有”意味著與來自其他導覽區塊的所有其他導覽網格相比,該區塊的導覽網格多邊形面中有一個距離該點最近的可能位置,這些其他導覽區塊也已在提供的區塊的導覽地圖上註冊。 如果有多個導覽網格存在符合條件的位置並且距離相等,那麼其多邊形先被處理的導覽區塊將贏得所有權。多邊形的處理順序與導覽區塊在 NavigationServer 上的註冊順序一致。 \ **注意:**\ 如果來自不同導覽區塊的導覽網格存在重疊(通常應當避免),可能會得到預料之外的結果。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_enabled: .. rst-class:: classref-method |void| **region_set_enabled**\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` If ``enabled`` is ``true``, the specified ``region`` will contribute to its current navigation map. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_enter_cost: .. rst-class:: classref-method |void| **region_set_enter_cost**\ (\ region\: :ref:`RID`, enter_cost\: :ref:`float`\ ) :ref:`🔗` 設定 ``region`` 地區的進入消耗 ``enter_cost``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_map: .. rst-class:: classref-method |void| **region_set_map**\ (\ region\: :ref:`RID`, map\: :ref:`RID`\ ) :ref:`🔗` 設定該地區的地圖。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_navigation_layers: .. rst-class:: classref-method |void| **region_set_navigation_layers**\ (\ region\: :ref:`RID`, navigation_layers\: :ref:`int`\ ) :ref:`🔗` 設定地區的導覽層。能夠在路徑請求中選擇地區(使用 :ref:`map_get_path()`\ )。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_navigation_mesh: .. rst-class:: classref-method |void| **region_set_navigation_mesh**\ (\ region\: :ref:`RID`, navigation_mesh\: :ref:`NavigationMesh`\ ) :ref:`🔗` 設定該地圖的導覽網格。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_owner_id: .. rst-class:: classref-method |void| **region_set_owner_id**\ (\ region\: :ref:`RID`, owner_id\: :ref:`int`\ ) :ref:`🔗` 設定管理該地區物件的 ``ObjectID``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_transform: .. rst-class:: classref-method |void| **region_set_transform**\ (\ region\: :ref:`RID`, transform\: :ref:`Transform3D`\ ) :ref:`🔗` 設定該地區的全域變換。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_travel_cost: .. rst-class:: classref-method |void| **region_set_travel_cost**\ (\ region\: :ref:`RID`, travel_cost\: :ref:`float`\ ) :ref:`🔗` 設定 ``region`` 地區的移動消耗 ``travel_cost``\ 。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_use_async_iterations: .. rst-class:: classref-method |void| **region_set_use_async_iterations**\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` If ``enabled`` is ``true`` the ``region`` uses an async synchronization process that runs on a background thread. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_region_set_use_edge_connections: .. rst-class:: classref-method |void| **region_set_use_edge_connections**\ (\ region\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` 如果 ``enabled``\ ,導覽區塊 ``region`` 將使用邊緣連接來與位於導覽地圖邊緣連接邊距範圍內的其他導覽區塊相連接。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_set_active: .. rst-class:: classref-method |void| **set_active**\ (\ active\: :ref:`bool`\ ) :ref:`🔗` 控制這個伺服器是否啟動。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_set_debug_enabled: .. rst-class:: classref-method |void| **set_debug_enabled**\ (\ enabled\: :ref:`bool`\ ) :ref:`🔗` 如果為 ``true``\ ,則該 NavigationServer 啟用了除錯模式。 .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_simplify_path: .. rst-class:: classref-method :ref:`PackedVector3Array` **simplify_path**\ (\ path\: :ref:`PackedVector3Array`, epsilon\: :ref:`float`\ ) :ref:`🔗` Returns a simplified version of ``path`` with less critical path points removed. The simplification amount is in worlds units and controlled by ``epsilon``. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_source_geometry_parser_create: .. rst-class:: classref-method :ref:`RID` **source_geometry_parser_create**\ (\ ) :ref:`🔗` Creates a new source geometry parser. If a :ref:`Callable` is set for the parser with :ref:`source_geometry_parser_set_callback()` the callback will be called for every single node that gets parsed whenever :ref:`parse_source_geometry_data()` is used. .. rst-class:: classref-item-separator ---- .. _class_NavigationServer3D_method_source_geometry_parser_set_callback: .. rst-class:: classref-method |void| **source_geometry_parser_set_callback**\ (\ parser\: :ref:`RID`, callback\: :ref:`Callable`\ ) :ref:`🔗` Sets the ``callback`` :ref:`Callable` for the specific source geometry ``parser``. The :ref:`Callable` will receive a call with the following parameters: - ``navigation_mesh`` - The :ref:`NavigationMesh` reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh. - ``source_geometry_data`` - The :ref:`NavigationMeshSourceGeometryData3D` reference. Add custom source geometry for navigation mesh baking to this object. - ``node`` - The :ref:`Node` that is parsed. .. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)` .. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)` .. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)` .. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)` .. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)` .. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)` .. |void| replace:: :abbr:`void (無回傳值。)`