A* Pathfinding Project  4.0.0
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
LegacyRichAI Class Reference

Advanced AI for navmesh based graphs. More...

Detailed Description

Advanced AI for navmesh based graphs.

Deprecated:
Use the RichAI class instead. This class only exists for compatibility reasons.
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 Attributes

bool preciseSlowdown = true
 Use a 3rd degree equation for calculating slowdown acceleration instead of a 2nd degree.
 
- Public Attributes inherited from RichAI
float acceleration = 5
 Max acceleration of the agent.
 
Animation anim
 
float centerOffset = 1
 Offset along the Y coordinate for the ground raycast start position.
 
float endReachedDistance = 0.01f
 Max distance to the endpoint to consider it reached.
 
bool funnelSimplification = false
 Use funnel simplification.
 
Vector3 gravity = new Vector3(float.NaN, float.NaN, float.NaN)
 Gravity to use.
 
LayerMask groundMask = -1
 Layer mask to use for ground placement.
 
float maxSpeed = 1
 Max speed of the agent.
 
bool raycastingForGroundPlacement = true
 Raycast for ground placement (when not having a CharacterController).
 
float repathRate = 0.5f
 Delay (seconds) between path searches.
 
bool repeatedlySearchPaths = false
 Search for new paths repeatedly.
 
float rotationSpeed = 360
 Max rotation speed of the agent.
 
float slowdownTime = 0.5f
 How long before reaching the end of the path to start to slow down.
 
bool slowWhenNotFacingTarget = true
 Slow down when not facing the target direction.
 
Transform target
 Target position to move to.
 
float wallDist = 1
 Walls within this range will be used for avoidance.
 
float wallForce = 3
 Force to avoid walls with.
 

Protected Member Functions

override void Awake ()
 
override IEnumerator TraverseSpecial (RichSpecial rs)
 
override void Update ()
 Update is called once per frame.
 
- Protected Member Functions inherited from RichAI
void CancelCurrentPathRequest ()
 
void NextPart ()
 Declare that the AI has completely traversed the current part.
 
virtual void OnDisable ()
 Called when the component is disabled.
 
virtual void OnDrawGizmos ()
 
virtual void OnEnable ()
 Called when the component is enabled.
 
virtual void OnTargetReached ()
 Called when the end of the path is reached.
 
virtual void Start ()
 Starts searching for paths.
 
virtual Vector3 UpdateTarget (RichFunnel fn)
 
- Protected Member Functions inherited from VersionedMonoBehaviour
virtual int OnUpgradeSerializedData (int version)
 Handle serialization backwards compatibility.
 

Private Member Functions

Vector3 RaycastPosition (Vector3 position, float lasty)
 
bool RotateTowards (Vector3 trotdir)
 Rotates along the Y-axis the transform towards trotdir.
 

Private Attributes

Vector3 currentTargetDirection
 
Vector3 lastTargetPoint
 
Vector3 velocity
 Current velocity of the agent.
 

Static Private Attributes

static float deltaTime
 Smooth delta time to avoid getting overly affected by e.g GC.
 

Additional Inherited Members

- Public Member Functions inherited from RichAI
void Teleport (Vector3 newPosition)
 Instantly moves the agent to the target position.
 
virtual void UpdatePath ()
 Force recalculation of the current path.
 
- Protected Attributes inherited from RichAI
bool canSearchPath
 
CharacterController controller
 Cached CharacterController component.
 
bool delayUpdatePath
 
float distanceToWaypoint = float.PositiveInfinity
 
bool lastCorner
 
float lastRepath = float.NegativeInfinity
 
IMovementPlane movementPlane = GraphTransform.identityTransform
 
List< Vector3 > nextCorners = new List<Vector3>()
 
Vector3 prevPosition
 Position of the agent at the end of the previous frame.
 
Vector3 realVelocity
 Current velocity of the agent.
 
readonly RichPath rp = new RichPath()
 Holds the current path that this agent is following.
 
RVOController rvoController
 Cached RVOController component.
 
Seeker seeker
 Cached Seeker component.
 
Transform tr
 Cached Transform component.
 
bool traversingSpecialPath
 
bool waitingForPathCalc
 
List< Vector3 > wallBuffer = new List<Vector3>()
 
- Static Protected Attributes inherited from RichAI
static readonly Color GizmoColorPath = new Color(8.0f/255, 78.0f/255, 194.0f/255)
 
static readonly Color GizmoColorRaycast = new Color(118.0f/255, 206.0f/255, 112.0f/255)
 
- Properties inherited from RichAI
bool ApproachingPartEndpoint [get]
 True if approaching the last waypoint in the current part of the path.
 
bool ApproachingPathEndpoint [get]
 True if approaching the last waypoint of all parts in the current path.
 
float DistanceToNextWaypoint [get]
 Distance to the next waypoint.
 
Vector3 NextWaypoint [get]
 Waypoint that the agent is moving towards.
 
bool PathPending [get]
 True if a path to the target is currently being calculated.
 
Vector3 TargetPoint [get]
 Current waypoint that the agent is moving towards.
 
bool TargetReached [get]
 True if the agent is within endReachedDistance units from the end of the current path.
 
bool TraversingSpecial [get]
 
Vector3 Velocity [get]
 Current velocity of the agent.
 

Member Function Documentation

override void Awake ( )
protectedvirtual

Reimplemented from RichAI.

Vector3 RaycastPosition ( Vector3  position,
float  lasty 
)
private
bool RotateTowards ( Vector3  trotdir)
private

Rotates along the Y-axis the transform towards trotdir.

override IEnumerator TraverseSpecial ( RichSpecial  rs)
protectedvirtual

Reimplemented from RichAI.

override void Update ( )
protectedvirtual

Update is called once per frame.

Reimplemented from RichAI.

Member Data Documentation

Vector3 currentTargetDirection
private
float deltaTime
staticprivate

Smooth delta time to avoid getting overly affected by e.g GC.

Vector3 lastTargetPoint
private
bool preciseSlowdown = true

Use a 3rd degree equation for calculating slowdown acceleration instead of a 2nd degree.

A 3rd degree equation can also make sure that the velocity when reaching the target is roughly zero and therefore it will have a more direct stop. In contrast solving a 2nd degree equation which will just make sure the target is reached but will usually have a larger velocity when reaching the target and therefore look more "bouncy".

Vector3 velocity
private

Current velocity of the agent.

Includes eventual velocity due to gravity


The documentation for this class was generated from the following file: