A* Pathfinding Project
4.3.0
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) |
Called for each path that the Seeker calculates after the calculation has finished. More... | |
List< Vector3 > | Apply (List< Vector3 > vs) |
Apply this modifier on a raw Vector3 list. More... | |
Public Member Functions inherited from MonoModifier | |
virtual void | PreProcess (Path path) |
Public Attributes | |
float | detail = 10 |
Detail of generated circle segments. More... | |
float | radius = 1f |
Radius of the circle segments generated. More... | |
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. More... | |
Properties inherited from VersionedMonoBehaviour | |
int Util.IEntityIndex. | EntityIndex [get, set] |
Internal entity index used by #BurstBatchHelper. More... | |
Properties inherited from IEntityIndex | |
int | EntityIndex [get, set] |
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. More... | |
bool | CalculateCircleOuter (Vector3 p1, Vector3 p2, float r1, float r2, out float a, out float sigma) |
Calculates outer tangents for a pair of circles. More... | |
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 | |
virtual void | OnDisable () |
virtual void | OnEnable () |
Alerts the Seeker that this modifier exists. More... | |
Protected Member Functions inherited from VersionedMonoBehaviour | |
virtual void | Awake () |
virtual int | OnUpgradeSerializedData (int version, bool unityThread) |
Handle serialization backwards compatibility. More... | |
virtual void | Reset () |
Handle serialization backwards compatibility. More... | |
|
strongprivate |
|
virtual |
Called for each path that the Seeker calculates after the calculation has finished.
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 |