MW UNITY NAMESPACE








































public class : MonoBehaviour

DynamicPathfinding


Dynamic Pathfinding that adapts to the world environment.



public bool

bDrawGizmos

Draw the Pathfinding bounding box.



public bool

GizmoOptions

Draw the positions of the individual nodes.



[SerializeField] Vector3

LocalCentre

The local centre of the bounding box.



[SerializeField] Vector3Int

Bounds

The Width, Height, and Depth of the Pathfinding box.



[SerializeField] LayerMask

TraversableLayer

The layer/s that can be walked on.



[SerializeField] [Min(1)] float

PointsPerUnit

The number of Nodes per Unity-world unit.



[SerializeField] bool

bAirIsTraversable

Make the Traversable Layer traversable.



[SerializeField] bool

bCheckInsideContacts

Whether or not to check if Nodes inside a contact is traversable.



[SerializeField] EInsideContactQueryMethod

InsideContactMethod

The method to use to determine if a point is inside a Collider.



[SerializeField] bool

bIsDynamic

True if this should adapt to the world environment.



[SerializeField] [Min(1)] int

FramesBetweenUpdate

The number of frames between each dynamic update to the Pathfinding Nodes.



[SerializeField] [Min(1)] int

NodesPerUpdate

The number of Nodes to update per frame.



public MArray<Node>

Nodes

The Nodes that are considered in the Dynamic Pathfinder.

The order is Z, Y, X.



public void

PlotPoints ()

Summary:

Plot the Nodes, adhering to Bounds.



public void

ForceReconnectAll ()

Summary:

Forces all Nodes to reconnect with each other.



public bool

Pathfind (Node Origin, Node Destination, MArray<Node>& Path)

Summary:

Find the shortest path from Origin to Destination.

Params:

Origin:

        The Node to begin searching on.

Destination:

        The Node to reach.

Path:

        The shortest path from Origin to Destination.

Returns:

True if a path from Origin to Destination was found.


public enum EInsideContactQueryMethod : byte

EInsideContactQueryMethod


The method for checking if a point is inside a Collider.


Raycast

Raycast from Contact Point to Collider Centre.


Bounds

Use Collider Bounds to Contact Point Check.


RaycastAndBounds

Use both Raycast and Bounds checks.


public class Node : MNode, IHeapItem<Node>

Node


A sample Node class for Pathfinding.



public void

Push (Node N)

Summary:

Registers N as a neighbour, and this as N's neighbour.

Params:

N:

        Neighbour.


public interface <T>

INodeT


The Interface that T must implement if it is to be used by Pathfinding.



float

F

This Node's F score.



float

G

This Node's G score.



float

H

This Node's H score.



uint

NumberOfDirections ()

Summary:

How many directions can this Node point to?



bool

IsTraversable ()

Summary:

Is this block traversable?



INode<T>

Neighbour (int Direction)

Summary:

Get the Neighbouring Node at Direction.

Params:

Direction:

        The neighbour of this Node in this direction.



float

DistanceHeuristic (T RelativeTo)

Summary:

The distance heuristic to calculate pathfinding scores.

Params:

RelativeTo:

        Distance to from this T to Relative To.

Returns:

An indicative distance from this T, Relative To.


public abstract class : INode<MNode>

MNode


Base class for Nodes to be use in A* Pathfinding.


bIsTraversable

Is this Node an obstacle for Pathfinding?


Neighbours

The connected Nodes to this Node.



public abstract float

DistanceHeuristic (MNode RelativeTo)

Summary:

The distance heuristic to calculate pathfinding scores.

Params:

RelativeTo:

        Distance to from this T to Relative To.

Returns:

An indicative distance from this T, Relative To.



public abstract bool

IsTraversable ()

Summary:

Is this block traversable?



INode<MNode>

Neighbour (int Direction)

Summary:

Get the Neighbouring Node at Direction.

Params:

Direction:

        The neighbour of this Node in this direction.



public virtual int

NumberOfDirections ()

Summary:

How many directions can this Node point to?



public static implicit operator bool

MNode -> Boolean ()

Summary:

Is MNode M null?


public class <T> : MonoBehaviour where T : INode<T>, IHeapItem<T>

MPathManagerT


The MonoBehavior script that manages pathfinding over frames.



[SerializeField] [Min(1)] uint

ComputationsPerFrame

The number of paths to compute per frame.



[SerializeField] [Min(1)] uint

FramesBetweenComputations

The number of frames between computing path/s.



public void

Pause ()

Summary:

Temporarily stop the computation of paths.



public void

Resume ()

Summary:

Continue the computation of paths.



public EStatus

Status ()

Summary:

Prints the current status of this Path Manager.

Returns:

If this Path Manager is currently Paused, or Running.


public static class <T> where T : MNode, IHeapItem<T>

PathfindingT


Provides the A* Pathfinding implementation for T.



public static bool

AStar (T Origin, Y Destination, MArray<T>& Path, UInt32 Depth, int MapSize, bool bUseDiagnostics)

Summary:

A* pathfinds from Origin to Destination looking uDepth times within a uMapSize.

Params:

Origin:

        T position to begin pathfinding.

Destination:

        T position to pathfind to.

Path:

        Reference T List of that make up the path from Origin to Destination.

Depth:

        The depth to search to.

MapSize:

        The total size of the map to be traversed. (The number of INodes).

bUseDiagnostics:

        Time the duration of Pathfinding?

Returns:

Whether or not a path was found from Origin to Destination within uDepth in uMapSize.


public static class <T> where T : INode<T>, IHeapItem<T>

PathRegisterT


Computes a number of paths over a number of frames.



public static void

RequestPath (T Origin, Y Destination, Action<System.Collections.Generic.List{ OnPathCalculated, Action<System.Collections.Generic.List{ OnPathFailed)

Summary:

Register a path to compute when possible.

Remarks:

This is on a first-in, first-out basis. A Queue.

Params:

Origin:

        T position to begin pathfinding.

Destination:

        T position to pathfind to.

OnPathCalculated:

        What to do when a path is found? List of T pathway.

OnPathFailed:

        What to do when a path cannot be found? List of T pathway attempt.



public static bool

ComputeNext ()

Summary:

Computes the next path in FIFO.

Returns:

Whether or not a computation was executed.



public static void

ComputeBatch (UInt32 BatchSize)

Summary:

Computes BatchSize paths in a single call.

Params:

BatchSize:

        The number of paths to compute.



public static uint

GetPathQueueSize ()

Summary:

Gets the number of agents waiting to compute paths.

Returns:

Unsigned integer number of T's awaiting a path.