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

NavMeshQuery.PolygonLocalToWorldMatrix

Switch to Manual
public Matrix4x4 PolygonLocalToWorldMatrix (Experimental.AI.PolygonId polygon);

Parameters

polygon必须确定其所有者转换的导航网格节点。

Returns

Matrix4x4 Transformation matrix for the surface owning the specified polygon.
Matrix4x4.identity when the NavMesh node is a NavMeshLink or an Off-mesh Link. See Also: NavMeshQuery.GetPolygonType.

Description

返回包含指定导航网格节点 (Read Only) 的导航网格表面的变换矩阵。

NavMeshData 表面可通过以下几种方式定义其变换:通过烘焙 NavMeshBuilder.BuildNavMeshData 时声明的 positionrotation 值、作为 NavMeshSurface 的一部分或通过明确设置 NavMeshData.positionNavMeshData.rotation 的值。

此外,还可以在以下情况下进一步指定 NavMeshDataInstance 的自定义变换:使用传递到 NavMesh.AddNavMeshData(数据、位置、旋转)方法的明确 positionrotation 值创建自定义变换。

重要信息:此方法不返回单个导航网格多边形的位置和方向。它返回拥有多边形的表面的位置。

已知问题:返回了标识矩阵而不是已通过调用 NavMesh.AddLink(链接、位置、旋转)实例化了的 NavMeshLinks 的实际变换。

另请参阅:NavMeshQuery.PolygonWorldToLocalMatrix