Version: 2018.1
Experimental: this API is experimental and might be changed or removed in the future.

NavMeshQuery.GetPortalPoints

マニュアルに切り替える
public bool GetPortalPoints (Experimental.AI.PolygonId polygon, Experimental.AI.PolygonId neighbourPolygon, out Vector3 left, out Vector3 right);

パラメーター

polygonFirst NavMesh node.
neighbourPolygonSecond NavMesh node.
leftOne of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the left side of the edge when traversing from the first node to the second.
rightOne of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the right side of the edge when traversing from the first node to the second.

戻り値

bool True if a connection exists between the two NavMesh nodes. False if no connection exists between the two NavMesh nodes.

説明

Obtains the end points of the line segment common to two adjacent NavMesh nodes.

For two polygons that are part of a NavMesh surface, this method returns the edge where both polygons meet. If the two polygons are in different NavMesh tiles the connected edges can be of different length or have different start and end positions from each other. If this happens the resulting separation edge is the overlapping part of the edges, which may be shorter than either of the individual edges.

When one node is a link and the other is a polygon, the returned points are placed where the link intersects the polygon.

The resulting positions are expressed in world space and can be transformed into a NavMesh's local space by the use of NavMeshQuery.PolygonWorldToLocalMatrix.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961