Path: blob/master/servers/navigation_2d/navigation_constants_2d.h
11322 views
/**************************************************************************/1/* navigation_constants_2d.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 once3132namespace NavigationEnums2D {3334enum PathfindingAlgorithm {35PATHFINDING_ALGORITHM_ASTAR = 0,36};3738enum PathPostProcessing {39PATH_POSTPROCESSING_CORRIDORFUNNEL = 0,40PATH_POSTPROCESSING_EDGECENTERED,41PATH_POSTPROCESSING_NONE,42};4344enum PathSegmentType {45PATH_SEGMENT_TYPE_REGION = 0,46PATH_SEGMENT_TYPE_LINK47};4849enum PathMetadataFlags {50PATH_INCLUDE_NONE = 0,51PATH_INCLUDE_TYPES = 1,52PATH_INCLUDE_RIDS = 2,53PATH_INCLUDE_OWNERS = 4,54PATH_INCLUDE_ALL = PATH_INCLUDE_TYPES | PATH_INCLUDE_RIDS | PATH_INCLUDE_OWNERS55};5657} //namespace NavigationEnums2D5859namespace NavigationDefaults2D {6061// Rasterization.6263// Same as in 3D but larger since 1px is treated as 1m.64constexpr float NAV_MESH_CELL_SIZE = 1.0f; // Must match ProjectSettings default 2D cell_size.65constexpr float NAV_MESH_CELL_SIZE_MIN = 0.01f;66constexpr const char *const NAV_MESH_CELL_SIZE_HINT = "0.001,100,0.001,or_greater";6768// Map.6970constexpr float EDGE_CONNECTION_MARGIN = 1.0f;71constexpr float LINK_CONNECTION_RADIUS = 4.0f;72constexpr int path_search_max_polygons = 4096;7374// Agent.7576constexpr float AVOIDANCE_AGENT_RADIUS = 10.0;77constexpr float AVOIDANCE_AGENT_MAX_SPEED = 100.0;78constexpr float AVOIDANCE_AGENT_TIME_HORIZON_AGENTS = 1.0;79constexpr float AVOIDANCE_AGENT_TIME_HORIZON_OBSTACLES = 0.0;80constexpr int AVOIDANCE_AGENT_MAX_NEIGHBORS = 10;81constexpr float AVOIDANCE_AGENT_NEIGHBOR_DISTANCE = 500.0;8283} //namespace NavigationDefaults2D848586