返回介绍

NavMeshObstacle 导航网格障碍

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

class in UnityEngine/Inherits from: Behaviour

Description 描述

An obstacle for NavMeshAgents to avoid.

导航网格躲避的障碍。

A NavMeshObstacle is cylindrical in shape and can move around the surface of the NavMesh with a specified velocity. By default, the obstacle will only affect the agent's avoidance behaviour rather than the pathfinding. This means that the agent will ignore the obstacle when plotting a path but will sidestep around it while moving along the path. If carving is enabled, the obstacle will create a temporary “hole” in the NavMesh. The hole will be recognised by the pathfinding, so paths will be plotted to avoid the obstacle. This means that if, say, an obstacle blocks a narrow gap, the pathfinding will seek an alternative route to the target. Without carving, the agent will head for the gap but won't be able to pass until the obstacle is clear.

导航网格障碍是圆柱形的并且可以用指定速度围绕导航网格表面移动。在默认情况下,障碍仅影响代理的躲避行为而不是寻路。这意味着当测绘路径时代理将会忽略该障碍,但是沿着路径移动时代理将会在障碍的附近回避。如果启用carving ,障碍将会在导航网格上创建一个临时的“突破口”。该突破口将会被寻路认可,因此测绘路径时将会避免该障碍。这意味着如果说障碍阻塞缺口,寻路将会寻找一个替代路线给目标。没有启用carving,代理将会朝缺口前进但是不可能通过缺口直到该障碍被清除。

Variables 变量

carveOnlyStationaryShould this obstacle be carved when it is constantly moving?
是否当障碍不断移动时可以被雕刻?
carvingShould this obstacle make a cut-out in the navmesh.
该障碍应该在导航网格中制作一张轮廓图。
carvingMoveThresholdThreshold distance for updating a moving carved hole (when carving is enabled).
临界距离适用于更新移动雕刻洞口(当雕刻被启用)。
carvingTimeToStationaryTime to wait until obstacle is treated as stationary (when carving and carveOnlyStationary are enabled).
等待时间直到障碍被处理为静止的(当carving和carveOnlyStationary被启用)。
centerThe center of the obstacle, measured in the object's local space.
障碍的中心,在对象自身空间测量。
heightHeight of the obstacle's cylinder shape.
障碍的圆柱形状的高。
radiusRadius of the obstacle's capsule shape.
障碍的胶囊形状的半径。
shapeShape of the obstacle.
障碍的形状。
sizeThe size of the obstacle, measured in the object's local space.
障碍的大小,在对象的自身空间测量。
velocityVelocity at which the obstacle moves around the NavMesh.
围绕导航网格移动的障碍的速度。

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

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

发布评论

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