Struct NavMeshPlaneMod
Similar to NavMeshLineMod, but instead measures the distance to a plane.
Using this modifier makes A* prefer paths that are close to a plane.
A use case for this is to obtain more geodesic paths on a spherical navmesh. Or more straight looking paths on navmeshes that contain a lot of hills or more complicated 3D shapes.
Implements
Namespace: AnyPath.Graphs.NavMesh
Assembly: AnyPath.dll
Syntax
public struct NavMeshPlaneMod : IEdgeMod<NavMeshGraphLocation>
Constructors
NavMeshPlaneMod(NavMeshGraphLocation, NavMeshGraphLocation, float3)
Construct the mod for usage with a sphere.
Declaration
public NavMeshPlaneMod(NavMeshGraphLocation start, NavMeshGraphLocation end, float3 center)
Parameters
| Type | Name | Description |
|---|---|---|
| NavMeshGraphLocation | start | Start location of your query. This should be on the sphere |
| NavMeshGraphLocation | end | Target location of your query |
| float3 | center | The center of the sphere |
NavMeshPlaneMod(Plane)
Construct the mod using a custom plane
Declaration
public NavMeshPlaneMod(Plane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| Plane | plane | The plane to measure the distance to |
Methods
ModifyCost(in NavMeshGraphLocation, in NavMeshGraphLocation, ref float)
Declaration
public bool ModifyCost(in NavMeshGraphLocation from, in NavMeshGraphLocation to, ref float cost)
Parameters
| Type | Name | Description |
|---|---|---|
| NavMeshGraphLocation | from | |
| NavMeshGraphLocation | to | |
| float | cost |
Returns
| Type | Description |
|---|---|
| bool |
ModifyEdgeBuffer(in NavMeshGraphLocation, ref NativeList<Edge<NavMeshGraphLocation>>)
Declaration
public void ModifyEdgeBuffer(in NavMeshGraphLocation from, ref NativeList<Edge<NavMeshGraphLocation>> edgeBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| NavMeshGraphLocation | from | |
| NativeList<Edge<NavMeshGraphLocation>> | edgeBuffer |