导航和寻路
This section provides a set of examples introducing various approaches to pathfinding implementation. These examples explain how to calculate routes in 2D and 3D spaces, with or without obstacles, and also showcase the features and usage of different navigation areas.本节提供了一组示例,介绍了寻路实现的各种方法。 这些示例解释了如何计算2D和3D空间中的路线,无论是否有障碍物,还展示了不同导航区域的功能和用法。
In UNIGINE, pathfinding can be performed within a Navigation Area of one of the following types:在UNIGINE中,可以在以下类型之一的导航区域内执行寻路:
- Navigation Mesh based on an arbitrary mesh, allowing calculation of only 2D routes within it.Navigation Mesh基于任意网格,只允许计算其中的2D路径。
- Navigation Sector, a plain cuboid-shaped navigation area where both 2D and 3D routes can be calculated.Navigation Sector,可以计算2D和3D路线的平面长方体形导航区域。
You can place obstacles in the navigation area: invisible nodes to be bypassed by the routes. You can use an obstacle as a single node or as a child node of a node that needs to be bypassed. The difference is in how the obstacle's transformation will change. UNIGINE provides 3 types of obstacles. You should select the appropriate type depending on the shape of the node or area to be bypassed during pathfinding.您可以在导航区域中放置障碍物:不可见的节点将被路由绕过。 您可以将障碍物用作单个节点,也可以将其用作需要绕过的节点的子节点。 不同之处在于障碍的转变将如何变化。 UNIGINE提供3种类型的障碍。 您应该根据寻路过程中要绕过的节点或区域的形状选择适当的类型。
See Also请参阅#
- Articles of the Pathfinding Objects section.寻路对象部分的相关文章。
- The C# component samples on Navigation.C#组件的导航示例。