Path: blob/master/servers/navigation_3d/navigation_path_query_parameters_3d.h
11322 views
/**************************************************************************/1/* navigation_path_query_parameters_3d.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/object/ref_counted.h"33#include "servers/navigation_3d/navigation_constants_3d.h"3435class NavigationPathQueryParameters3D : public RefCounted {36GDCLASS(NavigationPathQueryParameters3D, RefCounted);3738protected:39static void _bind_methods();4041public:42enum PathfindingAlgorithm {43PATHFINDING_ALGORITHM_ASTAR = NavigationEnums3D::PATHFINDING_ALGORITHM_ASTAR,44};4546enum PathPostProcessing {47PATH_POSTPROCESSING_CORRIDORFUNNEL = NavigationEnums3D::PATH_POSTPROCESSING_CORRIDORFUNNEL,48PATH_POSTPROCESSING_EDGECENTERED = NavigationEnums3D::PATH_POSTPROCESSING_EDGECENTERED,49PATH_POSTPROCESSING_NONE = NavigationEnums3D::PATH_POSTPROCESSING_NONE,50};5152enum PathMetadataFlags {53PATH_METADATA_INCLUDE_NONE = NavigationEnums3D::PathMetadataFlags::PATH_INCLUDE_NONE,54PATH_METADATA_INCLUDE_TYPES = NavigationEnums3D::PathMetadataFlags::PATH_INCLUDE_TYPES,55PATH_METADATA_INCLUDE_RIDS = NavigationEnums3D::PathMetadataFlags::PATH_INCLUDE_RIDS,56PATH_METADATA_INCLUDE_OWNERS = NavigationEnums3D::PathMetadataFlags::PATH_INCLUDE_OWNERS,57PATH_METADATA_INCLUDE_ALL = NavigationEnums3D::PathMetadataFlags::PATH_INCLUDE_ALL58};5960private:61PathfindingAlgorithm pathfinding_algorithm = PATHFINDING_ALGORITHM_ASTAR;62PathPostProcessing path_postprocessing = PATH_POSTPROCESSING_CORRIDORFUNNEL;63RID map;64Vector3 start_position;65Vector3 target_position;66uint32_t navigation_layers = 1;67BitField<PathMetadataFlags> metadata_flags = PATH_METADATA_INCLUDE_ALL;68bool simplify_path = false;69real_t simplify_epsilon = 0.0;7071LocalVector<RID> _excluded_regions;72LocalVector<RID> _included_regions;7374float path_return_max_length = 0.0;75float path_return_max_radius = 0.0;76int path_search_max_polygons = NavigationDefaults3D::path_search_max_polygons;77float path_search_max_distance = 0.0;7879public:80void set_pathfinding_algorithm(const PathfindingAlgorithm p_pathfinding_algorithm);81PathfindingAlgorithm get_pathfinding_algorithm() const;8283void set_path_postprocessing(const PathPostProcessing p_path_postprocessing);84PathPostProcessing get_path_postprocessing() const;8586void set_map(RID p_map);87RID get_map() const;8889void set_start_position(Vector3 p_start_position);90Vector3 get_start_position() const;9192void set_target_position(Vector3 p_target_position);93Vector3 get_target_position() const;9495void set_navigation_layers(uint32_t p_navigation_layers);96uint32_t get_navigation_layers() const;9798void set_metadata_flags(BitField<NavigationPathQueryParameters3D::PathMetadataFlags> p_flags);99BitField<NavigationPathQueryParameters3D::PathMetadataFlags> get_metadata_flags() const;100101void set_simplify_path(bool p_enabled);102bool get_simplify_path() const;103104void set_simplify_epsilon(real_t p_epsilon);105real_t get_simplify_epsilon() const;106107void set_excluded_regions(const TypedArray<RID> &p_regions);108TypedArray<RID> get_excluded_regions() const;109110void set_included_regions(const TypedArray<RID> &p_regions);111TypedArray<RID> get_included_regions() const;112113void set_path_return_max_length(float p_length);114float get_path_return_max_length() const;115116void set_path_return_max_radius(float p_radius);117float get_path_return_max_radius() const;118119void set_path_search_max_polygons(int p_max_polygons);120int get_path_search_max_polygons() const;121122void set_path_search_max_distance(float p_distance);123float get_path_search_max_distance() const;124};125126VARIANT_ENUM_CAST(NavigationPathQueryParameters3D::PathfindingAlgorithm);127VARIANT_ENUM_CAST(NavigationPathQueryParameters3D::PathPostProcessing);128VARIANT_BITFIELD_CAST(NavigationPathQueryParameters3D::PathMetadataFlags);129130131