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

Protected Member Functions

override void ApplyGravity (float deltaTime)
 Accelerates the agent downwards.
 
override void Start ()
 Starts searching for paths.
 
override void Update ()
 Called every frame.
 
override void UpdateMovementPlane ()
 Find the world position of the ground below the character.
 
- Protected Member Functions inherited from AIPath
virtual void CalculateNextRotation (float slowdown, out Quaternion nextRotation)
 
override Vector3 ClampToNavmesh (Vector3 position, out bool positionChanged)
 Constrains the character's position to lie on the navmesh.
 
override void MovementUpdateInternal (float deltaTime, out Vector3 nextPosition, out Quaternion nextRotation)
 Called during either Update or FixedUpdate depending on if rigidbodies are used for movement or not.
 
override void OnDisable ()
 
override void OnPathComplete (Path newPath)
 Called when a requested path has been calculated.
 
override int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility.
 
- Protected Member Functions inherited from AIBase
 AIBase ()
 
Vector2 CalculateDeltaToMoveThisFrame (Vector3 position, float distanceToEndOfPath, float deltaTime)
 Calculates how far to move during a single frame.
 
virtual void CalculatePathRequestEndpoints (out Vector3 start, out Vector3 end)
 Outputs the start point and end point of the next automatic path request.
 
void CancelCurrentPathRequest ()
 
virtual void FindComponents ()
 
virtual void FixedUpdate ()
 Called every physics update.
 
virtual void OnDrawGizmos ()
 
virtual void OnDrawGizmosSelected ()
 
virtual void OnEnable ()
 Called when the component is enabled.
 
Vector3 RaycastPosition (Vector3 position, float lastElevation)
 Checks if the character is grounded and prevents ground penetration.
 
Quaternion SimulateRotationTowards (Vector2 direction, float maxDegrees)
 Simulates rotating the agent towards the specified direction and returns the new rotation.
 
void UpdateVelocity ()
 
- Protected Member Functions inherited from VersionedMonoBehaviour
virtual void Awake ()
 

Private Member Functions

Vector3 InterpolateNormal (RaycastHit hit)
 

Private Attributes

Mesh cachedMesh
 
List< Vector3 > cachedNormals = new List<Vector3>()
 
List< int > cachedTriangles = new List<int>()
 

Additional Inherited Members

- Public Member Functions inherited from AIPath
Vector3 CalculateVelocity (Vector3 position)
 Current desired velocity of the agent (excluding physics and local avoidance but it includes gravity).
 
virtual void OnTargetReached ()
 The end of the path has been reached.
 
override void Teleport (Vector3 newPosition, bool clearPath=true)
 Instantly move the agent to a new position.
 
- Public Attributes inherited from AIPath
bool alwaysDrawGizmos
 Draws detailed gizmos constantly in the scene view instead of only when the agent is selected and settings are being modified.
 
bool constrainInsideGraph = false
 Ensure that the character is always on the traversable surface of the navmesh.
 
float endReachedDistance = 0.2F
 Distance to the end point to consider the end of path to be reached.
 
float maxAcceleration = -2.5f
 How quickly the agent accelerates.
 
float pickNextWaypointDist = 2
 How far the AI looks ahead along the path to determine the point it moves to.
 
float rotationSpeed = 360
 Rotation speed in degrees per second.
 
float slowdownDistance = 0.6F
 Distance from the end of the path where the AI will start to slow down.
 
bool slowWhenNotFacingTarget = true
 Slow down when not facing the target direction.
 
CloseToDestinationMode whenCloseToDestination = CloseToDestinationMode.Stop
 What to do when within endReachedDistance units from the destination.
 
- Protected Attributes inherited from AIPath
PathInterpolator interpolator = new PathInterpolator()
 Helper which calculates points along the current path.
 
Path path
 Current path which is followed.
 
- Static Protected Attributes inherited from AIBase
static readonly Color GizmoColorRaycast = new Color(118.0f/255, 206.0f/255, 112.0f/255)
 
- Properties inherited from AIPath
bool IAstarAI. canMove [get, set]
 Enables or disables movement completely.
 
bool IAstarAI. canSearch [get, set]
 Enables or disables recalculating the path at regular intervals.
 
bool hasPath [get]
 True if this agent currently has a path that it follows.
 
float IAstarAI. maxSpeed [get, set]
 Max speed in world units per second.
 
bool pathPending [get]
 True if a path is currently being calculated.
 
bool reachedEndOfPath [get, set]
 True if the agent has reached the end of the current path.
 
float remainingDistance [get]
 Remaining distance along the current path to the end of the path.
 
float speed [get, set]
 Maximum speed in world units per second.
 
Vector3 steeringTarget [get]
 Point on the path which the agent is currently moving towards.
 
Vector3 targetDirection [get]
 Direction that the agent wants to move in (excluding physics and local avoidance).
 
bool TargetReached [get]
 True if the end of the path has been reached.
 
float turningSpeed [get, set]
 Rotation speed.
 

Member Function Documentation

override void ApplyGravity ( float  deltaTime)
protectedvirtual

Accelerates the agent downwards.

See Also
verticalVelocity
gravity

Reimplemented from AIBase.

Vector3 InterpolateNormal ( RaycastHit  hit)
private
override void Start ( )
protectedvirtual

Starts searching for paths.

If you override this method you should in most cases call base.Start () at the start of it.

See Also
Init

Reimplemented from AIBase.

override void Update ( )
protectedvirtual

Called every frame.

If no rigidbodies are used then all movement happens here.

Reimplemented from AIBase.

override void UpdateMovementPlane ( )
protectedvirtual

Find the world position of the ground below the character.

Reimplemented from AIPath.

Member Data Documentation

Mesh cachedMesh
private
List<Vector3> cachedNormals = new List<Vector3>()
private
List<int> cachedTriangles = new List<int>()
private

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