Class RadiusModifier
Extends
MonoModifier
Public
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".
A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited.
The Pro version can be bought here
Public Methods
)
Apply this modifier on a raw Vector3 list.
void
Apply
(
)
Called for each path that the Seeker calculates after the calculation has finished.
Public Variables
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.
float
radius = 1f
Radius of the circle segments generated.
Usually similar to the character radius.
Inherited Public Members
Private/Protected Members
float []
a1 = new float[10]
float []
a2 = new float[10]
bool
CalculateCircleInner
(
Vector3 | p1 | Position of first circle |
Vector3 | p2 | Position of the second circle |
float | r1 | Radius of the first circle |
float | r2 | Radius of the second circle |
out float | a | Angle from the line joining the centers of the circles to the inner tangents. |
out float | sigma | World angle from p1 to p2 (in XZ space) |
)
Calculates inner tangents for a pair of circles.
Add a to sigma to get the first tangent angle, subtract a from sigma to get the second tangent angle.
Return
True on success. False when the circles are overlapping.
bool
CalculateCircleOuter
(
Vector3 | p1 | Position of first circle |
Vector3 | p2 | Position of the second circle |
float | r1 | Radius of the first circle |
float | r2 | Radius of the second circle |
out float | a | Angle from the line joining the centers of the circles to the inner tangents. |
out float | sigma | World angle from p1 to p2 (in XZ space) |
)
Calculates outer tangents for a pair of circles.
Add a to sigma to get the first tangent angle, subtract a from sigma to get the second tangent angle.
Return
True on success. False on failure (more specifically when |r1-r2| > |p1-p2| )
bool []
dir = new bool[10]
void
OnEnable
()
Alerts the Seeker that this modifier exists.
int
OnUpgradeSerializedData
(
int | version | |
bool | unityThread | |
)
Handle serialization backwards compatibility.
float []
radi = new float[10]
void
Reset
()
Handle serialization backwards compatibility.
TangentType
OuterRight= 1 << 0 |
|
InnerRightLeft= 1 << 1 |
|
InnerLeftRight= 1 << 2 |
|
OuterLeft= 1 << 3 |
|
Outer= OuterRight | OuterLeft |
|
Inner= InnerRightLeft | InnerLeftRight |
|