This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

导航网格

The Navigation Mesh is a navigation area which is arranged above the surface of an arbitrary mesh. In fact, the Navigation Mesh is an area of the specified height above the mesh polygons, which is available for pathfinding.Navigation Mesh是一个导航区域,它位于任意网格的表面上方。实际上,Navigation Mesh是网格多边形上方指定高度的区域,可用于寻路。

In contrast to navigation sectors, the Navigation Mesh enables the following:与之相反导航部门Navigation Mesh启用以下功能:

  • Only 2D routes can be calculated within the Navigation Mesh.Navigation Mesh内只能计算2D路线。
  • Pathfinding can be performed within 1 Navigation Mesh only. Pathfinding within the following areas is not supported:寻路只能在1 Navigation Mesh内执行。不支持以下区域内的寻路:

    • Within several intersecting Navigation Meshes在几个相交的Navigation Meshes
    • Within the intersecting Navigation Mesh and sector在相交的Navigation Mesh和扇区内

See also也可以看看#

  • The NavigationMesh class to manage navigation meshes via APINavigationMesh类,用于通过API管理导航网格物体
  • The article on Creating Routes to learn how to create routes inside the navigation mesh的文章创建路线了解如何在导航网格内创建路线
  • A set of samples located in the <UnigineSDK>/data/samples/paths folder:
    • mesh_00
    • route_03
    • route_04
    位于<UnigineSDK>/data/samples/paths文件夹中的一组样本:
    • mesh_00
    • route_03
    • route_04

Creating Navigation Mesh创建导航网格#

Before adding a Navigation Mesh, you should prepare a mesh, on which this Navigation Mesh will be based. Such mesh is created separately and should meet the following requirements:在添加Navigation Mesh之前,您应该准备一个网格,该Navigation Mesh将基于该网格。此类网格是单独创建的,并且应满足以下要求:

  • Any polygon of the mesh must not share its edge with more than 2 other polygons; otherwise, an error will occur.网格的任何多边形不得与2个以上的其他多边形共享其边;否则,将发生错误。
  • Mesh polygons should be as wide as possible (ideally, they should be equilateral). Too narrow and high polygons may reduce accuracy of path calculation.网格多边形应尽可能宽(理想情况下,它们应是等边的)。多边形太窄和太高都会降低路径计算的准确性。
  • The mesh should be optimized: it should not contain a large number of polygons.网格应该被优化:它不应该包含大量的多边形。

When a mesh is prepared, you can add the Navigation Mesh to the scene via UnigineEditor:准备好网格物体后,可以通过UnigineEditor将Navigation Mesh添加到场景中:

  1. Run UnigineEditor.跑步UnigineEditor。
  2. On the Menu bar, click Create -> Navigation -> Navigation Mesh.在菜单栏上,单击Create -> Navigation -> Navigation Mesh

  3. In the file dialog window that opens, choose the required mesh to be used as a base for the new navigation area and click OK.在打开的文件对话框窗口中,选择所需的网格用作新导航区域的基础,然后单击OK

  4. Click somewhere in the world to place the Navigation Mesh. A new Navigation Mesh is added to UnigineEditor and you can edit it via the Parameters window.单击世界上的某个地方以放置Navigation Mesh。新的Navigation Mesh已添加到UnigineEditor,您可以通过Parameters窗口进行编辑。
注意
The created Navigation Mesh only provides an area within which 2D routes are calculated. The routes themselves should be created using the script.创建的Navigation Mesh仅提供在其中计算2D路线的区域。路线本身应该是使用脚本创建

Example例子#

If you have a scene with different objects and need to calculate a 2D route among them, add the Navigation Mesh to this scene as follows:如果您的场景包含不同的对象,并且需要在它们之间计算2D路线,请按如下所示将Navigation Mesh添加到该场景:

  1. Create a flat mesh with holes in places where the objects are positioned.在放置对象的位置创建带有孔的平面网格。

    The scene现场
    The mesh created for the Navigation MeshNavigation Mesh创建的网格
  2. Specify this mesh as a base for a Navigation Mesh within which the route is calculated, and add the Navigation Mesh to the world. It will be highlighted in green:将这个网格指定为Navigation Mesh的基础(在其中计算路线),然后将Navigation Mesh添加到世界中。它将以绿色突出显示:

    A Navigation Mesh based on the flat mesh基于平面网格的Navigation Mesh
  3. Place the Navigation Mesh above the scene.Navigation Mesh放置在场景上方。

    The Navigation Mesh positioned above the sceneNavigation Mesh位于场景上方
注意
In this case, you can also use a navigation sector with obstacles positioned inside it instead of the Navigation Mesh. However, the Navigation Mesh is preferred for more complex cases.在这种情况下,您也可以使用导航部门障碍物位于其中而不是Navigation Mesh。但是,对于更复杂的情况,首选Navigation Mesh

Editing Navigation Mesh编辑导航网格#

In the Node tab of the Parameters window, you can adjust the following parameters of the Navigation Mesh:Parameters窗口的Node选项卡中,可以调整Navigation Mesh的以下参数:

Navigation Mask The Navigation mask of the Navigation Mesh must match the Navigation mask of the route that is calculated within it. Otherwise, the Navigation Mesh does not participate in pathfinding.Navigation MeshNavigation掩码必须与在其中计算的路由的Navigation掩码匹配。否则,Navigation Mesh不参与寻路。
Quality Quality of optimization for route calculation. This value specifies the number of iterations that are used to find the shortcut. The higher the value, the longer the route calculation takes.路线计算的优化质量。此值指定用于查找快捷方式的迭代次数。值越高,路线计算花费的时间越长。
Velocity Scaling factor for velocity of the point that moves inside the Navigation Mesh.Navigation Mesh内移动的点的速度的比例因子。
Dangerous

Danger factor that indicates if a moving point should try to avoid the Navigation Mesh.危险因素,指示移动点是否应尝试避免Navigation Mesh

注意
If the danger factor exceeds the maximum danger factor set for the route, the Navigation Mesh is excluded from pathfinding calculations.如果危险因子超过为该路线设置的最大危险因子,则将Navigation Mesh从寻路计算中排除。
Depth Depth value. This value affects the quality of the route that is currently calculated. The more the depth value, the better control over accuracy and speed of route calculation is provided. The depth can take integer value in range [0;4]. By default, the depth is set to 0 for a new Navigation Mesh. The 2, 3, 4 values are used for deeper heuristics.深度值。此值影响当前计算的路线的质量。深度值越大,就可以更好地控制路线计算的准确性和速度。深度可以取[0;4]范围内的整数值。默认情况下,对于新的Navigation Mesh,深度设置为0234值用于更深入的启发式。
Height Distance above the mesh polygons available for pathfinding. By default, the height is set to 1 for a new Navigation Mesh.可用于寻路的网格多边形上方的距离。默认情况下,新的Navigation Mesh的高度设置为1

Loading a New Mesh加载新的网格#

To load a new mesh on which the navigation area is based:要加载导航区域所基于的新网格,请执行以下操作:

  1. On the Navigation tab, press .Navigation选项卡上,按
  2. In the file dialog window that opens, choose the required mesh and press OK.在打开的文件对话框窗口中,选择所需的网格,然后按OK

Saving the Current Mesh保存当前网格#

To save the current mesh on which the navigation area is based:要保存导航区域所基于的当前网格,请执行以下操作:

  1. On the Navigation tab, press .Navigation选项卡上,按
  2. In the file dialog window that opens, specify a name for the mesh and press OK.在打开的文件对话框窗口中,为网格指定名称,然后按OK
最新更新: 2021-12-13
Build: ()