- SuperPathfinding.cs
- PathData.cs
- AISample.cs
Class in Corvostudio.SuperPathfinding
Name | Type | Description |
---|---|---|
Name | Type | Description |
nodeWidth |
float | Witdh of a node. Can be considered as "step distance". |
unitRadius |
float | Radius of the pathfinder. |
unitHeight |
float | Height of the pathfinder. |
unitClimbAngle |
float | Max climb angle for the pathfinder. |
unitStepHeight |
float | Max step height for the pathfinder. |
scanHeight |
float | Height of the scan area. |
scannedLayersMask |
LayerMask | Mask for the calculation. |
allowDiagonals |
bool | Allow diagonal movements. |
processingSpeed |
ProcessingSpeed | [Performance settings] Max amount of cycles per frame (ONLY DURING RUNTIME). |
gridNodesLimit |
int | [Performance settings] Max number nodes in path calculation. |
highQualityObstaclesCheck |
bool | [Performance settings] If true, algorithm will take deeper considerations about where pathfinder can and cannot fit, based on his radius. |
testPathStartPosition |
Transform | [Test setting] Transform start position for path tests in editor from the inspector. |
testPathDestination |
Transform | [Test setting] Transform target for path tests in editor from the inspector. |
Name | Type | Description | Arguments |
---|---|---|---|
Name | Type | Description | Arguments |
GetLastCalculatedPath() |
PathData | Get last calculated data from the PathFinding component. | |
FindPath() |
bool | Start calculating a path to the given position. If not forced, and another calculation is already progressing, just return false. Calculated PathData can be accessed with GetCalculatedPathData() | (Vector3) destination: Destination to reach. |
FindPath() |
bool | Start calculating a path from position A to B. Can also take a callback to return calculated path and force other calculations to stop. Calculated PathData can be accessed with GetCalculatedPathData() or directly sent with a callback. | (Vector3) startPos: Start position.(Vector3) destination: Destination to reach.(Action return PathData with callback. [Opional](bool) force: Force script to stop any previous calculation and start again. [Opional] |
StopAndClear() |
void | Stop all calculations and clear all path data. | |
SetOnGround() |
Vector3 | Return an adjusted position on the ground, if there is any in the given height range. | (Vector3) position: Position to adjust.(float) range: Range (up and down) where method can adjust position. |
IsNearEnoughToDestination() |
bool | Check if node is inside destination range. | (PathNode) node: Node to check.(Vector3) destination: Destination to check. |
IsCalculating() |
bool | Return true if component is calculating a path. | |
CalculatePathNodeColumn() |
PathNodeColumn | Calculate PathNodeColumn if not already done. [Not so udefull for end user] | (int)gridI : Shift on Vector3.right*nodeWidth(int)gridJ : Shift on Vector3.forward*nodeWidth |
GetDestination() |
Vector3 | Get last given destination for a path. | |
IsSlopeAccepted() |
bool | Check if a given direction satisfy slope angle requirements. | (Vector3) direction : Direction to check. |
Class in Corvostudio.SuperPathfinding
Name | Type | Description |
---|---|---|
Name | Type | Description |
Name | Type | Description | Arguments |
---|---|---|---|
Name | Type | Description | Arguments |
HavePath() |
bool | Check if the object contains a calulcated path.. | |
CurrentNode() |
Vector3 | Return current active node of the Path. | |
NextNode() |
void | Skip to next node of the path. First node got discarted and CurrentNode() now returns next node. | |
ClearPath() |
void | Delete all nodes inside the path. | |
NodesCount() |
int | Return the number of the remaining nodes in the path. | |
GetPathAsArray() |
Vector3[] | Return path as Vector3 array of waypoints from the start to the destination of the path. | |
GetNode() |
Vector3 | Get specific node inside the path. | (int) index : Index of the node. |
Class in Corvostudio.SuperPathfinding
Name | Type | Description |
---|---|---|
Name | Type | Description |
speed |
float | Speed of the AI while moving along path. |
updateRotation |
RotationType | How AI should face direction while moving along path. |
pathFindingSystem |
SuperPathfinding | Specify a custom SuperPathfinding component to use (NOTE: can be shared with other SampleAi's for better performance). |
Name | Type | Description | Arguments |
---|---|---|---|
Name | Type | Description | Arguments |
HavePath() |
bool | Check if unit have a calculated path. | |
GoTo() |
void | Tell to AI to calculate path and move to destination. | (Vector3) destination : Destination to reach. |
Stop() |
void | Stop calculating, moving and clear path. | |
UpdatePath() |
void | Calculate path again for assigned destination (if not already doing it). |
Enumeration
Name | Description |
---|---|
ultra |
Max cycles to 5000 cycles per frame. Usually maximum calculation cycles is much lower, so this is basically like "calculate path in one frame". |
veryHigh |
Max cycles to 1000 cycles per frame. |
high |
Max cycles to 500 cycles per frame. |
medium |
Max cycles to 100 cycles per frame. |
low |
Max cycles to 50 cycles per frame. |
veryLow |
Max cycles to 10 cycles per frame. Even a potato should be able to manage this low quantity of cycles. If you have performance issues even with this value, maybe you should calculate one or a few SuperPathfinder's paths per time. |
Enumeration
Name | Description |
---|---|
dontRotate |
Move PathFinder along path without rotating it. |
rotateAll |
Move PathFinder along path facing moving direction and aligning it with slope. |
rotateLeftRight |
Move PathFinder along path facing moving direction but ignoring slope. |
rotateAllLerped |
Move PathFinder along path facing moving direction but ignoring slope smoothly. |
rotateLeftRightLerped |
Move PathFinder along path facing moving direction but ignoring slope smoothly. |