返回介绍

NavMeshObstacle.carving 雕刻

发布于 2019-12-18 15:38:06 字数 2315 浏览 948 评论 0 收藏 0

JavaScript => public var carving: bool;
C# => public bool carving;

Description 描述

Should this obstacle make a cut-out in the navmesh.

该障碍应该在导航网格中制作一张轮廓图。

When enabled, this changes the navmesh by cutting out a hole. The shape of the hole is based on the size and shape set on NavMeshObstacle and the navmesh bake settings for radius and height.

当启用时,在导航网格上剪裁出孔洞。孔洞的形状基于大小和在NavMeshObstacle 上设置的形状和导航网格烘培设置的半径和高度。

When the obstacle moves, the carved hole will also move but to reduce CPU overhead the hole is only recalculated when necessary. The recalculation logic has two options: 1) carve when stationary, 2) carve when moved.

当障碍移动时,雕刻孔洞也会移动但为了减少CPU的开支,该孔洞仅在需要的是后进行重新计算。重新计算的逻辑有两个选择:(1)静止时雕刻,(2)移动时雕刻。

“Carve when stationary” is the default behavior and is used when carveOnlyStationary is set to true. The obstacle is treated as moving when it has moved more than the distance set by carvingMoveThreshold. At this time, the carved hole is removed. When the obstacle has stopped moving, and has been stationary more than carvingTimeToStationary seconds, the obstacles is treated stationary and carving is updated again. While the obstacle is moving, the agents will avoid it using the collision avoidance, but will not plan paths around it. This mode is generally the best choice in terms of performance. It is good match when the game object is controlled by physics (i.e. crates and barrels).

“静态雕刻”是默认行为并且当carveOnlyStationary设置为true时被使用。当障碍移动超过carvingMoveThreshold设置的距离时,该障碍被当作移动的。在这个时候,雕刻孔洞被移除。当障碍停止移动时,并且静止超过carvingTimeToStationary秒,障碍被作为静止并且再次雕刻更新。当障碍是移动的,代理将会避免它使用碰撞躲避,但是将不会围绕它计划路径。该模式在性能队列中普遍是最好的选择。当游戏对象被物理系统控制时,它是最匹配的(即箱和桶)。

“Carve when moved” behavior is used when carveOnlyStationary is set to false. In this mode the carved hole is updated when the obstacle has moved more than the distance set by carvingMoveThreshold. This mode is well suited for large slowly moving obstacles, for example a tank that is being avoided by infantry.

“动态雕刻”行为在carveOnlyStationary设置为false时使用。在这种模式中当障碍移动超过carvingMoveThreshold设置的距离时雕刻孔洞被更新。这中模式适合于大的慢的移动障碍,例如 被步兵躲避的坦克。

navmeshobstacle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文