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

NavMeshQuery.MapLocation

マニュアルに切り替える
public Experimental.AI.NavMeshLocation MapLocation (Vector3 position, Vector3 extents, int agentTypeID, int areaMask);

パラメーター

positionWorld position for which the closest point on the NavMesh needs to be found.
extentsMaximum distance, from the specified position, expanding along all three axes, within which NavMesh surfaces are searched.
agentTypeIDIdentifier for the agent type whose NavMesh surfaces should be selected for this operation. The Humanoid agent type exists for all NavMeshes and has an ID of 0. Other agent types can be defined manually through the Editor. A separate NavMesh surface needs to be baked for each agent type.
areaMaskBitmask used to represent areas of the NavMesh that should (value of 1) or shouldn't (values of 0) be sampled. This parameter is optional and defaults to NavMesh.AllAreas if unspecified. See Also: Areas and Costs.

戻り値

NavMeshLocation An object with position and valid PolygonId - when a point on the NavMesh has been found.
An invalid object - when no NavMesh surface with the desired features has been found within the search area. See Also: NavMeshQuery.IsValid.

説明

Finds the closest point and PolygonId on the NavMesh for a given world position.

The search only applies to the specified type of NavMesh surface, for one or more desired area types and is limited to within the specified search area. It does not search for positions on NavMeshLinks or Off-mesh Links.

Nearby NavMesh surfaces directly above or below the specified position are preferred. When there are none up or down within the specified search extents the surfaces closest sideways are sampled.

See Also: NavMesh.SamplePosition.