A* Pathfinding Project
4.0.8
The A* Pathfinding Project for Unity 3D
|
Radius path modifier for offsetting paths. More...
Radius path modifier for offsetting paths.
The radius modifier will offset the path to create the effect of adjusting it to the characters radius. It gives good results on navmeshes which have not been offset with the character radius during scan. Especially useful when characters with different radiuses are used on the same navmesh. It is also useful when using rvo local avoidance with the RVONavmesh since the RVONavmesh assumes the navmesh has not been offset with the character radius.
This modifier assumes all paths are in the XZ plane (i.e Y axis is up).
It is recommended to use the Funnel Modifier on the path as well.
Also check out the howto page "Using Modifiers".
Public Member Functions | |
override void | Apply (Path p) |
Main Post-Processing function. | |
List< Vector3 > | Apply (List< Vector3 > vs) |
Apply this modifier on a raw Vector3 list. | |
Public Member Functions inherited from MonoModifier | |
virtual void | OnDestroy () |
void | OnDisable () |
void | OnEnable () |
virtual void | PreProcess (Path p) |
Public Member Functions inherited from IPathModifier | |
void | Apply (Path p) |
void | PreProcess (Path p) |
Public Attributes | |
float | detail = 10 |
Detail of generated circle segments. | |
float | radius = 1f |
Radius of the circle segments generated. | |
Public Attributes inherited from MonoModifier | |
Seeker | seeker |
Properties | |
override int | Order [get] |
Properties inherited from MonoModifier | |
abstract int | Order [get] |
Modifiers will be executed from lower order to higher order. | |
Properties inherited from IPathModifier | |
int | Order [get] |
Private Types | |
enum | TangentType { OuterRight = 1 << 0, InnerRightLeft = 1 << 1, InnerLeftRight = 1 << 2, OuterLeft = 1 << 3, Outer = OuterRight | OuterLeft, Inner = InnerRightLeft | InnerLeftRight } |
Private Member Functions | |
bool | CalculateCircleInner (Vector3 p1, Vector3 p2, float r1, float r2, out float a, out float sigma) |
Calculates inner tangents for a pair of circles. | |
bool | CalculateCircleOuter (Vector3 p1, Vector3 p2, float r1, float r2, out float a, out float sigma) |
Calculates outer tangents for a pair of circles. | |
TangentType | CalculateTangentType (Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4) |
TangentType | CalculateTangentTypeSimple (Vector3 p1, Vector3 p2, Vector3 p3) |
Private Attributes | |
float[] | a1 = new float[10] |
float[] | a2 = new float[10] |
bool[] | dir = new bool[10] |
float[] | radi = new float[10] |
Additional Inherited Members | |
Protected Member Functions inherited from MonoModifier | |
override void | Awake () |
Alerts the Seeker that this modifier exists. | |
|
private |
|
virtual |
Main Post-Processing function.
Implements MonoModifier.
List<Vector3> Apply | ( | List< Vector3 > | vs | ) |
Apply this modifier on a raw Vector3 list.
|
private |
Calculates inner tangents for a pair of circles.
p1 | Position of first circle |
p2 | Position of the second circle |
r1 | Radius of the first circle |
r2 | Radius of the second circle |
a | Angle from the line joining the centers of the circles to the inner tangents. |
sigma | World angle from p1 to p2 (in XZ space) |
Add a to sigma to get the first tangent angle, subtract a from sigma to get the second tangent angle.
|
private |
Calculates outer tangents for a pair of circles.
p1 | Position of first circle |
p2 | Position of the second circle |
r1 | Radius of the first circle |
r2 | Radius of the second circle |
a | Angle from the line joining the centers of the circles to the inner tangents. |
sigma | World angle from p1 to p2 (in XZ space) |
Add a to sigma to get the first tangent angle, subtract a from sigma to get the second tangent angle.
|
private |
|
private |
|
private |
|
private |
float detail = 10 |
Detail of generated circle segments.
Measured as steps per full circle.
It is more performant to use a low value. For movement, using a high value will barely improve path quality.
|
private |
|
private |
float radius = 1f |
Radius of the circle segments generated.
Usually similar to the character radius.
|
get |