Struct PlatformerGraph
Assembly: AnyPath.dll
public struct PlatformerGraph : IGraph<PlatformerGraphLocation>, IDisposable
Constructors
Declaration
public PlatformerGraph(IReadOnlyList<float2> vertices, IReadOnlyList<PlatformerGraph.Edge> undirectedEdges, IReadOnlyList<PlatformerGraph.Edge> directedEdges, Allocator allocator, bool directedEdgesRaycastable = false, int edgesPerQuadrant = 16, int maxQuadTreeDepth = 5)
Parameters
Declaration
public PlatformerGraph(Allocator allocator, bool directedEdgesRaycastable = false, int edgesPerQuadrant = 16, int maxQuadTreeDepth = 5, int initialVertexCapacity = 0, int intialEdgeCapacity = 0)
Parameters
Type |
Name |
Description |
Allocator |
allocator |
|
bool |
directedEdgesRaycastable |
|
int |
edgesPerQuadrant |
|
int |
maxQuadTreeDepth |
|
int |
initialVertexCapacity |
|
int |
intialEdgeCapacity |
|
Properties
Declaration
public bool DirectedEdgesRaycastable { get; }
Property Value
Declaration
public int EdgeCount { get; }
Property Value
Declaration
public NativeArray<PlatformerGraph.Edge>.ReadOnly Edges { get; }
Property Value
Declaration
public NativeQuadtree<int> Quadtree { get; }
Property Value
Declaration
public int UndirectedEdgeCount { get; }
Property Value
Declaration
public NativeArray<float2>.ReadOnly Vertices { get; }
Property Value
Type |
Description |
NativeArray<float2>.ReadOnly |
|
Methods
Declaration
public bool ClosestLocation(NativeQuadtree<int>.NearestNeighbourQuery cache, float2 position, float maxDistance, ClosestPlatformerGraphLocationPredicate predicate, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(NativeQuadtree<int>.NearestNeighbourQuery cache, float2 position, float maxRadius, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(NativeQuadtree<int>.NearestNeighbourQuery cache, float2 position, float maxRadius, int flagBitMask, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(NativeQuadtree<int>.NearestNeighbourQuery cache, float2 position, float maxDistance, FunctionPointer<ClosestPlatformerGraphLocationPredicate> predicate, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(float2 position, float maxDistance, ClosestPlatformerGraphLocationPredicate predicate, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(float2 position, float maxRadius, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(float2 position, float maxRadius, int flagBitMask, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool ClosestLocation(float2 position, float maxDistance, FunctionPointer<ClosestPlatformerGraphLocationPredicate> predicate, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public void Collect(PlatformerGraphLocation location, ref NativeList<Edge<PlatformerGraphLocation>> edgeBuffer)
Parameters
Declaration
public bool ContainsEdgeId(int edgeId)
Parameters
Type |
Name |
Description |
int |
edgeId |
|
Returns
Declaration
public int GetEdgeIndex(int edgeId)
Parameters
Type |
Name |
Description |
int |
edgeId |
|
Returns
Declaration
public PlatformerGraph.Enumerator GetEnumerator()
Returns
Declaration
public PlatformerGraphLocation GetLocationFromEdgeId(int edgeId)
Parameters
Type |
Name |
Description |
int |
edgeId |
|
Returns
Declaration
public PlatformerGraphLocation GetLocationFromEdgeIndex(int edgeIndex)
Parameters
Type |
Name |
Description |
int |
edgeIndex |
|
Returns
Declaration
public void GetOverlappingEdgeIndices(AABB2D aabb, NativeHashSet<int> indices)
Parameters
Type |
Name |
Description |
AABB2D |
aabb |
|
NativeHashSet<int> |
indices |
|
Declaration
public void Populate(PlatformerGraph source)
Parameters
Declaration
public void Populate(IReadOnlyList<float2> vertices, IReadOnlyList<PlatformerGraph.Edge> undirectedEdges, IReadOnlyList<PlatformerGraph.Edge> directedEdges = null)
Parameters
Declaration
public void Populate(NativeArray<float2> vertices, NativeArray<PlatformerGraph.Edge> undirectedEdges, NativeArray<PlatformerGraph.Edge> directedEdges = default)
Parameters
Declaration
public bool Raycast(Ray2D ray, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public bool Raycast(Ray2D ray, int flagBitMask, out PlatformerGraphLocation location)
Parameters
Returns
Declaration
public void SetEnterCostAndFlags(int edgeIndex, float enterCost, int flags)
Parameters
Type |
Name |
Description |
int |
edgeIndex |
|
float |
enterCost |
|
int |
flags |
|
Declaration
public void SetUnwalkable(int edgeIndex)
Parameters
Type |
Name |
Description |
int |
edgeIndex |
|
Declaration
public bool TryGetEdgeIndex(int edgeId, out int edgeIndex)
Parameters
Type |
Name |
Description |
int |
edgeId |
|
int |
edgeIndex |
|
Returns
Implements
Extension Methods