From 8722a9920c1f6119bf6e769cba270e63097f8e25 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Thu, 23 May 2024 10:08:29 +0800 Subject: + astar project --- .../com.arongranberg.astar/RVO/RVONavmesh.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/RVO/RVONavmesh.cs (limited to 'Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/RVO/RVONavmesh.cs') diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/RVO/RVONavmesh.cs b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/RVO/RVONavmesh.cs new file mode 100644 index 0000000..982afe3 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/RVO/RVONavmesh.cs @@ -0,0 +1,35 @@ +using UnityEngine; +using System.Collections.Generic; +using UnityEngine.Profiling; + +namespace Pathfinding.RVO { + using Pathfinding.Util; + + /// + /// Adds a navmesh as RVO obstacles. + /// Add this to a scene in which has a navmesh or grid based graph, when scanning (or loading from cache) the graph + /// it will be added as RVO obstacles to the RVOSimulator (which must exist in the scene). + /// + /// Warning: You should only have a single instance of this script in the scene, otherwise it will add duplicate + /// obstacles and thereby increasing the CPU usage. + /// + /// If you update a graph during runtime the obstacles need to be recalculated which has a performance penalty. + /// This can be quite significant for larger graphs. + /// + /// In the screenshot the generated obstacles are visible in red. + /// [Open online documentation to see images] + /// + /// Deprecated: This component is deprecated. Local avoidance colliders never worked particularly well and the performance was poor. Modify the graphs instead so that pathfinding takes obstacles into account. + /// + [AddComponentMenu("")] + [HelpURL("https://arongranberg.com/astar/documentation/stable/rvonavmesh.html")] + public class RVONavmesh : GraphModifier { + /// + /// Height of the walls added for each obstacle edge. + /// If a graph contains overlapping regions (e.g multiple floor in a building) + /// you should set this low enough so that edges on different levels do not interfere, + /// but high enough so that agents cannot move over them by mistake. + /// + public float wallHeight = 5; + } +} -- cgit v1.1-26-g67d0