Path: blob/master/servers/navigation/navigation_globals.h
10277 views
/**************************************************************************/1/* navigation_globals.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 NavigationDefaults3D {3334// Rasterization.3536// To find the polygons edges the vertices are displaced in a grid where37// each cell has the following cell_size and cell_height.38constexpr float NAV_MESH_CELL_HEIGHT = 0.25f; // Must match ProjectSettings default 3D cell_height and NavigationMesh cell_height.39constexpr float NAV_MESH_CELL_SIZE = 0.25f; // Must match ProjectSettings default 3D cell_size and NavigationMesh cell_size.40constexpr float NAV_MESH_CELL_SIZE_MIN = 0.01f;41constexpr const char *const NAV_MESH_CELL_SIZE_HINT = "0.001,100,0.001,or_greater";4243// Map.4445constexpr float EDGE_CONNECTION_MARGIN = 0.25f;46constexpr float LINK_CONNECTION_RADIUS = 1.0f;47constexpr int path_search_max_polygons = 4096;4849// Agent.5051constexpr float AVOIDANCE_AGENT_HEIGHT = 1.0;52constexpr float AVOIDANCE_AGENT_RADIUS = 0.5;53constexpr float AVOIDANCE_AGENT_MAX_SPEED = 10.0;54constexpr float AVOIDANCE_AGENT_TIME_HORIZON_AGENTS = 1.0;55constexpr float AVOIDANCE_AGENT_TIME_HORIZON_OBSTACLES = 0.0;56constexpr int AVOIDANCE_AGENT_MAX_NEIGHBORS = 10;57constexpr float AVOIDANCE_AGENT_NEIGHBOR_DISTANCE = 50.0;5859} //namespace NavigationDefaults3D6061namespace NavigationDefaults2D {6263// Rasterization.6465// Same as in 3D but larger since 1px is treated as 1m.66constexpr float NAV_MESH_CELL_SIZE = 1.0f; // Must match ProjectSettings default 2D cell_size.67constexpr float NAV_MESH_CELL_SIZE_MIN = 0.01f;68constexpr const char *const NAV_MESH_CELL_SIZE_HINT = "0.001,100,0.001,or_greater";6970// Map.7172constexpr float EDGE_CONNECTION_MARGIN = 1.0f;73constexpr float LINK_CONNECTION_RADIUS = 4.0f;74constexpr int path_search_max_polygons = 4096;7576// Agent.7778constexpr float AVOIDANCE_AGENT_RADIUS = 10.0;79constexpr float AVOIDANCE_AGENT_MAX_SPEED = 100.0;80constexpr float AVOIDANCE_AGENT_TIME_HORIZON_AGENTS = 1.0;81constexpr float AVOIDANCE_AGENT_TIME_HORIZON_OBSTACLES = 0.0;82constexpr int AVOIDANCE_AGENT_MAX_NEIGHBORS = 10;83constexpr float AVOIDANCE_AGENT_NEIGHBOR_DISTANCE = 500.0;8485} //namespace NavigationDefaults2D868788